From 52c011b613b560ff8d6570c816a70e531e6bfbf2 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Tue, 19 Dec 2006 13:53:42 +0000 Subject: Support older version of define-minor-mode --- lib/bufhist.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/bufhist.el b/lib/bufhist.el index 34de7317..67941b7f 100644 --- a/lib/bufhist.el +++ b/lib/bufhist.el @@ -293,12 +293,21 @@ Commands:\\ \\[bufhist-last] bufhist-last go to last (current) item in history. \\[bufhist-clear] bufhist-clear clear history. \\[bufhist-delete] bufhist-clear delete current item from history." - nil "" bufhist-minor-mode-map - :group 'bufhist + nil "" bufhist-minor-mode-map) + +; For newer versions of define-minor-mode we can use extra +; args above instead of hook function below: +; :group 'bufhist +; (if bufhist-mode +; (bufhist-init) +; (bufhist-exit))) +; This doesn't work, e.g. with XEmacs 21.4.15. + +(defun bufhist-toggle-fn () (if bufhist-mode (bufhist-init) (bufhist-exit))) - +(add-hook 'bufhist-mode-hook 'bufhist-toggle-fn) (provide 'bufhist) -- cgit v1.2.3