From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Virtual Info files and nodes Date: Wed, 01 Jul 2009 17:02:12 +0200 Message-ID: References: <87ws6wnj3s.fsf@mail.jurta.org> <87prcnhn4i.fsf@mail.jurta.org> <87zlbq389k.fsf@mail.jurta.org> <871vp1uufd.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1246460557 26021 80.91.229.12 (1 Jul 2009 15:02:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jul 2009 15:02:37 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 01 17:02:30 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MM1KK-0002rJ-E2 for ged-emacs-devel@m.gmane.org; Wed, 01 Jul 2009 17:02:24 +0200 Original-Received: from localhost ([127.0.0.1]:57892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MM1KJ-0000bW-TJ for ged-emacs-devel@m.gmane.org; Wed, 01 Jul 2009 11:02:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MM1KD-0000YL-Vv for emacs-devel@gnu.org; Wed, 01 Jul 2009 11:02:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MM1K8-0000RA-Vt for emacs-devel@gnu.org; Wed, 01 Jul 2009 11:02:17 -0400 Original-Received: from [199.232.76.173] (port=40366 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MM1K8-0000R7-OT for emacs-devel@gnu.org; Wed, 01 Jul 2009 11:02:12 -0400 Original-Received: from smtp-04.vtx.ch ([212.147.0.65]:38901) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MM1K8-0002XS-5k for emacs-devel@gnu.org; Wed, 01 Jul 2009 11:02:12 -0400 Original-Received: from alfajor.home (dyn.144-85-174-020.dsl.vtx.ch [144.85.174.20]) by smtp-04.vtx.ch (VTX Services SA) with ESMTP id 2BA0D29AFAC; Wed, 1 Jul 2009 17:02:11 +0200 (CEST) Original-Received: by alfajor.home (Postfix, from userid 20848) id BCAD164346; Wed, 1 Jul 2009 17:02:12 +0200 (CEST) In-Reply-To: <871vp1uufd.fsf@mail.jurta.org> (Juri Linkov's message of "Wed, 01 Jul 2009 03:01:02 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111856 Archived-At: > 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