Rewrote ljablog.el’s main loop to be more lispish in nature. Sexy!
(defun ljablog-post ()
"Post a ljablog entry to both livejournal and advogato."
(interactive)
(let
((blogs
'((lj-compose lj-post)
(advogato-start-post advogato-save-post))))
(progn
(mark-whole-buffer)
(copy-region-as-kill (point-min) (point-max))
(mapcar
(lambda (x)
(funcall (car x))
(end-of-buffer)
(yank)
(if ljablog-debug-do-post
(funcall (cadr x))))
blogs))))

Psssst: if it has *curves*, it’s sexy. All that has is indentations…
Comment by shunra — February 13, 2004 @ 3:27 PM |
(looks
   ((cool)
      (2
            (me))))
Comment by 77azkkr — February 13, 2004 @ 4:36 PM |
Ani lo mevin.
It’s quite scary actually.
Comment by luckluster — February 17, 2004 @ 11:14 AM |
Here’s what it looks like now:
(defun ljablog-post () "Post a ljablog entry to both livejournal and advogato." (interactive) (let ((blogs (list (make-blog :compose-func 'lj-compose :pre-post-hook 'ljab-turn-lj-html-on :post-func 'lj-post :debug-really-post t) (make-blog :compose-func 'advogato-start-post :post-func 'advogato-save-post :debug-really-post t))) (buffer (current-buffer))) (mapcar (lambda (blog) (set-buffer buffer) (copy-region-as-kill (point-min) (point-max)) (funcall (blog-compose-func blog)) (end-of-buffer) (yank) (let ((hook (blog-pre-post-hook blog)) (debug (blog-debug-really-post blog)) (post (blog-post-func blog))) (when hook (funcall hook)) (when debug (funcall post)))) blogs)))Do you want me to explain it?
Comment by mulix — February 17, 2004 @ 11:22 AM |
I thought it’s some kind of geeky pseudo-code joke at first.. but if it’s a real emacs maco than I’m not scared anymore. 🙂
Comment by luckluster — February 18, 2004 @ 8:25 AM
It’s definitely real, I use it everytime I post here. You can see the code here:
http://www.mulix.org/code/ljablog/ljablog.el.
Comment by mulix — February 19, 2004 @ 9:40 PM