mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
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.
This commit is contained in:
parent
90a9c7b7b5
commit
2641dfd4b4
3 changed files with 18 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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'."
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue