summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-fill.el
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2023-04-26 07:05:49 -0700
committerF. Jason Park <jp@neverwas.me>2023-05-05 17:18:01 -0700
commit2641dfd4b4334942282358b50d74f75424ebf4fa (patch)
tree0084983ccf1409308723ee753764193099aa96f0 /lisp/erc/erc-fill.el
parent90a9c7b7b594dfcdc985541eb366e5684136c3ec (diff)
downloademacs-2641dfd4b4334942282358b50d74f75424ebf4fa.tar.gz
emacs-2641dfd4b4334942282358b50d74f75424ebf4fa.tar.bz2
emacs-2641dfd4b4334942282358b50d74f75424ebf4fa.zip
Add erc-timestamp property to invisible messages
* lisp/erc/erc-fill.el (erc-fill--wrap-beginning-of-line): Pretend nicks with an empty string as a `display' prop are `invisible-p' and break out of hidden "merged" nicks after moving. (Bug#60936.) * lisp/erc/erc-match.el (erc-hide-fools): Add comment. * lisp/erc/erc-stamp.el (erc-add-timestamp): Always add `erc-timestamp' and `cursor-sensor-functions' properties but respect tradition and don't actually stamp any invisible messages.
Diffstat (limited to 'lisp/erc/erc-fill.el')
-rw-r--r--lisp/erc/erc-fill.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el
index 7b6495f9f3f..a56134d8188 100644
--- a/lisp/erc/erc-fill.el
+++ b/lisp/erc/erc-fill.el
@@ -221,8 +221,13 @@ messages less than a day apart."
(let ((inhibit-field-text-motion t))
(erc-fill--wrap-move #'move-beginning-of-line
#'beginning-of-visual-line arg))
- (when (get-text-property (point) 'erc-prompt)
- (goto-char erc-input-marker)))
+ (if (get-text-property (point) 'erc-prompt)
+ (goto-char erc-input-marker)
+ ;; Mimic what `move-beginning-of-line' does with invisible text.
+ (when-let ((erc-fill-wrap-merge)
+ (empty (get-text-property (point) 'display))
+ ((string-empty-p empty)))
+ (goto-char (text-property-not-all (point) (pos-eol) 'display empty)))))
(defun erc-fill--wrap-end-of-line (arg)
"Defer to `move-end-of-line' or `end-of-visual-line'."
@@ -389,6 +394,9 @@ See `erc-fill-wrap-mode' for details."
(progn
(skip-syntax-forward "^-")
(forward-char)
+ ;; Using the `invisible' property might make more
+ ;; sense, but that would require coordination
+ ;; with other modules, like `erc-match'.
(cond ((and erc-fill-wrap-merge
(erc-fill--wrap-continued-message-p))
(put-text-property (point-min) (point)