diff options
| author | Karl Heuer | 1995-11-03 02:28:26 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-11-03 02:28:26 +0000 |
| commit | 942fc7728822f756b3d5e6587d0e661af6650d15 (patch) | |
| tree | 9b061bc39872d8418c7a53b7592030003211c1a7 | |
| parent | a6903f091103a8ccd11e2947aec2b1a74b3f08c9 (diff) | |
| download | emacs-942fc7728822f756b3d5e6587d0e661af6650d15.tar.gz emacs-942fc7728822f756b3d5e6587d0e661af6650d15.zip | |
(mh-make-folder-mode-line): support mh-msg-count.
(mh-delete-scan-msgs): use fast new mh-goto-msg.
| -rw-r--r-- | lisp/mail/mh-e.el | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/lisp/mail/mh-e.el b/lisp/mail/mh-e.el index 645d22a80e1..0bda4492e4e 100644 --- a/lisp/mail/mh-e.el +++ b/lisp/mail/mh-e.el | |||
| @@ -2,16 +2,16 @@ | |||
| 2 | 2 | ||
| 3 | ;;; Copyright (C) 1985,86,87,88,90,92,93,94,95 Free Software Foundation, Inc. | 3 | ;;; Copyright (C) 1985,86,87,88,90,92,93,94,95 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | (defconst mh-e-time-stamp "Time-stamp: <95/04/11 15:43:42 gildea>") | 5 | (defconst mh-e-time-stamp "Time-stamp: <95/10/30 19:14:06 gildea>") |
| 6 | (defconst mh-e-version "5.0.1" | 6 | (defconst mh-e-version "5.0.2" |
| 7 | "Version numbers of this version of mh-e.") | 7 | "Version numbers of this version of mh-e.") |
| 8 | 8 | ||
| 9 | ;; Maintainer: Stephen Gildea <gildea@lcs.mit.edu> | 9 | ;; Maintainer: Stephen Gildea <gildea@lcs.mit.edu> |
| 10 | ;; Version: 5.0.1 | 10 | ;; Version: 5.0.2 |
| 11 | ;; Keywords: mail | 11 | ;; Keywords: mail |
| 12 | ;; Bug-reports: include `M-x mh-version' output in any correspondence | 12 | ;; Bug-reports: include `M-x mh-version' output in any correspondence |
| 13 | 13 | ||
| 14 | ;; This file is part of GNU Emacs. | 14 | ;; This file is part of mh-e, part of GNU Emacs. |
| 15 | 15 | ||
| 16 | ;; GNU Emacs is free software; you can redistribute it and/or modify | 16 | ;; GNU Emacs is free software; you can redistribute it and/or modify |
| 17 | ;; it under the terms of the GNU General Public License as published by | 17 | ;; it under the terms of the GNU General Public License as published by |
| @@ -63,7 +63,7 @@ | |||
| 63 | ;;; Modified by James Larus, BBN, July 1984 and UCB, 1984 & 1985. | 63 | ;;; Modified by James Larus, BBN, July 1984 and UCB, 1984 & 1985. |
| 64 | ;;; Rewritten for GNU Emacs, James Larus 1985. larus@ginger.berkeley.edu | 64 | ;;; Rewritten for GNU Emacs, James Larus 1985. larus@ginger.berkeley.edu |
| 65 | ;;; Modified by Stephen Gildea 1988. gildea@lcs.mit.edu | 65 | ;;; Modified by Stephen Gildea 1988. gildea@lcs.mit.edu |
| 66 | (defconst mh-e-RCS-id "$Id: mh-e.el,v 1.7 1995/04/20 23:35:01 kwzh Exp kwzh $") | 66 | (defconst mh-e-RCS-id "$Id: mh-e.el,v 1.8 1995/04/25 22:28:04 kwzh Exp kwzh $") |
| 67 | 67 | ||
| 68 | ;;; Code: | 68 | ;;; Code: |
| 69 | 69 | ||
| @@ -786,6 +786,7 @@ The value of mh-folder-mode-hook is called when a new folder is set up." | |||
| 786 | 'mh-narrowed-to-seq nil ; Sequence display is narrowed to | 786 | 'mh-narrowed-to-seq nil ; Sequence display is narrowed to |
| 787 | 'mh-first-msg-num nil ; Number of first msg in buffer | 787 | 'mh-first-msg-num nil ; Number of first msg in buffer |
| 788 | 'mh-last-msg-num nil ; Number of last msg in buffer | 788 | 'mh-last-msg-num nil ; Number of last msg in buffer |
| 789 | 'mh-msg-count nil ; Number of msgs in buffer | ||
| 789 | 'mh-mode-line-annotation nil ; Indiction this is not the full folder | 790 | 'mh-mode-line-annotation nil ; Indiction this is not the full folder |
| 790 | 'mh-previous-window-config nil) ; Previous window configuration | 791 | 'mh-previous-window-config nil) ; Previous window configuration |
| 791 | (setq truncate-lines t) | 792 | (setq truncate-lines t) |
| @@ -901,8 +902,8 @@ The value of mh-folder-mode-hook is called when a new folder is set up." | |||
| 901 | (mh-notate-user-sequences) | 902 | (mh-notate-user-sequences) |
| 902 | (if new-mail-p | 903 | (if new-mail-p |
| 903 | (progn | 904 | (progn |
| 904 | (mh-goto-cur-msg) | 905 | (mh-make-folder-mode-line) |
| 905 | (mh-make-folder-mode-line)) | 906 | (mh-goto-cur-msg)) |
| 906 | (goto-char point-before-inc)))))) | 907 | (goto-char point-before-inc)))))) |
| 907 | 908 | ||
| 908 | 909 | ||
| @@ -916,19 +917,19 @@ The value of mh-folder-mode-hook is called when a new folder is set up." | |||
| 916 | (setq mh-first-msg-num (mh-get-msg-num nil)) | 917 | (setq mh-first-msg-num (mh-get-msg-num nil)) |
| 917 | (mh-last-msg) | 918 | (mh-last-msg) |
| 918 | (setq mh-last-msg-num (mh-get-msg-num nil)) | 919 | (setq mh-last-msg-num (mh-get-msg-num nil)) |
| 919 | (let ((lines (count-lines (point-min) (point-max)))) | 920 | (setq mh-msg-count (count-lines (point-min) (point-max))) |
| 920 | (setq mode-line-buffer-identification | 921 | (setq mode-line-buffer-identification |
| 921 | (list (format "{%%b%s} %d msg%s" | 922 | (list (format "{%%b%s} %d msg%s" |
| 922 | (if mh-mode-line-annotation | 923 | (if mh-mode-line-annotation |
| 923 | (format "/%s" mh-mode-line-annotation) | 924 | (format "/%s" mh-mode-line-annotation) |
| 924 | "") | 925 | "") |
| 925 | lines | 926 | mh-msg-count |
| 926 | (if (zerop lines) | 927 | (if (zerop mh-msg-count) |
| 927 | "s" | 928 | "s" |
| 928 | (if (> lines 1) | 929 | (if (> mh-msg-count 1) |
| 929 | (format "s (%d-%d)" mh-first-msg-num | 930 | (format "s (%d-%d)" mh-first-msg-num |
| 930 | mh-last-msg-num) | 931 | mh-last-msg-num) |
| 931 | (format " (%d)" mh-first-msg-num))))))))) | 932 | (format " (%d)" mh-first-msg-num)))))))) |
| 932 | 933 | ||
| 933 | 934 | ||
| 934 | (defun mh-unmark-all-headers (remove-all-flags) | 935 | (defun mh-unmark-all-headers (remove-all-flags) |
| @@ -1061,16 +1062,11 @@ The value of mh-folder-mode-hook is called when a new folder is set up." | |||
| 1061 | 1062 | ||
| 1062 | (defun mh-delete-scan-msgs (msgs) | 1063 | (defun mh-delete-scan-msgs (msgs) |
| 1063 | ;; Delete the scan listing lines for each of the msgs in the LIST. | 1064 | ;; Delete the scan listing lines for each of the msgs in the LIST. |
| 1064 | ;; Optimized for speed (i.e., no regular expressions). | ||
| 1065 | (setq msgs (sort msgs '<)) ;okay to clobber msgs | ||
| 1066 | (save-excursion | 1065 | (save-excursion |
| 1067 | (mh-first-msg) | 1066 | (while msgs |
| 1068 | (while (and msgs (< (point) (point-max))) | 1067 | (if (mh-goto-msg (car msgs) t t) |
| 1069 | (cond ((equal (mh-get-msg-num nil) (car msgs)) | 1068 | (mh-delete-line 1)) |
| 1070 | (delete-region (point) (save-excursion (forward-line) (point))) | 1069 | (setq msgs (cdr msgs))))) |
| 1071 | (setq msgs (cdr msgs))) | ||
| 1072 | (t | ||
| 1073 | (forward-line)))))) | ||
| 1074 | 1070 | ||
| 1075 | 1071 | ||
| 1076 | (defun mh-outstanding-commands-p () | 1072 | (defun mh-outstanding-commands-p () |
| @@ -1329,6 +1325,8 @@ inform MH of the change." | |||
| 1329 | (define-key mh-folder-mode-map ">" 'mh-write-msg-to-file) | 1325 | (define-key mh-folder-mode-map ">" 'mh-write-msg-to-file) |
| 1330 | (define-key mh-folder-mode-map "!" 'mh-refile-or-write-again) | 1326 | (define-key mh-folder-mode-map "!" 'mh-refile-or-write-again) |
| 1331 | 1327 | ||
| 1328 | ;; "C-c /" prefix is used in mh-folder-mode by pgp.el and mailcrypt | ||
| 1329 | |||
| 1332 | 1330 | ||
| 1333 | 1331 | ||
| 1334 | ;;;autoload the other mh-e parts | 1332 | ;;;autoload the other mh-e parts |