summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-fill.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc/erc-fill.el')
-rw-r--r--lisp/erc/erc-fill.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el
index a56134d8188..bf995a5a5e6 100644
--- a/lisp/erc/erc-fill.el
+++ b/lisp/erc/erc-fill.el
@@ -300,7 +300,9 @@ of the minor-mode toggles as usual."
(setq msg (concat msg (and msg " ")
(erc-fill--make-module-dependency-msg "button"))))
(erc-with-server-buffer
- (erc-button-mode +1))))
+ (erc-button-mode +1)))
+ (add-hook 'erc-button--prev-next-predicate-functions
+ #'erc-fill--wrap-merged-button-p nil t))
;; Set local value of user option (can we avoid this somehow?)
(unless (eq erc-fill-function #'erc-fill-wrap)
(setq-local erc-fill-function #'erc-fill-wrap))
@@ -328,6 +330,8 @@ of the minor-mode toggles as usual."
(kill-local-variable 'erc-fill--wrap-value)
(kill-local-variable 'erc-fill-function)
(kill-local-variable 'erc-fill--wrap-visual-keys)
+ (remove-hook 'erc-button--prev-next-predicate-functions
+ #'erc-fill--wrap-merged-button-p t)
(remove-function (local 'erc-stamp--insert-date-function)
#'erc-fill--wrap-stamp-insert-prefixed-date)
(visual-line-mode -1))
@@ -414,6 +418,10 @@ See `erc-fill-wrap-mode' for details."
`((space :width (- erc-fill--wrap-value ,len))
(space :width erc-fill--wrap-value))))))
+;; FIXME use own text property to avoid false positives.
+(defun erc-fill--wrap-merged-button-p (point)
+ (equal "" (get-text-property point 'display)))
+
;; This is an experimental helper for third-party modules. You could,
;; for example, use this to automatically resize the prefix to a
;; fraction of the window's width on some event change. Another use