beaneater.org.uk Nicholas Wolverson scribbles on his screen

First emacs post!


25 October 2004
(20:46)

Bring on the new. I'm posting this entry from XEmacs, via the wonders of XML-RPC and the magic of the following snippet of lisp:

(defun post-buffer (title categories)
  "Post current buffer to weblog with given title/categories."
  (interactive "sTitle: \nsCategories: ")
  (post-text title (buffer-substring) categories))

(defun post-text (title body categories)
  "Post given text to weblog"
  (let ((id (post-entry title body categories)))
    (message (concat "Entry posted: " id))))

(defun post-entry (title body categories)
  (xml-rpc-method-call
   "http://beaneater.org.uk/XMLRPC" 'beanlog.newPost
   title body categories))

If I ever get around to learning more elisp, I guess I might make it into a proper mode (I don't care if such a thing already exists). At least there's a few things I'd like to automate.

It is interesting writing these kind of little thingies in Perl, elisp, and Haskell, as I am at the minute, different takes on typing give a completely different feel. I guess some C and Java could round it off...

Comment | Permalink | in categories Log Meta Geek