[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: describe-mode "some-mode"?
From: |
lee |
Subject: |
Re: describe-mode "some-mode"? |
Date: |
Sat, 30 Aug 2014 13:29:12 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
Drew Adams <drew.adams@oracle.com> writes:
>> >> is there a function like describe-key which describes a mode specified
>> >> by the user?
>> >>
>> >> The docstring of describe-mode says it either describes the mode of the
>> >> current buffer or of the buffer given. How can I get a description of a
>> >> mode without enabling the mode in a buffer?
>> >
>> > Something like this will get you started. For more info (e.g. to include
>> > minor-mode info) see the definition of `describe-mode'. You could also
>> > improve the interactive spec, to use completion against major modes or
>> > something.
>> >
>> > (defun my-describe-mode (mode)
>> > (interactive (list (intern (read-string "Mode: "))))
>> > (with-help-window (help-buffer)
>> > (with-current-buffer (help-buffer)
>> > (insert (help-documentation mode nil 'ADD-HELP-BUTTONS)))))
>>
>> Warning: the function `help-documentation' is not known to be defined.
>
> My bad. Sometimes I forget what is provided from emacs -Q and what
> is from my code (I should have tested it with emacs -Q).
>
> `help-documentation' is defined in `help-fns+.el'
> (http://www.emacswiki.org/emacs-en/download/help-fns%2b.el). It is
> like the vanilla function `documentation', but it uses
> `help-substitute-command-keys' so that keys mentioned in the help
> become links to their doc.
>
> Using only vanilla functions:
>
> (defun my-describe-mode (mode)
> (interactive (list (intern (read-string "Mode: "))))
> (with-help-window (help-buffer)
> (with-current-buffer (help-buffer)
> (insert (substitute-command-keys (documentation mode))))))
Thank you very much, that works fine! :)
--
GNU Emacs 24.4.50.2 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2014-08-17 on yun.yagibdah.de
- describe-mode "some-mode"?, lee, 2014/08/22
- RE: describe-mode "some-mode"?, Drew Adams, 2014/08/22
- Re: describe-mode "some-mode"?, lee, 2014/08/23
- Message not available
- Re: describe-mode "some-mode"?, Emanuel Berg, 2014/08/23
- RE: describe-mode "some-mode"?, Drew Adams, 2014/08/23
- Message not available
- Re: describe-mode "some-mode"?, Emanuel Berg, 2014/08/31
- RE: describe-mode "some-mode"?, Drew Adams, 2014/08/31
Message not available
Message not available