[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/rcirc-update 95fdd4b 14/18: Allow filtering how nicks are presen
From: |
Philip Kaludercic |
Subject: |
feature/rcirc-update 95fdd4b 14/18: Allow filtering how nicks are presented |
Date: |
Thu, 10 Jun 2021 11:43:40 -0400 (EDT) |
branch: feature/rcirc-update
commit 95fdd4b99bccc11f373c3b9d6cacee8269728344
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Allow filtering how nicks are presented
* rcirc.el (rcirc-nick-filter): Add new option
(rcirc-completion-at-point): Use rcirc-nick-filter
(rcirc-format-response-string): Use rcirc-nick-filter
(rcirc-sort-nicknames-join): Use rcirc-nick-filter
---
lisp/net/rcirc.el | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index b3b70a6..ad5a4d6 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -391,6 +391,11 @@ will be killed."
:version "24.3"
:type 'boolean)
+(defcustom rcirc-nick-filter #'identity
+ "Function applied to nicknames before displaying."
+ :version "28.1"
+ :type 'function)
+
(defvar rcirc-nick nil
"The nickname used for the current connection.")
@@ -1118,11 +1123,13 @@ The list is updated automatically by
`defun-rcirc-command'.")
rcirc-prompt-end-marker)))
(table (cond
;; No completion before the prompt
- ((< beg rcirc-prompt-end-marker) nil)
+ ((< beg rcirc-prompt-end-marker) nil)
;; Only complete nicks mid-message
((> beg rcirc-prompt-end-marker)
- (rcirc-channel-nicks (rcirc-buffer-process)
- rcirc-target))
+ (mapcar rcirc-nick-filter
+ (rcirc-channel-nicks
+ (rcirc-buffer-process)
+ rcirc-target)))
;; Complete commands at the beginning of the
;; message, when the first character is a dash
((eq (char-after beg) ?/)
@@ -1135,7 +1142,7 @@ The list is updated automatically by
`defun-rcirc-command'.")
;; Complete usernames right after the prompt by
;; appending a colon after the name
((mapcar
- (lambda (str) (concat str ": "))
+ (lambda (str) (concat (funcall rcirc-nick-filter str)
": "))
(rcirc-channel-nicks (rcirc-buffer-process)
rcirc-target))))))
(list beg (point) table))))
@@ -1601,7 +1608,7 @@ communication."
(sender (if (or (not sender)
(string= (rcirc-server-name process) sender))
""
- sender))
+ (funcall rcirc-nick-filter sender)))
face)
(while (re-search-forward "%\\(\\(f\\(.\\)\\)\\|\\(.\\)\\)" nil t)
(rcirc-add-face start (match-beginning 0) face)
@@ -2044,7 +2051,7 @@ INPUT is a string containing nicknames separated by SEP.
This function does not alter the INPUT string."
(let* ((parts (split-string input sep t))
(sorted (sort parts 'rcirc-nickname<)))
- (mapconcat 'identity sorted sep)))
+ (mapconcat rcirc-nick-filter sorted sep)))
;;; activity tracking
(defvar rcirc-track-minor-mode-map
- branch feature/rcirc-update created (now fd96e3a), Philip Kaludercic, 2021/06/10
- feature/rcirc-update c6b6c2d 02/18: Use auth-source for user-passwords, Philip Kaludercic, 2021/06/10
- feature/rcirc-update fb15875 03/18: Fix checkdoc complaints and related issues, Philip Kaludercic, 2021/06/10
- feature/rcirc-update c300326 12/18: Add TAGMSG handler, Philip Kaludercic, 2021/06/10
- feature/rcirc-update fd96e3a 18/18: Allow hiding certain message types after reconnecting, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 8ea5766 05/18: Recognize quoted commands in rcirc-process-input-line, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 06af44e 08/18: Create framework for IRCv3 support, Philip Kaludercic, 2021/06/10
- feature/rcirc-update ab49a9a 10/18: Implement batch extension, Philip Kaludercic, 2021/06/10
- feature/rcirc-update f6e18c6 13/18: Implement invite-notify capability, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 567e288 11/18: Implement message-ids extension, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 95fdd4b 14/18: Allow filtering how nicks are presented,
Philip Kaludercic <=
- feature/rcirc-update b67b1ee 15/18: Fix prompt doubling when reconnecting, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 6898816 01/18: Default to libera instead of freenode, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 0b367ec 06/18: Remove custom rcirc-completion implementation, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 4ff1f66 07/18: Replace defun-rcirc-command with rcirc-define-command, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 849e71f 09/18: Implement server-time extension, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 3a61e7b 17/18: Use defvar-local instead of setq-local where applicable, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 13f6f78 16/18: Allow for optional arguments using rcirc-define-command, Philip Kaludercic, 2021/06/10
- feature/rcirc-update e6c99a7 04/18: Integrate formatting into rcirc-send-string, Philip Kaludercic, 2021/06/10