aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/mail/rmailsum.el139
1 files changed, 136 insertions, 3 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index b9d4a82892a..9e5df68e249 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -588,6 +588,103 @@ Instead, all of the Rmail Mode commands are available, plus:
588 (define-key rmail-summary-mode-map "?" 'describe-mode) 588 (define-key rmail-summary-mode-map "?" 'describe-mode)
589 ) 589 )
590 590
591;;; Menu bar bindings.
592
593(define-key rmail-summary-mode-map [menu-bar] (make-sparse-keymap))
594
595(define-key rmail-summary-mode-map [menu-bar classify]
596 (cons "Classify" (make-sparse-keymap "Classify")))
597
598(define-key rmail-summary-mode-map [menu-bar classify output-inbox]
599 '("Output (inbox)" . rmail-summary-output))
600
601(define-key rmail-summary-mode-map [menu-bar classify output]
602 '("Output (Rmail)" . rmail-summary-output-to-rmail-file))
603
604(define-key rmail-summary-mode-map [menu-bar classify kill-label]
605 '("Kill Label" . rmail-summary-kill-label))
606
607(define-key rmail-summary-mode-map [menu-bar classify add-label]
608 '("Add Label" . rmail-summary-add-label))
609
610(define-key rmail-summary-mode-map [menu-bar summary]
611 (cons "Summary" (make-sparse-keymap "Summary")))
612
613(define-key rmail-summary-mode-map [menu-bar summary labels]
614 '("By Labels" . rmail-summary-by-labels))
615
616(define-key rmail-summary-mode-map [menu-bar summary recipients]
617 '("By Recipients" . rmail-summary-by-recipients))
618
619(define-key rmail-summary-mode-map [menu-bar summary topic]
620 '("By Topic" . rmail-summary-by-topic))
621
622(define-key rmail-summary-mode-map [menu-bar summary regexp]
623 '("By Regexp" . rmail-summary-by-regexp))
624
625(define-key rmail-summary-mode-map [menu-bar summary all]
626 '("All" . rmail-summary))
627
628(define-key rmail-summary-mode-map [menu-bar mail]
629 (cons "Mail" (make-sparse-keymap "Mail")))
630
631(define-key rmail-summary-mode-map [menu-bar mail continue]
632 '("Continue" . rmail-summary-continue))
633
634(define-key rmail-summary-mode-map [menu-bar mail forward]
635 '("Forward" . rmail-summary-forward))
636
637(define-key rmail-summary-mode-map [menu-bar mail retry]
638 '("Retry" . rmail-summary-retry-failure))
639
640(define-key rmail-summary-mode-map [menu-bar mail reply]
641 '("Reply" . rmail-summary-reply))
642
643(define-key rmail-summary-mode-map [menu-bar mail mail]
644 '("Mail" . rmail-summary-mail))
645
646(define-key rmail-summary-mode-map [menu-bar delete]
647 (cons "Delete" (make-sparse-keymap "Delete")))
648
649(define-key rmail-summary-mode-map [menu-bar delete expunge/save]
650 '("Expunge/Save" . rmail-summary-expunge-and-save))
651
652(define-key rmail-summary-mode-map [menu-bar delete expunge]
653 '("Expunge" . rmail-summary-expunge))
654
655(define-key rmail-summary-mode-map [menu-bar delete undelete]
656 '("Undelete" . rmail-summary-undelete))
657
658(define-key rmail-summary-mode-map [menu-bar delete delete]
659 '("Delete" . rmail-summary-delete-forward))
660
661(define-key rmail-summary-mode-map [menu-bar move]
662 (cons "Move" (make-sparse-keymap "Move")))
663
664(define-key rmail-summary-mode-map [menu-bar move search-back]
665 '("Search Back" . rmail-summary-search-backward))
666
667(define-key rmail-summary-mode-map [menu-bar move search]
668 '("Search" . rmail-summary-search))
669
670(define-key rmail-summary-mode-map [menu-bar move previous]
671 '("Previous Nondeleted" . rmail-summary-previous-msg))
672
673(define-key rmail-summary-mode-map [menu-bar move next]
674 '("Next Nondeleted" . rmail-summary-next-msg))
675
676(define-key rmail-summary-mode-map [menu-bar move last]
677 '("Last" . rmail-summary-last-message))
678
679(define-key rmail-summary-mode-map [menu-bar move first]
680 '("First" . rmail-summary-first-message))
681
682(define-key rmail-summary-mode-map [menu-bar move previous]
683 '("Previous" . rmail-summary-previous-all))
684
685(define-key rmail-summary-mode-map [menu-bar move next]
686 '("Next" . rmail-summary-next-all))
687
591(defun rmail-summary-goto-msg (&optional n nowarn skip-rmail) 688(defun rmail-summary-goto-msg (&optional n nowarn skip-rmail)
592 (interactive "P") 689 (interactive "P")
593 (if (consp n) (setq n (prefix-numeric-value n))) 690 (if (consp n) (setq n (prefix-numeric-value n)))
@@ -742,6 +839,37 @@ Go back to summary buffer."
742 (rmail-abort-edit) 839 (rmail-abort-edit)
743 (pop-to-buffer rmail-summary-buffer)) 840 (pop-to-buffer rmail-summary-buffer))
744 841
842(defun rmail-summary-search-backward (regexp &optional n)
843 "Show message containing next match for REGEXP.
844Prefix argument gives repeat count; negative argument means search
845backwards (through earlier messages).
846Interactively, empty argument means use same regexp used last time."
847 (interactive
848 (let* ((reversep (>= (prefix-numeric-value current-prefix-arg) 0))
849 (prompt
850 (concat (if reversep "Reverse " "") "Rmail search (regexp): "))
851 regexp)
852 (if rmail-search-last-regexp
853 (setq prompt (concat prompt
854 "(default "
855 rmail-search-last-regexp
856 ") ")))
857 (setq regexp (read-string prompt))
858 (cond ((not (equal regexp ""))
859 (setq rmail-search-last-regexp regexp))
860 ((not rmail-search-last-regexp)
861 (error "No previous Rmail search string")))
862 (list rmail-search-last-regexp
863 (prefix-numeric-value current-prefix-arg))))
864 ;; Don't use save-excursion because that prevents point from moving
865 ;; properly in the summary buffer.
866 (let ((buffer (current-buffer)))
867 (unwind-protect
868 (progn
869 (set-buffer rmail-buffer)
870 (rmail-search regexp (- n)))
871 (set-buffer buffer))))
872
745(defun rmail-summary-search (regexp &optional n) 873(defun rmail-summary-search (regexp &optional n)
746 "Show message containing next match for REGEXP. 874 "Show message containing next match for REGEXP.
747Prefix argument gives repeat count; negative argument means search 875Prefix argument gives repeat count; negative argument means search
@@ -764,9 +892,14 @@ Interactively, empty argument means use same regexp used last time."
764 (error "No previous Rmail search string"))) 892 (error "No previous Rmail search string")))
765 (list rmail-search-last-regexp 893 (list rmail-search-last-regexp
766 (prefix-numeric-value current-prefix-arg)))) 894 (prefix-numeric-value current-prefix-arg))))
767 (save-excursion 895 ;; Don't use save-excursion because that prevents point from moving
768 (set-buffer rmail-buffer) 896 ;; properly in the summary buffer.
769 (rmail-search regexp n))) 897 (let ((buffer (current-buffer)))
898 (unwind-protect
899 (progn
900 (set-buffer rmail-buffer)
901 (rmail-search regexp n))
902 (set-buffer buffer))))
770 903
771(defun rmail-summary-toggle-header () 904(defun rmail-summary-toggle-header ()
772 "Show original message header if pruned header currently shown, or vice versa." 905 "Show original message header if pruned header currently shown, or vice versa."