From: lee <lee@yun.yagibdah.de>
To: help-gnu-emacs@gnu.org
Subject: Re: describe-mode "some-mode"?
Date: Sat, 23 Aug 2014 14:49:41 +0200 [thread overview]
Message-ID: <87egw7z8ca.fsf@yun.yagibdah.de> (raw)
In-Reply-To: <988b6e41-62ed-4d33-abf1-804ddcedef59@default> (Drew Adams's message of "Fri, 22 Aug 2014 11:21:07 -0700 (PDT)")
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)))))
,----
| Compiling file /home/lee/emacs/my-helper-functions.el at Sat Aug 23 14:44:35 2014
|
| In end of data:
| my-helper-functions.el:116:1:Warning: the function `help-documentation' is not
| known to be defined.
`----
> On the other hand, it is OK and simple to instead create a temporary buffer, put it in the mode, and use `describe-mode' there.
Yes, I thought about writing a function to do just that and thought it
shouldn't be necessary to create a dummy-buffer to see the docstring for
a particular mode. Emacs is self-documenting :)
It seems I'd have to do just that for now ...
--
GNU Emacs 24.4.50.2 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2014-08-17 on yun.yagibdah.de
next prev parent reply other threads:[~2014-08-23 12:49 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 17:27 describe-mode "some-mode"? lee
2014-08-22 18:21 ` Drew Adams
2014-08-23 12:49 ` lee [this message]
2014-08-23 15:29 ` Drew Adams
2014-08-30 11:29 ` lee
[not found] ` <mailman.7432.1408807808.1147.help-gnu-emacs@gnu.org>
2014-08-24 1:56 ` Emanuel Berg
2014-08-24 2:46 ` Drew Adams
[not found] ` <mailman.7448.1408848386.1147.help-gnu-emacs@gnu.org>
2014-08-31 22:27 ` Emanuel Berg
2014-09-01 3:37 ` Drew Adams
[not found] ` <mailman.8013.1409542696.1147.help-gnu-emacs@gnu.org>
2014-09-01 21:37 ` Elispers all around the world (was: Re: describe-mode "some-mode"?) Emanuel Berg
2014-09-01 22:27 ` Jorge Araya Navarro
2014-09-01 22:29 ` Drew Adams
[not found] ` <mailman.8073.1409610571.1147.help-gnu-emacs@gnu.org>
2014-09-01 23:10 ` Emanuel Berg
[not found] ` <mailman.8074.1409610608.1147.help-gnu-emacs@gnu.org>
2014-09-01 23:17 ` Emanuel Berg
[not found] ` <mailman.7427.1408798399.1147.help-gnu-emacs@gnu.org>
2014-08-24 2:22 ` describe-mode "some-mode"? Emanuel Berg
[not found] ` <mailman.7404.1408731692.1147.help-gnu-emacs@gnu.org>
2014-08-22 19:04 ` Emanuel Berg
2014-08-23 3:27 ` IELM (was: Re: describe-mode "some-mode"?) Emanuel Berg
2014-08-23 13:20 ` describe-mode "some-mode": (documentation some-mode) (was: IELM) lee
[not found] ` <mailman.7429.1408800080.1147.help-gnu-emacs@gnu.org>
2014-08-24 2:05 ` Emanuel Berg
2014-08-30 11:42 ` describe-mode "some-mode": (documentation some-mode) lee
2014-08-30 22:30 ` Michael Heerdegen
[not found] <mailman.7401.1408728471.1147.help-gnu-emacs@gnu.org>
2014-08-24 3:39 ` describe-mode "some-mode"? Rusi
2014-08-30 11:36 ` lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87egw7z8ca.fsf@yun.yagibdah.de \
--to=lee@yun.yagibdah.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).