(require 'easymenu)
(require 'custom)
(require 'browse-url)
+(require 'gnus-score)
(eval-when-compile (require 'cl))
(defvar gnus-group-menu-hook nil
;(defvar gnus-signature-face 'italic
; "Face used for signature.")
-(defvar gnus-button-url-regexp "\\b\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*[-a-zA-Z0-9_=#$@~`%&*+|\\/]"
+(defvar gnus-button-url-regexp "\\b\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?[-\\wa-zA-Z0-9_=!?#$@~`%&*+|\\/.,]*[-\\wa-zA-Z0-9_=#$@~`%&*+|\\/]"
"*Regular expression that matches URLs.")
(defvar gnus-button-alist
`(("\\bin\\( +article\\)? +\\(<\\([^\n @<>]+@[^\n @<>]+\\)>\\)" 2
t gnus-button-message-id 3)
+ ("\\(<?\\(url: ?\\)?news:\\([^>\n\t ]*\\)>?\\)" 1 t
+ gnus-button-message-id 3)
+ ("\\(<URL: *\\)?mailto: *\\([^> \n\t]+\\)>?" 0 t gnus-button-reply 2)
;; This is how URLs _should_ be embedded in text...
("<URL: *\\([^\n\r>]*\\)>" 0 t gnus-button-url 1)
;; Next regexp stolen from highlight-headers.el.
;; Modified by Vladimir Alexiev.
- (,gnus-button-url-regexp 0 t gnus-button-url 0)
- ("\\(<\\(url: \\)?news:\\([^>\n ]*\\)>\\)" 1 t
- gnus-button-message-id 3)
- ("\\(<URL: *\\)?mailto: *\\([^ \n\t]+\\)>?" 0 t gnus-button-reply 2))
+ (,gnus-button-url-regexp 0 t gnus-button-url 0))
"Alist of regexps matching buttons in article bodies.
Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where
(defvar gnus-header-button-alist
`(("^\\(References\\|Message-I[Dd]\\):" "<[^>]+>"
0 t gnus-button-message-id 0)
- ("^\\(From\\|Reply-To\\): " ": *\\(.+\\)$" 1 t gnus-button-reply 0)
+ ("^\\(From\\|Reply-To\\):" ": *\\(.+\\)$" 1 t gnus-button-reply 1)
("^\\(Cc\\|To\\):" "[^ \t\n<>,()\"]+@[^ \t\n<>,()\"]+"
0 t gnus-button-mailto 0)
- ("^X-[Uu][Rr][Ll]:" ,gnus-button-url-regexp 0 t gnus-button-url 0))
+ ("^X-[Uu][Rr][Ll]:" ,gnus-button-url-regexp 0 t gnus-button-url 0)
+ ("^[^:]+:" ,gnus-button-url-regexp 0 t gnus-button-url 0)
+ ("^[^:]+:" "\\(<\\(url: \\)?news:\\([^>\n ]*\\)>\\)" 1 t
+ gnus-button-message-id 3))
"Alist of headers and regexps to match buttons in article heads.
This alist is very similar to `gnus-button-alist', except that each
;;; Group mode highlighting.
-(defvar gnus-group-highlight
- (cond
- ((not (eq gnus-display-type 'color))
- '((mailp . bold)
- ((= unread 0) . italic)))
- ((eq gnus-background-mode 'dark)
- `(((> unread 200) . ,(custom-face-lookup "Red" nil nil t nil nil))
- ((and (< level 3) (zerop unread)) .
- ,(custom-face-lookup "SeaGreen" nil nil t nil nil))
- ((< level 3) . ,(custom-face-lookup "SpringGreen" nil nil t nil nil))
- ((zerop unread) . ,(custom-face-lookup "SteelBlue" nil nil t nil nil))
- (t . ,(custom-face-lookup "SkyBlue" nil nil t nil nil))
- ))
- (t
- `(((not mailp) .
- ,(custom-face-lookup "ForestGreen" nil nil t nil nil))
- ((zerop unread) .
- ,(custom-face-lookup "Blue" nil nil t nil nil)))))
- "Group 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.
-Variables bound when these forms are evaluated include:
-
-group: The group name.
-unread: The number of unread articles.
-method: The select method.
-mailp: Whether the select method is a mail method.
-level: The level of the group.
-score: The score of the group.
-ticked: The number of ticked articles in the group.
-")
+;see gnus-cus.el
+;(defvar gnus-group-highlight nil
+; "Group 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.
+;Variables bound when these forms are evaluated include:
+;
+;group: The group name.
+;unread: The number of unread articles.
+;method: The select method.
+;mailp: Whether the select method is a mail method.
+;level: The level of the group.
+;score: The score of the group.
+;ticked: The number of ticked articles in the group.
+;")
;;; Internal variables.
(easy-menu-define
gnus-group-reading-menu gnus-group-mode-map ""
'("Group"
- ["Read" gnus-group-read-group t]
- ["Select" gnus-group-select-group t]
- ["See old articles" (gnus-group-select-group 'all) :keys "C-u SPC"]
- ["Catch up" gnus-group-catchup-current t]
- ["Catch up all articles" gnus-group-catchup-current-all t]
- ["Check for new articles" gnus-group-get-new-news-this-group t]
- ["Toggle subscription" gnus-group-unsubscribe-current-group t]
- ["Kill" gnus-group-kill-group t]
- ["Yank" gnus-group-yank-group t]
- ["Describe" gnus-group-describe-group t]
- ["Fetch FAQ" gnus-group-fetch-faq t]
- ["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]
+ ["Read" gnus-group-read-group (gnus-group-group-name)]
+ ["Select" gnus-group-select-group (gnus-group-group-name)]
+ ["See old articles" (gnus-group-select-group 'all)
+ :keys "C-u SPC" :active (gnus-group-group-name)]
+ ["Catch up" gnus-group-catchup-current (gnus-group-group-name)]
+ ["Catch up all articles" gnus-group-catchup-current-all
+ (gnus-group-group-name)]
+ ["Check for new articles" gnus-group-get-new-news-this-group
+ (gnus-group-group-name)]
+ ["Toggle subscription" gnus-group-unsubscribe-current-group
+ (gnus-group-group-name)]
+ ["Kill" gnus-group-kill-group (gnus-group-group-name)]
+ ["Yank" gnus-group-yank-group gnus-list-of-killed-groups]
+ ["Describe" gnus-group-describe-group (gnus-group-group-name)]
+ ["Fetch FAQ" gnus-group-fetch-faq (gnus-group-group-name)]
+ ["Edit kill file" gnus-group-edit-local-kill
+ (gnus-group-group-name)]
+ ;; Actually one should check, if any of the marked groups gives t for
+ ;; (gnus-check-backend-function 'request-expire-articles ...)
+ ["Expire articles" gnus-group-expire-articles
+ (or (and (gnus-group-group-name)
+ (gnus-check-backend-function
+ 'request-expire-articles
+ (gnus-group-group-name))) gnus-group-marked)]
+ ["Set group level" gnus-group-set-current-level
+ (gnus-group-group-name)]
+ ["Select quick" gnus-group-quick-select-group (gnus-group-group-name)]
))
(easy-menu-define
gnus-group-group-menu gnus-group-mode-map ""
'("Groups"
("Listing"
- ["List subscribed groups" gnus-group-list-groups t]
- ["List all groups" gnus-group-list-all-groups t]
- ["List groups matching..." gnus-group-list-matching t]
- ["List killed groups" gnus-group-list-killed t]
- ["List zombie groups" gnus-group-list-zombies t]
- ["List level" gnus-group-list-level t]
+ ["List unread subscribed groups" gnus-group-list-groups t]
+ ["List (un)subscribed groups" gnus-group-list-all-groups t]
+ ["List killed groups" gnus-group-list-killed gnus-killed-list]
+ ["List zombie groups" gnus-group-list-zombies gnus-zombie-list]
+ ["List level..." gnus-group-list-level t]
["Describe all groups" gnus-group-describe-all-groups t]
- ["Group apropos" gnus-group-apropos t]
- ["Group and description apropos" gnus-group-description-apropos 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 all groups matching..." gnus-group-list-all-matching t]
["List active file" gnus-group-list-active t])
("Sort"
- ["Default sort" gnus-group-sort-groups t]
- ["Sort by method" gnus-group-sort-groups-by-method t]
- ["Sort by rank" gnus-group-sort-groups-by-rank t]
- ["Sort by score" gnus-group-sort-groups-by-score t]
- ["Sort by level" gnus-group-sort-groups-by-level t]
- ["Sort by unread" gnus-group-sort-groups-by-unread t]
- ["Sort by name" gnus-group-sort-groups-by-alphabet t])
+ ["Default sort" gnus-group-sort-groups
+ (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]
+ ["Sort by method" gnus-group-sort-groups-by-method
+ (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]
+ ["Sort by rank" gnus-group-sort-groups-by-rank
+ (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]
+ ["Sort by score" gnus-group-sort-groups-by-score
+ (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]
+ ["Sort by level" gnus-group-sort-groups-by-level
+ (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]
+ ["Sort by unread" gnus-group-sort-groups-by-unread
+ (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))]
+ ["Sort by name" gnus-group-sort-groups-by-alphabet
+ (or (not (boundp 'gnus-topic-mode)) (not gnus-topic-mode))])
("Mark"
- ["Mark group" gnus-group-mark-group t]
- ["Unmark group" gnus-group-unmark-group t]
- ["Unmark all" gnus-group-unmark-all-groups t]
- ["Mark regexp" gnus-group-mark-regexp t]
+ ["Mark group" gnus-group-mark-group
+ (and (gnus-group-group-name)
+ (not (memq (gnus-group-group-name) gnus-group-marked)))]
+ ["Unmark group" gnus-group-unmark-group
+ (and (gnus-group-group-name)
+ (memq (gnus-group-group-name) gnus-group-marked))]
+ ["Unmark all" gnus-group-unmark-all-groups gnus-group-marked]
+ ["Mark regexp..." gnus-group-mark-regexp t]
["Mark region" gnus-group-mark-region t]
["Mark buffer" gnus-group-mark-buffer t]
- ["Execute command" gnus-group-universal-argument t])
+ ["Execute command" gnus-group-universal-argument
+ (or gnus-group-marked (gnus-group-group-name))])
("Subscribe"
- ["Subscribe to random group" gnus-group-unsubscribe-group t]
+ ["Subscribe to a group" gnus-group-unsubscribe-group t]
["Kill all newsgroups in region" gnus-group-kill-region t]
- ["Kill all zombie groups" gnus-group-kill-all-zombies t]
+ ["Kill all zombie groups" gnus-group-kill-all-zombies
+ gnus-zombie-list]
["Kill all groups on level..." gnus-group-kill-level t])
("Foreign groups"
["Make a foreign group" gnus-group-make-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]
- ["Rename group" gnus-group-rename-group t]
- ["Delete group" gnus-group-delete-group t])
+ ["Rename group" gnus-group-rename-group
+ (gnus-check-backend-function
+ 'request-rename-group (gnus-group-group-name))]
+ ["Delete group" gnus-group-delete-group
+ (gnus-check-backend-function
+ 'request-delete-group (gnus-group-group-name))])
("Editing groups"
- ["Parameters" gnus-group-edit-group-parameters t]
- ["Select method" gnus-group-edit-group-method t]
- ["Info" gnus-group-edit-group t])
+ ["Parameters" gnus-group-edit-group-parameters
+ (gnus-group-group-name)]
+ ["Select method" gnus-group-edit-group-method
+ (gnus-group-group-name)]
+ ["Info" gnus-group-edit-group (gnus-group-group-name)])
("Score file"
- ["Flush cache" gnus-score-flush-cache t])
+ ["Flush cache" gnus-score-flush-cache
+ (or gnus-score-cache gnus-short-name-score-file-cache)])
("Move"
["Next" gnus-group-next-group t]
["Previous" gnus-group-prev-group t]
["Jump to group" gnus-group-jump-to-group t]
["First unread group" gnus-group-first-unread-group t]
["Best unread group" gnus-group-best-unread-group t])
- ["Transpose" gnus-group-transpose-groups t]
- ["Read a directory as a group" gnus-group-enter-directory t]
+ ["Transpose" gnus-group-transpose-groups
+ (gnus-group-group-name)]
+ ["Read a directory as a group..." gnus-group-enter-directory t]
))
(easy-menu-define
'("Misc"
["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
- (not (string-match "XEmacs" emacs-version)) ]
+ ["Post an article..." gnus-group-post-news t]
+ ["Customize score file" gnus-score-customize t]
["Check for new news" gnus-group-get-new-news t]
["Activate all groups" gnus-activate-all-groups t]
["Delete bogus groups" gnus-group-check-bogus-groups t]
["Read init file" gnus-group-read-init-file t]
["Browse foreign server" gnus-group-browse-foreign-server t]
["Enter server buffer" gnus-group-enter-server-mode t]
- ["Expire expirable articles" gnus-group-expire-all-groups t]
+ ["Expire all expirable articles" gnus-group-expire-all-groups t]
["Generate any kiboze groups" nnkiboze-generate-groups t]
["Gnus version" gnus-version t]
["Save .newsrc files" gnus-group-save-newsrc t]
("Mark"
("Read"
["Mark as read" gnus-summary-mark-as-read-forward t]
- ["Mark same subject and select" gnus-summary-kill-same-subject-and-select t]
+ ["Mark same subject and select"
+ gnus-summary-kill-same-subject-and-select t]
["Mark same subject" gnus-summary-kill-same-subject t]
["Catchup" gnus-summary-catchup t]
["Catchup all" gnus-summary-catchup-all t]
["Catchup to here" gnus-summary-catchup-to-here t]
["Catchup region" gnus-summary-mark-region-as-read t]
- ["Mark excluded" gnus-summary-limit-mark-exlcuded-as-read t])
+ ["Mark excluded" gnus-summary-limit-mark-excluded-as-read t])
("Various"
["Tick" gnus-summary-tick-article-forward t]
["Mark as dormant" gnus-summary-mark-as-dormant t]
["Set bookmark" gnus-summary-set-bookmark t]
["Remove bookmark" gnus-summary-remove-bookmark t])
("Limit"
- ["Unread" gnus-summary-limit-to-unread t]
- ["Marks" gnus-summary-limit-to-marks t]
+ ["Marks..." gnus-summary-limit-to-marks t]
+ ["Subject..." gnus-summary-limit-to-subject t]
+ ["Author..." gnus-summary-limit-to-author t]
["Score" gnus-summary-limit-to-score t]
- ["Subject" gnus-summary-limit-to-subject t]
- ["Author" gnus-summary-limit-to-author t]
+ ["Unread" gnus-summary-limit-to-unread 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]
["Hide childless dormant"
gnus-summary-limit-exclude-childless-dormant t]
- ["Hide thread" gnus-summary-limit-exclude-thread t]
+ ;;["Hide thread" gnus-summary-limit-exclude-thread t]
["Show expunged" gnus-summary-show-all-expunged t])
("Process mark"
["Set mark" gnus-summary-mark-as-processable t]
["Mark above" gnus-uu-mark-over t]
["Mark series" gnus-uu-mark-series t]
["Mark region" gnus-uu-mark-region t]
- ["Mark by regexp" gnus-uu-mark-by-regexp 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]
("Modes"
["Pick and read" gnus-pick-mode t]
["Binary" gnus-binary-mode t])
- ["Filter articles" gnus-summary-execute-command t]
- ["Run command on subjects" gnus-summary-universal-argument t]
+ ["Filter articles..." gnus-summary-execute-command t]
+ ["Run command on subjects..." gnus-summary-universal-argument t]
["Toggle line truncation" gnus-summary-toggle-truncation t]
["Expand window" gnus-summary-expand-window t]
- ["Expire expirable articles" gnus-summary-expire-articles t]
+ ["Expire expirable articles" gnus-summary-expire-articles
+ (gnus-check-backend-function
+ 'request-expire-articles gnus-newsgroup-name)]
["Edit local kill file" gnus-summary-edit-local-kill t]
["Edit main kill file" gnus-summary-edit-global-kill t]
))
"Score"
(nconc
(list
- ["Enter score" gnus-summary-score-entry t])
+ ["Enter score..." gnus-summary-score-entry t])
(gnus-visual-score-map 'increase)
(gnus-visual-score-map 'lower)
'(("Mark"
["Current score" gnus-summary-current-score t]
["Set score" gnus-summary-set-score t]
["Customize score file" gnus-score-customize t]
- ["Switch current score file" gnus-score-change-score-file t]
- ["Set mark below" gnus-score-set-mark-below t]
- ["Set expunge below" gnus-score-set-expunge-below t]
- ["Edit current score file" gnus-score-edit-alist t]
+ ["Switch current score file..." gnus-score-change-score-file t]
+ ["Set mark below..." gnus-score-set-mark-below t]
+ ["Set expunge below..." gnus-score-set-expunge-below t]
+ ["Edit current score file" gnus-score-edit-current-scores t]
["Edit score file" gnus-score-edit-file t]
["Trace score" gnus-score-find-trace t]
["Rescore buffer" gnus-summary-rescore t]
- ["Increase score" gnus-summary-increase-score t]
- ["Lower score" gnus-summary-lower-score 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)
["Pipe through a filter" gnus-summary-pipe-output t]
["Add to SOUP packet" gnus-soup-add-article t])
("Backend"
- ["Respool article" gnus-summary-respool-article t]
- ["Move article" gnus-summary-move-article t]
- ["Copy article" gnus-summary-copy-article t]
- ["Crosspost article" gnus-summary-crosspost-article t]
- ["Import file" gnus-summary-import-article t]
- ["Edit article" gnus-summary-edit-article t]
- ["Delete article" gnus-summary-delete-article t]
+ ["Respool article..." gnus-summary-respool-article t]
+ ["Move article..." gnus-summary-move-article
+ (gnus-check-backend-function
+ 'request-move-article gnus-newsgroup-name)]
+ ["Copy article..." gnus-summary-copy-article t]
+ ["Crosspost article..." gnus-summary-crosspost-article
+ (gnus-check-backend-function
+ 'request-replace-article gnus-newsgroup-name)]
+ ["Import file..." gnus-summary-import-article t]
+ ["Edit article" gnus-summary-edit-article
+ (not (gnus-group-read-only-p))]
+ ["Delete article" gnus-summary-delete-article
+ (gnus-check-backend-function
+ 'request-expire-articles gnus-newsgroup-name)]
["Query respool" gnus-summary-respool-query t]
- ["Delete expirable articles" gnus-summary-expire-articles-now t])
+ ["Delete expirable articles" gnus-summary-expire-articles-now
+ (gnus-check-backend-function
+ 'request-expire-articles gnus-newsgroup-name)])
("Extract"
["Uudecode" gnus-uu-decode-uu t]
["Uudecode and save" gnus-uu-decode-uu-and-save t]
["Binhex" gnus-uu-decode-binhex t]
["Postscript" gnus-uu-decode-postscript t])
["Enter digest buffer" gnus-summary-enter-digest-group t]
- ["Isearch article" gnus-summary-isearch-article t]
- ["Search articles forward" gnus-summary-search-article-forward t]
- ["Search articles backward" gnus-summary-search-article-backward t]
+ ["Isearch article..." gnus-summary-isearch-article t]
+ ["Search articles forward..." gnus-summary-search-article-forward t]
+ ["Search articles backward..." gnus-summary-search-article-backward 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 article with id..." gnus-summary-refer-article t]
["Redisplay" gnus-summary-show-article t]))
-
-
(easy-menu-define
gnus-summary-thread-menu gnus-summary-mode-map ""
'("Threads"
["Resend message" gnus-summary-resend-message t]
["Send bounced mail" gnus-summary-resend-bounced-mail t]
["Send a mail" gnus-summary-mail-other-window t]
- ["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])
+ ;;("Draft"
+ ;;["Send" gnus-summary-send-draft t]
+ ;;["Send bounced" gnus-resend-bounced-mail t])
))
(run-hooks 'gnus-summary-menu-hook)
))
(score (or (cdr (assq (or article gnus-current-article)
gnus-newsgroup-scored))
gnus-summary-default-score 0))
- (default gnus-summary-default-score)
(mark (or (gnus-summary-article-mark) gnus-unread-mark))
(inhibit-read-only t))
;; Eval the cars of the lists until we find a match.
- (while (and list
- (not (eval (caar list))))
- (setq list (cdr list)))
+ (let ((default gnus-summary-default-score))
+ (while (and list
+ (not (eval (caar list))))
+ (setq list (cdr list))))
(let ((face (cdar list)))
(unless (eq face (get-text-property beg 'face))
- (put-text-property
+ (gnus-put-text-property
beg end 'face
(setq face (if (boundp face) (symbol-value face) face)))
(when gnus-summary-highlight-line-function
(setq list (cdr list)))
(let ((face (cdar list)))
(unless (eq face (get-text-property beg 'face))
- (put-text-property
+ (gnus-put-text-property
beg end 'face
(setq face (if (boundp face) (symbol-value face) face)))
(gnus-extent-start-open beg)))
(when (and header-face
(not (memq (point) hpoints)))
(push (point) hpoints)
- (put-text-property from (point) 'face header-face))
+ (gnus-put-text-property from (point) 'face header-face))
(when (and field-face
(not (memq (setq from (point)) fpoints)))
(push from fpoints)
(if (re-search-forward "^[^ \t]" nil t)
(forward-char -2)
(goto-char (point-max)))
- (put-text-property from (point) 'face field-face)))))))))
+ (gnus-put-text-property from (point) 'face field-face)))))))))
(defun gnus-article-highlight-signature ()
"Highlight the signature in an article.
(widen)
(re-search-backward gnus-signature-separator nil t)
(let ((start (match-beginning 0))
- (end (set-marker (make-marker) (match-end 0))))
- (gnus-article-add-button start end 'gnus-signature-toggle
+ (end (set-marker (make-marker) (1+ (match-end 0)))))
+ (gnus-article-add-button start (1- end) 'gnus-signature-toggle
end)))))))
(defun gnus-article-add-buttons (&optional force)
(and gnus-article-button-face
(gnus-overlay-put (gnus-make-overlay from to)
'face gnus-article-button-face))
- (add-text-properties
+ (gnus-add-text-properties
from to
(nconc (and gnus-article-mouse-face
(list gnus-mouse-face-prop gnus-article-mouse-face))
(let ((buffer-read-only nil)
(inhibit-point-motion-hooks t))
(if (get-text-property end 'invisible)
- (remove-text-properties end (point-max) gnus-hidden-properties)
- (add-text-properties end (point-max) gnus-hidden-properties)))))
+ (gnus-unhide-text end (point-max))
+ (gnus-hide-text end (point-max) gnus-hidden-properties)))))
(defun gnus-button-entry ()
;; Return the first entry in `gnus-button-alist' matching this place.
0 (length string) nil string)
string))
(nthcdr 4 entry))))
- (cond ((fboundp fun)
- (apply fun args))
- ((and (boundp fun)
- (fboundp (symbol-value fun)))
- (apply (symbol-value fun) args))
- (t
- (message "You must define `%S' to use this button"
+ (cond
+ ((fboundp fun)
+ (apply fun args))
+ ((and (boundp fun)
+ (fboundp (symbol-value fun)))
+ (apply (symbol-value fun) args))
+ (t
+ (gnus-message 1 "You must define `%S' to use this button"
(cons fun args)))))))
(defun gnus-button-message-id (message-id)
(defun gnus-button-mailto (address)
;; Mail to ADDRESS.
- (gnus-new-mail address))
+ (set-buffer (gnus-copy-article-buffer))
+ (message-reply address))
(defun gnus-button-reply (address)
;; Reply to ADDRESS.
- (gnus-mail-reply t address))
+ (message-reply address))
(defun gnus-button-url (address)
"Browse ADDRESS."
(defvar gnus-prev-page-map nil)
(unless gnus-prev-page-map
(setq gnus-prev-page-map (make-sparse-keymap))
- (define-key gnus-prev-page-map gnus-mouse-2 'gnus-article-prev-page)
- (define-key gnus-prev-page-map "\r" 'gnus-article-prev-page))
+ (define-key gnus-prev-page-map gnus-mouse-2 'gnus-button-prev-page)
+ (define-key gnus-prev-page-map "\r" 'gnus-button-prev-page))
(defun gnus-insert-prev-page-button ()
(let ((buffer-read-only nil))
(unless gnus-next-page-map
(setq gnus-next-page-map (make-keymap))
(suppress-keymap gnus-prev-page-map)
- (define-key gnus-next-page-map gnus-mouse-2 'gnus-article-next-page)
- (define-key gnus-next-page-map "\r" 'gnus-article-next-page))
+ (define-key gnus-next-page-map gnus-mouse-2 'gnus-button-next-page)
+ (define-key gnus-next-page-map "\r" 'gnus-button-next-page))
+
+(defun gnus-button-next-page ()
+ "Go to the next page."
+ (interactive)
+ (let ((win (selected-window)))
+ (select-window (get-buffer-window gnus-article-buffer t))
+ (gnus-article-next-page)
+ (select-window win)))
+
+(defun gnus-button-prev-page ()
+ "Go to the prev page."
+ (interactive)
+ (let ((win (selected-window)))
+ (select-window (get-buffer-window gnus-article-buffer t))
+ (gnus-article-prev-page)
+ (select-window win)))
(defun gnus-insert-next-page-button ()
(let ((buffer-read-only nil))