From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#12855: 24.2; The Messages buffer stops following the appended lines. Date: Mon, 12 Nov 2012 10:56:42 +0100 Message-ID: <50A0C7DA.3080001@gmx.at> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070009020209040601090605" X-Trace: ger.gmane.org 1352714268 24115 80.91.229.3 (12 Nov 2012 09:57:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Nov 2012 09:57:48 +0000 (UTC) Cc: 12855@debbugs.gnu.org To: Yves Baumes Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 12 10:57:58 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TXqmC-0002Ap-9F for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Nov 2012 10:57:56 +0100 Original-Received: from localhost ([::1]:49964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXqm2-0001dD-To for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Nov 2012 04:57:46 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXqly-0001ct-7F for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2012 04:57:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXqlv-0006Ah-4y for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2012 04:57:42 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXqlv-0006Ac-1A for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2012 04:57:39 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TXqmH-0003xW-PO for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2012 04:58:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Nov 2012 09:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12855 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12855-submit@debbugs.gnu.org id=B12855.135271426415193 (code B ref 12855); Mon, 12 Nov 2012 09:58:01 +0000 Original-Received: (at 12855) by debbugs.gnu.org; 12 Nov 2012 09:57:44 +0000 Original-Received: from localhost ([127.0.0.1]:34690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXqlz-0003x0-Vx for submit@debbugs.gnu.org; Mon, 12 Nov 2012 04:57:44 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:57252) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1TXqlx-0003ws-MU for 12855@debbugs.gnu.org; Mon, 12 Nov 2012 04:57:43 -0500 Original-Received: (qmail invoked by alias); 12 Nov 2012 09:56:53 -0000 Original-Received: from 62-47-55-250.adsl.highway.telekom.at (EHLO [62.47.55.250]) [62.47.55.250] by mail.gmx.net (mp010) with SMTP; 12 Nov 2012 10:56:53 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19O3rsXyKhO1rbPjygr3La79gd9isKGilGQyQOmn2 ffn4NFMH1jagSG In-Reply-To: X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-Spam-Score: 0.8 (/) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:66790 Archived-At: This is a multi-part message in MIME format. --------------070009020209040601090605 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > 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 --------------070009020209040601090605 Content-Type: text/plain; name="window-point-insertion-type.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="window-point-insertion-type.diff" === 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 --------------070009020209040601090605--