[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
mode-line tooltips for minor modes
From: |
Dan Nicolaescu |
Subject: |
mode-line tooltips for minor modes |
Date: |
Tue, 08 Apr 2008 23:26:22 -0700 |
I can't find the original thread where this was discussed...
Anyway, the proposed way to add a tooltip for minor-modes was to add
:help "Blah blah" to define-minor-mode.
The patch below does that. It stores the tooltip in the `help' property
of the minor mode symbol (better ideas are welcome).
Now, how can this be used? Where is the code that can do
(get 'help MINOR_MODE) and set the value there as a tooltip?
Index: emacs-lisp/easy-mmode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/easy-mmode.el,v
retrieving revision 1.90
diff -u -3 -p -r1.90 easy-mmode.el
--- emacs-lisp/easy-mmode.el 8 Jan 2008 20:45:36 -0000 1.90
+++ emacs-lisp/easy-mmode.el 9 Apr 2008 06:18:16 -0000
@@ -169,6 +169,7 @@ For example, you could write
(:type (setq type (list :type (pop body))))
(:require (setq require (pop body)))
(:keymap (setq keymap (pop body)))
+ (:help (setq help (pop body)))
(t (push keyw extra-keywords) (push (pop body) extra-keywords))))
(setq keymap-sym (if (and keymap (symbolp keymap)) keymap
@@ -250,6 +251,9 @@ With zero or negative ARG turn mode off.
;; Return the new setting.
,mode)
+ (when help
+ (put ',mode 'help ,help))
+
;; Autoloading a define-minor-mode autoloads everything
;; up-to-here.
:autoload-end
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- mode-line tooltips for minor modes,
Dan Nicolaescu <=