all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard M Stallman <rms@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 2350@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org,
	erich@cozi.com
Subject: bug#2350: 23.0.90; compilation-mode inserts output in the wrong location
Date: Wed, 18 Feb 2009 18:05:32 -0500	[thread overview]
Message-ID: <E1LZvTw-0005tW-TE@fencepost.gnu.org> (raw)
In-Reply-To: <jwvab8jygaj.fsf-monnier+emacsbugreports@gnu.org> (message from Stefan Monnier on Wed, 18 Feb 2009 09:25:59 -0500)

    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






  parent reply	other threads:[~2009-02-18 23:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17  0:20 bug#2350: 23.0.90; compilation-mode inserts output in the wrong location Eric Hanchrow
2009-02-17 16:42 ` Stefan Monnier
2009-02-18 12:09   ` Richard M Stallman
2009-02-18 14:25     ` Stefan Monnier
2009-02-18 23:05       ` Richard M Stallman
2009-02-18 23:52         ` Stefan Monnier
2009-02-18 23:05       ` Richard M Stallman [this message]
2016-01-21 19:54         ` Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1LZvTw-0005tW-TE@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=2350@emacsbugs.donarmstrong.com \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=erich@cozi.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.