diff options
| author | Karl Heuer | 1994-04-19 03:41:23 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-04-19 03:41:23 +0000 |
| commit | 10e09db421119f7b823ee11def1515dc85d0ef97 (patch) | |
| tree | 721f537b9a271847ab4f779ba337e10bae8bd91a | |
| parent | 04645d5fb30e4855a2d3041282bb31173a4ee75b (diff) | |
| download | emacs-10e09db421119f7b823ee11def1515dc85d0ef97.tar.gz emacs-10e09db421119f7b823ee11def1515dc85d0ef97.zip | |
(rmail-summary-rmail-update): Update rmail buffer even if it isn't displayed.
| -rw-r--r-- | lisp/mail/rmailsum.el | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 19f72b00a1f..2a80ff4469c 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el | |||
| @@ -548,34 +548,36 @@ Commands for sorting the summary: | |||
| 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 | ||