comparison lisp/menu-bar.el @ 32329:878aee6eaf4b

(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.
author Eli Zaretskii <eliz@gnu.org>
date Mon, 09 Oct 2000 10:26:22 +0000
parents 0d9e6ed2718b
children 0ad3db06d19b
comparison
equal deleted inserted replaced
32328:66df0c812955 32329:878aee6eaf4b
638 (global-font-lock-mode))) 638 (global-font-lock-mode)))
639 639
640 640
641 ;; The "Tools" menu items 641 ;; The "Tools" menu items
642 642
643 (defun send-mail-item-name ()
644 (let* ((known-send-mail-commands '((sendmail-user-agent . "sendmail")
645 (mh-e-user-agent . "MH")
646 (message-user-agent . "Gnus Message")
647 (gnus-user-agent . "Gnus")))
648 (name (assq mail-user-agent known-send-mail-commands)))
649 (if name
650 (setq name (cdr name))
651 (setq name (symbol-name mail-user-agent))
652 (if (string-match "\\(.+\\)-user-agent" name)
653 (setq name (match-string 1 name))))
654 name))
655
643 (defun read-mail-item-name () 656 (defun read-mail-item-name ()
644 (let* ((known-rmail-commands '((rmail . "RMAIL") 657 (let* ((known-rmail-commands '((rmail . "RMAIL")
645 (mh-rmail . "MH") 658 (mh-rmail . "MH")
646 (gnus . "Gnus"))) 659 (gnus . "Gnus")))
647 (known (assq read-mail-command known-rmail-commands))) 660 (known (assq read-mail-command known-rmail-commands)))
696 '(menu-item "Display Speedbar" speedbar-frame-mode)) 709 '(menu-item "Display Speedbar" speedbar-frame-mode))
697 (define-key menu-bar-tools-menu [directory-search] 710 (define-key menu-bar-tools-menu [directory-search]
698 '(menu-item "Directory Search" eudc-tools-menu 711 '(menu-item "Directory Search" eudc-tools-menu
699 :help "Query directory servers via LDAP, CCSO PH/QI or BBDB")) 712 :help "Query directory servers via LDAP, CCSO PH/QI or BBDB"))
700 (define-key menu-bar-tools-menu [compose-mail] 713 (define-key menu-bar-tools-menu [compose-mail]
701 '(menu-item "Send Mail" compose-mail 714 (list
702 :help "Send a mail message")) 715 'menu-item `(format "Send Mail (with %s)" (send-mail-item-name))
716 'compose-mail
717 :visible `(and mail-user-agent (not (eq mail-user-agent 'ignore)))
718 :help "Send a mail message"))
703 (define-key menu-bar-tools-menu [rmail] 719 (define-key menu-bar-tools-menu [rmail]
704 (list 720 (list
705 'menu-item `(format "Read Mail (with %s)" (read-mail-item-name)) 721 'menu-item `(format "Read Mail (with %s)" (read-mail-item-name))
706 (lambda () 722 (lambda ()
707 (interactive) 723 (interactive)
708 (call-interactively read-mail-command)) 724 (call-interactively read-mail-command))
725 :visible `(and read-mail-command (not (eq read-mail-command 'ignore)))
709 :help "Read your mail and reply to it")) 726 :help "Read your mail and reply to it"))
710 (define-key menu-bar-tools-menu [gnus] 727 (define-key menu-bar-tools-menu [gnus]
711 '(menu-item "Read Net News (Gnus)" gnus 728 '(menu-item "Read Net News (Gnus)" gnus
712 :help "Read network news groups")) 729 :help "Read network news groups"))
713 730