* mode-line tooltips for minor modes
@ 2008-04-09 6:26 Dan Nicolaescu
0 siblings, 0 replies; only message in thread
From: Dan Nicolaescu @ 2008-04-09 6:26 UTC (permalink / raw)
To: emacs-devel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-04-09 6:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-09 6:26 mode-line tooltips for minor modes Dan Nicolaescu
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.