[1734] in testers
Fixes for mh-e.el
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Mon Aug 5 06:16:20 1991
From: ckclark@ATHENA.MIT.EDU
Date: Mon, 5 Aug 91 06:16:21 -0400
To: testers@ATHENA.MIT.EDU
Reply-To: ckclark@mit.edu
You can apply this patch to the source tree, or get the change from the
RCS logs in the emacsdev locker. The .elc version may be copied from
there, too, as I have byte-compiled it.
1. Fixed mh-quit problem.
2. Fixed "huge minibuffer" bug which happens when run in horizontally split window.
3. Fixed range selection in scanning. Now it works.
Changes where based on a patch by darrylo@hpnmxx.sr.hp.com posted to the
gnulists. The orginal (which can be found in the bug-emacs discuss
meeting, transaction [11123]) 1qprovided many other features which were not
appropriate for Athena.
*** /source/third/common/gnu/emacs/lisp/mh-e.el Sun Jun 30 22:15:37 1991
--- mh-e.el Mon Aug 5 05:47:51 1991
***************
*** 47,53 ****
;;;(defvar mh-lib "/usr/new/lib/mh/" "Directory of MH library.")
(defvar mh-redist-full-contents t
! "Non-nil if the `dist' command needs whole letter for redistribution.
This is the case when `send' is compiled with the BERK option.")
--- 47,53 ----
;;;(defvar mh-lib "/usr/new/lib/mh/" "Directory of MH library.")
(defvar mh-redist-full-contents t
! "*Non-nil if the `dist' command needs whole letter for redistribution.
This is the case when `send' is compiled with the BERK option.")
***************
*** 760,769 ****
"Restore the previous window configuration, if one exists.
Finish by running mh-quit-hook."
(interactive)
(if mh-previous-window-config
! (progn (if mh-show-buffer (bury-buffer mh-show-buffer))
! (if (mh-current-folder (bury-buffer mh-current-folder))
! (set-window-configuration mh-previous-window-config))))
(run-hooks 'mh-quit-hook))
--- 760,771 ----
"Restore the previous window configuration, if one exists.
Finish by running mh-quit-hook."
(interactive)
+ (if mh-current-folder
+ (bury-buffer mh-current-folder))
+ (if mh-show-buffer
+ (bury-buffer mh-show-buffer))
(if mh-previous-window-config
! (set-window-configuration mh-previous-window-config))
(run-hooks 'mh-quit-hook))
***************
*** 906,912 ****
(mh-read-msg-range "Range to scan [all]? ")
nil)))
(setq mh-next-direction 'forward)
! (mh-scan-folder mh-current-folder (or range "all")))
(defun mh-redistribute (to cc msg)
--- 908,916 ----
(mh-read-msg-range "Range to scan [all]? ")
nil)))
(setq mh-next-direction 'forward)
! (mh-scan-folder mh-current-folder (if (string= range "")
! "all"
! range)))
(defun mh-redistribute (to cc msg)
***************
*** 1031,1037 ****
(setq msg (mh-get-msg-num t)))
(setq mh-showing t)
(mh-set-mode-name "mh-e show")
! (if (not (eql (next-window (minibuffer-window)) (selected-window)))
(delete-other-windows)) ; force ourself to the top window
(let ((folder mh-current-folder))
(mh-show-message-in-other-window)
--- 1035,1041 ----
(setq msg (mh-get-msg-num t)))
(setq mh-showing t)
(mh-set-mode-name "mh-e show")
! (if (not (eql (minibuffer-window) (selected-window)))
(delete-other-windows)) ; force ourself to the top window
(let ((folder mh-current-folder))
(mh-show-message-in-other-window)
***************
*** 1123,1129 ****
(interactive (list (mh-prompt-for-folder "Visit" "+inbox" t)
(mh-read-msg-range "Range [all]? ")))
(let ((config (current-window-configuration)))
! (mh-scan-folder folder (or range "all"))
(setq mh-previous-window-config config)))
--- 1127,1135 ----
(interactive (list (mh-prompt-for-folder "Visit" "+inbox" t)
(mh-read-msg-range "Range [all]? ")))
(let ((config (current-window-configuration)))
! (mh-scan-folder folder (if (string= range "")
! "all"
! range))
(setq mh-previous-window-config config)))
***************
*** 2591,2607 ****
(delq (assoc folder mh-folder-list) mh-folder-list)))
(defun mh-read-msg-range (prompt)
;; Read a list of blank-separated items.
(let* ((buf (read-string prompt))
(buf-size (length buf))
(start 0)
! (input ()))
! (while (< start buf-size)
! (let ((next (read-from-string buf start buf-size)))
! (mh-push (car next) input)
! (setq start (cdr next))))
! (nreverse input)))
--- 2597,2648 ----
(delq (assoc folder mh-folder-list) mh-folder-list)))
+ (defun mh-drop-spaces (str)
+ "Return a copy of STR, with leading and trailing spaces removed."
+ (let (loc)
+ (if (string-match "^[ \t]+" str)
+ (setq str (substring str (match-end 0)))
+ )
+ (if (string-match "[ \t]+$" str)
+ (progn
+ (setq loc (match-beginning 0))
+ (if (> loc 0)
+ (setq loc (1- loc))
+ )
+ (setq str (substring str 0 loc))
+ )
+ )
+ str
+ )
+ )
+
(defun mh-read-msg-range (prompt)
;; Read a list of blank-separated items.
(let* ((buf (read-string prompt))
(buf-size (length buf))
(start 0)
! (input ""))
! (while (> (length buf) 0)
! (if (string-match "\\([^, \t]*\\)\\([, \t]*\\)" buf)
! (progn
! (if (/= (match-beginning 1) (match-end 1))
! (setq input (concat input " "
! (substring buf
! (match-beginning 1)
! (match-end 1))))
! )
! )
! (error "Error in mh-read-msg-range")
! )
! (setq buf (substring buf (match-end 2)))
! )
! (setq input (mh-drop-spaces input))
! (if (string= input "")
! (setq input "all")
! )
! input
! )
! )