(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
;;
(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))
(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)))
("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.")
(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
;;