[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: describe-mode "some-mode": (documentation some-mode)

From: lee
Subject: Re: describe-mode "some-mode": (documentation some-mode)
Date: Sat, 30 Aug 2014 13:42:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Emanuel Berg <address@hidden> writes:

> lee <address@hidden> 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 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2014-08-17 on

reply via email to

[Prev in Thread] Current Thread [Next in Thread]