mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
Fix more missing faces on ERC margin strings
* lisp/erc/erc-goodies.el (keep-place-indicator): Add
`erc-keep-place-indicator-arrow' face to overlay arrow.
* lisp/erc/erc-stamp.el (erc-stamp--display-prompt-in-left-margin)
(erc--conceal-prompt): Add `erc-prompt-face' to entire `left-margin'
string. See also 9ba65aa9 "Fix missing margin face on display prop in
erc-stamp".
* test/lisp/erc/erc-fill-tests.el (erc-fill--left-hand-stamps): Update
expected text properties on prompt. (Bug#80693)
This commit is contained in:
parent
3229d6f0e3
commit
05f89d711d
3 changed files with 41 additions and 32 deletions
|
|
@ -399,16 +399,18 @@ This module is local to individual buffers."
|
|||
(progn
|
||||
(erc--restore-initialize-priors erc-keep-place-indicator-mode
|
||||
erc--keep-place-indicator-overlay (make-overlay 0 0))
|
||||
(when-let* (((memq erc-keep-place-indicator-style '(t arrow)))
|
||||
(ov-property (if (zerop (fringe-columns 'left))
|
||||
'after-string
|
||||
'before-string))
|
||||
(display (if (zerop (fringe-columns 'left))
|
||||
`((margin left-margin) ,overlay-arrow-string)
|
||||
(when (memq erc-keep-place-indicator-style '(t arrow))
|
||||
(overlay-put
|
||||
erc--keep-place-indicator-overlay
|
||||
(if (zerop (fringe-columns 'left)) 'after-string 'before-string)
|
||||
(propertize " " 'display
|
||||
(if (zerop (fringe-columns 'left))
|
||||
`((margin left-margin)
|
||||
,(propertize overlay-arrow-string
|
||||
'font-lock-face
|
||||
'erc-keep-place-indicator-arrow))
|
||||
'(left-fringe right-triangle
|
||||
erc-keep-place-indicator-arrow)))
|
||||
(bef (propertize " " 'display display)))
|
||||
(overlay-put erc--keep-place-indicator-overlay ov-property bef))
|
||||
erc-keep-place-indicator-arrow)))))
|
||||
(when (memq erc-keep-place-indicator-style '(t face))
|
||||
(overlay-put erc--keep-place-indicator-overlay 'face
|
||||
'erc-keep-place-indicator-line)))
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ and `erc-stamp--margin-left-p', before activating the mode."
|
|||
|
||||
(defun erc-stamp--display-prompt-in-left-margin ()
|
||||
"Show prompt in the left margin with padding."
|
||||
(when (or (not erc-stamp--last-prompt) (functionp erc-prompt)
|
||||
(when (or (null erc-stamp--last-prompt) (functionp erc-prompt)
|
||||
(> (string-width erc-stamp--last-prompt) left-margin-width))
|
||||
(let ((s (buffer-substring erc-insert-marker (1- erc-input-marker))))
|
||||
;; Prevent #("abc" n m (display ((...) #("abc" p q (display...))))
|
||||
|
|
@ -489,7 +489,9 @@ and `erc-stamp--margin-left-p', before activating the mode."
|
|||
;; This papers over a subtle off-by-1 bug here.
|
||||
(unless (equal sm s)
|
||||
(setq s (concat sm (substring s -1))))))
|
||||
(setq erc-stamp--last-prompt (string-pad s left-margin-width nil t))))
|
||||
(setq erc-stamp--last-prompt
|
||||
(propertize (string-pad s left-margin-width nil t)
|
||||
'font-lock-face 'erc-prompt-face))))
|
||||
(put-text-property erc-insert-marker (1- erc-input-marker)
|
||||
'display `((margin left-margin) ,erc-stamp--last-prompt))
|
||||
erc-stamp--last-prompt)
|
||||
|
|
@ -505,12 +507,15 @@ and `erc-stamp--margin-left-p', before activating the mode."
|
|||
(&context (erc-stamp--display-margin-mode (eql t))
|
||||
(erc-stamp--margin-left-p (eql t))
|
||||
(erc-stamp--skip-left-margin-prompt-p null))
|
||||
(when-let* (((null erc--hidden-prompt-overlay))
|
||||
(prompt (string-pad erc-prompt-hidden left-margin-width nil 'start))
|
||||
(ov (make-overlay erc-insert-marker (1- erc-input-marker)
|
||||
(unless erc--hidden-prompt-overlay
|
||||
(let ((ov (make-overlay erc-insert-marker (1- erc-input-marker)
|
||||
nil 'front-advance)))
|
||||
(overlay-put ov 'display `((margin left-margin) ,prompt))
|
||||
(setq erc--hidden-prompt-overlay ov)))
|
||||
(overlay-put ov 'display
|
||||
`((margin left-margin)
|
||||
,(propertize (string-pad erc-prompt-hidden
|
||||
left-margin-width nil 'start)
|
||||
'font-lock-face 'erc-prompt-face)))
|
||||
(setq erc--hidden-prompt-overlay ov))))
|
||||
|
||||
(defun erc-insert-timestamp-left (string)
|
||||
"Insert timestamps at the beginning of the line."
|
||||
|
|
|
|||
|
|
@ -421,8 +421,9 @@
|
|||
(pcase-let ((`((margin left-margin) ,displayed)
|
||||
(get-text-property erc-insert-marker 'display)))
|
||||
(should (equal-including-properties
|
||||
displayed #(" ERC>" 4 8
|
||||
( read-only t
|
||||
displayed #(" ERC>"
|
||||
0 4 (font-lock-face erc-prompt-face)
|
||||
4 8 ( read-only t
|
||||
front-sticky t
|
||||
field erc-prompt
|
||||
erc-prompt t
|
||||
|
|
@ -437,8 +438,9 @@
|
|||
(pcase-let ((`((margin left-margin) ,displayed)
|
||||
(get-text-property erc-insert-marker 'display)))
|
||||
(should (equal-including-properties
|
||||
displayed #(" ERC>" 3 7
|
||||
( read-only t
|
||||
displayed #(" ERC>"
|
||||
0 3 (font-lock-face erc-prompt-face)
|
||||
3 7 ( read-only t
|
||||
front-sticky t
|
||||
field erc-prompt
|
||||
erc-prompt t
|
||||
|
|
|
|||
Loading…
Reference in a new issue