comparison lisp/mail/rmailsum.el @ 6762:f77de1e2b48b

(rmail-new-summary): Avoid unsafe save-restriction.
author Karl Heuer <kwzh@gnu.org>
date Sat, 09 Apr 1994 02:46:19 +0000
parents d6bc6057d197
children 666f11765323
comparison
equal deleted inserted replaced
6761:f1d73d12436e 6762:f77de1e2b48b
154 (setq mesg rmail-current-message) 154 (setq mesg rmail-current-message)
155 ;; Filter the messages; make or get their summary lines. 155 ;; Filter the messages; make or get their summary lines.
156 (let ((summary-msgs ()) 156 (let ((summary-msgs ())
157 (new-summary-line-count 0)) 157 (new-summary-line-count 0))
158 (let ((msgnum 1) 158 (let ((msgnum 1)
159 (buffer-read-only nil)) 159 (buffer-read-only nil)
160 (save-restriction 160 (old-min (point-min-marker))
161 (save-excursion 161 (old-max (point-max-marker)))
162 (widen) 162 ;; Can't use save-restriction here; that doesn't work if we
163 (goto-char (point-min)) 163 ;; plan to modify text outside the original restriction.
164 (while (>= rmail-total-messages msgnum) 164 (save-excursion
165 (if (or (null function) 165 (widen)
166 (apply function (cons msgnum args))) 166 (goto-char (point-min))
167 (setq summary-msgs 167 (while (>= rmail-total-messages msgnum)
168 (cons (cons msgnum (rmail-make-summary-line msgnum)) 168 (if (or (null function)
169 summary-msgs))) 169 (apply function (cons msgnum args)))
170 (setq msgnum (1+ msgnum))) 170 (setq summary-msgs
171 (setq summary-msgs (nreverse summary-msgs))))) 171 (cons (cons msgnum (rmail-make-summary-line msgnum))
172 summary-msgs)))
173 (setq msgnum (1+ msgnum)))
174 (setq summary-msgs (nreverse summary-msgs)))
175 (narrow-to-region old-min old-max))
172 ;; Temporarily, while summary buffer is unfinished, 176 ;; Temporarily, while summary buffer is unfinished,
173 ;; we "don't have" a summary. 177 ;; we "don't have" a summary.
174 (setq rmail-summary-buffer nil) 178 (setq rmail-summary-buffer nil)
175 (save-excursion 179 (save-excursion
176 (let ((rbuf (current-buffer)) 180 (let ((rbuf (current-buffer))