Mercurial > emacs
changeset 88135:3c2c324caf38
(rmail-sort-by-lines, rmail-fetch-field): Use the rmail message
descriptor instead of deprecated functions.
(rmail-sort-messages): Overhaul to use mbox format.
author | Paul Reilly <pmr@pajato.com> |
---|---|
date | Tue, 18 Feb 2003 16:40:21 +0000 |
parents | abff0bc9014b |
children | 31edc813b710 |
files | lisp/mail/rmailsort.el |
diffstat | 1 files changed, 13 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/mail/rmailsort.el Tue Feb 18 16:28:30 2003 +0000 +++ b/lisp/mail/rmailsort.el Tue Feb 18 16:40:21 2003 +0000 @@ -121,8 +121,8 @@ (rmail-sort-messages reverse (function (lambda (msg) - (count-lines (rmail-msgbeg msg) - (rmail-msgend msg)))))) + (count-lines (rmail-desc-get-start msg) + (rmail-desc-get-end msg)))))) ;;;###autoload (defun rmail-sort-by-labels (reverse labels) @@ -167,14 +167,15 @@ (predicate nil) ;< or string-lessp (sort-lists nil)) (message "Finding sort keys...") + (rmail-header-show-headers) (widen) (let ((msgnum 1)) (while (>= rmail-total-messages msgnum) (setq sort-lists (cons (list (funcall keyfun msgnum) ;Make sorting key (eq rmail-current-message msgnum) ;True if current - (aref rmail-message-vector msgnum) - (aref rmail-message-vector (1+ msgnum))) + (rmail-desc-get-marker-start msgnum) + (rmail-desc-get-marker-end msgnum)) sort-lists)) (if (zerop (% msgnum 10)) (message "Finding sort keys...%d" msgnum)) @@ -198,7 +199,7 @@ (msginfo nil)) ;; There's little hope that we can easily undo after that. (buffer-disable-undo (current-buffer)) - (goto-char (rmail-msgbeg 1)) + (goto-char (rmail-desc-get-start 1)) ;; To force update of all markers. (insert-before-markers ?Z) (backward-char 1) @@ -220,26 +221,23 @@ (delete-char 1) (setq quit-flag nil) (buffer-enable-undo) - (rmail-set-message-counters) + (goto-char (point-min)) + (rmail-initialize-messages) (rmail-show-message current-message) - (goto-char (+ point-offset (point-min))) (if (rmail-summary-exists) (rmail-select-summary (rmail-update-summary))))))) +;; mbox: ready (defun rmail-fetch-field (msg field) "Return the value of the header FIELD of MSG. Arguments are MSG and FIELD." (save-restriction (widen) - (let ((next (rmail-msgend msg))) - (goto-char (rmail-msgbeg msg)) - (narrow-to-region (if (search-forward "\n*** EOOH ***\n" next t) - (point) - (forward-line 1) - (point)) - (progn (search-forward "\n\n" nil t) (point))) - (mail-fetch-field field)))) + (narrow-to-region + (rmail-desc-get-start msg) + (rmail-desc-get-end msg)) + (rmail-header-get-header field))) (defun rmail-make-date-sortable (date) "Make DATE sortable using the function string-lessp."