From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: describe-mode "some-mode": (documentation some-mode) (was: IELM) Date: Sun, 24 Aug 2014 04:05:40 +0200 Organization: Aioe.org NNTP Server Message-ID: <878umek5fv.fsf@debian.uxu> References: <87bnrc1lkz.fsf@yun.yagibdah.de> <87tx54mjmm.fsf@debian.uxu> <87lhqflwb6.fsf_-_@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1408846226 16006 80.91.229.3 (24 Aug 2014 02:10:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Aug 2014 02:10:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 24 04:10:20 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XLNG7-00056n-V9 for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Aug 2014 04:10:20 +0200 Original-Received: from localhost ([::1]:42744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLNG7-0004xw-Fe for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Aug 2014 22:10:19 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-NNTP-Posting-Host: P0uMB9BthHuWo8+BJXB4Mw.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:iQRz+zdHrq0Wd5i4Of+US2YRXFY= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:207102 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99379 Archived-At: lee 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