From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard M Stallman Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#2350: 23.0.90; compilation-mode inserts output in the wrong location Date: Wed, 18 Feb 2009 18:05:32 -0500 Message-ID: References: Reply-To: rms@gnu.org, 2350@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1234999445 1725 80.91.229.12 (18 Feb 2009 23:24:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Feb 2009 23:24:05 +0000 (UTC) Cc: 2350@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org, erich@cozi.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 19 00:25:20 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LZvn3-0000RJ-SL for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Feb 2009 00:25:18 +0100 Original-Received: from localhost ([127.0.0.1]:59762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZvlj-0000jZ-Le for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Feb 2009 18:23:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LZvlW-0000eM-FB for bug-gnu-emacs@gnu.org; Wed, 18 Feb 2009 18:23:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LZvlV-0000cv-9o for bug-gnu-emacs@gnu.org; Wed, 18 Feb 2009 18:23:41 -0500 Original-Received: from [199.232.76.173] (port=39413 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZvlU-0000ca-NJ for bug-gnu-emacs@gnu.org; Wed, 18 Feb 2009 18:23:40 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:57486) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LZvlT-0002KV-Gs for bug-gnu-emacs@gnu.org; Wed, 18 Feb 2009 18:23:39 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1INNZoL028522; Wed, 18 Feb 2009 15:23:37 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n1INF4Va025921; Wed, 18 Feb 2009 15:15:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Richard M Stallman Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 18 Feb 2009 23:15:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2350 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123499846924212 (code B ref -1); Wed, 18 Feb 2009 23:15:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 18 Feb 2009 23:07:49 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1IN7efl024196; Wed, 18 Feb 2009 15:07:41 -0800 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LZvTw-0005tW-TE; Wed, 18 Feb 2009 18:05:32 -0500 In-reply-to: (message from Stefan Monnier on Wed, 18 Feb 2009 09:25:59 -0500) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Wed, 18 Feb 2009 18:23:41 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:25427 gmane.emacs.pretest.bugs:23935 Archived-At: But what isn't clear is whether it's always the right thing to do: it's clear in this particular use of narrow, but there might be other uses of narrow in conjunction with compilation buffers where it would be the wrong thing to do. I looked at the code, and I think it is clear what to do: make sure that narrowing does not prevent insertion at the specified insertion point. Does this change make it work? *** compile.el.~1.486.~ 2009-02-17 13:06:13.000000000 -0500 --- compile.el 2009-02-18 12:23:10.000000000 -0500 *************** *** 1733,1741 **** (with-current-buffer (process-buffer proc) (let ((inhibit-read-only t) ;; `save-excursion' doesn't use the right insertion-type for us. ! (pos (copy-marker (point) t))) (unwind-protect (progn (goto-char (process-mark proc)) ;; We used to use `insert-before-markers', so that windows with ;; point at `process-mark' scroll along with the output, but we --- 1733,1747 ---- (with-current-buffer (process-buffer proc) (let ((inhibit-read-only t) ;; `save-excursion' doesn't use the right insertion-type for us. ! (pos (copy-marker (point) t)) ! (min (point-min-marker)) ! (max (point-max-marker))) (unwind-protect (progn + ;; If we are inserting at the end of the visible region, + ;; keep the inserted text visible. + (set-marker-insertion-type max t) + (widen) (goto-char (process-mark proc)) ;; We used to use `insert-before-markers', so that windows with ;; point at `process-mark' scroll along with the output, but we *************** *** 1745,1751 **** (comint-carriage-motion (process-mark proc) (point))) (set-marker (process-mark proc) (point)) (run-hooks 'compilation-filter-hook)) ! (goto-char pos)))))) ;;; test if a buffer is a compilation buffer, assuming we're in the buffer (defsubst compilation-buffer-internal-p () --- 1751,1760 ---- (comint-carriage-motion (process-mark proc) (point))) (set-marker (process-mark proc) (point)) (run-hooks 'compilation-filter-hook)) ! (goto-char pos) ! (narrow-to-region min max) ! (set-marker min nil) ! (set-marker max nil)))))) ;;; test if a buffer is a compilation buffer, assuming we're in the buffer (defsubst compilation-buffer-internal-p () Unless and until we come across a real case