comparison lisp/mail/rmail.el @ 88133:aa85e6f55862

(rmail-msg-restore-non-pruned-header, rmail-msg-prune-header): Use the rmail message descriptor. (rmail-msgbeg, rmail-msgend): Even though these are deprecated, update them to DTRT for external callers.
author Paul Reilly <pmr@pajato.com>
date Tue, 18 Feb 2003 16:25:49 +0000
parents 5da4d43003a3
children 824f9f6f0df3
comparison
equal deleted inserted replaced
88132:7335eaf754d2 88133:aa85e6f55862
1289 (while (setq window (get-buffer-window rmail-summary-buffer)) 1289 (while (setq window (get-buffer-window rmail-summary-buffer))
1290 (quit-window nil window)) 1290 (quit-window nil window))
1291 (bury-buffer rmail-summary-buffer))) 1291 (bury-buffer rmail-summary-buffer)))
1292 (quit-window))) 1292 (quit-window)))
1293 1293
1294 ;;; mbox: not ready 1294 ;;; mbox: ready
1295 (defun rmail-duplicate-message () 1295 (defun rmail-duplicate-message ()
1296 "Create a duplicated copy of the current message. 1296 "Create a duplicated copy of the current message.
1297 The duplicate copy goes into the Rmail file just after the 1297 The duplicate copy goes into the Rmail file just after the
1298 original copy." 1298 original copy."
1299 (interactive) 1299 (interactive)
2008 "Determine if the headers for the current message are being 2008 "Determine if the headers for the current message are being
2009 displayed. If MSG is non-nil it will be used as the message number 2009 displayed. If MSG is non-nil it will be used as the message number
2010 instead of the current message." 2010 instead of the current message."
2011 (rmail-desc-get-header-display-state (or msg rmail-current-message))) 2011 (rmail-desc-get-header-display-state (or msg rmail-current-message)))
2012 2012
2013 ;; mbox: untested
2013 (defun rmail-msg-restore-non-pruned-header () 2014 (defun rmail-msg-restore-non-pruned-header ()
2014 (let ((old-point (point)) 2015 (let ((old-point (point))
2015 new-point 2016 new-point
2016 new-start 2017 new-start
2017 (inhibit-read-only t)) 2018 (inhibit-read-only t))
2018 (save-excursion 2019 (save-excursion
2019 (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max)) 2020 (narrow-to-region
2021 (rmail-desc-get-start rmail-current-message)
2022 (point-max))
2020 (goto-char (point-min)) 2023 (goto-char (point-min))
2021 (forward-line 1) 2024 (forward-line 1)
2022 ;; Change 1 to 0. 2025 ;; Change 1 to 0.
2023 (delete-char 1) 2026 (delete-char 1)
2024 (insert ?0) 2027 (insert ?0)
2042 ;; Narrow to after the new EOOH line. 2045 ;; Narrow to after the new EOOH line.
2043 (narrow-to-region new-start (point-max))) 2046 (narrow-to-region new-start (point-max)))
2044 (if new-point 2047 (if new-point
2045 (goto-char new-point)))) 2048 (goto-char new-point))))
2046 2049
2050 ;; mbox: untested
2047 (defun rmail-msg-prune-header () 2051 (defun rmail-msg-prune-header ()
2048 (let ((new-point 2052 (let ((new-point
2049 (= (point) (point-min)))) 2053 (= (point) (point-min))))
2050 (save-excursion 2054 (save-excursion
2051 (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max)) 2055 (narrow-to-region
2056 (rmail-desc-get-start rmail-current-message)
2057 (point-max))
2052 (rmail-reformat-message (point-min) (point-max))) 2058 (rmail-reformat-message (point-min) (point-max)))
2053 (if new-point 2059 (if new-point
2054 (goto-char (point-min))))) 2060 (goto-char (point-min)))))
2055 2061
2056 (defun rmail-toggle-header (&optional arg) 2062 (defun rmail-toggle-header (&optional arg)
2145 (forward-line 1) 2151 (forward-line 1)
2146 (re-search-backward labels (prog1 (point) (end-of-line)) t)))) 2152 (re-search-backward labels (prog1 (point) (end-of-line)) t))))
2147 2153
2148 ;;;; *** Rmail Message Selection And Support *** 2154 ;;;; *** Rmail Message Selection And Support ***
2149 2155
2156 ;; mbox: deprecated. -pmr
2150 (defun rmail-msgend (n) 2157 (defun rmail-msgend (n)
2151 (marker-position (aref rmail-message-vector (1+ n)))) 2158 (rmail-desc-get-start n))
2152 2159
2160 ;; mbox: deprecated. -pmr
2153 (defun rmail-msgbeg (n) 2161 (defun rmail-msgbeg (n)
2154 (marker-position (aref rmail-message-vector n))) 2162 (rmail-desc-get-end n))
2155 2163
2156 (defun rmail-widen-to-current-msgbeg (function) 2164 (defun rmail-widen-to-current-msgbeg (function)
2157 "Call FUNCTION with point at start of internal data of current message. 2165 "Call FUNCTION with point at start of internal data of current message.
2158 Assumes that bounds were previously narrowed to display the message in Rmail. 2166 Assumes that bounds were previously narrowed to display the message in Rmail.
2159 The bounds are widened enough to move point where desired, then narrowed 2167 The bounds are widened enough to move point where desired, then narrowed