From: "Mark H. Weaver" <mhw@netris.org>
Subject: Problem with comint-postoutput-scroll-to-bottom
Date: Sat, 16 Apr 2005 13:59:38 -0400 [thread overview]
Message-ID: <E1DMrZy-0003D9-MP@strings> (raw)
I've discovered a problem in comint.el, which results in at least two
user-visible bugs. Although I have some experience working in Scheme,
I'm very new to hacking elisp, so please excuse me if the terminology
below is incorrect.
The problem is that comint-postoutput-scroll-to-bottom (normally
included in comint-output-filter-functions) makes decisions based on
the location of point, and in some cases moves point. This logic
assumes that point is where the user thinks point is, i.e. where the
cursor is visible on the screen.
Unfortunately, none of that logic works, because at the time the
comint-output-filter-functions are called from comint-output-filter,
point has been temporarily moved to the process mark.
Furthermore, after the comint-output-filter-functions are called,
comint-output-filter moves point back to the process mark, thus
discarding any movement done by comint-postoutput-scroll-to-bottom.
So far, I've found two user-visible bugs caused by this problem:
* comint-move-point-for-output does not work. For example, when this
variable is set to t or 'all, the point should be moved to the end
when new output arrives. This doesn't work at all, because it is
comint-postoutput-scroll-to-bottom which moves point, but
coming-output-filter immediately discards that change by moving
point back to the process mark.
* Consider the case when comint-move-point-for-output is nil,
comint-scroll-show-maximum-output is t, and point is somewhere in
the middle of the buffer. In this case, whenever new output
arrives, (recenter -1) is called, which is most annoying.
comint-postoutput-scroll-to-bottom tries to prevent this, by
recentering only if point is at the end of the buffer, but since
point has been temporarily moved by coming-output-filter, this logic
doesn't work.
Below is one possible way to fix the user-visible problems, but it may
not be the best fix, and may even break established conventions for
comint-output-filter-functions. My Emacs knowledge is not sufficient
to confidently propose a proper fix.
Mark
*** comint.el 15 Apr 2005 21:41:13 -0400 1.315
--- comint.el 16 Apr 2005 13:16:43 -0400
***************
*** 1701,1708 ****
;; Interpret any carriage motion characters (newline, backspace)
(comint-carriage-motion comint-last-output-start (point)))
(run-hook-with-args 'comint-output-filter-functions string)
!
(goto-char (process-mark process)) ; in case a filter moved it
(unless comint-use-prompt-regexp-instead-of-fields
--- 1701,1709 ----
;; Interpret any carriage motion characters (newline, backspace)
(comint-carriage-motion comint-last-output-start (point)))
+ (goto-char saved-point)
(run-hook-with-args 'comint-output-filter-functions string)
! (set-marker saved-point (point-marker))
(goto-char (process-mark process)) ; in case a filter moved it
(unless comint-use-prompt-regexp-instead-of-fields
reply other threads:[~2005-04-16 17:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1DMrZy-0003D9-MP@strings \
--to=mhw@netris.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).