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 (parent:
c3002ce
)
Nick completeion avoids @s, added /users.
author
plugd
<plugd@thelambdalab.xyz>
Sat, 26 Aug 2023 08:16:49 +0000
(10:16 +0200)
committer
plugd
<plugd@thelambdalab.xyz>
Sat, 26 Aug 2023 08:16:49 +0000
(10:16 +0200)
lurk.el
patch
|
blob
|
history
diff --git
a/lurk.el
b/lurk.el
index
edfb66f
..
bf8f254
100644
(file)
--- a/
lurk.el
+++ b/
lurk.el
@@
-890,6
+890,7
@@
in which case they match anything.")
("NICK" "Change nick." lurk-command-nick)
("LIST" "Display details of one or more channels." lurk-command-list)
("WHOIS" "Ask server for details of nick." nil lurk-nick-completions)
("NICK" "Change nick." lurk-command-nick)
("LIST" "Display details of one or more channels." lurk-command-list)
("WHOIS" "Ask server for details of nick." nil lurk-nick-completions)
+ ("USERS" "List nicks of users in current context." lurk-command-users)
("MSG" "Send private message to user." lurk-command-msg lurk-nick-completions)
("CLEAR" "Clear buffer text." lurk-command-clear lurk-context-completions)
("HELP" "Display help on client commands." lurk-command-help lurk-help-completions))
("MSG" "Send private message to user." lurk-command-msg lurk-nick-completions)
("CLEAR" "Clear buffer text." lurk-command-clear lurk-context-completions)
("HELP" "Display help on client commands." lurk-command-help lurk-help-completions))
@@
-1032,6
+1033,15
@@
in which case they match anything.")
(dolist (context params)
(lurk-clear-context context))))
(dolist (context params)
(lurk-clear-context context))))
+(defun lurk-command-users (params)
+ (if lurk-current-context
+ (progn
+ (lurk-display-notice lurk-current-context "Users in context:")
+ (lurk-display-notice
+ lurk-current-context
+ (string-join (lurk-get-context-users lurk-current-context) " ")))
+ (lurk-display-notice nil "No current channel.")))
+
;;; Command entering
;;
;;; Command entering
;;
@@
-1114,7
+1124,7
@@
in which case they match anything.")
(defun lurk-complete-input ()
(interactive)
(let ((completion-ignore-case t))
(defun lurk-complete-input ()
(interactive)
(let ((completion-ignore-case t))
- (when (
and (>= (point) lurk-input-marker)
)
+ (when (
>= (point) lurk-input-marker
)
(pcase (buffer-substring lurk-input-marker (point))
((rx (: "/" (let cmd-str (+ (not whitespace))) (+ " ") (* (not whitespace)) string-end))
(let ((space-idx (save-excursion
(pcase (buffer-substring lurk-input-marker (point))
((rx (: "/" (let cmd-str (+ (not whitespace))) (+ " ") (* (not whitespace)) string-end))
(let ((space-idx (save-excursion
@@
-1135,7
+1145,11
@@
in which case they match anything.")
(re-search-backward " " lurk-input-marker t)))
(start (if space-idx (+ 1 space-idx) lurk-input-marker)))
(unless (string-prefix-p "/" (buffer-substring start end))
(re-search-backward " " lurk-input-marker t)))
(start (if space-idx (+ 1 space-idx) lurk-input-marker)))
(unless (string-prefix-p "/" (buffer-substring start end))
- (completion-in-region start end (lurk-get-context-users lurk-current-context)))))))))
+ (let* ((users (lurk-get-context-users lurk-current-context))
+ (users-no@ (mapcar
+ (lambda (u) (car (split-string u "@" t)))
+ users)))
+ (completion-in-region start end users-no@)))))))))
(defun lurk-enter ()
"Enter current contents of line after prompt."
(defun lurk-enter ()
"Enter current contents of line after prompt."