diff options
| author | Eli Zaretskii | 2000-10-09 10:28:16 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2000-10-09 10:28:16 +0000 |
| commit | e4ca8f8c2e22decdd215f3738ecf8fd8f532ec52 (patch) | |
| tree | 96be08d4adcc0f591c9f698fe0b4e44a03bbaf53 | |
| parent | 06a8c9f89b2f6bb9b066456820f4477d3aa1a272 (diff) | |
| download | emacs-e4ca8f8c2e22decdd215f3738ecf8fd8f532ec52.tar.gz emacs-e4ca8f8c2e22decdd215f3738ecf8fd8f532ec52.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/menu-bar.el | 21 |
2 files changed, 26 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7f18cf6e500..539faf2e012 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2000-10-09 Eli Zaretskii <eliz@is.elta.co.il> | 1 | 2000-10-09 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 2 | ||
| 3 | * menu-bar.el (send-mail-item-name): New function. | ||
| 4 | (menu-bar-tools-menu) <compose-mail>: Use it to display the value | ||
| 5 | of mail-user-agent in the menu. Don't display the "Send Mail" | ||
| 6 | item if mail-user-agent is nil or its value is ignore. | ||
| 7 | (menu-bar-tools-menu) <rmail>: Don't display the "Read Mail" item | ||
| 8 | if read-mail-command is nil or its value is ignore. | ||
| 9 | |||
| 3 | * mouse.el ([header-line mouse-1]): Bind to mouse-select-window. | 10 | * mouse.el ([header-line mouse-1]): Bind to mouse-select-window. |
| 4 | 11 | ||
| 5 | 2000-10-09 Miles Bader <miles@gnu.org> | 12 | 2000-10-09 Miles Bader <miles@gnu.org> |
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 4cbfda6b978..cf342bbab48 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -640,6 +640,19 @@ Do the same for the keys of the same name." | |||
| 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") |
| @@ -698,14 +711,18 @@ Do the same for the keys of the same name." | |||
| 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 |