Muli Ben-Yehuda's journal

October 6, 2003

lj-update hackery

Filed under: Uncategorized — Muli Ben-Yehuda @ 12:48 PM

lj-compose now starts with the new buffer in auto-fill-mode, just the way I like it. Steps to achieve this worthy goal:

At the top of lj-write.el, define a variable to hold the hooks list:

 
(defvar lj-compose-hook nil 
    "Hooks to be called on lj-compose startup") 

Change lj-compose() to call our hooks:

(defun lj-compose (&optional profile)
  "Compose a LiveJournal update, using PROFILE."
  (interactive)
  (lj--initialize)
  (switch-to-buffer (get-buffer-create "*LiveJournal*"))
  (delete-region (point-min) (point-max))
  (or (eq major-mode 'lj-update-mode) (lj-update-mode))
  (lj--insert-initial-buffer-contents nil profile)
  (set-buffer-modified-p nil)
  ;; call our startup hooks 
  (mapcar 
       (lambda (x) (funcall x))
       lj-compose-hook))

And add the hooks you want to the initialization files (.xemacs/init.el in my case):

(add-hook 'lj-compose-hook '(lambda () (auto-fill-mode t))) 

That’s all folks!

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: