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 Reply