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:
ee4de69
)
Can now erase context output.
author
plugd
<plugd@thelambdalab.xyz>
Mon, 26 Jul 2021 08:54:22 +0000
(10:54 +0200)
committer
plugd
<plugd@thelambdalab.xyz>
Mon, 26 Jul 2021 08:54:22 +0000
(10:54 +0200)
lurk.el
patch
|
blob
|
history
diff --git
a/lurk.el
b/lurk.el
index
66517ba
..
447f5f5
100644
(file)
--- a/
lurk.el
+++ b/
lurk.el
@@
-409,6
+409,11
@@
portion of the source component of the message, as LURK doesn't use this.")
(if lurk-display-header
(lurk-setup-header))))
(if lurk-display-header
(lurk-setup-header))))
+(defun lurk-clear-buffer ()
+ "Completely erase all non-prompt and non-input text from lurk buffer."
+ (with-current-buffer "*lurk*"
+ (let ((inhibit-read-only t))
+ (delete-region (point-min) lurk-prompt-marker))))
;;; Output formatting and highlighting
;;
;;; Output formatting and highlighting
;;
@@
-560,6
+565,16
@@
portion of the source component of the message, as LURK doesn't use this.")
(force-window-update "*lurk*"))
(lurk-scroll-windows-to-last-line))
(force-window-update "*lurk*"))
(lurk-scroll-windows-to-last-line))
+(defun lurk-clear-context (context)
+ (with-current-buffer "*lurk*"
+ (save-excursion
+ (goto-char (point-min))
+ (let ((inhibit-read-only t)
+ (match nil))
+ (while (setq match (text-property-search-forward 'context context t))
+ (delete-region (prop-match-beginning match)
+ (prop-match-end match)))))))
+
(defconst lurk-url-regex
(rx (:
(group (+ alpha))
(defconst lurk-url-regex
(rx (:
(group (+ alpha))
@@
-602,7
+617,8
@@
portion of the source component of the message, as LURK doesn't use this.")
(strikethrough nil)
(prev-point (point)))
(while (re-search-forward (rx (or (any "\x02\x1D\x1F\x1E\x0F")
(strikethrough nil)
(prev-point (point)))
(while (re-search-forward (rx (or (any "\x02\x1D\x1F\x1E\x0F")
- (: "\x03" (+ digit) (opt "," (* digit))))) nil t)
+ (: "\x03" (+ digit) (opt "," (* digit)))))
+ nil t)
(let ((beg (+ (match-beginning 0) 1)))
(if bold
(add-face-text-property prev-point beg '(:weight bold)))
(let ((beg (+ (match-beginning 0) 1)))
(if bold
(add-face-text-property prev-point beg '(:weight bold)))
@@
-860,6
+876,7
@@
in which case they match anything.")
("LIST" "Display details of one or more channels." lurk-command-list)
("WHOIS" "Ask server for details of nick." nil lurk-nick-completions)
("MSG" "Send private message to user." lurk-command-msg lurk-nick-completions)
("LIST" "Display details of one or more channels." lurk-command-list)
("WHOIS" "Ask server for details of nick." nil lurk-nick-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))
"Table of commands explicitly supported by Lurk.")
("HELP" "Display help on client commands." lurk-command-help lurk-help-completions))
"Table of commands explicitly supported by Lurk.")
@@
-994,6
+1011,11
@@
in which case they match anything.")
(lurk-display-message lurk-nick to text))
(lurk-display-notice nil "Usage: /msg <nick> <message>")))
(lurk-display-message lurk-nick to text))
(lurk-display-notice nil "Usage: /msg <nick> <message>")))
+(defun lurk-command-clear (params)
+ (if (not params)
+ (lurk-clear-buffer)
+ (dolist (context params)
+ (lurk-clear-context context))))
;;; Command entering
;;
;;; Command entering
;;