;;; Code:
(require 'gnus)
-(require gnus-easymenu)
-(require 'custom)
(require 'gnus-ems)
+(require 'easymenu)
+(require 'custom)
+
+(defvar gnus-group-menu-hook nil
+ "*Hook run after the creation of the group mode menu.")
+
+(defvar gnus-summary-menu-hook nil
+ "*Hook run after the creation of the summary mode menu.")
+
+(defvar gnus-article-menu-hook nil
+ "*Hook run after the creation of the article mode menu.")
+
+(defvar gnus-server-menu-hook nil
+ "*Hook run after the creation of the server mode menu.")
+
+(defvar gnus-browse-menu-hook nil
+ "*Hook run after the creation of the browse mode menu.")
;;; Summary highlights.
-(defvar gnus-summary-highlight-properties
- '((unread "ForestGreen" "green")
- (ticked "Firebrick" "pink")
- (read "black" "white")
- (low italic italic)
- (high bold bold)
- (canceled "yellow/black" "black/yellow")))
-
-(defvar gnus-summary-highlight-translation
- '(((unread (= mark gnus-unread-mark))
- (ticked (or (= mark gnus-ticked-mark) (= mark gnus-dormant-mark)))
- (read (not (or (= mark gnus-unread-mark) (= mark gnus-dormant-mark)
- (= mark gnus-ticked-mark) (= mark gnus-canceled-mark))))
- (canceled (= mark gnus-canceled-mark)))
- ((low (< score gnus-summary-default-score))
- (high (> score gnus-summary-default-score)))))
-
-(defun gnus-visual-map-face-translation ()
- (let ((props gnus-summary-highlight-properties)
- (trans gnus-summary-highlight-translation)
- map)
- (while props)))
+;(defvar gnus-summary-highlight-properties
+; '((unread "ForestGreen" "green")
+; (ticked "Firebrick" "pink")
+; (read "black" "white")
+; (low italic italic)
+; (high bold bold)
+; (canceled "yellow/black" "black/yellow")))
+
+;(defvar gnus-summary-highlight-translation
+; '(((unread (= mark gnus-unread-mark))
+; (ticked (or (= mark gnus-ticked-mark) (= mark gnus-dormant-mark)))
+; (read (not (or (= mark gnus-unread-mark) (= mark gnus-dormant-mark)
+; (= mark gnus-ticked-mark) (= mark gnus-canceled-mark))))
+; (canceled (= mark gnus-canceled-mark)))
+; ((low (< score gnus-summary-default-score))
+; (high (> score gnus-summary-default-score)))))
+
+;(defun gnus-visual-map-face-translation ()
+; (let ((props gnus-summary-highlight-properties)
+; (trans gnus-summary-highlight-translation)
+; map)
+; (while props)))
-(defvar gnus-summary-selected-face 'underline
- "*Face used for highlighting the current article in the summary buffer.")
+;see gnus-cus.el
+;(defvar gnus-summary-selected-face 'underline
+; "*Face used for highlighting the current article in the summary buffer.")
-(defvar gnus-summary-highlight
- (cond ((not (eq gnus-display-type 'color))
- '(((> score default) . bold)
- ((< score default) . italic)))
- ((eq gnus-background-mode 'dark)
- (list (cons '(= mark gnus-canceled-mark)
- (custom-face-lookup "yellow" "black" nil nil nil nil))
- (cons '(and (> score default)
- (or (= mark gnus-dormant-mark)
- (= mark gnus-ticked-mark)))
- (custom-face-lookup "pink" nil nil t nil nil))
- (cons '(and (< score default)
- (or (= mark gnus-dormant-mark)
- (= mark gnus-ticked-mark)))
- (custom-face-lookup "pink" nil nil nil t nil))
- (cons '(or (= mark gnus-dormant-mark)
- (= mark gnus-ticked-mark))
- (custom-face-lookup "pink" nil nil nil nil nil))
-
- (cons '(and (> score default) (= mark gnus-ancient-mark))
- (custom-face-lookup "SkyBlue" nil nil t nil nil))
- (cons '(and (< score default) (= mark gnus-ancient-mark))
- (custom-face-lookup "SkyBlue" nil nil nil t nil))
- (cons '(= mark gnus-ancient-mark)
- (custom-face-lookup "SkyBlue" nil nil nil nil nil))
-
- (cons '(and (> score default) (= mark gnus-unread-mark))
- (custom-face-lookup "white" nil nil t nil nil))
- (cons '(and (< score default) (= mark gnus-unread-mark))
- (custom-face-lookup "white" nil nil nil t nil))
- (cons '(= mark gnus-unread-mark)
- (custom-face-lookup "white" nil nil nil nil nil))
-
- (cons '(> score default) 'bold)
- (cons '(< score default) 'italic)))
- (t
- (list (cons '(= mark gnus-canceled-mark)
- (custom-face-lookup "yellow" "black" nil nil nil nil))
- (cons '(and (> score default)
- (or (= mark gnus-dormant-mark)
- (= mark gnus-ticked-mark)))
- (custom-face-lookup "firebrick" nil nil t nil nil))
- (cons '(and (< score default)
- (or (= mark gnus-dormant-mark)
- (= mark gnus-ticked-mark)))
- (custom-face-lookup "firebrick" nil nil nil t nil))
- (cons '(or (= mark gnus-dormant-mark)
- (= mark gnus-ticked-mark))
- (custom-face-lookup "firebrick" nil nil nil nil nil))
-
- (cons '(and (> score default) (= mark gnus-ancient-mark))
- (custom-face-lookup "RoyalBlue" nil nil t nil nil))
- (cons '(and (< score default) (= mark gnus-ancient-mark))
- (custom-face-lookup "RoyalBlue" nil nil nil t nil))
- (cons '(= mark gnus-ancient-mark)
- (custom-face-lookup "RoyalBlue" nil nil nil nil nil))
-
- (cons '(and (> score default) (/= mark gnus-unread-mark))
- (custom-face-lookup "DarkGreen" nil nil t nil nil))
- (cons '(and (< score default) (/= mark gnus-unread-mark))
- (custom-face-lookup "DarkGreen" nil nil nil t nil))
- (cons '(/= mark gnus-unread-mark)
- (custom-face-lookup "DarkGreen" nil nil nil nil nil))
-
- (cons '(> score default) 'bold)
- (cons '(< score default) 'italic))))
- "*Alist of `(FORM . FACE)'.
-Summary lines are highlighted with the FACE for the first FORM which
-evaluate to a non-nil value.
-
-Point will be at the beginning of the line when FORM is evaluated.
-The following can be used for convenience:
-
-score: (gnus-summary-article-score)
-default: gnus-summary-default-score
-below: gnus-summary-mark-below
-mark: (gnus-summary-article-mark)
-
-The latter can be used like this:
- ((= mark gnus-replied-mark) . underline)")
+;see gnus-cus.el
+;(defvar gnus-summary-highlight
+; (cond ((not (eq gnus-display-type 'color))
+; '(((> score default) . bold)
+; ((< score default) . italic)))
+; ((eq gnus-background-mode 'dark)
+; (list (cons '(= mark gnus-canceled-mark)
+; (custom-face-lookup "yellow" "black" nil nil nil nil))
+; (cons '(and (> score default)
+; (or (= mark gnus-dormant-mark)
+; (= mark gnus-ticked-mark)))
+; (custom-face-lookup "pink" nil nil t nil nil))
+; (cons '(and (< score default)
+; (or (= mark gnus-dormant-mark)
+; (= mark gnus-ticked-mark)))
+; (custom-face-lookup "pink" nil nil nil t nil))
+; (cons '(or (= mark gnus-dormant-mark)
+; (= mark gnus-ticked-mark))
+; (custom-face-lookup "pink" nil nil nil nil nil))
+
+; (cons '(and (> score default) (= mark gnus-ancient-mark))
+; (custom-face-lookup "SkyBlue" nil nil t nil nil))
+; (cons '(and (< score default) (= mark gnus-ancient-mark))
+; (custom-face-lookup "SkyBlue" nil nil nil t nil))
+; (cons '(= mark gnus-ancient-mark)
+; (custom-face-lookup "SkyBlue" nil nil nil nil nil))
+
+; (cons '(and (> score default) (= mark gnus-unread-mark))
+; (custom-face-lookup "white" nil nil t nil nil))
+; (cons '(and (< score default) (= mark gnus-unread-mark))
+; (custom-face-lookup "white" nil nil nil t nil))
+; (cons '(= mark gnus-unread-mark)
+; (custom-face-lookup "white" nil nil nil nil nil))
+
+; (cons '(> score default) 'bold)
+; (cons '(< score default) 'italic)))
+; (t
+; (list (cons '(= mark gnus-canceled-mark)
+; (custom-face-lookup "yellow" "black" nil nil nil nil))
+; (cons '(and (> score default)
+; (or (= mark gnus-dormant-mark)
+; (= mark gnus-ticked-mark)))
+; (custom-face-lookup "firebrick" nil nil t nil nil))
+; (cons '(and (< score default)
+; (or (= mark gnus-dormant-mark)
+; (= mark gnus-ticked-mark)))
+; (custom-face-lookup "firebrick" nil nil nil t nil))
+; (cons '(or (= mark gnus-dormant-mark)
+; (= mark gnus-ticked-mark))
+; (custom-face-lookup "firebrick" nil nil nil nil nil))
+
+; (cons '(and (> score default) (= mark gnus-ancient-mark))
+; (custom-face-lookup "RoyalBlue" nil nil t nil nil))
+; (cons '(and (< score default) (= mark gnus-ancient-mark))
+; (custom-face-lookup "RoyalBlue" nil nil nil t nil))
+; (cons '(= mark gnus-ancient-mark)
+; (custom-face-lookup "RoyalBlue" nil nil nil nil nil))
+
+; (cons '(and (> score default) (/= mark gnus-unread-mark))
+; (custom-face-lookup "DarkGreen" nil nil t nil nil))
+; (cons '(and (< score default) (/= mark gnus-unread-mark))
+; (custom-face-lookup "DarkGreen" nil nil nil t nil))
+; (cons '(/= mark gnus-unread-mark)
+; (custom-face-lookup "DarkGreen" nil nil nil nil nil))
+
+; (cons '(> score default) 'bold)
+; (cons '(< score default) 'italic))))
+; "*Alist of `(FORM . FACE)'.
+;Summary lines are highlighted with the FACE for the first FORM which
+;evaluate to a non-nil value.
+
+;Point will be at the beginning of the line when FORM is evaluated.
+;The following can be used for convenience:
+
+;score: (gnus-summary-article-score)
+;default: gnus-summary-default-score
+;below: gnus-summary-mark-below
+;mark: (gnus-summary-article-mark)
+
+;The latter can be used like this:
+; ((= mark gnus-replied-mark) . underline)")
;;; article highlights
-(defvar gnus-header-face-alist
- (cond ((not (eq gnus-display-type 'color))
- '(("" bold italic)))
- ((eq gnus-background-mode 'dark)
- (list (list "From" nil
- (custom-face-lookup "SkyBlue" nil nil t t nil))
- (list "Subject" nil
- (custom-face-lookup "pink" nil nil t t nil))
- (list "Newsgroups:.*," nil
- (custom-face-lookup "yellow" nil nil t t nil))
- (list ""
- (custom-face-lookup "cyan" nil nil t nil nil)
- (custom-face-lookup "green" nil nil nil t nil))))
- (t
- (list (list "From" nil
- (custom-face-lookup "RoyalBlue" nil nil t t nil))
- (list "Subject" nil
- (custom-face-lookup "firebrick" nil nil t t nil))
- (list "Newsgroups:.*," nil
- (custom-face-lookup "red" nil nil t t nil))
- (list ""
- (custom-face-lookup "DarkGreen" nil nil t nil nil)
- (custom-face-lookup "DarkGreen" nil nil nil t nil)))))
- "Alist of headers and faces used for highlighting them.
-The entries in the list has the form `(REGEXP NAME CONTENT)', where
-REGEXP is a regular expression matching the beginning of the header,
-NAME is the face used for highlighting the header name and CONTENT is
-the face used for highlighting the header content.
-
-The first non-nil NAME or CONTENT with a matching REGEXP in the list
-will be used.")
-
-
-(defvar gnus-make-foreground t
- "Non nil means foreground color to highlight citations.")
-
-(defvar gnus-article-button-face 'bold
- "Face used for text buttons.")
-
-(defvar gnus-article-mouse-face (if (boundp 'gnus-mouse-face)
- gnus-mouse-face
- 'highlight)
- "Face used when the mouse is over the button.")
-
-(defvar gnus-signature-face 'italic
- "Face used for signature.")
+;see gnus-cus.el
+;(defvar gnus-header-face-alist
+; (cond ((not (eq gnus-display-type 'color))
+; '(("" bold italic)))
+; ((eq gnus-background-mode 'dark)
+; (list (list "From" nil
+; (custom-face-lookup "SkyBlue" nil nil t t nil))
+; (list "Subject" nil
+; (custom-face-lookup "pink" nil nil t t nil))
+; (list "Newsgroups:.*," nil
+; (custom-face-lookup "yellow" nil nil t t nil))
+; (list ""
+; (custom-face-lookup "cyan" nil nil t nil nil)
+; (custom-face-lookup "green" nil nil nil t nil))))
+; (t
+; (list (list "From" nil
+; (custom-face-lookup "RoyalBlue" nil nil t t nil))
+; (list "Subject" nil
+; (custom-face-lookup "firebrick" nil nil t t nil))
+; (list "Newsgroups:.*," nil
+; (custom-face-lookup "red" nil nil t t nil))
+; (list ""
+; (custom-face-lookup "DarkGreen" nil nil t nil nil)
+; (custom-face-lookup "DarkGreen" nil nil nil t nil)))))
+; "Alist of headers and faces used for highlighting them.
+;The entries in the list has the form `(REGEXP NAME CONTENT)', where
+;REGEXP is a regular expression matching the beginning of the header,
+;NAME is the face used for highlighting the header name and CONTENT is
+;the face used for highlighting the header content.
+
+;The first non-nil NAME or CONTENT with a matching REGEXP in the list
+;will be used.")
+
+
+;see gnus-cus.el
+;(defvar gnus-make-foreground t
+; "Non nil means foreground color to highlight citations.")
+
+;see gnus-cus.el
+;(defvar gnus-article-button-face 'bold
+; "Face used for text buttons.")
+
+;see gnus-cus.el
+;(defvar gnus-article-mouse-face (if (boundp 'gnus-mouse-face)
+; gnus-mouse-face
+; 'highlight)
+; "Face used when the mouse is over the button.")
+
+;see gnus-cus.el
+;(defvar gnus-signature-face 'italic
+; "Face used for signature.")
(defvar gnus-button-alist
'(("in\\( +article\\)? +\\(<\\([^\n @<>]+@[^\n @<>]+\\)>\\)" 2
;; Next regexp stolen from highlight-headers.el.
;; Modified by Vladimir Alexiev.
("\\b\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*[-a-zA-Z0-9_=#$@~`%&*+|\\/]" 0 t gnus-button-url 0))
- "Alist of regexps matching buttons in an article.
+ "Alist of regexps matching buttons in article bodies.
Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where
REGEXP: is the string matching text around the button,
CALLBACK can also be a variable, in that case the value of that
variable it the real callback function.")
-(eval-when-compile
- (defvar browse-url-browser-function))
-
-(defvar gnus-button-url
- (cond ((boundp 'browse-url-browser-function) browse-url-browser-function)
- ((fboundp 'w3-fetch) 'w3-fetch)
- ((eq window-system 'x) 'gnus-netscape-open-url))
- "*Function to fetch URL.
-The function will be called with one argument, the URL to fetch.
-Useful values of this function are:
-
-w3-fetch:
- defined in the w3 emacs package by William M. Perry.
-gnus-netscape-open-url:
- open url in existing netscape, start netscape if none found.
-gnus-netscape-start-url:
- start new netscape with url.")
+(defvar gnus-header-button-alist
+ '(("^\\(References\\|Message-ID\\):" "<[^>]+>" 0 t gnus-button-message-id 0)
+ ("^\\(From\\|Reply-To\\): " ": *\\(.+\\)$" 1 t gnus-button-reply 0)
+ ("^\\(Cc\\|To\\):" "[^ \t\n<>,()\"]+@[^ \t\n<>,()\"]+"
+ 0 t gnus-button-mailto 0))
+ "Alist of headers and regexps to match buttons in article heads.
+
+This alist is very similar to `gnus-button-alist', except that each
+alist has an additional HEADER element first in each entry:
+
+\(HEADER REGEXP BUTTON FORM CALLBACK PAR)
+
+HEADER is a regexp to match a header. For a fuller explanation, see
+`gnus-button-alist'.")
+
+;see gnus-cus.el
+;(eval-when-compile
+; (defvar browse-url-browser-function))
+
+;see gnus-cus.el
+;(defvar gnus-button-url
+; (cond ((boundp 'browse-url-browser-function) browse-url-browser-function)
+; ((fboundp 'w3-fetch) 'w3-fetch)
+; ((eq window-system 'x) 'gnus-netscape-open-url))
+; "*Function to fetch URL.
+;The function will be called with one argument, the URL to fetch.
+;Useful values of this function are:
+
+;w3-fetch:
+; defined in the w3 emacs package by William M. Perry.
+;gnus-netscape-open-url:
+; open url in existing netscape, start netscape if none found.
+;gnus-netscape-start-url:
+; start new netscape with url.")
\f
["Edit kill file" gnus-group-edit-local-kill t]
["Expire articles" gnus-group-expire-articles t]
["Set group level" gnus-group-set-current-level t]
+ ["Select quick" gnus-group-quick-select-group t]
))
(easy-menu-define
["Describe all groups" gnus-group-describe-all-groups t]
["Group apropos" gnus-group-apropos t]
["Group and description apropos" gnus-group-description-apropos t]
- ["List groups matching..." gnus-group-list-matching t])
+ ["List groups matching..." gnus-group-list-matching t]
+ ["List active file" gnus-group-list-active t])
("Mark"
["Mark group" gnus-group-mark-group t]
["Unmark group" gnus-group-unmark-group t]
["Kill all zombie groups" gnus-group-kill-all-zombies t])
("Foreign groups"
["Make a foreign group" gnus-group-make-group t]
- ["Edit a group entry" gnus-group-edit-group t]
["Add a directory group" gnus-group-make-directory-group t]
["Add the help group" gnus-group-make-help-group t]
["Add the archive group" gnus-group-make-archive-group t]
["Make a doc group" gnus-group-make-doc-group t]
["Make a kiboze group" gnus-group-make-kiboze-group t]
["Make a virtual group" gnus-group-make-empty-virtual t]
- ["Add a group to a virtual" gnus-group-add-to-virtual t])
+ ["Add a group to a virtual" gnus-group-add-to-virtual t]
+ ["Rename group" gnus-group-rename-group t]
+ ["Delete group" gnus-group-delete-group t])
+ ("Editing groups"
+ ["Parameters" gnus-group-edit-group-parameters t]
+ ["Select method" gnus-group-edit-group-method t]
+ ["Info" gnus-group-edit-group t])
+ ("Score file"
+ ["Flush cache" gnus-score-flush-cache t])
["Read a directory as a group" gnus-group-enter-directory t]
["Jump to group" gnus-group-jump-to-group t]
["Best unread group" gnus-group-best-unread-group t]
["Send a bug report" gnus-bug t]
["Send a mail" gnus-group-mail t]
["Post an article" gnus-group-post-news t]
- ["Customize score file" gnus-score-customize t]
+ ["Customize score file" gnus-score-customize
+ (not (string-match "XEmacs" emacs-version)) ]
["Check for new news" gnus-group-get-new-news t]
["Delete bogus groups" gnus-group-check-bogus-groups t]
["Find new newsgroups" gnus-find-new-newsgroups t]
["Edit global kill file" gnus-group-edit-global-kill t]
["Sort group buffer" gnus-group-sort-groups t]
))
+ (run-hooks 'gnus-group-menu-hook)
)))
;; Server mode
(gnus-visual-turn-off-edit-menu 'server)
(or
(boundp 'gnus-server-menu)
- (easy-menu-define
- gnus-server-menu
- gnus-server-mode-map
- ""
- '("Server"
- ["Add" gnus-server-add-server t]
- ["Browse" gnus-server-read-server t]
- ["List" gnus-server-list-servers t]
- ["Kill" gnus-server-kill-server t]
- ["Yank" gnus-server-yank-server t]
- ["Copy" gnus-server-copy-server t]
- ["Edit" gnus-server-edit-server t]
- ["Exit" gnus-server-exit t]
- ))))
+ (progn
+ (easy-menu-define
+ gnus-server-menu
+ gnus-server-mode-map
+ ""
+ '("Server"
+ ["Add" gnus-server-add-server t]
+ ["Browse" gnus-server-read-server t]
+ ["List" gnus-server-list-servers t]
+ ["Kill" gnus-server-kill-server t]
+ ["Yank" gnus-server-yank-server t]
+ ["Copy" gnus-server-copy-server t]
+ ["Edit" gnus-server-edit-server t]
+ ["Exit" gnus-server-exit t]
+ ))
+ (run-hooks 'gnus-server-menu-hook)
+ )))
;; Browse mode
(defun gnus-browse-make-menu-bar ()
(gnus-visual-turn-off-edit-menu 'browse)
(or
(boundp 'gnus-browse-menu)
- (easy-menu-define
- gnus-browse-menu
- gnus-browse-mode-map
- ""
- '("Browse"
- ["Subscribe" gnus-browse-unsubscribe-current-group t]
- ["Read" gnus-group-read-group t]
- ["Exit" gnus-browse-exit t]
- ))))
+ (progn
+ (easy-menu-define
+ gnus-browse-menu
+ gnus-browse-mode-map
+ ""
+ '("Browse"
+ ["Subscribe" gnus-browse-unsubscribe-current-group t]
+ ["Read" gnus-group-read-group t]
+ ["Exit" gnus-browse-exit t]
+ ))
+ (run-hooks 'gnus-browse-menu-hook)
+ )))
+
;; Summary buffer
(defun gnus-summary-make-menu-bar ()
(gnus-visual-turn-off-edit-menu 'summary)
(or
- (boundp 'gnus-summary-mark-menu)
+ (boundp 'gnus-summary-misc-menu)
(progn
(easy-menu-define
["Set expirable mark" gnus-summary-mark-as-expirable t]
["Set bookmark" gnus-summary-set-bookmark t]
["Remove bookmark" gnus-summary-remove-bookmark t])
- ("Display"
- ["Remove lines marked as read" gnus-summary-remove-lines-marked-as-read t]
- ["Remove lines marked with..." gnus-summary-remove-lines-marked-with t]
- ["Show dormant articles" gnus-summary-show-all-dormant t]
- ["Hide dormant articles" gnus-summary-hide-all-dormant t]
- ["Show expunged articles" gnus-summary-show-all-expunged t])
+ ("Limit"
+ ["Unread" gnus-summary-limit-to-unread t]
+ ["Marks" gnus-summary-limit-to-marks t]
+ ["Score" gnus-summary-limit-to-score t]
+ ["Subject" gnus-summary-limit-to-subject t]
+ ["Non-dormant" gnus-summary-limit-exclude-dormant t]
+ ["Articles" gnus-summary-limit-to-articles t]
+ ["Pop limit" gnus-summary-pop-limit t]
+ ["Show dormant" gnus-summary-limit-include-dormant t]
+ ["Show expunged" gnus-summary-show-all-expunged t])
("Process mark"
["Set mark" gnus-summary-mark-as-processable t]
["Remove mark" gnus-summary-unmark-as-processable t]
["Mark region" gnus-uu-mark-region t]
["Mark by regexp" gnus-uu-mark-by-regexp t]
["Mark all" gnus-uu-mark-all t]
+ ["Mark buffer" gnus-uu-mark-buffer t]
["Mark sparse" gnus-uu-mark-sparse t]
- ["Mark thread" gnus-uu-mark-thread t]))
+ ["Mark thread" gnus-uu-mark-thread t]
+ ["Unmark thread" gnus-uu-unmark-thread t]))
("Move"
["Scroll article forwards" gnus-summary-next-page t]
["Next unread article" gnus-summary-next-unread-article t]
["Edit score file" gnus-score-edit-file t]
["Trace score" gnus-score-find-trace t]
["Increase score" gnus-summary-increase-score t]
- ["Lower score" gnus-summary-lower-score t]
- ("Default header"
- ["Ask" (gnus-score-set-default 'gnus-score-default-header nil)
- :style radio
- :selected (null gnus-score-default-header)]
- ["From" (gnus-score-set-default 'gnus-score-default-header 'a)
- :style radio
- :selected (eq gnus-score-default-header 'a )]
- ["Subject" (gnus-score-set-default 'gnus-score-default-header 's)
- :style radio
- :selected (eq gnus-score-default-header 's )]
- ["Article body"
- (gnus-score-set-default 'gnus-score-default-header 'b)
- :style radio
- :selected (eq gnus-score-default-header 'b )]
- ["All headers"
- (gnus-score-set-default 'gnus-score-default-header 'h)
- :style radio
- :selected (eq gnus-score-default-header 'h )]
- ["Message-Id" (gnus-score-set-default 'gnus-score-default-header 'i)
- :style radio
- :selected (eq gnus-score-default-header 'i )]
- ["Thread" (gnus-score-set-default 'gnus-score-default-header 't)
- :style radio
- :selected (eq gnus-score-default-header 't )]
- ["Crossposting"
- (gnus-score-set-default 'gnus-score-default-header 'x)
- :style radio
- :selected (eq gnus-score-default-header 'x )]
- ["Lines" (gnus-score-set-default 'gnus-score-default-header 'l)
- :style radio
- :selected (eq gnus-score-default-header 'l )]
- ["Date" (gnus-score-set-default 'gnus-score-default-header 'd)
- :style radio
- :selected (eq gnus-score-default-header 'd )]
- ["Followups to author"
- (gnus-score-set-default 'gnus-score-default-header 'f)
- :style radio
- :selected (eq gnus-score-default-header 'f )])
- ("Default type"
- ["Ask" (gnus-score-set-default 'gnus-score-default-type nil)
- :style radio
- :selected (null gnus-score-default-type)]
- ;; The `:active' key is commented out in the following,
- ;; because the GNU Emacs hack to support radio buttons use
- ;; active to indicate which button is selected.
- ["Substring" (gnus-score-set-default 'gnus-score-default-type 's)
- :style radio
- ;; :active (not (memq gnus-score-default-header '(l d)))
- :selected (eq gnus-score-default-type 's)]
- ["Regexp" (gnus-score-set-default 'gnus-score-default-type 'r)
- :style radio
- ;; :active (not (memq gnus-score-default-header '(l d)))
- :selected (eq gnus-score-default-type 'r)]
- ["Exact" (gnus-score-set-default 'gnus-score-default-type 'e)
- :style radio
- ;; :active (not (memq gnus-score-default-header '(l d)))
- :selected (eq gnus-score-default-type 'e)]
- ["Fuzzy" (gnus-score-set-default 'gnus-score-default-type 'f)
- :style radio
- ;; :active (not (memq gnus-score-default-header '(l d)))
- :selected (eq gnus-score-default-type 'f)]
- ["Before date" (gnus-score-set-default 'gnus-score-default-type 'b)
- :style radio
- ;; :active (eq (gnus-score-default-header 'd))
- :selected (eq gnus-score-default-type 'b)]
- ["At date" (gnus-score-set-default 'gnus-score-default-type 'n)
- :style radio
- ;; :active (eq (gnus-score-default-header 'd))
- :selected (eq gnus-score-default-type 'n)]
- ["After date" (gnus-score-set-default 'gnus-score-default-type 'a)
- :style radio
- ;; :active (eq (gnus-score-default-header 'd))
- :selected (eq gnus-score-default-type 'a)]
- ["Less than number"
- (gnus-score-set-default 'gnus-score-default-type '<)
- :style radio
- ;; :active (eq (gnus-score-default-header 'l))
- :selected (eq gnus-score-default-type '<)]
- ["Equal to number"
- (gnus-score-set-default 'gnus-score-default-type '=)
- :style radio
- ;; :active (eq (gnus-score-default-header 'l))
- :selected (eq gnus-score-default-type '=)]
- ["Greater than number"
- (gnus-score-set-default 'gnus-score-default-type '>)
- :style radio
- ;; :active (eq (gnus-score-default-header 'l))
- :selected (eq gnus-score-default-type '>)])
- ["Default fold" gnus-score-default-fold-toggle
- :style toggle
- :selected gnus-score-default-fold]
- ("Default duration"
- ["Ask" (gnus-score-set-default 'gnus-score-default-duration nil)
- :style radio
- :selected (null gnus-score-default-duration)]
- ["Permanent"
- (gnus-score-set-default 'gnus-score-default-duration 'p)
- :style radio
- :selected (eq gnus-score-default-duration 'p)]
- ["Temporary"
- (gnus-score-set-default 'gnus-score-default-duration 't)
- :style radio
- :selected (eq gnus-score-default-duration 't)]
- ["Immediate"
- (gnus-score-set-default 'gnus-score-default-duration 'i)
- :style radio
- :selected (eq gnus-score-default-duration 'i)])
- ))))
+ ["Lower score" gnus-summary-lower-score t]))))
+
+ (and nil
+ '(("Default header"
+ ["Ask" (gnus-score-set-default 'gnus-score-default-header nil)
+ :style radio
+ :selected (null gnus-score-default-header)]
+ ["From" (gnus-score-set-default 'gnus-score-default-header 'a)
+ :style radio
+ :selected (eq gnus-score-default-header 'a )]
+ ["Subject" (gnus-score-set-default 'gnus-score-default-header 's)
+ :style radio
+ :selected (eq gnus-score-default-header 's )]
+ ["Article body"
+ (gnus-score-set-default 'gnus-score-default-header 'b)
+ :style radio
+ :selected (eq gnus-score-default-header 'b )]
+ ["All headers"
+ (gnus-score-set-default 'gnus-score-default-header 'h)
+ :style radio
+ :selected (eq gnus-score-default-header 'h )]
+ ["Message-Id" (gnus-score-set-default 'gnus-score-default-header 'i)
+ :style radio
+ :selected (eq gnus-score-default-header 'i )]
+ ["Thread" (gnus-score-set-default 'gnus-score-default-header 't)
+ :style radio
+ :selected (eq gnus-score-default-header 't )]
+ ["Crossposting"
+ (gnus-score-set-default 'gnus-score-default-header 'x)
+ :style radio
+ :selected (eq gnus-score-default-header 'x )]
+ ["Lines" (gnus-score-set-default 'gnus-score-default-header 'l)
+ :style radio
+ :selected (eq gnus-score-default-header 'l )]
+ ["Date" (gnus-score-set-default 'gnus-score-default-header 'd)
+ :style radio
+ :selected (eq gnus-score-default-header 'd )]
+ ["Followups to author"
+ (gnus-score-set-default 'gnus-score-default-header 'f)
+ :style radio
+ :selected (eq gnus-score-default-header 'f )])
+ ("Default type"
+ ["Ask" (gnus-score-set-default 'gnus-score-default-type nil)
+ :style radio
+ :selected (null gnus-score-default-type)]
+ ;; The `:active' key is commented out in the following,
+ ;; because the GNU Emacs hack to support radio buttons use
+ ;; active to indicate which button is selected.
+ ["Substring" (gnus-score-set-default 'gnus-score-default-type 's)
+ :style radio
+ ;; :active (not (memq gnus-score-default-header '(l d)))
+ :selected (eq gnus-score-default-type 's)]
+ ["Regexp" (gnus-score-set-default 'gnus-score-default-type 'r)
+ :style radio
+ ;; :active (not (memq gnus-score-default-header '(l d)))
+ :selected (eq gnus-score-default-type 'r)]
+ ["Exact" (gnus-score-set-default 'gnus-score-default-type 'e)
+ :style radio
+ ;; :active (not (memq gnus-score-default-header '(l d)))
+ :selected (eq gnus-score-default-type 'e)]
+ ["Fuzzy" (gnus-score-set-default 'gnus-score-default-type 'f)
+ :style radio
+ ;; :active (not (memq gnus-score-default-header '(l d)))
+ :selected (eq gnus-score-default-type 'f)]
+ ["Before date" (gnus-score-set-default 'gnus-score-default-type 'b)
+ :style radio
+ ;; :active (eq (gnus-score-default-header 'd))
+ :selected (eq gnus-score-default-type 'b)]
+ ["At date" (gnus-score-set-default 'gnus-score-default-type 'n)
+ :style radio
+ ;; :active (eq (gnus-score-default-header 'd))
+ :selected (eq gnus-score-default-type 'n)]
+ ["After date" (gnus-score-set-default 'gnus-score-default-type 'a)
+ :style radio
+ ;; :active (eq (gnus-score-default-header 'd))
+ :selected (eq gnus-score-default-type 'a)]
+ ["Less than number"
+ (gnus-score-set-default 'gnus-score-default-type '<)
+ :style radio
+ ;; :active (eq (gnus-score-default-header 'l))
+ :selected (eq gnus-score-default-type '<)]
+ ["Equal to number"
+ (gnus-score-set-default 'gnus-score-default-type '=)
+ :style radio
+ ;; :active (eq (gnus-score-default-header 'l))
+ :selected (eq gnus-score-default-type '=)]
+ ["Greater than number"
+ (gnus-score-set-default 'gnus-score-default-type '>)
+ :style radio
+ ;; :active (eq (gnus-score-default-header 'l))
+ :selected (eq gnus-score-default-type '>)])
+ ["Default fold" gnus-score-default-fold-toggle
+ :style toggle
+ :selected gnus-score-default-fold]
+ ("Default duration"
+ ["Ask" (gnus-score-set-default 'gnus-score-default-duration nil)
+ :style radio
+ :selected (null gnus-score-default-duration)]
+ ["Permanent"
+ (gnus-score-set-default 'gnus-score-default-duration 'p)
+ :style radio
+ :selected (eq gnus-score-default-duration 'p)]
+ ["Temporary"
+ (gnus-score-set-default 'gnus-score-default-duration 't)
+ :style radio
+ :selected (eq gnus-score-default-duration 't)]
+ ["Immediate"
+ (gnus-score-set-default 'gnus-score-default-duration 'i)
+ :style radio
+ :selected (eq gnus-score-default-duration 'i)])
+ ))
(easy-menu-define
gnus-summary-article-menu
""
'("Article"
("Hide"
- ("Date"
- ["Local" gnus-article-date-local t]
- ["UT" gnus-article-date-local t]
- ["Lapsed" gnus-article-date-local t])
+ ["All" gnus-article-hide t]
["Headers" gnus-article-hide-headers t]
["Signature" gnus-article-hide-signature t]
["Citation" gnus-article-hide-citation t]
+ ["PGP" gnus-article-hide-pgp t])
+ ("Highlight"
+ ["All" gnus-article-highlight t]
+ ["Headers" gnus-article-highlight-headers t]
+ ["Signature" gnus-article-highlight-signature t]
+ ["Citation" gnus-article-highlight-citation t])
+ ("Date"
+ ["Local" gnus-article-date-local t]
+ ["UT" gnus-article-date-ut t]
+ ["Original" gnus-article-date-original t]
+ ["Lapsed" gnus-article-date-lapsed t])
+ ("Filter"
["Overstrike" gnus-article-treat-overstrike t]
["Word wrap" gnus-article-word-wrap t]
["CR" gnus-article-remove-cr t]
["Show X-Face" gnus-article-display-x-face t]
- ["Quoted-Printable" gnus-article-de-quoted-unreadable t])
+ ["Quoted-Printable" gnus-article-de-quoted-unreadable t]
+ ["Rot 13" gnus-summary-caesar-message t]
+ ["Add buttons" gnus-article-add-buttons t]
+ ["Add buttons to head" gnus-article-add-buttons-to-head t]
+ ["Stop page breaking" gnus-summary-stop-page-breaking t]
+ ["Toggle MIME" gnus-summary-toggle-mime t]
+ ["Toggle header" gnus-summary-toggle-header t])
+ ("Output"
+ ["Save in default format" gnus-summary-save-article t]
+ ["Save in file" gnus-summary-save-article-file t]
+ ["Save in Unix mail format" gnus-summary-save-article-mail t]
+ ["Save in MH folder" gnus-summary-save-article-folder t]
+ ["Save in VM folder" gnus-summary-save-article-vm t]
+ ["Save in RMAIL mbox" gnus-summary-save-article-rmail t]
+ ["Save body in file" gnus-summary-save-article-body-file t]
+ ["Pipe through a filter" gnus-summary-pipe-output t])
+ ("Backend"
+ ["Respool article" gnus-summary-respool-article t]
+ ["Move article" gnus-summary-move-article t]
+ ["Copy article" gnus-summary-copy-article t]
+ ["Import file" gnus-summary-import-article t]
+ ["Edit article" gnus-summary-edit-article t]
+ ["Delete article" gnus-summary-delete-article t])
("Extract"
["Uudecode" gnus-uu-decode-uu t]
["Uudecode and save" gnus-uu-decode-uu-and-save t]
["Beginning of the article" gnus-summary-beginning-of-article t]
["End of the article" gnus-summary-end-of-article t]
["Fetch parent of article" gnus-summary-refer-parent-article t]
+ ["Fetch referenced articles" gnus-summary-refer-references t]
["Fetch article with id..." gnus-summary-refer-article t]
- ["Stop page breaking" gnus-summary-stop-page-breaking t]
- ["Rot 13" gnus-summary-caesar-message t]
- ["Redisplay" gnus-summary-show-article t]
- ["Toggle header" gnus-summary-toggle-header t]
- ["Toggle MIME" gnus-summary-toggle-mime t]
- ["Save" gnus-summary-save-article t]
- ["Save in mail format" gnus-summary-save-article-mail t]
- ["Pipe through a filter" gnus-summary-pipe-output t]
- ("Mail articles"
- ["Respool article" gnus-summary-respool-article t]
- ["Move article" gnus-summary-move-article t]
- ["Copy article" gnus-summary-copy-article t]
- ["Import file" gnus-summary-import-article t]
- ["Edit article" gnus-summary-edit-article t]
- ["Delete article" gnus-summary-delete-article t])
- ))
+ ["Redisplay" gnus-summary-show-article t]))
+
+
(easy-menu-define
gnus-summary-thread-menu
gnus-summary-mode-map
["Reply & followup" gnus-summary-followup-and-reply t]
["Reply & followup and yank" gnus-summary-followup-and-reply-with-original t]
["Uuencode and post" gnus-uu-post-news t]
+ ("Draft"
+ ["Send" gnus-summary-send-draft t]
+ ["Send bounced" gnus-resend-bounced-mail t])
))
-
+ (run-hooks 'gnus-summary-menu-hook)
)))
(defun gnus-score-set-default (var value)
["Show summary" gnus-article-show-summary t]
["Fetch Message-ID at point" gnus-article-refer-article t]
["Mail to address at point" gnus-article-mail t]
- ["Mail to address at point and include original"
- gnus-article-mail-with-original t]
))
(easy-menu-define
["Remove carriage return" gnus-article-remove-cr t]
["Remove quoted-unreadable" gnus-article-de-quoted-unreadable t]
))
+ (run-hooks 'gnus-article-menu-hook)
)))
;;;
;; If no mouse-face prop on line (e.g. xemacs) we
;; will have to = from = end, so we highlight the
;; entire line instead.
- (if (= to from)
+ (if (= (+ to 2) from)
(progn
(setq from beg)
(setq to end)))
(end (progn (end-of-line) (point)))
;; now find out where the line starts and leave point there.
(beg (progn (beginning-of-line) (point)))
- (score (or (cdr (assq (or (get-text-property beg 'gnus-number)
+ (score (or (cdr (assq (or (gnus-summary-article-number)
gnus-current-article)
gnus-newsgroup-scored))
gnus-summary-default-score 0))
(default gnus-summary-default-score)
- (mark (get-text-property beg 'gnus-mark))
+ (mark (gnus-summary-article-mark))
(inhibit-read-only t))
(while (and list (not (eval (car (car list)))))
(setq list (cdr list)))
(let ((face (and list (cdr (car list)))))
- (or (eobp)
+ (or (null mark)
(eq face (get-text-property beg 'face))
(put-text-property beg end 'face
(if (boundp face) (symbol-value face) face))))
(let* ((pos (posn-point (event-start event)))
(data (get-text-property pos 'gnus-data))
(fun (get-text-property pos 'gnus-callback)))
- (if fun (funcall fun data))))
+ (if fun (funcall fun data))))
(defun gnus-article-press-button ()
"Check text at point for a callback function.
(interactive)
(let* ((data (get-text-property (point) 'gnus-data))
(fun (get-text-property (point) 'gnus-callback)))
- (if fun (funcall fun data))))
+ (if fun (funcall fun data))))
;; Suggested by Arne Elofsson <arne@hodgkin.mbi.ucla.edu>
(defun gnus-article-next-button ()
(interactive)
(if (get-text-property (point) 'gnus-callback)
(goto-char (next-single-property-change (point) 'gnus-callback
- nil (point-max))))
+ nil (point-max))))
(let ((pos (next-single-property-change (point) 'gnus-callback)))
(if pos
(goto-char pos)
(goto-char pos)
(error "No buttons found")))))
-(defun gnus-article-highlight ()
+(defun gnus-article-highlight (&optional force)
"Highlight current article.
This function calls `gnus-article-highlight-headers',
`gnus-article-highlight-citation',
`gnus-article-highlight-signature', and `gnus-article-add-buttons' to
do the highlighting. See the documentation for those functions."
- (interactive)
+ (interactive (list 'force))
(gnus-article-highlight-headers)
- (gnus-article-highlight-citation)
+ (gnus-article-highlight-citation force)
(gnus-article-highlight-signature)
- (gnus-article-add-buttons))
+ (gnus-article-add-buttons force)
+ (gnus-article-add-buttons-to-head))
-(defun gnus-article-highlight-some ()
+(defun gnus-article-highlight-some (&optional force)
"Highlight current article.
This function calls `gnus-article-highlight-headers',
`gnus-article-highlight-signature', and `gnus-article-add-buttons' to
do the highlighting. See the documentation for those functions."
- (interactive)
+ (interactive (list 'force))
(gnus-article-highlight-headers)
(gnus-article-highlight-signature)
(gnus-article-add-buttons))
-(defun gnus-article-hide ()
+(defun gnus-article-hide (&optional force)
"Hide current article.
This function calls `gnus-article-hide-headers',
`gnus-article-hide-citation-maybe', and `gnus-article-hide-signature'
to do the hiding. See the documentation for those functions."
- (interactive)
+ (interactive (list 'force))
(gnus-article-hide-headers)
- (gnus-article-hide-citation-maybe)
+ (gnus-article-hide-citation-maybe force)
(gnus-article-hide-signature))
(defun gnus-article-highlight-headers ()
(add-text-properties (match-end 0) (point-max)
gnus-hidden-properties)))))
-(defun gnus-article-add-buttons ()
- "Find external references in article and make them to buttons.
-
-External references are things like message-ids and URLs, as specified by
-`gnus-button-alist'."
- (interactive)
+(defun gnus-article-add-buttons (&optional force)
+ "Find external references in the article and make buttons of them.
+\"External references\" are things like Message-IDs and URLs, as
+specified by `gnus-button-alist'."
+ (interactive (list 'force))
(if (eq gnus-button-last gnus-button-alist)
()
(setq gnus-button-regexp (mapconcat 'car gnus-button-alist "\\|")
gnus-button-last gnus-button-alist))
(save-excursion
(set-buffer gnus-article-buffer)
- (gnus-cite-parse-maybe)
+ (gnus-cite-parse-maybe force)
(let ((buffer-read-only nil)
(inhibit-point-motion-hooks t)
(case-fold-search t))
()
(goto-char (match-end 0))
(if (eval form)
- (gnus-article-add-button start end 'gnus-button-push
- (set-marker (make-marker)
- from)))))))))
+ (gnus-article-add-button
+ start end 'gnus-button-push
+ (set-marker (make-marker) from)))))))))
+
+;; Add buttons to the head of an article.
+(defun gnus-article-add-buttons-to-head ()
+ "Add buttons to the head of the article."
+ (interactive)
+ (save-excursion
+ (set-buffer gnus-article-buffer)
+ (let ((buffer-read-only nil)
+ (inhibit-point-motion-hooks t)
+ (case-fold-search t)
+ (alist gnus-header-button-alist)
+ entry beg end)
+ (gnus-narrow-to-headers)
+ (while alist
+ ;; Each alist entry.
+ (setq entry (car alist)
+ alist (cdr alist))
+ (goto-char (point-min))
+ (while (re-search-forward (car entry) nil t)
+ ;; Each header matching the entry.
+ (setq beg (match-beginning 0))
+ (setq end (or (and (re-search-forward "^[^ \t]" nil t)
+ (match-beginning 0))
+ (point-max)))
+ (goto-char beg)
+ (while (re-search-forward (nth 1 entry) end t)
+ ;; Each match within a header.
+ (let* ((from (match-beginning 0))
+ (entry (cdr entry))
+ (start (match-beginning (nth 1 entry)))
+ (end (match-end (nth 1 entry)))
+ (form (nth 2 entry)))
+ (goto-char (match-end 0))
+ (and (eval form)
+ (gnus-article-add-button
+ start end (nth 3 entry)
+ (buffer-substring (match-beginning (nth 4 entry))
+ (match-end (nth 4 entry)))))))
+ (goto-char end))))
+ (widen)))
+
(defun gnus-netscape-open-url (url)
"Open URL in netscape, or start new scape with URL."
- (let ((process (start-process (concat "netscape " url)
- nil
- "netscape"
- "-remote"
- (concat "openUrl(" url ")'"))))
+ (let ((process
+ (start-process
+ (concat "netscape " url) nil
+ "netscape" "-remote" (concat "openUrl(" url ")'"))))
(set-process-sentinel process
(` (lambda (process change)
(or (eq (process-exit-status process) 0)
(and gnus-article-button-face
(gnus-overlay-put (gnus-make-overlay from to)
'face gnus-article-button-face))
- (add-text-properties from to
- (append (and gnus-article-mouse-face
- (list 'mouse-face gnus-article-mouse-face))
- (list 'gnus-callback fun)
- (and data (list 'gnus-data data)))))
+ (add-text-properties
+ from to
+ (nconc (and gnus-article-mouse-face
+ (list 'mouse-face gnus-article-mouse-face))
+ (list 'gnus-callback fun)
+ (and data (list 'gnus-data data)))))
;;; Internal functions:
(remove-text-properties end (point-max) gnus-hidden-properties)
(add-text-properties end (point-max) gnus-hidden-properties)))))
-(defun gnus-make-face (color)
- ;; Create entry for face with COLOR.
- (if gnus-make-foreground
- (custom-face-lookup color nil nil nil nil nil)
- (custom-face-lookup nil color nil nil nil nil)))
+;see gnus-cus.el
+;(defun gnus-make-face (color)
+; ;; Create entry for face with COLOR.
+; (if gnus-make-foreground
+; (custom-face-lookup color nil nil nil nil nil)
+; (custom-face-lookup nil color nil nil nil nil)))
(defun gnus-button-entry ()
;; Return the first entry in `gnus-button-alist' matching this place.
(let ((string (buffer-substring
(match-beginning group)
(match-end group))))
- (set-text-properties 0 (length string) nil string)
- string))
+ (set-text-properties 0 (length string) nil string)
+ string))
(nthcdr 4 entry))))
(cond ((fboundp fun)
(apply fun args))
(cons fun args)))))))
(defun gnus-button-message-id (message-id)
- ;; Push on MESSAGE-ID.
+ ;; Fetch MESSAGE-ID.
(save-excursion
(set-buffer gnus-summary-buffer)
(gnus-summary-refer-article message-id)))
+(defun gnus-button-mailto (address)
+ ;; Mail to ADDRESS.
+ (gnus-new-mail address))
+
+(defun gnus-button-reply (address)
+ ;; Reply to ADDRESS.
+ (gnus-mail-reply t address))
+
;;; Compatibility Functions:
(or (fboundp 'rassoc)