Subject: Re: bug#12855: 24.2; The Messages buffer stops following the appended lines.

From: Stefan Monnier <[email-masked]>
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