aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKatsumi Yamaoka2011-06-10 00:10:24 +0000
committerKatsumi Yamaoka2011-06-10 00:10:24 +0000
commitb229f37d43081a2d960467ead3c5eed6a5764680 (patch)
treed9c930358aaa29a2e5f930c80f7a21505b823e1b /lisp
parent5b4d6e0e880a20333a8c5bbdc517b6e54c285e3f (diff)
downloademacs-b229f37d43081a2d960467ead3c5eed6a5764680.tar.gz
emacs-b229f37d43081a2d960467ead3c5eed6a5764680.zip
Improve Gnus' dribble data handling.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog21
-rw-r--r--lisp/gnus/gnus-agent.el4
-rw-r--r--lisp/gnus/gnus-group.el32
-rw-r--r--lisp/gnus/gnus-srvr.el6
-rw-r--r--lisp/gnus/gnus-start.el17
-rw-r--r--lisp/gnus/gnus-sum.el23
6 files changed, 77 insertions, 26 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index ff3eb98bb97..2bfaf32f958 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,24 @@
12011-06-10 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-group.el (gnus-group-update-group): Add new argument
4 `info-unchanged' that stops updating dribble buffer.
5
6 * gnus-start.el (gnus-dribble-enter): Add new argument `regexp' that
7 deletes lines matching to it in dribble buffer.
8
9 * gnus-agent.el (gnus-agent-fetch-group-1):
10 * gnus-group.el (gnus-group-update-group-line, gnus-group-make-group):
11 * gnus-srvr.el (gnus-server-update-server, gnus-server-set-info):
12 * gnus-start.el (gnus-group-change-level):
13 * gnus-sum.el (gnus-summary-move-article): Delete old dribble entry.
14
15 * gnus-sum.el (gnus-summary-update-info): Don't update dribble buffer
16 if newsgroup info is not changed.
17
18 * gnus-group.el (gnus-group-get-new-news-this-group):
19 * gnus-sum.el (gnus-summary-read-group-1, gnus-summary-exit-no-update):
20 Don't update dribble buffer.
21
12011-06-01 Teodor Zlatanov <tzz@lifelogs.com> 222011-06-01 Teodor Zlatanov <tzz@lifelogs.com>
2 23
3 * gnus-registry.el (gnus-registry-remove-ignored): New function to 24 * gnus-registry.el (gnus-registry-remove-ignored): New function to
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index b4f0dc38e7e..424c55c40f5 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -2614,7 +2614,9 @@ modified) original contents, they are first saved to their own file."
2614 (gnus-dribble-enter 2614 (gnus-dribble-enter
2615 (concat "(gnus-group-set-info '" 2615 (concat "(gnus-group-set-info '"
2616 (gnus-prin1-to-string info) 2616 (gnus-prin1-to-string info)
2617 ")")))))))))))) 2617 ")")
2618 (concat "^(gnus-group-set-info '(\""
2619 (regexp-quote group) "\""))))))))))))
2618 2620
2619;;; 2621;;;
2620;;; Agent Category Mode 2622;;; Agent Category Mode
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 4c474b0aa23..518f215a7ba 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1437,7 +1437,8 @@ if it is a string, only list groups matching REGEXP."
1437 (gnus-dribble-enter 1437 (gnus-dribble-enter
1438 (concat "(gnus-group-set-info '" 1438 (concat "(gnus-group-set-info '"
1439 (gnus-prin1-to-string (nth 2 entry)) 1439 (gnus-prin1-to-string (nth 2 entry))
1440 ")"))) 1440 ")")
1441 (concat "^(gnus-group-set-info '(\"" (regexp-quote group) "\"")))
1441 (setq gnus-group-indentation (gnus-group-group-indentation)) 1442 (setq gnus-group-indentation (gnus-group-group-indentation))
1442 (gnus-delete-line) 1443 (gnus-delete-line)
1443 (gnus-group-insert-group-line-info group) 1444 (gnus-group-insert-group-line-info group)
@@ -1685,10 +1686,11 @@ and ends at END."
1685 (gnus-active group)) 1686 (gnus-active group))
1686 (gnus-group-update-group group)) 1687 (gnus-group-update-group group))
1687 1688
1688(defun gnus-group-update-group (group &optional visible-only) 1689(defun gnus-group-update-group (group &optional visible-only
1690 info-unchanged)
1689 "Update all lines where GROUP appear. 1691 "Update all lines where GROUP appear.
1690If VISIBLE-ONLY is non-nil, the group won't be displayed if it isn't 1692If VISIBLE-ONLY is non-nil, the group won't be displayed if it isn't
1691already." 1693already. If INFO-UNCHANGED is non-nil, dribble buffer is not updated."
1692 (with-current-buffer gnus-group-buffer 1694 (with-current-buffer gnus-group-buffer
1693 (save-excursion 1695 (save-excursion
1694 ;; The buffer may be narrowed. 1696 ;; The buffer may be narrowed.
@@ -1697,14 +1699,17 @@ already."
1697 (let ((ident (gnus-intern-safe group gnus-active-hashtb)) 1699 (let ((ident (gnus-intern-safe group gnus-active-hashtb))
1698 (loc (point-min)) 1700 (loc (point-min))
1699 found buffer-read-only) 1701 found buffer-read-only)
1700 ;; Enter the current status into the dribble buffer. 1702 (unless info-unchanged
1701 (let ((entry (gnus-group-entry group))) 1703 ;; Enter the current status into the dribble buffer.
1702 (when (and entry 1704 (let ((entry (gnus-group-entry group)))
1703 (not (gnus-ephemeral-group-p group))) 1705 (when (and entry
1704 (gnus-dribble-enter 1706 (not (gnus-ephemeral-group-p group)))
1705 (concat "(gnus-group-set-info '" 1707 (gnus-dribble-enter
1706 (gnus-prin1-to-string (nth 2 entry)) 1708 (concat "(gnus-group-set-info '"
1707 ")")))) 1709 (gnus-prin1-to-string (nth 2 entry))
1710 ")")
1711 (concat "^(gnus-group-set-info '(\""
1712 (regexp-quote group) "\"")))))
1708 ;; Find all group instances. If topics are in use, each group 1713 ;; Find all group instances. If topics are in use, each group
1709 ;; may be listed in more than once. 1714 ;; may be listed in more than once.
1710 (while (setq loc (text-property-any 1715 (while (setq loc (text-property-any
@@ -2715,7 +2720,8 @@ server."
2715 (unless (gnus-ephemeral-group-p name) 2720 (unless (gnus-ephemeral-group-p name)
2716 (gnus-dribble-enter 2721 (gnus-dribble-enter
2717 (concat "(gnus-group-set-info '" 2722 (concat "(gnus-group-set-info '"
2718 (gnus-prin1-to-string (cdr info)) ")"))) 2723 (gnus-prin1-to-string (cdr info)) ")")
2724 (concat "^(gnus-group-set-info '(\"" (regexp-quote name) "\"")))
2719 ;; Insert the line. 2725 ;; Insert the line.
2720 (gnus-group-insert-group-line-info nname) 2726 (gnus-group-insert-group-line-info nname)
2721 (forward-line -1) 2727 (forward-line -1)
@@ -4032,7 +4038,7 @@ If DONT-SCAN is non-nil, scan non-activated groups as well."
4032 (when gnus-agent 4038 (when gnus-agent
4033 (gnus-agent-save-group-info 4039 (gnus-agent-save-group-info
4034 method (gnus-group-real-name group) active)) 4040 method (gnus-group-real-name group) active))
4035 (gnus-group-update-group group)) 4041 (gnus-group-update-group group nil t))
4036 (if (eq (gnus-server-status (gnus-find-method-for-group group)) 4042 (if (eq (gnus-server-status (gnus-find-method-for-group group))
4037 'denied) 4043 'denied)
4038 (gnus-error 3 "Server denied access") 4044 (gnus-error 3 "Server denied access")
diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index 9bf2d37a3e4..ec98b2ff749 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -362,7 +362,8 @@ The following commands are available:
362 (when entry 362 (when entry
363 (gnus-dribble-enter 363 (gnus-dribble-enter
364 (concat "(gnus-server-set-info \"" server "\" '" 364 (concat "(gnus-server-set-info \"" server "\" '"
365 (gnus-prin1-to-string (cdr entry)) ")\n"))) 365 (gnus-prin1-to-string (cdr entry)) ")\n")
366 (concat "^(gnus-server-set-info \"" (regexp-quote server) "\"")))
366 (when (or entry oentry) 367 (when (or entry oentry)
367 ;; Buffer may be narrowed. 368 ;; Buffer may be narrowed.
368 (save-restriction 369 (save-restriction
@@ -381,7 +382,8 @@ The following commands are available:
381 (when (and server info) 382 (when (and server info)
382 (gnus-dribble-enter 383 (gnus-dribble-enter
383 (concat "(gnus-server-set-info \"" server "\" '" 384 (concat "(gnus-server-set-info \"" server "\" '"
384 (gnus-prin1-to-string info) ")")) 385 (gnus-prin1-to-string info) ")")
386 (concat "^(gnus-server-set-info \"" (regexp-quote server) "\""))
385 (let* ((server (nth 1 info)) 387 (let* ((server (nth 1 info))
386 (entry (assoc server gnus-server-alist)) 388 (entry (assoc server gnus-server-alist))
387 (cached (assoc server gnus-server-method-cache))) 389 (cached (assoc server gnus-server-method-cache)))
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."
832 gnus-current-startup-file) 832 gnus-current-startup-file)
833 "-dribble")) 833 "-dribble"))
834 834
835(defun gnus-dribble-enter (string) 835(defun gnus-dribble-enter (string &optional regexp)
836 "Enter STRING into the dribble buffer." 836 "Enter STRING into the dribble buffer.
837If REGEXP is given, lines that match it will be deleted."
837 (when (and (not gnus-dribble-ignore) 838 (when (and (not gnus-dribble-ignore)
838 gnus-dribble-buffer 839 gnus-dribble-buffer
839 (buffer-name gnus-dribble-buffer)) 840 (buffer-name gnus-dribble-buffer))
840 (let ((obuf (current-buffer))) 841 (let ((obuf (current-buffer)))
841 (set-buffer gnus-dribble-buffer) 842 (set-buffer gnus-dribble-buffer)
843 (when regexp
844 (goto-char (point-min))
845 (let (end)
846 (while (re-search-forward regexp nil t)
847 (unless (bolp) (forward-line 1))
848 (setq end (point))
849 (goto-char (match-beginning 0))
850 (delete-region (point-at-bol) end))))
842 (goto-char (point-max)) 851 (goto-char (point-max))
843 (insert string "\n") 852 (insert string "\n")
844 ;; This has been commented by Josh Huber <huber@alum.wpi.edu> 853 ;; 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."
1354 (when (cdr entry) 1363 (when (cdr entry)
1355 (setcdr (gnus-group-entry (caadr entry)) entry)) 1364 (setcdr (gnus-group-entry (caadr entry)) entry))
1356 (gnus-dribble-enter 1365 (gnus-dribble-enter
1357 (format 1366 (format "(gnus-group-set-info '%S)" info)
1358 "(gnus-group-set-info '%S)" info))))) 1367 (concat "^(gnus-group-set-info '(\"" (regexp-quote group) "\"")))))
1359 (when gnus-group-change-level-function 1368 (when gnus-group-change-level-function
1360 (funcall gnus-group-change-level-function 1369 (funcall gnus-group-change-level-function
1361 group level oldlevel previous))))) 1370 group level oldlevel previous)))))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 1c4382b24a6..f974d386acb 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -4098,7 +4098,7 @@ If NO-DISPLAY, don't generate a summary buffer."
4098 (setq gnus-newsgroup-prepared t) 4098 (setq gnus-newsgroup-prepared t)
4099 (gnus-run-hooks 'gnus-summary-prepared-hook) 4099 (gnus-run-hooks 'gnus-summary-prepared-hook)
4100 (unless (gnus-ephemeral-group-p group) 4100 (unless (gnus-ephemeral-group-p group)
4101 (gnus-group-update-group group)) 4101 (gnus-group-update-group group nil t))
4102 t))))) 4102 t)))))
4103 4103
4104(defun gnus-summary-auto-select-subject () 4104(defun gnus-summary-auto-select-subject ()
@@ -7140,7 +7140,12 @@ The prefix argument ALL means to select all articles."
7140 t))) 7140 t)))
7141 (unless (listp (cdr gnus-newsgroup-killed)) 7141 (unless (listp (cdr gnus-newsgroup-killed))
7142 (setq gnus-newsgroup-killed (list gnus-newsgroup-killed))) 7142 (setq gnus-newsgroup-killed (list gnus-newsgroup-killed)))
7143 (let ((headers gnus-newsgroup-headers)) 7143 (let ((headers gnus-newsgroup-headers)
7144 (ephemeral-p (gnus-ephemeral-group-p group))
7145 info)
7146 (unless ephemeral-p
7147 (setq info (copy-sequence (gnus-get-info group))
7148 info (delq (gnus-info-params info) info)))
7144 ;; Set the new ranges of read articles. 7149 ;; Set the new ranges of read articles.
7145 (with-current-buffer gnus-group-buffer 7150 (with-current-buffer gnus-group-buffer
7146 (gnus-undo-force-boundary)) 7151 (gnus-undo-force-boundary))
@@ -7160,8 +7165,12 @@ The prefix argument ALL means to select all articles."
7160 (gnus-mark-xrefs-as-read group headers gnus-newsgroup-unreads)) 7165 (gnus-mark-xrefs-as-read group headers gnus-newsgroup-unreads))
7161 ;; Do not switch windows but change the buffer to work. 7166 ;; Do not switch windows but change the buffer to work.
7162 (set-buffer gnus-group-buffer) 7167 (set-buffer gnus-group-buffer)
7163 (unless (gnus-ephemeral-group-p group) 7168 (unless ephemeral-p
7164 (gnus-group-update-group group))))))) 7169 (gnus-group-update-group
7170 group nil
7171 (equal info
7172 (setq info (copy-sequence (gnus-get-info group))
7173 info (delq (gnus-info-params info) info))))))))))
7165 7174
7166(defun gnus-summary-save-newsrc (&optional force) 7175(defun gnus-summary-save-newsrc (&optional force)
7167 "Save the current number of read/marked articles in the dribble buffer. 7176 "Save the current number of read/marked articles in the dribble buffer.
@@ -7314,7 +7323,7 @@ If FORCE (the prefix), also save the .newsrc file(s)."
7314 ;; Clear the current group name. 7323 ;; Clear the current group name.
7315 (setq gnus-newsgroup-name nil) 7324 (setq gnus-newsgroup-name nil)
7316 (unless (gnus-ephemeral-group-p group) 7325 (unless (gnus-ephemeral-group-p group)
7317 (gnus-group-update-group group)) 7326 (gnus-group-update-group group nil t))
7318 (when (equal (gnus-group-group-name) group) 7327 (when (equal (gnus-group-group-name) group)
7319 (gnus-group-next-unread-group 1)) 7328 (gnus-group-next-unread-group 1))
7320 (when quit-config 7329 (when quit-config
@@ -9994,7 +10003,9 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
9994 (gnus-dribble-enter 10003 (gnus-dribble-enter
9995 (concat "(gnus-group-set-info '" 10004 (concat "(gnus-group-set-info '"
9996 (gnus-prin1-to-string (gnus-get-info to-group)) 10005 (gnus-prin1-to-string (gnus-get-info to-group))
9997 ")")))) 10006 ")")
10007 (concat "^(gnus-group-set-info '(\""
10008 (regexp-quote to-group) "\""))))
9998 10009
9999 ;; Update the Xref header in this article to point to 10010 ;; Update the Xref header in this article to point to
10000 ;; the new crossposted article we have just created. 10011 ;; the new crossposted article we have just created.