summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-start.el
diff options
context:
space:
mode:
authorKatsumi Yamaoka <yamaoka@jpl.org>2011-06-10 00:10:24 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2011-06-10 00:10:24 +0000
commitb229f37d43081a2d960467ead3c5eed6a5764680 (patch)
treed9c930358aaa29a2e5f930c80f7a21505b823e1b /lisp/gnus/gnus-start.el
parent5b4d6e0e880a20333a8c5bbdc517b6e54c285e3f (diff)
downloademacs-b229f37d43081a2d960467ead3c5eed6a5764680.tar.gz
Improve Gnus' dribble data handling.
Diffstat (limited to 'lisp/gnus/gnus-start.el')
-rw-r--r--lisp/gnus/gnus-start.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 719d0c9e472..aa9af012a1c 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -832,13 +832,22 @@ prompt the user for the name of an NNTP server to use."
gnus-current-startup-file)
"-dribble"))
-(defun gnus-dribble-enter (string)
- "Enter STRING into the dribble buffer."
+(defun gnus-dribble-enter (string &optional regexp)
+ "Enter STRING into the dribble buffer.
+If REGEXP is given, lines that match it will be deleted."
(when (and (not gnus-dribble-ignore)
gnus-dribble-buffer
(buffer-name gnus-dribble-buffer))
(let ((obuf (current-buffer)))
(set-buffer gnus-dribble-buffer)
+ (when regexp
+ (goto-char (point-min))
+ (let (end)
+ (while (re-search-forward regexp nil t)
+ (unless (bolp) (forward-line 1))
+ (setq end (point))
+ (goto-char (match-beginning 0))
+ (delete-region (point-at-bol) end))))
(goto-char (point-max))
(insert string "\n")
;; This has been commented by Josh Huber <huber@alum.wpi.edu>
@@ -1354,8 +1363,8 @@ for new groups, and subscribe the new groups as zombies."
(when (cdr entry)
(setcdr (gnus-group-entry (caadr entry)) entry))
(gnus-dribble-enter
- (format
- "(gnus-group-set-info '%S)" info)))))
+ (format "(gnus-group-set-info '%S)" info)
+ (concat "^(gnus-group-set-info '(\"" (regexp-quote group) "\"")))))
(when gnus-group-change-level-function
(funcall gnus-group-change-level-function
group level oldlevel previous)))))