Thanks for working on this David, I like the idea. David Edmondson writes: > @@ -2491,6 +2498,16 @@ rcirc-markup-urls > (end (match-end 0)) > (url (match-string-no-properties 0)) > (link-text (buffer-substring-no-properties start end))) > + ;; Truncate the visible part of URLs if required and necessary. > + (when (and rcirc-url-max-length > + (> (- end start) rcirc-url-max-length)) > + (let* ((ellipsis "...") > + (new-end (- (+ start rcirc-url-max-length) > + (length ellipsis)))) > + (delete-region new-end end) > + (goto-char new-end) > + (insert ellipsis) > + (setq end (point)))) > ;; Add a button for the URL. Note that we use `make-text-button', > ;; rather than `make-button', as text-buttons are much faster in > ;; large buffers. Couldn't we reuse url-truncate-url-for-viewing, which tries to be smart about where it places the ellipsis, for this? I think the existing code can also be cleaned up a little: