help-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Emanuel Berg
Subject: Re: describe-mode "some-mode": (documentation some-mode) (was: IELM)
Date: Sun, 24 Aug 2014 04:05:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

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?

Try: `M-x ielm RET', then type

(documentation 'emacs-lisp-mode)

and hit RET. See that it works except the \n's don't
get respected, so it is all on one/the same line.

I don't think it is wise to fiddle with
`documentation', so probably some wrapper must use
`documentation' to extract the docstring, and then
output it, substituting the \n's for newlines (and
more).

Get back to you on this.

> 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.

-- 
underground experts united


reply via email to

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