[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 2641dfd4b43 06/14: Add erc-timestamp property to invisible messag
From: |
F. Jason Park |
Subject: |
master 2641dfd4b43 06/14: Add erc-timestamp property to invisible messages |
Date: |
Fri, 5 May 2023 20:30:48 -0400 (EDT) |
branch: master
commit 2641dfd4b4334942282358b50d74f75424ebf4fa
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>
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.
---
lisp/erc/erc-fill.el | 12 ++++++++++--
lisp/erc/erc-match.el | 2 ++
lisp/erc/erc-stamp.el | 10 ++++++----
3 files changed, 18 insertions(+), 6 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)
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index 82b821503a8..c08a640260c 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -654,6 +654,8 @@ See `erc-log-match-format'."
(defvar-local erc-match--hide-fools-offset-bounds nil)
+;; FIXME this should merge with instead of overwrite existing
+;; `invisible' values.
(defun erc-hide-fools (match-type _nickuserhost _message)
"Hide foolish comments.
This function should be called from `erc-text-matched-hook'."
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index 61f289a8753..f90a8fc50b1 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -198,13 +198,15 @@ may not be unique, `equal'-wise."
This function is meant to be called from `erc-insert-modify-hook'
or `erc-send-modify-hook'."
- (unless (get-text-property (point-min) 'invisible)
+ (progn ; remove this `progn' on next major refactor
(let* ((ct (erc-stamp--current-time))
+ (invisible (get-text-property (point-min) 'invisible))
(erc-stamp--current-time ct))
- (funcall erc-insert-timestamp-function
- (erc-format-timestamp ct erc-timestamp-format))
+ (unless invisible
+ (funcall erc-insert-timestamp-function
+ (erc-format-timestamp ct erc-timestamp-format)))
;; FIXME this will error when advice has been applied.
- (when (and (fboundp erc-insert-away-timestamp-function)
+ (when (and (not invisible) (fboundp erc-insert-away-timestamp-function)
erc-away-timestamp-format
(erc-away-time)
(not erc-timestamp-format))
- master updated (1ef219e220c -> ba44b481844), F. Jason Park, 2023/05/05
- master c9f1ad2a870 01/14: Revive option erc-query-on-unjoined-chan-privmsg, F. Jason Park, 2023/05/05
- master 8654cea5843 02/14: Move ERC's buffer-display tests to separate file, F. Jason Park, 2023/05/05
- master 5de90fa9611 03/14: Extend erc-interactive-display to cover /JOINs, F. Jason Park, 2023/05/05
- master 9e1a5a389ed 04/14: Ignore erc-reconnect-display after a timeout, F. Jason Park, 2023/05/05
- master 90a9c7b7b59 05/14: Actually define erc-default-server-functions, F. Jason Park, 2023/05/05
- master b0d761be0f9 08/14: Restore module var toggles in ERC's Custom buffers, F. Jason Park, 2023/05/05
- master 2e18ba6302f 07/14: Simplify erc-button movement commands, F. Jason Park, 2023/05/05
- master 2641dfd4b43 06/14: Add erc-timestamp property to invisible messages,
F. Jason Park <=
- master 16306567706 09/14: Don't send multiline commands as messages in ERC, F. Jason Park, 2023/05/05
- master 35dd1ade7f1 11/14: Preprocess prompt input linewise in ERC, F. Jason Park, 2023/05/05
- master ba44b481844 14/14: Add interface for finding users in erc-server-PRIVMSG, F. Jason Park, 2023/05/05
- master 3a5a6fce957 10/14: Redo line splitting for outgoing messages in ERC, F. Jason Park, 2023/05/05
- master 5adda2f4683 12/14: Revise FORM-as-function interface in erc-button-alist, F. Jason Park, 2023/05/05
- master d141f7149b6 13/14: Improve erc-button--modify-nick-function interface, F. Jason Park, 2023/05/05