From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Juri Linkov <juri@jurta.org>
Cc: emacs-devel@gnu.org
Subject: Re: Virtual Info files and nodes
Date: Wed, 01 Jul 2009 17:02:12 +0200 [thread overview]
Message-ID: <jwvzlboo3dt.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <871vp1uufd.fsf@mail.jurta.org> (Juri Linkov's message of "Wed, 01 Jul 2009 03:01:02 +0300")
> There are valid calls with filename=nil where nil means the current
> Info file: in Info-find-node-2 filename=nil means to not re-read
> the current Info file, other places rely on the value nil returned
> from Info-find-file when its argument filename is nil since this
> function checks for (stringp filename). So the same check should be
> also in Info-virtual-fun because a call to Info-virtual-fun is outside
> of branches that check for a non-string filename in Info-find-file
> and Info-find-node-2.
If you could explain that somewhere in a comment in info.el, that would
be swell. I have always found info.el's code a bit delicate to modify
because of these special cases with special meanings which are difficult
to predict.
>> Thanks, looks fairly good now. I just worry a little bit about binding
>> inhibit-read-only around the call to (Info-virtual-call virtual-fun
>> filename nodename no-going-back) since that may involve a lot of code
>> that accesses other buffers. Maybe (setq buffer-read-only nil) would be
>> a better choice here.
> This code was a copy from a branch that reads a static Info file.
I know, but for a static file, the affected code was more confined.
> But this could be different like:
> (let ((filename (or filename Info-current-file)))
> (setq buffer-file-name nil)
> (setq buffer-read-only nil)
> (erase-buffer)
> (setq Info-current-file filename)
> (Info-virtual-call virtual-fun filename nodename no-going-back)
> (set-marker Info-tag-table-marker nil)
> (setq buffer-read-only t)
> (set-buffer-modified-p nil)
> (set (make-local-variable 'Info-current-node-virtual) t))
Yes, that's exactly what I was alluding to.
Stefan
prev parent reply other threads:[~2009-07-01 15:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-28 21:28 Virtual Info files and nodes Juri Linkov
2009-06-29 0:14 ` Stefan Monnier
2009-06-29 0:48 ` Juri Linkov
2009-06-29 8:42 ` Stefan Monnier
2009-06-29 23:55 ` Juri Linkov
[not found] ` <jwvr5x11odl.fsf-monnier+emacs@gnu.org>
2009-07-01 0:01 ` Juri Linkov
2009-07-01 15:02 ` Stefan Monnier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvzlboo3dt.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=juri@jurta.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.