aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2021-04-12 22:49:48 -0400
committerStefan Monnier2021-04-12 22:49:48 -0400
commit6de79542e43ece9a12ebc032c275a6c3fee0b73b (patch)
treee90d8725251f5f3056f3117b76bf5f9f5d2519ec
parent214dfbfea0cc7d64704aa4a258da542435c44cbb (diff)
downloademacs-6de79542e43ece9a12ebc032c275a6c3fee0b73b.tar.gz
emacs-6de79542e43ece9a12ebc032c275a6c3fee0b73b.zip
* lisp/comint.el: Add `font-lock-face` to `rear-nonsticky`
(comint--prompt-rear-nonsticky): New const. (comint-send-input, comint-output-filter): Use it.
-rw-r--r--lisp/comint.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 2745c5a26f6..ef34174305f 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1797,6 +1797,10 @@ Ignore duplicates if `comint-input-ignoredups' is non-nil."
1797 (min size (- comint-input-ring-size size))))) 1797 (min size (- comint-input-ring-size size)))))
1798 (ring-insert comint-input-ring cmd))) 1798 (ring-insert comint-input-ring cmd)))
1799 1799
1800(defconst comint--prompt-rear-nonsticky
1801 '(field inhibit-line-move-field-capture read-only font-lock-face)
1802 "Text properties we set on the prompt and don't want to leak past it.")
1803
1800(defun comint-send-input (&optional no-newline artificial) 1804(defun comint-send-input (&optional no-newline artificial)
1801 "Send input to process. 1805 "Send input to process.
1802After the process output mark, sends all text from the process mark to 1806After the process output mark, sends all text from the process mark to
@@ -1916,8 +1920,8 @@ Similarly for Soar, Scheme, etc."
1916 (unless (or no-newline comint-use-prompt-regexp) 1920 (unless (or no-newline comint-use-prompt-regexp)
1917 ;; Cover the terminating newline 1921 ;; Cover the terminating newline
1918 (add-text-properties end (1+ end) 1922 (add-text-properties end (1+ end)
1919 '(rear-nonsticky 1923 `(rear-nonsticky
1920 (field inhibit-line-move-field-capture read-only) 1924 ,comint--prompt-rear-nonsticky
1921 field boundary 1925 field boundary
1922 inhibit-line-move-field-capture t))))) 1926 inhibit-line-move-field-capture t)))))
1923 1927
@@ -2124,10 +2128,10 @@ Make backspaces delete the previous character."
2124 (unless comint-use-prompt-regexp 2128 (unless comint-use-prompt-regexp
2125 (with-silent-modifications 2129 (with-silent-modifications
2126 (add-text-properties comint-last-output-start (point) 2130 (add-text-properties comint-last-output-start (point)
2127 '(front-sticky 2131 `(rear-nonsticky
2132 ,comint--prompt-rear-nonsticky
2133 front-sticky
2128 (field inhibit-line-move-field-capture) 2134 (field inhibit-line-move-field-capture)
2129 rear-nonsticky
2130 (field inhibit-line-move-field-capture read-only)
2131 field output 2135 field output
2132 inhibit-line-move-field-capture t)))) 2136 inhibit-line-move-field-capture t))))
2133 2137
@@ -2157,8 +2161,8 @@ Make backspaces delete the previous character."
2157 'font-lock-face 2161 'font-lock-face
2158 'comint-highlight-prompt) 2162 'comint-highlight-prompt)
2159 (add-text-properties prompt-start (point) 2163 (add-text-properties prompt-start (point)
2160 '(rear-nonsticky 2164 `(rear-nonsticky
2161 (field inhibit-line-move-field-capture read-only)))) 2165 ,comint--prompt-rear-nonsticky)))
2162 (goto-char saved-point))))))) 2166 (goto-char saved-point)))))))
2163 2167
2164(defun comint-preinput-scroll-to-bottom () 2168(defun comint-preinput-scroll-to-bottom ()