From: Stefan Monnier <monnier@iro.umontreal.ca>
To: JD Smith <jdtsmith@gmail.com>
Cc: 47603-done@debbugs.gnu.org
Subject: bug#47603: comint sets '(rear-nonsticky t) on entire prompt, disabling 'cursor-intangible
Date: Mon, 12 Apr 2021 22:49:55 -0400 [thread overview]
Message-ID: <jwv35vu7vcf.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <3D036269-3D25-4F05-8B1E-BF9CB1956326@gmail.com> (JD Smith's message of "Mon, 5 Apr 2021 14:07:17 -0400")
> Comint sets ‘(rear-nonsticky t) on the entire detected prompt text, which
> prevents `cursor-intangible from functioning correctly when applied to the
> prompt. As Stefan put it:
I fixed it a while back but forgot the `font-lock-face` property in the
list of properties to add to `rear-nonstick` so I just added the
patch below to `master`.
I believe this should now do it.
Stefan
diff --git a/lisp/comint.el b/lisp/comint.el
index 2745c5a26f..b90e6354d8 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1797,6 +1797,9 @@ comint-add-to-input-history
(min size (- comint-input-ring-size size)))))
(ring-insert comint-input-ring cmd)))
+(defconst comint--prompt-rear-nonsticky
+ '(field inhibit-line-move-field-capture read-only font-lock-face))
+
(defun comint-send-input (&optional no-newline artificial)
"Send input to process.
After the process output mark, sends all text from the process mark to
@@ -1916,8 +1919,8 @@ comint-send-input
(unless (or no-newline comint-use-prompt-regexp)
;; Cover the terminating newline
(add-text-properties end (1+ end)
- '(rear-nonsticky
- (field inhibit-line-move-field-capture read-only)
+ `(rear-nonsticky
+ ,comint--prompt-rear-nonsticky
field boundary
inhibit-line-move-field-capture t)))))
@@ -2124,10 +2127,10 @@ comint-output-filter
(unless comint-use-prompt-regexp
(with-silent-modifications
(add-text-properties comint-last-output-start (point)
- '(front-sticky
+ `(rear-nonsticky
+ ,comint--prompt-rear-nonsticky
+ front-sticky
(field inhibit-line-move-field-capture)
- rear-nonsticky
- (field inhibit-line-move-field-capture read-only)
field output
inhibit-line-move-field-capture t))))
@@ -2157,8 +2160,8 @@ comint-output-filter
'font-lock-face
'comint-highlight-prompt)
(add-text-properties prompt-start (point)
- '(rear-nonsticky
- (field inhibit-line-move-field-capture read-only))))
+ `(rear-nonsticky
+ ,comint--prompt-rear-nonsticky)))
(goto-char saved-point)))))))
(defun comint-preinput-scroll-to-bottom ()
prev parent reply other threads:[~2021-04-13 2:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-05 18:07 bug#47603: comint sets '(rear-nonsticky t) on entire prompt, disabling 'cursor-intangible JD Smith
2021-04-13 2:49 ` Stefan Monnier [this message]
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=jwv35vu7vcf.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=47603-done@debbugs.gnu.org \
--cc=jdtsmith@gmail.com \
/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).