Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Read file into *Help* buffer

6 views
Skip to first unread message

Tim Johnson

unread,
Sep 23, 2016, 8:29:33 PM9/23/16
to Emacs
Hello :

Using GNU Emacs 24.3.1 in Ubuntu 14.04

Is there a way to read a specific text file into a buffer
(defaulting as *Help*) with help-mode activated?

I.E. I'd like to use some text files to be loaded in the same manner
that would take effect if I invoked help-command or any other
"help-oriented" command.

--
Tim
http://www.akwebsoft.com, http://www.tj49.com

Drew Adams

unread,
Sep 23, 2016, 10:04:18 PM9/23/16
to Tim Johnson, Emacs
> Is there a way to read a specific text file into a buffer
> (defaulting as *Help*) with help-mode activated?
>
> I.E. I'd like to use some text files to be loaded in the same manner
> that would take effect if I invoked help-command or any other
> "help-oriented" command.

Functions `help-buffer' and `with-help-window' can help.

Something like this:

(defun file-to-help (file)
"..."
(with-current-buffer (help-buffer)
(with-help-window (help-buffer)
(insert-file-contents (expand-file-name file)
nil nil nil :REPLACE))))

Tim Johnson

unread,
Sep 23, 2016, 10:13:49 PM9/23/16
to Emacs
* Drew Adams <drew....@oracle.com> [160923 18:07]:
Thank you Drew.

I'll try this approach tomorrow and report back.
Cheers
0 new messages