The Lambda Lab
/
projects
/
lurk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
af0002a
)
Joins/parts update context users.
author
plugd
<plugd@thelambdalab.xyz>
Sun, 19 May 2024 22:38:05 +0000
(
00:38
+0200)
committer
plugd
<plugd@thelambdalab.xyz>
Sun, 26 May 2024 19:14:04 +0000
(21:14 +0200)
murk.el
patch
|
blob
|
history
diff --git
a/murk.el
b/murk.el
index
ffe10e6
..
2e89982
100644
(file)
--- a/
murk.el
+++ b/
murk.el
@@
-57,6
+57,9
@@
"IRC networks."
:type '(alist :key-type string))
"IRC networks."
:type '(alist :key-type string))
+(defcustom murk-show-joins nil
+ "Set to non-nil to be notified of joins, parts and quits.")
+
(defcustom murk-display-header t
"If non-nil, use buffer header to display current host and channel."
:type '(boolean))
(defcustom murk-display-header t
"If non-nil, use buffer header to display current host and channel."
:type '(boolean))
@@
-359,6
+362,11
@@
The head of this list is always the current context.")
ctx
(cl-union users (murk-context-users ctx))))
ctx
(cl-union users (murk-context-users ctx))))
+(defun murk-del-context-user (ctx user)
+ (murk-set-context-users
+ ctx
+ (delete user (murk-context-users ctx))))
+
;;; Buffer
;;
;;; Buffer
;;
@@
-657,6
+665,15
@@
The head of this list is always the current context.")
"Joining channel " channel " on " server)
(murk-render-prompt)))
"Joining channel " channel " on " server)
(murk-render-prompt)))
+ ("JOIN"
+ (let* ((channel (car (murk-msg-params msg)))
+ (nick (murk-msg-src msg))
+ (ctx (murk-get-context server channel)))
+ (murk-add-context-users ctx (list nick))
+ (if murk-show-joins
+ (murk-display-notice ctx nick " joined channel " channel
+ " on " server))))
+
((and "PART"
(guard (equal (murk-connection-nick server)
(murk-msg-src msg))))
((and "PART"
(guard (equal (murk-connection-nick server)
(murk-msg-src msg))))
@@
-665,6
+682,15
@@
The head of this list is always the current context.")
(murk-remove-context (list server channel))
(murk-render-prompt)))
(murk-remove-context (list server channel))
(murk-render-prompt)))
+ ("PART"
+ (let* ((channel (car (lurk-msg-params msg)))
+ (nick (lurk-msg-src msg))
+ (ctx (murk-get-context server channel)))
+ (murk-del-context-user ctx nick)
+ (if murk-show-joins
+ (murk-display-notice ctx nick " left channel " channel
+ " on " server))))
+
("QUIT"
(let ((nick (murk-msg-src msg))
(reason (mapconcat 'identity (murk-msg-params msg) " ")))
("QUIT"
(let ((nick (murk-msg-src msg))
(reason (mapconcat 'identity (murk-msg-params msg) " ")))
@@
-715,6
+741,7
@@
The head of this list is always the current context.")
(defvar murk-command-table
'(("DEBUG" "Toggle debug mode on/off." murk-command-debug murk-boolean-completions)
("HEADER" "Toggle display of header." murk-command-header murk-boolean-completions)
(defvar murk-command-table
'(("DEBUG" "Toggle debug mode on/off." murk-command-debug murk-boolean-completions)
("HEADER" "Toggle display of header." murk-command-header murk-boolean-completions)
+ ("SHOWJOINS" "Toggles display of joins/parts." murk-command-showjoins murk-boolean-completions)
("NETWORKS" "List known IRC networks." murk-command-networks)
("CONNECT" "Connect to an IRC network." murk-command-connect murk-network-completions)
("QUIT" "Disconnect from current network." murk-command-quit)
("NETWORKS" "List known IRC networks." murk-command-networks)
("CONNECT" "Connect to an IRC network." murk-command-connect murk-network-completions)
("QUIT" "Disconnect from current network." murk-command-quit)
@@
-766,6
+793,16
@@
The head of this list is always the current context.")
(setq-local header-line-format nil)
(murk-display-notice nil "Header disabled.")))
(setq-local header-line-format nil)
(murk-display-notice nil "Header disabled.")))
+(defun murk-command-showjoins (params)
+ (setq murk-show-joins
+ (if params
+ (if (equal (upcase (car params)) "ON")
+ t
+ nil)
+ (not murk-show-joins)))
+ (murk-display-notice nil "Joins/parts will now be "
+ (if murk-show-joins "shown" "hidden") "."))
+
(defun murk-command-clear (params)
(if (not params)
(murk-clear-buffer)
(defun murk-command-clear (params)
(if (not params)
(murk-clear-buffer)