comparison lisp/mail/rmailsum.el @ 6961:666f11765323

(rmail-summary-rmail-update): Update rmail buffer even if it isn't displayed.
author Karl Heuer <kwzh@gnu.org>
date Tue, 19 Apr 1994 03:41:23 +0000
parents f77de1e2b48b
children e3d392f28d8f
comparison
equal deleted inserted replaced
6960:1371d69e89bb 6961:666f11765323
546 546
547 ;; Show in Rmail the message described by the summary line that point is on, 547 ;; Show in Rmail the message described by the summary line that point is on,
548 ;; but only if the Rmail buffer is already visible. 548 ;; but only if the Rmail buffer is already visible.
549 ;; This is a post-command-hook in summary buffers. 549 ;; This is a post-command-hook in summary buffers.
550 (defun rmail-summary-rmail-update () 550 (defun rmail-summary-rmail-update ()
551 (if (get-buffer-window rmail-buffer) 551 (let (buffer-read-only)
552 (let (buffer-read-only) 552 (save-excursion
553 (save-excursion 553 ;; If at end of buffer, pretend we are on the last text line.
554 ;; If at end of buffer, pretend we are on the last text line. 554 (if (eobp)
555 (if (eobp) 555 (forward-line -1))
556 (forward-line -1)) 556 (beginning-of-line)
557 (beginning-of-line) 557 (skip-chars-forward " ")
558 (skip-chars-forward " ") 558 (let ((msg-num (string-to-int (buffer-substring
559 (let ((beg (point)) 559 (point)
560 msg-num 560 (progn (skip-chars-forward "0-9")
561 (buf rmail-buffer)) 561 (point))))))
562 (skip-chars-forward "0-9") 562 (or (eq rmail-current-message msg-num)
563 (setq msg-num (string-to-int (buffer-substring beg (point)))) 563 (let ((window (get-buffer-window rmail-buffer))
564 (or (eq rmail-current-message msg-num) 564 (owin (selected-window)))
565 (let (go-where window (owin (selected-window))) 565 (setq rmail-current-message msg-num)
566 (setq rmail-current-message msg-num) 566 (if (= (following-char) ?-)
567 (if (= (following-char) ?-) 567 (progn
568 (progn 568 (delete-char 1)
569 (delete-char 1) 569 (insert " ")))
570 (insert " "))) 570 (if window
571 (setq window (display-buffer rmail-buffer)) 571 ;; Using save-window-excursion would cause the new value
572 ;; Using save-window-excursion caused the new value
573 ;; of point to get lost. 572 ;; of point to get lost.
574 (unwind-protect 573 (unwind-protect
575 (progn 574 (progn
576 (select-window window) 575 (select-window window)
577 (rmail-show-message msg-num)) 576 (rmail-show-message msg-num))
578 (select-window owin))))))))) 577 (select-window owin))
578 (save-excursion
579 (set-buffer rmail-buffer)
580 (rmail-show-message msg-num)))))))))
579 581
580 (defvar rmail-summary-mode-map nil) 582 (defvar rmail-summary-mode-map nil)
581 583
582 (if rmail-summary-mode-map 584 (if rmail-summary-mode-map
583 nil 585 nil