GNU bug report logs - #12855
24.2; The Messages buffer stops following the appended lines.

Previous Next

Package: emacs;

Reported by: Yves Baumes <ybaumes <at> gmail.com>

Date: Sat, 10 Nov 2012 19:19:02 UTC

Severity: normal

Found in version 24.2

Done: martin rudalics <rudalics <at> gmx.at>

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 12855 in the body.
You can then email your comments to 12855 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#12855; Package emacs. (Sat, 10 Nov 2012 19:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yves Baumes <ybaumes <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 10 Nov 2012 19:19:03 GMT) Full text and rfc822 format available.

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

From: Yves Baumes <ybaumes <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2; The Messages buffer stops following the appended lines.
Date: Sat, 10 Nov 2012 20:18:02 +0100
Let's split the frame in two windows only, one for the *scratch* and the
other for *Messages*. From here you have a few lines only in the
*Messages* buffer. And untill now, every new lines introduced because of
a command output is followed. Moreover, I can see the "ghost" cursor at
the end of the buffer and it follows every *Messages* buffer updates.

Then, from the *scratch* buffer, I call the describe-variable key
sequence ( C-h v xxx ). The current buffer being *scratch*, the
*Messages* buffer will be replaced with the *help* buffer.

After finishing to read the description I want to quit it, because I
want the *Messages* buffer to come back. For that, I do: C-x o, thus
switching to the focus to the *Help* buffer, and I just type in 'q' to
quit it and instantly focus back to the *scratch* buffer.

But: When I look into the *Messages* buffer, the "ghost" cursor is no
longer at the same place. It has moved in the middle of the buffer. From
there, the window position relative to the buffer remains the same.
Which is not good because I want to see the *Messages* updates when they
come in.

