glauer@SRN-VAX.ARPA (10/22/85)
From: glauer@SRN-VAX.ARPA
Just a couple minor fixes to mh-e.el...
1. In mh-send the To: field is not filled in. This happens because in
mh-insert-fields a search-forward is done for (concat "\n" field-name)
which fails when the field is on the first line. Fix is to replace it
with a re-search-forward for (concat "^" field-name).
(defun mh-insert-fields (&rest name-values)
"Insert the NAME-VALUE pairs in the current buffer."
(let ((case-fold-search t))
(while name-values
(let ((field-name (car name-values))
(value (cadr name-values)))
(goto-char (dot-min))
! (cond ((not (re-search-forward (concat "^" field-name) nil t))
(search-forward "---")
(beginning-of-line)
(insert field-name " " value "\n"))
(t
(end-of-line)
(insert " " value)))
(setq name-values (cddr name-values))))))
2. There's no point in doing a redisplay of the last message when you
delete it. This happens in mh-next-line and is fixed by moving the
redisplay inside one more condition...
(defun mh-next-line (&optional arg)
"Move to next undeleted message in window and display body if summary
flag set."
(interactive "p")
(pop-to-buffer mh-folder-buffer)
(forward-line (if arg arg 1))
(if (not (re-search-forward "^....[^D^]" nil 0 arg))
(progn
(forward-line -1)
(message "No more messages"))
(beginning-of-line)
! (if (not mh-summarize) (mh-show))))
3. mh-previous-line doesn't work correctly, as it skips a line. Fixed
by ...
(defun mh-previous-line (&optional arg)
"Move to previous message in window and display body if summary flag set."
(interactive "p")
(pop-to-buffer mh-folder-buffer)
! (forward-line (- (if arg (1- arg) 0)))
(if (not (re-search-backward "^....[^D^]" nil 0 arg))
(message "Beginning of messages")
(if (not mh-summarize) (mh-show))))