Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-summary-execute-command
@ 2001-03-19  5:29 Katsumi Yamaoka
  2001-07-10  1:12 ` gnus-summary-execute-command ShengHuo ZHU
  0 siblings, 1 reply; 2+ messages in thread
From: Katsumi Yamaoka @ 2001-03-19  5:29 UTC (permalink / raw)
  Cc: KAWABATA, Taichi

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

Hi,

I have a suggestion that the command `gnus-summary-execute-command'
should work with the extra headers which is specified in `gnus-extra-
headers' and/or `nnmail-extra-headers', for instance:

(setq gnus-extra-headers '(To Newsgroups)
      nnmail-extra-headers gnus-extra-headers
      gnus-ignored-from-addresses "Katsumi Yamaoka")

It is useful because of some mailing lists have their own
identification only in the To field.  Here is a patch for it:

2001-03-19 05:28:00  Katsumi Yamaoka <yamaoka@jpl.org>

	* gnus-kill.el (gnus-execute): Work with the extra headers.
	* gnus-sum.el (gnus-summary-execute-command): Ditto.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: extra-headers.patch --]
[-- Type: text/x-patch, Size: 1823 bytes --]

--- gnus-kill.el~	Sun Oct 29 21:57:13 2000
+++ gnus-kill.el	Mon Mar 19 05:28:00 2001
@@ -641,18 +641,30 @@
 marked as read or ticked are ignored."
   (save-excursion
     (let ((killed-no 0)
-	  function article header)
+	  function article header extras)
       (cond
        ;; Search body.
        ((or (null field)
 	    (string-equal field ""))
 	(setq function nil))
        ;; Get access function of header field.
-       ((fboundp
-	 (setq function
-	       (intern-soft
-		(concat "mail-header-" (downcase field)))))
-	(setq function `(lambda (h) (,function h))))
+       ((cond ((fboundp
+		(setq function
+		      (intern-soft
+		       (concat "mail-header-" (downcase field)))))
+	       (setq function `(lambda (h) (,function h))))
+	      ((when (setq extras
+			   (member (downcase field)
+				   (mapcar (lambda (header)
+					     (downcase (symbol-name header)))
+					   gnus-extra-headers)))
+		 (setq function
+		       `(lambda (h)
+			  (gnus-extra-header
+			   (quote ,(nth (- (length gnus-extra-headers)
+					   (length extras))
+					gnus-extra-headers))
+			   h)))))))
        ;; Signal error.
        (t
 	(error "Unknown header field: \"%s\"" field)))
--- gnus-sum.el~	Thu Mar 15 21:57:38 2001
+++ gnus-sum.el	Mon Mar 19 05:28:00 2001
@@ -7409,9 +7409,11 @@
    (list (let ((completion-ignore-case t))
 	   (completing-read
 	    "Header name: "
-	    (mapcar (lambda (string) (list string))
-		    '("Number" "Subject" "From" "Lines" "Date"
-		      "Message-ID" "Xref" "References" "Body"))
+	    (mapcar (lambda (header) (list (format "%s" header)))
+		    (append
+		     '("Number" "Subject" "From" "Lines" "Date"
+		       "Message-ID" "Xref" "References" "Body")
+		     gnus-extra-headers))
 	    nil 'require-match))
 	 (read-string "Regexp: ")
 	 (read-key-sequence "Command: ")

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gnus-summary-execute-command
  2001-03-19  5:29 gnus-summary-execute-command Katsumi Yamaoka
@ 2001-07-10  1:12 ` ShengHuo ZHU
  0 siblings, 0 replies; 2+ messages in thread
From: ShengHuo ZHU @ 2001-07-10  1:12 UTC (permalink / raw)


Katsumi Yamaoka <yamaoka@jpl.org> writes:

> Hi,
> 
> I have a suggestion that the command `gnus-summary-execute-command'
> should work with the extra headers which is specified in `gnus-extra-
> headers' and/or `nnmail-extra-headers', for instance:
> 
> (setq gnus-extra-headers '(To Newsgroups)
>       nnmail-extra-headers gnus-extra-headers
>       gnus-ignored-from-addresses "Katsumi Yamaoka")
> 
> It is useful because of some mailing lists have their own
> identification only in the To field.  Here is a patch for it:
> 
> 2001-03-19 05:28:00  Katsumi Yamaoka <yamaoka@jpl.org>
> 
> 	* gnus-kill.el (gnus-execute): Work with the extra headers.
> 	* gnus-sum.el (gnus-summary-execute-command): Ditto.

Installed. Thanks.

ShengHuo


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-07-10  1:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-19  5:29 gnus-summary-execute-command Katsumi Yamaoka
2001-07-10  1:12 ` gnus-summary-execute-command ShengHuo ZHU

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).