Regards
Yves.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12855; Package emacs. (Mon, 12 Nov 2012 09:58:01 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Yves Baumes <ybaumes <at> gmail.com>
Cc: 12855 <at> debbugs.gnu.org
Subject: Re: bug#12855: 24.2; The Messages buffer stops following the appended
	lines.
Date: Mon, 12 Nov 2012 10:56:42 +0100
[Message part 1 (text/plain, inline)]
> Let's split the frame in two windows only, one for the *scratch* and the
> other for *Messages*. From here you have a few lines only in the
> *Messages* buffer. And untill now, every new lines introduced because of
> a command output is followed. Moreover, I can see the "ghost" cursor at
> the end of the buffer and it follows every *Messages* buffer updates.
>
> Then, from the *scratch* buffer, I call the describe-variable key
> sequence ( C-h v xxx ). The current buffer being *scratch*, the
> *Messages* buffer will be replaced with the *help* buffer.
>
> After finishing to read the description I want to quit it, because I
> want the *Messages* buffer to come back. For that, I do: C-x o, thus
> switching to the focus to the *Help* buffer, and I just type in 'q' to
> quit it and instantly focus back to the *scratch* buffer.
>
> But: When I look into the *Messages* buffer, the "ghost" cursor is no
> longer at the same place. It has moved in the middle of the buffer. From
> there, the window position relative to the buffer remains the same.
> Which is not good because I want to see the *Messages* updates when they
> come in.

This is due to a bug in `display-buffer-record-window' which doesn't pay
attention to the buffer's `window-point-insertion-type' when storing the
window-point marker.  A similar bug occurs in `record-window-buffer', so
functions like `switch-to-prev-buffer' and `switch-to-next-buffer' are
affected by the same problem whenever they switch to a buffer whose
`window-point-insertion-type' is non-nil.

Since this bug constitutes a considerable annoyance and a regression wrt
23.4 I'd like to install the attached patch on the Emacs 24 branch.  It
principally only adds the necessary TYPE argument to the `copy-marker'
calls but looks more complex because I have to do this in the right
buffer and therefore rearranged the code a bit.  OK to install?

martin
[window-point-insertion-type.diff (text/plain, inline)]
=== modified file 'lisp/window.el'
--- lisp/window.el	2012-11-11 01:47:56 +0000
+++ lisp/window.el	2012-11-12 07:35:12 +0000
@@ -3039,20 +3039,20 @@
     (unless (eq (aref (buffer-name buffer) 0) ?\s)
       ;; Add an entry for buffer to WINDOW's previous buffers.
       (with-current-buffer buffer
-	(let ((start (window-start window))
-	      (point (window-point window)))
-	  (setq entry
-		(cons buffer
-		      (if entry
-			  ;; We have an entry, update marker positions.
-			  (list (set-marker (nth 1 entry) start)
-				(set-marker (nth 2 entry) point))
-			;; Make new markers.
-			(list (copy-marker start)
-			      (copy-marker point)))))
-
+	(let* ((start
+		(if entry
+		    (set-marker (nth 1 entry) (window-start window))
+		  (copy-marker (window-start window))))
+	       (point
+		(if entry
+		    (set-marker (nth 2 entry) (window-point window))
+		  (copy-marker
+		   ;; Preserve window-point-insertion-type (Bug#12855).
+		   (window-point) window-point-insertion-type))))
 	  (set-window-prev-buffers
-	   window (cons entry (window-prev-buffers window))))))))
+	   window
+	   (cons (list buffer start point)
+		 (window-prev-buffers window))))))))
 
 (defun unrecord-window-buffer (&optional window buffer)
   "Unrecord BUFFER in WINDOW.
@@ -4555,13 +4555,17 @@
 	  ;; If WINDOW has a quit-restore parameter, reset its car.
 	  (setcar (window-parameter window 'quit-restore) 'same))
       ;; WINDOW shows another buffer.
-      (set-window-parameter
-       window 'quit-restore
-       (list 'other
-	     ;; A quadruple of WINDOW's buffer, start, point and height.
-	     (list (window-buffer window) (window-start window)
-		   (window-point window) (window-total-size window))
-	     (selected-window) buffer))))
+      (with-current-buffer (window-buffer window)
+	(set-window-parameter
+	 window 'quit-restore
+	 (list 'other
+	       ;; A quadruple of WINDOW's buffer, start, point and height.
+	       (list (current-buffer) (window-start window)
+		     ;; Preserve window-point-insertion-type (Bug#12588).
+		     (copy-marker
+		      (window-point window) window-point-insertion-type)
+		     (window-total-size window))
+	       (selected-window) buffer)))))
    ((eq type 'window)
     ;; WINDOW has been created on an existing frame.
     (set-window-parameter



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12855; Package emacs. (Mon, 12 Nov 2012 14:39:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 12855 <at> debbugs.gnu.org, Yves Baumes <ybaumes <at> gmail.com>
Subject: Re: bug#12855: 24.2;
	The Messages buffer stops following the appended lines.
Date: Mon, 12 Nov 2012 09:37:47 -0500
> Since this bug constitutes a considerable annoyance and a regression wrt
> 23.4 I'd like to install the attached patch on the Emacs 24 branch.  It
> principally only adds the necessary TYPE argument to the `copy-marker'
> calls but looks more complex because I have to do this in the right
> buffer and therefore rearranged the code a bit.  OK to install?

Yes.

> -	(let ((start (window-start window))
> -	      (point (window-point window)))
> -	  (setq entry
> -		(cons buffer
> -		      (if entry
> -			  ;; We have an entry, update marker positions.
> -			  (list (set-marker (nth 1 entry) start)
> -				(set-marker (nth 2 entry) point))
> -			;; Make new markers.
> -			(list (copy-marker start)
> -			      (copy-marker point)))))
> -
> +	(let* ((start
> +		(if entry
> +		    (set-marker (nth 1 entry) (window-start window))
> +		  (copy-marker (window-start window))))
> +	       (point
> +		(if entry
> +		    (set-marker (nth 2 entry) (window-point window))
> +		  (copy-marker
> +		   ;; Preserve window-point-insertion-type (Bug#12855).
> +		   (window-point) window-point-insertion-type))))
>  	  (set-window-prev-buffers
> -	   window (cons entry (window-prev-buffers window))))))))
> +	   window
> +	   (cons (list buffer start point)
> +		 (window-prev-buffers window))))))))

I don't understand why you massaged the code this way instead of just
adding window-point-insertion-type to the last copy-marker call, but
I presume there's a good reason.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12855; Package emacs. (Mon, 12 Nov 2012 17:33:01 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 12855 <at> debbugs.gnu.org, Yves Baumes <ybaumes <at> gmail.com>
Subject: Re: bug#12855: 24.2; The Messages buffer stops following the appended
	lines.
Date: Mon, 12 Nov 2012 18:32:01 +0100
>> -	(let ((start (window-start window))
>> -	      (point (window-point window)))
>> -	  (setq entry
>> -		(cons buffer
>> -		      (if entry
>> -			  ;; We have an entry, update marker positions.
>> -			  (list (set-marker (nth 1 entry) start)
>> -				(set-marker (nth 2 entry) point))
>> -			;; Make new markers.
>> -			(list (copy-marker start)
>> -			      (copy-marker point)))))
>> -
>> +	(let* ((start
>> +		(if entry
>> +		    (set-marker (nth 1 entry) (window-start window))
>> +		  (copy-marker (window-start window))))
>> +	       (point
>> +		(if entry
>> +		    (set-marker (nth 2 entry) (window-point window))
>> +		  (copy-marker
>> +		   ;; Preserve window-point-insertion-type (Bug#12855).
>> +		   (window-point) window-point-insertion-type))))
>>  	  (set-window-prev-buffers
>> -	   window (cons entry (window-prev-buffers window))))))))
>> +	   window
>> +	   (cons (list buffer start point)
>> +		 (window-prev-buffers window))))))))
>
> I don't understand why you massaged the code this way instead of just
> adding window-point-insertion-type to the last copy-marker call, but
> I presume there's a good reason.

Probably not.  Do you think the old version was more readable?

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12855; Package emacs. (Mon, 12 Nov 2012 20:58:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 12855 <at> debbugs.gnu.org, Yves Baumes <ybaumes <at> gmail.com>
Subject: Re: bug#12855: 24.2;
	The Messages buffer stops following the appended lines.
Date: Mon, 12 Nov 2012 15:57:10 -0500
> Probably not.  Do you think the old version was more readable?

The difference is fairly small (not worth changing one for the other),
but if I had to choose I think I'd prefer the current code.


        Stefan




Reply sent to martin rudalics <rudalics <at> gmx.at>:
You have taken responsibility. (Tue, 13 Nov 2012 08:24:02 GMT) Full text and rfc822 format available.

Notification sent to Yves Baumes <ybaumes <at> gmail.com>:
bug acknowledged by developer. (Tue, 13 Nov 2012 08:24:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: 12855-done <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, Yves Baumes <ybaumes <at> gmail.com>
Subject: Re: bug#12855: 24.2; The Messages buffer stops following the appended
	lines.
Date: Tue, 13 Nov 2012 09:22:29 +0100
> The difference is fairly small (not worth changing one for the other),
> but if I had to choose I think I'd prefer the current code.

Done in revision 110859 on the Emacs-24 branch.  Bug closed.

Thanks, martin







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

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

Previous Next


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