From: lee <lee@yun.yagibdah.de>
To: help-gnu-emacs@gnu.org
Subject: Re: describe-mode "some-mode": (documentation some-mode)
Date: Sat, 30 Aug 2014 13:42:44 +0200 [thread overview]
Message-ID: <87ha0u9paj.fsf@yun.yagibdah.de> (raw)
In-Reply-To: <878umek5fv.fsf@debian.uxu> (Emanuel Berg's message of "Sun, 24 Aug 2014 04:05:40 +0200")
Emanuel Berg <embe8573@student.uu.se> writes:
> lee <lee@yun.yagibdah.de> writes:
>
>> (defun my-describe-mode () "Display the documentation
>> of MODE." (interactive) (let ((mode (list (intern
>> (read-string "Mode: "))))) (unless (functionp mode)
>> (with-current-buffer (switch-to-buffer-other-window
>> "my-describe-mode") (insert (documentation mode))))))
>>
>> This inserts "Keyboard macro." into the buffer
>> (without the quotes). I'm not too sure about what I'm
>> doing here ...
>
> What are you trying to do?
I was trying to insert the documentation for a mode into a buffer.
Instead of returning the docstring for the mode, (insert (documentation
mode)) inserts "Keybaord macro." into the buffer with the function I
defined to do this.
I'm wondering why apparently (documentation mode) returns "Keyboard
macro." instead of the docstring ...
>> When I use (help-buffer) instead of
>> "my-describe-mode" for a buffer, the (help-buffer)
>> might be read-only?
>
> The help buffers are read-only, yes.
Ah, interesting: because when I tried to insert into the help-buffer,
"Keyboard macro." was inserted in the current buffer instead. That's
why I changed the function to use (switch-to-buffer-other-window
"my-describe-mode") instead.
What's the defined or supposed behaviour of 'insert when the buffer to
insert something into is read-only?
--
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-30 11:42 UTC|newest]
Thread overview: 21+ 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
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 ` lee [this message]
2014-08-30 22:30 ` describe-mode "some-mode": (documentation some-mode) Michael Heerdegen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ha0u9paj.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.
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.