From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Virtual Info files and nodes
Date: Wed, 01 Jul 2009 03:01:02 +0300 [thread overview]
Message-ID: <871vp1uufd.fsf@mail.jurta.org> (raw)
In-Reply-To: <jwvr5x11odl.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 30 Jun 2009 22:13:49 +0200")
>>>>> - Why check (stringp filename) in Info-virtual-file? Isn't it an
>>>>> error to call it with something else than a string.
>>>> Really only nil can be expected now,
>>> Can it? In which circumstance?
>> `filename' can be nil when `Info-virtual-fun' is called with non-nil
>> `nodename'
>
> That part is obvious enough.
>
>> to check for a node name when a file name is irrelevant -
>> its argument value is nil in this case.
>
> But again: is that ever the case?
> I'd think a node name can only be meaningful when accompagnied by a filename.
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.
>> This is done in the next version below with other fixes including the
>> handling of "dir":
>
> 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.
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))
--
Juri Linkov
http://www.jurta.org/emacs/
next prev parent reply other threads:[~2009-07-01 0:01 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 [this message]
2009-07-01 15:02 ` Stefan Monnier
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871vp1uufd.fsf@mail.jurta.org \
--to=juri@jurta.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).