unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9915: 24.0.91; Info-hide-node-references does not take effect immediately
@ 2011-10-31 11:47 Eli Zaretskii
  2011-11-01  9:32 ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2011-10-31 11:47 UTC (permalink / raw)
  To: 9915

 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)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#9915: 24.0.91; Info-hide-node-references does not take effect immediately
  2011-10-31 11:47 bug#9915: 24.0.91; Info-hide-node-references does not take effect immediately Eli Zaretskii
@ 2011-11-01  9:32 ` Juri Linkov
  2011-11-01 11:18   ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2011-11-01  9:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 9915

> 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






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#9915: 24.0.91; Info-hide-node-references does not take effect immediately
  2011-11-01  9:32 ` Juri Linkov
@ 2011-11-01 11:18   ` Eli Zaretskii
  2011-11-01 21:59     ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2011-11-01 11:18 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 9915

> From: Juri Linkov <juri@jurta.org>
> Cc: 9915@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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#9915: 24.0.91; Info-hide-node-references does not take effect immediately
  2011-11-01 11:18   ` Eli Zaretskii
@ 2011-11-01 21:59     ` Juri Linkov
  2011-11-02  9:45       ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2011-11-01 21:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 9915

> 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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#9915: 24.0.91; Info-hide-node-references does not take effect immediately
  2011-11-01 21:59     ` Juri Linkov
@ 2011-11-02  9:45       ` Juri Linkov
  2011-11-19 21:45         ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2011-11-02  9:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 9915

> 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? "))






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#9915: 24.0.91; Info-hide-node-references does not take effect immediately
  2011-11-02  9:45       ` Juri Linkov
@ 2011-11-19 21:45         ` Juri Linkov
  0 siblings, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2011-11-19 21:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 9915-done

> 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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-19 21:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-31 11:47 bug#9915: 24.0.91; Info-hide-node-references does not take effect immediately Eli Zaretskii
2011-11-01  9:32 ` Juri Linkov
2011-11-01 11:18   ` Eli Zaretskii
2011-11-01 21:59     ` Juri Linkov
2011-11-02  9:45       ` Juri Linkov
2011-11-19 21:45         ` Juri Linkov

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).