From: yamaoka Date: Wed, 25 Jan 2006 22:01:33 +0000 (+0000) Subject: Synch to No Gnus 200601251745. X-Git-Tag: t-gnus-6_17_4-quimby-~131 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fea68af39b1d9b5505c1bbdfa14e649cdc3ab84;p=elisp%2Fgnus.git- Synch to No Gnus 200601251745. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dd42690..373c050 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,22 @@ +2006-01-25 Reiner Steib + + * message.el: Change some comments WRT tool-bars. + + * gnus-sum.el (gnus-summary-tool-bar) + (gnus-summary-tool-bar-gnome, gnus-summary-tool-bar-retro) + (gnus-summary-tool-bar-zap-list): New variables. + (gnus-summary-make-tool-bar): Complete rewrite using + `gmm-tool-bar-from-list'. + + * gnus-group.el (gnus-group-tool-bar, gnus-group-tool-bar-gnome) + (gnus-group-tool-bar-retro, gnus-group-tool-bar-zap-list): New + variables. + (gnus-group-make-tool-bar): Complete rewrite using + `gmm-tool-bar-from-list'. + (gnus-group-tool-bar-update): New function. + + * message.el (message-mode-field-menu): Add "Show hidden Headers". + 2006-01-25 Katsumi Yamaoka * mm-uu.el (mm-uu-dissect-text-parts): Ignore it if a given part diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 3309123..8bc5e7b 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -39,6 +39,7 @@ (require 'gnus-range) (require 'gnus-win) (require 'gnus-undo) +(require 'gmm-utils) (require 'time-date) (require 'gnus-ems) @@ -1005,36 +1006,128 @@ simple manner.") (gnus-run-hooks 'gnus-group-menu-hook))) -(defvar gnus-group-toolbar-map nil) - -;; Emacs 21 tool bar. Should be no-op otherwise. -(defun gnus-group-make-tool-bar () - (if (and - (condition-case nil (require 'tool-bar) (error nil)) - (fboundp 'tool-bar-add-item-from-menu) - (default-value 'tool-bar-mode) - (not gnus-group-toolbar-map)) - (setq gnus-group-toolbar-map - (let ((tool-bar-map (make-sparse-keymap)) - (load-path (mm-image-load-path))) - (tool-bar-add-item-from-menu - 'gnus-group-get-new-news "get-news" gnus-group-mode-map) - (tool-bar-add-item-from-menu - 'gnus-group-get-new-news-this-group "gnntg" gnus-group-mode-map) - (tool-bar-add-item-from-menu - 'gnus-group-catchup-current "catchup" gnus-group-mode-map) - (tool-bar-add-item-from-menu - 'gnus-group-describe-group "describe-group" gnus-group-mode-map) - (tool-bar-add-item "subscribe" 'gnus-group-subscribe 'subscribe - :help "Subscribe to the current group") - (tool-bar-add-item "unsubscribe" 'gnus-group-unsubscribe - 'unsubscribe - :help "Unsubscribe from the current group") - (tool-bar-add-item-from-menu - 'gnus-group-exit "exit-gnus" gnus-group-mode-map) - tool-bar-map))) - (if gnus-group-toolbar-map - (set (make-local-variable 'tool-bar-map) gnus-group-toolbar-map))) + +(defvar gnus-group-tool-bar-map nil) + +(defun gnus-group-tool-bar-update (&optional symbol value) + "Update group buffer toolbar. +Setter function for custom variables." + (when symbol + (set-default symbol value)) + ;; (setq-default gnus-group-tool-bar-map nil) + ;; (use-local-map gnus-group-mode-map) + (when (gnus-alive-p) + (with-current-buffer gnus-group-buffer + (gnus-group-make-tool-bar t)))) + +;; The default will be changed when the new icons have been checked in: +(defcustom gnus-group-tool-bar 'gnus-group-tool-bar-retro + "Specifies the Gnus group tool bar. + +It can be either a list or a symbol refering to a list. See +`gmm-tool-bar-from-list' for the format of the list. The +default key map is `gnus-group-mode-map'. + +Pre-defined symbols include `gnus-group-tool-bar-gnome' and +`gnus-group-tool-bar-retro'." + :type '(choice (const :tag "GNOME style" gnus-group-tool-bar-gnome) + (const :tag "Retro look" gnus-group-tool-bar-retro) + (repeat :tag "User defined list" gmm-tool-bar-item) + (symbol)) + :version "23.0" ;; No Gnus + :initialize 'custom-initialize-default + :set 'gnus-group-tool-bar-update + :group 'gnus-group) + +(defcustom gnus-group-tool-bar-gnome + '((gnus-group-post-news "compose") + (gnus-group-get-new-news "inbox") ;; Add... nil :visible gnus-plugged ? + ;; FIXME: gnus-*-read-group should have a better help text. + (gnus-topic-read-group "open" nil :visible gnus-topic-mode) + (gnus-group-read-group "open" nil :visible (not gnus-topic-mode)) + ;; (gnus-group-find-new-groups "???" nil) + (gnus-group-save-newsrc "save") + (gnus-group-describe-group "describe") + (gnus-group-unsubscribe-current-group "toggle-subscription") + ;; (gnus-group-subscribe "subscribe" t + ;; :help "Subscribe to the current group") + ;; (gnus-group-unsubscribe "unsubscribe" t + ;; :help "Unsubscribe from the current group") + ;; + ;; Some useful agent icons? I don't use the agent so agent users should + ;; suggest useful commands: + (gnus-group-send-queue "outbox" t + :visible (and gnus-agent gnus-plugged) + :help "Send articles from the queue group") + (gnus-agent-toggle-plugged "connect" nil + :visible (and gnus-agent (not gnus-plugged))) + (gnus-agent-toggle-plugged "disconnect" nil + :visible (and gnus-agent gnus-plugged)) + ;; + (gnus-group-exit "exit-mode") + (gnus-info-find-node "help")) + "List of functions for the group tool bar (GNOME style). + +See `gmm-tool-bar-from-list' for the format of the list." + :type '(repeat gmm-tool-bar-item) + :version "23.0" ;; No Gnus + :initialize 'custom-initialize-default + :set 'gnus-group-tool-bar-update + :group 'gnus-group) + +(defcustom gnus-group-tool-bar-retro + '((gnus-group-get-new-news "get-news") + (gnus-group-get-new-news-this-group "gnntg") + (gnus-group-catchup-current "catchup") + (gnus-group-describe-group "describe-group") + (gnus-group-subscribe "subscribe" t + :help "Subscribe to the current group") + (gnus-group-unsubscribe "unsubscribe" t + :help "Unsubscribe from the current group") + (gnus-group-exit "exit-gnus" gnus-group-mode-map)) + "List of functions for the group tool bar (retro look). + +See `gmm-tool-bar-from-list' for the format of the list." + :type '(repeat gmm-tool-bar-item) + :version "23.0" ;; No Gnus + :initialize 'custom-initialize-default + :set 'gnus-group-tool-bar-update + :group 'gnus-group) + +;; FIXME: Moving through the Group buffer (in topic mode) e.g. with C-n +;; doesn't update the state (enabled/disabled) of the icon +;; `gnus-group-describe-group'. After `C-l' the state is correct. +;; See the following report on emacs-devel +;; : +;; From: Reiner Steib +;; Subject: tool bar icons not updated according to :active condition +;; Newsgroups: gmane.emacs.devel +;; Date: Mon, 23 Jan 2006 19:59:13 +0100 +;; Message-ID: + +(defcustom gnus-group-tool-bar-zap-list t + "List of icon items from the global tool bar. +These items are not displayed in the Gnus group mode tool bar. + +See `gmm-tool-bar-from-list' for the format of the list." + :type 'gmm-tool-bar-zap-list + :version "23.0" ;; No Gnus + :initialize 'custom-initialize-default + :set 'gnus-group-tool-bar-update + :group 'gnus-group) + +(defun gnus-group-make-tool-bar (&optional force) + "Make a group mode tool bar from `gnus-group-tool-bar'. +When FORCE, rebuild the tool bar." + (when (or (not gnus-group-tool-bar-map) force) + (let ((map (when (default-value 'tool-bar-mode) + (let ((load-path (mm-image-load-path))) + (gmm-tool-bar-from-list gnus-group-tool-bar + gnus-group-tool-bar-zap-list + 'gnus-group-mode-map))))) + (if map + (set (make-local-variable 'tool-bar-map) map)))) + gnus-group-tool-bar-map) (defun gnus-group-mode () "Major mode for reading news. @@ -2288,6 +2381,25 @@ If EXCLUDE-GROUP, do not go to that group." (gnus-group-position-point) (and best-point (gnus-group-group-name)))) +;; Is there something like an after-point-motion-hook? +;; (inhibit-point-motion-hooks?). Is there a tool-bar-update function? + +;; (defun gnus-group-menu-bar-update () +;; (let* ((buf (list (with-current-buffer gnus-group-buffer +;; (current-buffer)))) +;; (name (buffer-name (car buf)))) +;; (setcdr buf +;; (if (> (length name) 27) +;; (concat (substring name 0 12) +;; "..." +;; (substring name -12)) +;; name)) +;; (menu-bar-update-buffers-1 buf))) + +;; (defun gnus-group-position-point () +;; (gnus-goto-colon) +;; (gnus-group-menu-bar-update)) + (defun gnus-group-first-unread-group () "Go to the first group with unread articles." (interactive) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 9b0539a..c427b17 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -40,6 +40,7 @@ (require 'gnus-int) (require 'gnus-undo) (require 'gnus-util) +(require 'gmm-utils) (require 'nnoo) (eval-when-compile @@ -2616,49 +2617,146 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) (defvar gnus-summary-tool-bar-map nil) -;; Emacs 21 tool bar. Should be no-op otherwise. -(defun gnus-summary-make-tool-bar () - (if (and (fboundp 'tool-bar-add-item-from-menu) - (default-value 'tool-bar-mode) - (not gnus-summary-tool-bar-map)) - (setq gnus-summary-tool-bar-map - (let ((tool-bar-map (make-sparse-keymap)) - (load-path (mm-image-load-path))) - (tool-bar-add-item-from-menu - 'gnus-summary-prev-unread "prev-ur" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-summary-next-unread "next-ur" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-summary-post-news "post" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-summary-followup-with-original "fuwo" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-summary-followup "followup" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-summary-reply-with-original "reply-wo" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-summary-reply "reply" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-summary-caesar-message "rot13" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-uu-decode-uu "uu-decode" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-summary-save-article-file "save-aif" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-summary-save-article "save-art" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-uu-post-news "uu-post" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-uu-post-news "uu-post" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-summary-catchup "catchup" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-summary-catchup-and-exit "cu-exit" gnus-summary-mode-map) - (tool-bar-add-item-from-menu - 'gnus-summary-exit "exit-summ" gnus-summary-mode-map) - tool-bar-map))) - (if gnus-summary-tool-bar-map - (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map))) +;; Note: The :set function in the `gnus-summary-tool-bar*' variables will only +;; affect _new_ message buffers. We might add a function that walks thru all +;; message-mode buffers and force the update. +(defun gnus-summary-tool-bar-update (&optional symbol value) + "Update summary mode toolbar. +Setter function for custom variables." + (if symbol + ;; When used as ":set" function: + (progn + (set-default symbol value) + (setq-default gnus-summary-tool-bar-map nil)) + (gnus-summary-make-tool-bar t))) + +;; The default will be changed when the new icons have been checked in: +(defcustom gnus-summary-tool-bar 'gnus-summary-tool-bar-retro + "Specifies the Gnus summary tool bar. + +It can be either a list or a symbol refering to a list. See +`gmm-tool-bar-from-list' for the format of the list. The +default key map is `gnus-summary-mode-map'. + +Pre-defined symbols include `gnus-summary-tool-bar-gnome' and +`gnus-summary-tool-bar-retro'." + :type '(choice (const :tag "GNOME style" gnus-summary-tool-bar-gnome) + (const :tag "Retro look" gnus-summary-tool-bar-retro) + (repeat :tag "User defined list" gmm-tool-bar-item) + (symbol)) + :version "23.0" ;; No Gnus + :initialize 'custom-initialize-default + :set 'gnus-summary-tool-bar-update + :group 'gnus-summary) + +(defcustom gnus-summary-tool-bar-gnome + '((gnus-summary-post-news "compose" nil) + (gnus-summary-reply-with-original "reply-author") + (gnus-summary-reply "reply" nil :visible nil) + (gnus-summary-followup-with-original "reply-all") + (gnus-summary-followup "reply-all" nil :visible nil) + (gnus-summary-mail-forward "forward") + (gnus-summary-save-article "save") ;; stock_mail-copy + (gnus-summary-search-article-forward "search") + (gnus-summary-print-article "print") + ;; gnus-group-read-only-p + (gnus-summary-mark-as-expirable + "delete" nil + :visible (gnus-check-backend-function 'request-expire-articles + gnus-newsgroup-name)) + (gnus-summary-tick-article-forward "flag-followup" nil :visible nil) + (gnus-summary-mark-as-spam + "spam" t :visible (spam-group-ham-contents-p gnus-newsgroup-name) + :help "Mark as spam") + (gnus-summary-mark-as-read-forward + "not-spam" nil :visible (spam-group-spam-contents-p gnus-newsgroup-name)) + ;; Some new commands that may need more suitable icons: + (gnus-summary-save-newsrc "save" nil :visible nil) + ;; (gnus-summary-show-article "stock_message-display" nil :visible nil) + (gnus-summary-prev-article "left-arrow" nil :visible nil) ;; Emacs 22 + (gnus-summary-next-article "right-arrow" nil :visible nil) ;; Emacs 22 + (gnus-summary-prev-unread-article "prev-node") ;; Emacs 22 + (gnus-summary-next-unread-article "next-node") ;; Emacs 22 + (gnus-summary-enter-digest-group "right_arrow" nil :visible nil) + ;; + ;; Maybe some sort-by-... could be added: + (gnus-summary-sort-by-author "sort-a-z" nil :visible nil) + (gnus-summary-sort-by-date "sort-1-9" nil :visible nil) + ;; + (gnus-summary-insert-new-articles "inbox") + ;; + (gnus-summary-exit "exit-mode") + ;; + (gnus-info-find-node "help")) + "List of functions for the summary tool bar (GNOME style). + +See `gmm-tool-bar-from-list' for the format of the list." + :type '(repeat gmm-tool-bar-item) + :version "23.0" ;; No Gnus + :initialize 'custom-initialize-default + :set 'gnus-summary-tool-bar-update + :group 'gnus-summary) + +(defcustom gnus-summary-tool-bar-retro + '((gnus-summary-prev-unread-article "prev-ur") + (gnus-summary-next-unread-article "next-ur") + (gnus-summary-post-news "post") + (gnus-summary-followup-with-original "fuwo") + (gnus-summary-followup "followup") + (gnus-summary-reply-with-original "reply-wo") + (gnus-summary-reply "reply") + (gnus-summary-caesar-message "rot13") + (gnus-uu-decode-uu "uu-decode") + (gnus-summary-save-article-file "save-aif") + (gnus-summary-save-article "save-art") + (gnus-uu-post-news "uu-post") + (gnus-summary-catchup "catchup") + (gnus-summary-catchup-and-exit "cu-exit") + (gnus-summary-exit "exit-summ") + ;; Some new command that may need more suitable icons: + (gnus-summary-print-article "print" nil :visible nil) + (gnus-summary-mark-as-expirable "close" nil :visible nil) + (gnus-summary-save-newsrc "save" nil :visible nil) + ;; (gnus-summary-enter-digest-group "right_arrow" nil :visible nil) + (gnus-summary-search-article-forward "search" nil :visible nil) + ;; (gnus-summary-insert-new-articles "paste" nil :visible nil) + ;; (gnus-summary-toggle-threads "open" nil :visible nil) + ;; + (gnus-info-find-node "help" nil :visible nil)) + "List of functions for the summary tool bar (retro look). + +See `gmm-tool-bar-from-list' for the format of the list." + :type '(repeat gmm-tool-bar-item) + :version "23.0" ;; No Gnus + :initialize 'custom-initialize-default + :set 'gnus-summary-tool-bar-update + :group 'gnus-summary) + +(defcustom gnus-summary-tool-bar-zap-list t + "List of icon items from the global tool bar. +These items are not displayed in the Gnus summary mode tool bar. + +See `gmm-tool-bar-from-list' for the format of the list." + :type 'gmm-tool-bar-zap-list + :version "23.0" ;; No Gnus + :initialize 'custom-initialize-default + :set 'gnus-summary-tool-bar-update + :group 'gnus-summary) + +(defun gnus-summary-make-tool-bar (&optional force) + "Make a summary mode tool bar from `gnus-summary-tool-bar'. +When FORCE, rebuild the tool bar." + (when (or (not gnus-summary-tool-bar-map) force) + (let ((map (when (default-value 'tool-bar-mode) + (let ((load-path (mm-image-load-path))) + (gmm-tool-bar-from-list gnus-summary-tool-bar + gnus-summary-tool-bar-zap-list + 'gnus-summary-mode-map))))) + (when map + ;; Need to set `gnus-summary-tool-bar-map' because `gnus-article-mode' + ;; uses it's value. + (setq gnus-summary-tool-bar-map map)))) + (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map)) (defun gnus-score-set-default (var value) "A version of set that updates the GNU Emacs menu-bar." @@ -2769,12 +2867,13 @@ The following commands are available: \\{gnus-summary-mode-map}" (interactive) (kill-all-local-variables) + (let ((gnus-summary-local-variables gnus-newsgroup-variables)) + (gnus-summary-make-local-variables)) + (gnus-summary-make-local-variables) + (setq gnus-newsgroup-name group) (when (gnus-visual-p 'summary-menu 'menu) (gnus-summary-make-menu-bar) (gnus-summary-make-tool-bar)) - (gnus-summary-make-local-variables) - (let ((gnus-summary-local-variables gnus-newsgroup-variables)) - (gnus-summary-make-local-variables)) (gnus-make-thread-indent-array) (gnus-simplify-mode-line) (setq major-mode 'gnus-summary-mode) @@ -2789,7 +2888,6 @@ The following commands are available: (setq selective-display-ellipses t) ;Display `...' (gnus-summary-set-display-table) (gnus-set-default-directory) - (setq gnus-newsgroup-name group) (unless (gnus-news-group-p group) (setq gnus-newsgroup-incorporated (nnmail-new-mail-numbers (gnus-group-real-name group)))) diff --git a/lisp/message.el b/lisp/message.el index 5f48faa..6a3e855 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -2684,6 +2684,8 @@ Prefixed with two \\[universal-argument]'s, display the PGG manual." "----" ["Sort Headers" message-sort-headers t] ["Encode non-ASCII domain names" message-idna-to-ascii-rhs t] + ;; We hide `message-hidden-headers' by narrowing the buffer. + ["Show Hidden Headers" widen t] ["Goto Body" message-goto-body t] ["Goto Signature" message-goto-signature t])) @@ -7423,9 +7425,9 @@ which specify the range to operate on." (defvar tool-bar-map) (defvar tool-bar-mode)) -;; Note: The :set function in the `message-tool-bar*' will only affect _new_ -;; message buffers. We might add a function that walks thru all message-mode -;; buffers and force the update. +;; Note: The :set function in the `message-tool-bar*' variables will only +;; affect _new_ message buffers. We might add a function that walks thru all +;; message-mode buffers and force the update. (defun message-tool-bar-update (&optional symbol value) "Update message mode toolbar. Setter function for custom variables." @@ -7436,8 +7438,7 @@ Setter function for custom variables." (setq-default message-tool-bar-map nil)) (message-make-tool-bar t))) -;; The default will be changed to `message-tool-bar-gnome' when the new icons -;; have been checked in: +;; The default will be changed when the new icons have been checked in: (defcustom message-tool-bar 'message-tool-bar-retro "Specifies the message mode tool bar.