GNU bug report logs - #9915
24.0.91; Info-hide-node-references does not take effect immediately

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Mon, 31 Oct 2011 11:50:01 UTC

Severity: normal

Tags: patch

Found in version 24.0.91

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9915 in the body.
You can then email your comments to 9915 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#9915; Package emacs. (Mon, 31 Oct 2011 11:50:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eli Zaretskii <eliz <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 31 Oct 2011 11:50:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.91; Info-hide-node-references does not take effect immediately
Date: Mon, 31 Oct 2011 07:47:22 -0400
 emacs -Q
 C-h i
 m Emacs RET

Observe this line near the middle of the window:

  For information on extending Emacs, see Emacs Lisp(elisp).

Use "M-x customize-variable" to customize the variable
Info-hide-node-references to a nil value.  Then return to the *info*
buffer.

Expected result: the above line shows the full reference, as in

  For information on extending Emacs, see *note Emacs Lisp: (elisp)Top.

Actual result: the display does not change, until you leave this node
and return to it, or manually invoke revert-buffer.

This is confusing.  The option should take effect immediately after it
is customized.

Bonus points for making its effect immediate when the variable's value
is changed through "M-x set-variable RET".


In GNU Emacs 24.0.91.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1)
 of 2011-10-31 on fencepost.gnu.org
configured using `configure  '--enable-asserts' '--enable-checking' '--with-gif=no' '--with-tiff=no' 'CFLAGS=-ggdb -g3 -O0 -DGLYPH_DEBUG=1''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: RMAIL

Minor modes in effect:
  shell-dirtrack-mode: t
  display-time-mode: t
  show-paren-mode: t
  savehist-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 
~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ 
ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC 
[ 6 ~ ESC [ 6 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 
5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 
~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 6 ~ ESC [ 6 ~ ESC O A ESC 
O A ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B 
ESC O B ESC O B ESC O B ESC O B ESC O A ESC O A C-x 
C-x C-w C-x C-s C-x k RET C-u g ESC O A RET d d d d 
d d SPC d SPC d SPC d d d d C-x C-s ESC ! ESC O A RET 
ESC x ESC O A RET ESC O A RET C-s 1 2 : 3 4 : 0 5 C-s 
ESC O B ESC [ 6 ~ ESC [ 6 ~ ESC O B ESC O B ESC O B 
ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC 
O B ESC O B ESC O B ESC O B C-x C-x C-w C-x C-s C-x 
k RET C-u g ESC O A RET d d ESC x r e p o r t - e m 
TAB RET

Recent messages:
Wrote /home/e/eliz/mail.n2
Getting mail from /srv/data/home/e/eliz/mail.n2...
Counting new messages...done (2)
Saving file /home/e/eliz/INBOX...
Wrote /home/e/eliz/INBOX [2 times]
Computing summary lines...done
2 new messages read
Showing message 916
Showing message 916...done
No following nondeleted message

Load-path shadows:
None found.

Features:
(shadow emacsbug help-mode view newcomment multi-isearch shell
pcomplete comint ring flyspell ispell qp rmailsum rmailmm message
sendmail regexp-opt format-spec rfc822 mml easymenu mml-sec mm-decode
mm-bodies mm-encode mailabbrev gmm-utils mailheader mail-parse rfc2231
rmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time
paren cus-start cus-load time-date savehist saveplace tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image fringe lisp-mode register page menu-bar rfn-eshadow
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
make-network-process dynamic-setting font-render-setting move-toolbar
gtk x-toolkit x multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9915; Package emacs. (Tue, 01 Nov 2011 09:38:03 GMT) Full text and rfc822 format available.

Message #8 received at 9915 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9915 <at> debbugs.gnu.org
Subject: Re: bug#9915: 24.0.91;
	Info-hide-node-references does not take effect immediately
Date: Tue, 01 Nov 2011 11:32:35 +0200
> Use "M-x customize-variable" to customize the variable
> Info-hide-node-references to a nil value.  Then return to the *info*
> buffer.
>
> Expected result: the above line shows the full reference, as in
>
>   For information on extending Emacs, see *note Emacs Lisp: (elisp)Top.
>
> Actual result: the display does not change, until you leave this node
> and return to it, or manually invoke revert-buffer.

Is this what you want?

=== modified file 'lisp/info.el'
--- lisp/info.el	2011-10-30 14:37:48 +0000
+++ lisp/info.el	2011-11-01 09:30:42 +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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9915; Package emacs. (Tue, 01 Nov 2011 11:21:01 GMT) Full text and rfc822 format available.

Message #11 received at 9915 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> jurta.org>
Cc: 9915 <at> debbugs.gnu.org
Subject: Re: bug#9915: 24.0.91;
	Info-hide-node-references does not take effect immediately
Date: Tue, 01 Nov 2011 07:18:29 -0400
> From: Juri Linkov <juri <at> jurta.org>
> Cc: 9915 <at> debbugs.gnu.org
> Date: Tue, 01 Nov 2011 11:32:35 +0200
> 
> > Use "M-x customize-variable" to customize the variable
> > Info-hide-node-references to a nil value.  Then return to the *info*
> > buffer.
> >
> > Expected result: the above line shows the full reference, as in
> >
> >   For information on extending Emacs, see *note Emacs Lisp: (elisp)Top.
> >
> > Actual result: the display does not change, until you leave this node
> > and return to it, or manually invoke revert-buffer.
> 
> Is this what you want?

This works for me, thanks.  But there seems to be a left-over problem
with this change, at least on a TTY: when I finish customizing the
value and hit RET on the "Set for current session" button, Emacs
signals an error:

   custom-variable-set: Selecting deleted buffer

The customization does take effect, this error notwithstanding.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9915; Package emacs. (Tue, 01 Nov 2011 23:00:04 GMT) Full text and rfc822 format available.

Message #14 received at 9915 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9915 <at> debbugs.gnu.org
Subject: Re: bug#9915: 24.0.91;
	Info-hide-node-references does not take effect immediately
Date: Tue, 01 Nov 2011 23:59:02 +0200
> This works for me, thanks.  But there seems to be a left-over problem
> with this change, at least on a TTY: when I finish customizing the
> value and hit RET on the "Set for current session" button, Emacs
> signals an error:
>
>    custom-variable-set: Selecting deleted buffer

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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9915; Package emacs. (Wed, 02 Nov 2011 09:57:02 GMT) Full text and rfc822 format available.

Message #17 received at 9915 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9915 <at> debbugs.gnu.org
Subject: Re: bug#9915: 24.0.91;
	Info-hide-node-references does not take effect immediately
Date: Wed, 02 Nov 2011 11:45:51 +0200
> 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? "))





Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Sat, 19 Nov 2011 21:48:02 GMT) Full text and rfc822 format available.

Notification sent to Eli Zaretskii <eliz <at> gnu.org>:
bug acknowledged by developer. (Sat, 19 Nov 2011 21:48:02 GMT) Full text and rfc822 format available.

Message #22 received at 9915-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9915-done <at> debbugs.gnu.org
Subject: Re: bug#9915: 24.0.91;
	Info-hide-node-references does not take effect immediately
Date: Sat, 19 Nov 2011 23:45:17 +0200
> 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'.

Patch installed.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 18 Dec 2011 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 153 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.