diff options
author | David Aspinall <da@inf.ed.ac.uk> | 2009-09-07 08:48:43 +0000 |
---|---|---|
committer | David Aspinall <da@inf.ed.ac.uk> | 2009-09-07 08:48:43 +0000 |
commit | 5e867b61855e551994ab17a4a0fb21c04fab6503 (patch) | |
tree | 1ee487ed664f40e7d6d4f652a34014b7d5fa83bb | |
parent | 8201ac7d4e126631ac7f28519195184e21454791 (diff) |
Use extended form of define-minor-mode
-rw-r--r-- | lib/bufhist.el | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/bufhist.el b/lib/bufhist.el index ddde0ef8..9ef3b6b9 100644 --- a/lib/bufhist.el +++ b/lib/bufhist.el @@ -119,22 +119,12 @@ Commands:\\<bufhist-minor-mode-map> \\[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) - -; 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 () + nil "" bufhist-minor-mode-map + :group 'bufhist (if bufhist-mode (bufhist-init) (bufhist-exit))) - (make-variable-buffer-local 'bufhist-ring) (make-variable-buffer-local 'bufhist-ring-pos) (make-variable-buffer-local 'bufhist-lastswitch-modified-tick) @@ -343,6 +333,4 @@ The size defaults to `bufhist-ring-size'." (widget-setup)) -(add-hook 'bufhist-mode-hook 'bufhist-toggle-fn) - (provide 'bufhist) |