* Read file into *Help* buffer
@ 2016-09-24 0:29 Tim Johnson
2016-09-24 2:03 ` Drew Adams
0 siblings, 1 reply; 4+ messages in thread
From: Tim Johnson @ 2016-09-24 0:29 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Read file into *Help* buffer
2016-09-24 0:29 Read file into *Help* buffer Tim Johnson
@ 2016-09-24 2:03 ` Drew Adams
2016-09-24 2:13 ` Tim Johnson
2016-09-24 18:17 ` Tim Johnson
0 siblings, 2 replies; 4+ messages in thread
From: Drew Adams @ 2016-09-24 2:03 UTC (permalink / raw)
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))))
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Read file into *Help* buffer
2016-09-24 2:03 ` Drew Adams
@ 2016-09-24 2:13 ` Tim Johnson
2016-09-24 18:17 ` Tim Johnson
1 sibling, 0 replies; 4+ messages in thread
From: Tim Johnson @ 2016-09-24 2:13 UTC (permalink / raw)
To: Emacs
* Drew Adams <drew.adams@oracle.com> [160923 18:07]:
> > 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))))
Thank you Drew.
I'll try this approach tomorrow and report back.
Cheers
--
Tim
http://www.akwebsoft.com, http://www.tj49.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Read file into *Help* buffer
2016-09-24 2:03 ` Drew Adams
2016-09-24 2:13 ` Tim Johnson
@ 2016-09-24 18:17 ` Tim Johnson
1 sibling, 0 replies; 4+ messages in thread
From: Tim Johnson @ 2016-09-24 18:17 UTC (permalink / raw)
To: help-gnu-emacs
* Drew Adams <drew.adams@oracle.com> [160923 18:07]:
> > 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))))
Seems to work as I want - right out of the box!
Thanks to Drew ...
:)
--
Tim
http://www.akwebsoft.com, http://www.tj49.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-24 18:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-24 0:29 Read file into *Help* buffer Tim Johnson
2016-09-24 2:03 ` Drew Adams
2016-09-24 2:13 ` Tim Johnson
2016-09-24 18:17 ` Tim Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).