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#9915: 24.0.91; Info-hide-node-references does not take effect immediately Date: Wed, 02 Nov 2011 11:45:51 +0200 Organization: JURTA Message-ID: <87k47iyi0g.fsf@mail.jurta.org> References: <877h3k1ahg.fsf@mail.jurta.org> <87vcr3v7g5.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1320227691 7616 80.91.229.12 (2 Nov 2011 09:54:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 2 Nov 2011 09:54:51 +0000 (UTC) Cc: 9915@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 02 10:54:46 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RLXWw-0000fQ-0P for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Nov 2011 10:54:46 +0100 Original-Received: from localhost ([::1]:37932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLXWv-00017s-Gg for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Nov 2011 05:54:45 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLXWr-00014h-UR for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2011 05:54:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLXWq-0005lz-S7 for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2011 05:54:41 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLXWq-0005lp-Q7 for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2011 05:54:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RLXZ8-0002hj-Ht for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2011 05:57: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: Wed, 02 Nov 2011 09:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9915 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9915-submit@debbugs.gnu.org id=B9915.132022776810303 (code B ref 9915); Wed, 02 Nov 2011 09:57:02 +0000 Original-Received: (at 9915) by debbugs.gnu.org; 2 Nov 2011 09:56:08 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RLXYG-0002g8-Ad for submit@debbugs.gnu.org; Wed, 02 Nov 2011 05:56:08 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RLXYD-0002ft-JP for 9915@debbugs.gnu.org; Wed, 02 Nov 2011 05:56:06 -0400 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 2897E6E804D; Wed, 2 Nov 2011 02:53:43 -0700 (PDT) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id D2256451C577; Wed, 2 Nov 2011 02:53:41 -0700 (PDT) In-Reply-To: <87vcr3v7g5.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 01 Nov 2011 23:59:02 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 02 Nov 2011 05:57:02 -0400 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:53434 Archived-At: > This is due to the peculiarity of the implementation of > `Info-revert-find-node' that kills the *Info* buffer to revert it. > Its comment says: > > ;; It's perhaps a bit nasty to kill the *info* buffer to force a re-read, > ;; but at least it keeps this routine (which is for makeinfo-buffer and > ;; Info-revert-buffer-function) out of the way of normal operations. > > It has other nasty effects when used in defcustom, e.g. when > *Info* buffers are displayed in different windows, it will mess up > the window configuration. I think `Info-revert-find-node' should > be rewritten to not kill the *Info* buffer, but I'm not sure > whether this is need for 24.1. This should be fixed with the following patch that doesn't kill the *Info* buffer. I tested it with `M-x makeinfo-buffer RET', with `M-x revert-buffer RET' and with customizing `Info-hide-node-references'. === modified file 'lisp/info.el' --- lisp/info.el 2011-10-24 05:47:05 +0000 +++ lisp/info.el 2011-11-02 09:43:59 +0000 @@ -231,6 +231,12 @@ (defcustom Info-hide-note-references t (const :tag "Replace tag and hide reference" t) (const :tag "Hide tag and reference" hide) (other :tag "Only replace tag" tag)) + :set (lambda (sym val) + (set sym val) + (dolist (buffer (buffer-list)) + (with-current-buffer buffer + (when (eq major-mode 'Info-mode) + (revert-buffer t t))))) :group 'info) (defcustom Info-refill-paragraphs nil @@ -811,10 +822,6 @@ (defun Info-on-current-buffer (&optional (concat default-directory (buffer-name)))) (Info-find-node-2 nil nodename)) -;; It's perhaps a bit nasty to kill the *info* buffer to force a re-read, -;; but at least it keeps this routine (which is for makeinfo-buffer and -;; Info-revert-buffer-function) out of the way of normal operations. -;; (defun Info-revert-find-node (filename nodename) "Go to an Info node FILENAME and NODENAME, re-reading disk contents. When *info* is already displaying FILENAME and NODENAME, the window position @@ -822,33 +829,24 @@ (defun Info-revert-find-node (filename n (or (eq major-mode 'Info-mode) (switch-to-buffer "*info*")) (let ((old-filename Info-current-file) (old-nodename Info-current-node) - (old-buffer-name (buffer-name)) + (window-selected (eq (selected-window) (get-buffer-window))) (pcolumn (current-column)) (pline (count-lines (point-min) (line-beginning-position))) - (wline (count-lines (point-min) (window-start))) - (old-history-forward Info-history-forward) - (old-history Info-history) - (new-history (and Info-current-file - (list Info-current-file Info-current-node (point))))) - (kill-buffer (current-buffer)) - (switch-to-buffer (or old-buffer-name "*info*")) - (Info-mode) - (Info-find-node filename nodename) - (setq Info-history-forward old-history-forward) - (setq Info-history old-history) + (wline (count-lines (point-min) (window-start)))) + ;; When `Info-current-file' is nil, `Info-find-node-2' rereads the file. + (setq Info-current-file nil) + (Info-find-node filename nodename t) (if (and (equal old-filename Info-current-file) (equal old-nodename Info-current-node)) (progn ;; note goto-line is no good, we want to measure from point-min - (goto-char (point-min)) - (forward-line wline) - (set-window-start (selected-window) (point)) + (when window-selected + (goto-char (point-min)) + (forward-line wline) + (set-window-start (selected-window) (point))) (goto-char (point-min)) (forward-line pline) - (move-to-column pcolumn)) - ;; only add to the history when coming from a different file+node - (if new-history - (setq Info-history (cons new-history Info-history)))))) + (move-to-column pcolumn))))) (defun Info-revert-buffer-function (_ignore-auto noconfirm) (when (or noconfirm (y-or-n-p "Revert info buffer? "))