Article View: gnu.emacs.help
Article #189779describe-mode
From: Mattias Waldau
Date: Fri, 16 Nov 1990 14:19
Date: Fri, 16 Nov 1990 14:19
36 lines
2057 bytes
2057 bytes
I have made a major mode and I am just writing documentation for it.
When the user presses C-h m, the documentation string in the XXX-mode
function is printed on the screen.
I would like that the documentation of say about 10-20 important
commands was written afterwards. I do not want to insert these
documentations explicite|y into the documentation of XXX-mode. I only
want to give a list of function names that are expanded with the
documentation function.
The simplest solution I found was to patch describe-mode. How should
this actually be done, since it must a general problem?
(defun describe-mode ()
"Display documentation of current major mode."
(interactive)
(with-output-to-temp-buffer "*Help*"
(princ mode-name)
(princ " Mode:\n")
(princ (documentation major-mode))
;; The following dolist-loop is the patch done.
(dolist (function (get major-mode 'important-commands))
(princ (format "\n\n%s:\t\t%s\n" function
(substitute-command-keys
(concat "\\\\[" (symbol-name function) "]"))))
(princ (documentation function)))
(print-help-return-message)))
where the major-mode get the property 'important-commands, e.g.
(put 'nd-mode 'important-commands '(nd-melt nd-id-elim-power nd-exists-elim))
--
Mattias Waldau
Computing Science Department mattias@emil.csd.uu.se
P.O. Box 520, S-751 20 Uppsala, Sweden Phone: +46-18-181055
Technical Details
Message-ID:
<MATTIAS.90Nov16151921@sylvester.csd.uu.se>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!sunic!kuling!kuling.docs.uu.se!mattiasShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103b8b,32254d6b50ef66a2,start X-Google-Attributes: gid103b8b,public X-Google-ArrivalTime: 1990-11-16 06:19:21 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!sunic!kuling!kuling.docs.uu.se!mattias From: mattias@sylvester.csd.uu.se (Mattias Waldau) Newsgroups: gnu.emacs.help Subject: describe-mode Message-ID: <MATTIAS.90Nov16151921@sylvester.csd.uu.se> Date: 16 Nov 90 14:19:21 GMT Sender: news@kuling.UUCP Organization: Computing Science Dept, Uppsala University, Sweden Lines: 36 Posted: Fri Nov 16 15:19:21 1990