diff lisp/gnus/gnus-sum.el @ 116:9f59509498e1 r20-1b10

Import from CVS: tag r20-1b10
author cvs
date Mon, 13 Aug 2007 09:23:06 +0200
parents 8619ce7e4c50
children 7d55a9ba150c
line wrap: on
line diff
--- a/lisp/gnus/gnus-sum.el	Mon Aug 13 09:21:56 2007 +0200
+++ b/lisp/gnus/gnus-sum.el	Mon Aug 13 09:23:06 2007 +0200
@@ -715,31 +715,6 @@
 
 (defvar gnus-scores-exclude-files nil)
 
-(defvar gnus-summary-display-table
-  ;; Change the display table.	Odd characters have a tendency to mess
-  ;; up nicely formatted displays - we make all possible glyphs
-  ;; display only a single character.
-
-  ;; We start from the standard display table, if any.
-  (let ((table (or (copy-sequence standard-display-table)
-		   (make-display-table)))
-	;; Nix out all the control chars...
-	(i 32))
-    (while (>= (setq i (1- i)) 0)
-      (aset table i [??]))
-    ;; ... but not newline and cr, of course.  (cr is necessary for the
-    ;; selective display).
-    (aset table ?\n nil)
-    (aset table ?\r nil)
-    ;; We nix out any glyphs over 126 that are not set already.
-    (let ((i 256))
-      (while (>= (setq i (1- i)) 127)
-	;; Only modify if the entry is nil.
-	(or (aref table i)
-	    (aset table i [??]))))
-    table)
-  "Display table used in summary mode buffers.")
-
 (defvar gnus-original-article nil)
 (defvar gnus-article-internal-prepare-hook nil)
 (defvar gnus-newsgroup-process-stack nil)
@@ -1872,7 +1847,7 @@
   (setq truncate-lines t)
   (setq selective-display t)
   (setq selective-display-ellipses t)	;Display `...'
-  (setq buffer-display-table gnus-summary-display-table)
+  (gnus-summary-set-display-table)
   (gnus-set-default-directory)
   (setq gnus-newsgroup-name group)
   (make-local-variable 'gnus-summary-line-format)
@@ -2210,6 +2185,30 @@
   (mouse-set-point e)
   (gnus-summary-next-page nil t))
 
+(defun gnus-summary-set-display-table ()
+  ;; Change the display table.  Odd characters have a tendency to mess
+  ;; up nicely formatted displays - we make all possible glyphs
+  ;; display only a single character.
+
+  ;; We start from the standard display table, if any.
+  (let ((table (or (copy-sequence standard-display-table)
+		   (make-display-table)))
+	;; Nix out all the control chars...
+	(i 32))
+    (while (>= (setq i (1- i)) 0)
+      (aset table i [??]))
+    ;; ... but not newline and cr, of course.  (cr is necessary for the
+    ;; selective display).
+    (aset table ?\n nil)
+    (aset table ?\r nil)
+    ;; We nix out any glyphs over 126 that are not set already.
+    (let ((i 256))
+      (while (>= (setq i (1- i)) 127)
+	;; Only modify if the entry is nil.
+	(or (aref table i)
+	    (aset table i [??]))))
+    (setq buffer-display-table table)))
+
 (defun gnus-summary-setup-buffer (group)
   "Initialize summary buffer."
   (let ((buffer (concat "*Summary " group "*")))
@@ -3586,6 +3585,11 @@
   "Select newsgroup GROUP.
 If READ-ALL is non-nil, all articles in the group are selected."
   (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
+	 ;;!!! Dirty hack; should be removed.
+	 (gnus-summary-ignore-duplicates
+	  (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual)
+	      t
+	    gnus-summary-ignore-duplicates))
 	 (info (nth 2 entry))
 	 articles fetched-articles cached)
 
@@ -6180,7 +6184,8 @@
 			   gnus-current-article)))
 	   (ogroup gnus-newsgroup-name)
 	   (params (append (gnus-info-params (gnus-get-info ogroup))
-			   (list (cons 'to-group ogroup))))
+			   (list (cons 'to-group ogroup))
+			   (list (cons 'save-article-group ogroup))))
 	   (case-fold-search t)
 	   (buf (current-buffer))
 	   dig)
@@ -6667,20 +6672,26 @@
 	     (set-buffer copy-buf)
 	     ;; First put the article in the destination group.
 	     (gnus-request-article-this-buffer article gnus-newsgroup-name)
-	     (setq art-group
-		   (gnus-request-accept-article
-		    to-newsgroup select-method (not articles)))
-	     (setq new-xref (concat new-xref " " (car art-group)
-				    ":" (cdr art-group)))
-	     ;; Now we have the new Xrefs header, so we insert
-	     ;; it and replace the new article.
-	     (nnheader-replace-header "Xref" new-xref)
-	     (gnus-request-replace-article
-	      (cdr art-group) to-newsgroup (current-buffer))
-	     art-group)))))
-      (if (not art-group)
-	  (gnus-message 1 "Couldn't %s article %s"
-			(cadr (assq action names)) article)
+	     (when (consp (setq art-group
+				(gnus-request-accept-article
+				 to-newsgroup select-method (not articles))))
+	       (setq new-xref (concat new-xref " " (car art-group)
+				      ":" (cdr art-group)))
+	       ;; Now we have the new Xrefs header, so we insert
+	       ;; it and replace the new article.
+	       (nnheader-replace-header "Xref" new-xref)
+	       (gnus-request-replace-article
+		(cdr art-group) to-newsgroup (current-buffer))
+	       art-group))))))
+      (cond
+       ((not art-group)
+	(gnus-message 1 "Couldn't %s article %s"
+		      (cadr (assq action names)) article))
+       ((and (eq art-group 'junk)
+	     (eq action 'move))
+	(gnus-summary-mark-article article gnus-canceled-mark)
+	(gnus-message 4 "Deleted article %s" article))
+       (t
 	(let* ((entry
 		(or
 		 (gnus-gethash (car art-group) gnus-newsrc-hashtb)
@@ -6755,7 +6766,7 @@
 
 	(gnus-summary-goto-subject article)
 	(when (eq action 'move)
-	  (gnus-summary-mark-article article gnus-canceled-mark)))
+	  (gnus-summary-mark-article article gnus-canceled-mark))))
       (gnus-summary-remove-process-mark article))
     ;; Re-activate all groups that have been moved to.
     (while to-groups
@@ -7068,7 +7079,7 @@
 
 ;;; Respooling
 
-(defun gnus-summary-respool-query ()
+(defun gnus-summary-respool-query (&optional silent)
   "Query where the respool algorithm would put this article."
   (interactive)
   (gnus-set-global-variables)
@@ -7078,8 +7089,13 @@
       (set-buffer gnus-original-article-buffer)
       (save-restriction
 	(message-narrow-to-head)
-	(message "This message would go to %s"
-		 (mapconcat 'car (nnmail-article-group 'identity) ", "))))))
+	(let ((groups (nnmail-article-group 'identity)))
+	  (unless silent
+	    (if groups
+		(message "This message would go to %s"
+			 (mapconcat 'car groups ", "))
+	      (message "This message would go to no groups"))
+	    groups))))))
 
 ;; Summary marking commands.