]> git.eshelyaron.com Git - emacs.git/commitdiff
(send-mail-item-name): New function.
authorEli Zaretskii <eliz@gnu.org>
Mon, 9 Oct 2000 10:28:16 +0000 (10:28 +0000)
committerEli Zaretskii <eliz@gnu.org>
Mon, 9 Oct 2000 10:28:16 +0000 (10:28 +0000)
(menu-bar-tools-menu) <compose-mail>: Use it to display the value
of mail-user-agent in the menu.  Don't display the "Send Mail"
item if mail-user-agent is nil or its value is ignore.
(menu-bar-tools-menu) <rmail>: Don't display the "Read Mail" item
if read-mail-command is nil or its value is ignore.

lisp/ChangeLog
lisp/menu-bar.el

index 7f18cf6e500059ef5323dd93e8529d209b7ec1a4..539faf2e01240f538635185351eb915ffe5c38ec 100644 (file)
@@ -1,5 +1,12 @@
 2000-10-09  Eli Zaretskii  <eliz@is.elta.co.il>
 
+       * menu-bar.el (send-mail-item-name): New function.
+       (menu-bar-tools-menu) <compose-mail>: Use it to display the value
+       of mail-user-agent in the menu.  Don't display the "Send Mail"
+       item if mail-user-agent is nil or its value is ignore.
+       (menu-bar-tools-menu) <rmail>: Don't display the "Read Mail" item
+       if read-mail-command is nil or its value is ignore.
+
        * mouse.el ([header-line mouse-1]): Bind to mouse-select-window.
 
 2000-10-09  Miles Bader  <miles@gnu.org>
index 4cbfda6b978a3caf8740a4683d243ef9678e1021..cf342bbab48e1118daf8c31b3982a4f8a8e9d7d5 100644 (file)
@@ -640,6 +640,19 @@ Do the same for the keys of the same name."
 \f
 ;; The "Tools" menu items
 
+(defun send-mail-item-name ()
+  (let* ((known-send-mail-commands '((sendmail-user-agent . "sendmail")
+                                    (mh-e-user-agent . "MH")
+                                    (message-user-agent . "Gnus Message")
+                                    (gnus-user-agent . "Gnus")))
+        (name (assq mail-user-agent known-send-mail-commands)))
+    (if name
+       (setq name (cdr name))
+      (setq name (symbol-name mail-user-agent))
+      (if (string-match "\\(.+\\)-user-agent" name)
+         (setq name (match-string 1 name))))
+    name))
+
 (defun read-mail-item-name ()
   (let* ((known-rmail-commands '((rmail . "RMAIL")
                                 (mh-rmail . "MH")
@@ -698,14 +711,18 @@ Do the same for the keys of the same name."
   '(menu-item "Directory Search" eudc-tools-menu
              :help "Query directory servers via LDAP, CCSO PH/QI or BBDB"))
 (define-key menu-bar-tools-menu [compose-mail]
-  '(menu-item "Send Mail" compose-mail
-             :help "Send a mail message"))
+  (list
+   'menu-item `(format "Send Mail (with %s)" (send-mail-item-name))
+   'compose-mail
+   :visible `(and mail-user-agent (not (eq mail-user-agent 'ignore)))
+   :help "Send a mail message"))
 (define-key menu-bar-tools-menu [rmail]
   (list
    'menu-item `(format "Read Mail (with %s)" (read-mail-item-name))
    (lambda ()
      (interactive)
      (call-interactively read-mail-command))
+   :visible `(and read-mail-command (not (eq read-mail-command 'ignore)))
    :help "Read your mail and reply to it"))
 (define-key menu-bar-tools-menu [gnus]
   '(menu-item "Read Net News (Gnus)" gnus