From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#12230: 24.2; revert-buffer in an Info buffer should refresh Info-index-nodes Date: Mon, 20 Aug 2012 02:39:29 +0300 Organization: JURTA Message-ID: <87393i8n9q.fsf@mail.jurta.org> References: <83boi8dq2r.fsf@gnu.org> <877gsvg7d6.fsf@mail.jurta.org> <831uj3egws.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1345419781 10128 80.91.229.3 (19 Aug 2012 23:43:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Aug 2012 23:43:01 +0000 (UTC) Cc: 12230@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 20 01:42:58 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T3F8z-0007L0-01 for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Aug 2012 01:42:57 +0200 Original-Received: from localhost ([::1]:53563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3F8x-0005k9-LC for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Aug 2012 19:42:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3F8v-0005k0-HW for bug-gnu-emacs@gnu.org; Sun, 19 Aug 2012 19:42:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T3F8u-0006NC-Nk for bug-gnu-emacs@gnu.org; Sun, 19 Aug 2012 19:42:53 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3F8u-0006N8-K9 for bug-gnu-emacs@gnu.org; Sun, 19 Aug 2012 19:42:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T3F94-0004ZB-CN for bug-gnu-emacs@gnu.org; Sun, 19 Aug 2012 19:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Aug 2012 23:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12230 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12230-submit@debbugs.gnu.org id=B12230.134541977817543 (code B ref 12230); Sun, 19 Aug 2012 23:43:02 +0000 Original-Received: (at 12230) by debbugs.gnu.org; 19 Aug 2012 23:42:58 +0000 Original-Received: from localhost ([127.0.0.1]:39011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T3F8z-0004Yu-LP for submit@debbugs.gnu.org; Sun, 19 Aug 2012 19:42:57 -0400 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:51033 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T3F8x-0004Ym-1g for 12230@debbugs.gnu.org; Sun, 19 Aug 2012 19:42:56 -0400 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 38417451CA52; Sun, 19 Aug 2012 16:42:43 -0700 (PDT) In-Reply-To: <831uj3egws.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 19 Aug 2012 05:48:03 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:63308 Archived-At: >> Since `Info-revert-find-node' is not the right place to clear >> the cache because the same problem can occur after killing >> the Info buffer and revisiting the same Info manual manually, >> perhaps the right fix would be to check the modtime of the Info file >> in `Info-find-file' and clear the cache for modified files. > > That should do the trick, I think. Thanks. Actually there are more caches that should be cleared. The following patch should clear them: === modified file 'lisp/info.el' --- lisp/info.el 2012-08-07 16:12:20 +0000 +++ lisp/info.el 2012-08-19 23:38:18 +0000 @@ -813,6 +816,10 @@ (defun Info-node-at-bob-matching (regexp (forward-line 1) ; does the line after delimiter match REGEXP? (re-search-backward regexp beg t)))) +(defvar Info-file-attributes nil + "List of the file attributes of visited Info files. +Each element is a list (FILE-NAME FILE-ATTRIBUTES...).") + (defun Info-find-file (filename &optional noerror) "Return expanded FILENAME, or t if FILENAME is \"dir\". Optional second argument NOERROR, if t, means if file is not found @@ -875,6 +882,22 @@ (defun Info-find-file (filename &optiona (if noerror (setq filename nil) (error "Info file %s does not exist" filename))) + ;; Clear the caches of modified Info files. + (let* ((attribs-old (cdr (assoc filename Info-file-attributes))) + (modtime-old (and attribs-old (nth 5 attribs-old))) + (attribs-new (and (stringp filename) (file-attributes filename))) + (modtime-new (and attribs-new (nth 5 attribs-new)))) + (when (and modtime-old modtime-new + (> (float-time modtime-new) (float-time modtime-old))) + (setq Info-index-nodes (remove (assoc filename Info-index-nodes) + Info-index-nodes)) + (setq Info-toc-nodes (remove (assoc filename Info-toc-nodes) + Info-toc-nodes))) + ;; Add new modtime to `Info-file-attributes'. + (setq Info-file-attributes + (cons (cons filename attribs-new) + (remove (assoc filename Info-file-attributes) + Info-file-attributes)))) filename)))) (defun Info-find-node (filename nodename &optional no-going-back)