[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] Re: Saving day pages and planner-appt error
From: |
Sacha Chua |
Subject: |
[emacs-wiki-discuss] Re: Saving day pages and planner-appt error |
Date: |
Wed, 08 Jun 2005 23:21:08 +0800 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) |
David Lord <address@hidden> writes:
> 'write-file-functions
> 'local-write-file-hooks)))
> (add-hook hook 'planner-renumber-notes-maybe t t)
> But write-file-functions does not appear to be defined anywhere in my
> environment (GNU Emacs 21.3.1 Windows 2000). It is not mentioned in any
> lisp files apart from planner.
Hmm. Let's try that with write-file-hooks instead of
local-write-file-hooks... Does this work?
(define-derived-mode planner-mode emacs-wiki-mode "Planner"
"An extension to Emacs Wiki that supports a planning system.
\\{planner-mode-map}"
;; because we're not inheriting from normal-mode, we need to
;; explicitly run file variables if the user wants to
(condition-case err
(hack-local-variables)
(error (message "File local-variables error: %s"
(prin1-to-string err))))
;; check to see if the mode changed
(when (eq major-mode 'planner-mode)
(let ((hook 'write-file-hooks))
(add-hook hook 'planner-renumber-notes-maybe t t)
(add-hook hook 'planner-sort-tasks-maybe t t)
(add-hook hook 'planner-renumber-tasks-maybe t t)
(add-hook hook 'planner-align-tasks-maybe t t))
(add-hook 'emacs-wiki-before-highlight-buffer-hook
'planner-zap-overlays t t)
(add-hook 'emacs-wiki-before-highlight-buffer-hook
'planner-highlight-tasks t t)
(add-hook 'emacs-wiki-before-highlight-buffer-hook
'planner-highlight-notes t t)
(when (fboundp 'easy-menu-add)
(easy-menu-add planner-menu planner-mode-map))
(planner-prepare-file)))
--
Sacha Chua <address@hidden> - open source geekette
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C
interests: emacs, gnu/linux, personal information management, CS ed
sachac on irc.freenode.net#emacs . YM: sachachua83