diff options
| author | Glenn Morris | 2011-11-13 17:43:50 -0800 |
|---|---|---|
| committer | Glenn Morris | 2011-11-13 17:43:50 -0800 |
| commit | 71e027ac2d510f3616fe8d0572376c2d7f91c2f8 (patch) | |
| tree | eeab59c5453bdc10b7606dc1c9910f909f69c315 /lisp | |
| parent | d7cecd19b3e4cf7a4c33145397900fb10f2cd698 (diff) | |
| download | emacs-71e027ac2d510f3616fe8d0572376c2d7f91c2f8.tar.gz emacs-71e027ac2d510f3616fe8d0572376c2d7f91c2f8.zip | |
Rmail summary fixes for empty summaries.
* lisp/mail/rmailsum.el (rmail-summary, rmail-new-summary)
(rmail-new-summary-1): Allow empty summaries.
(rmail-new-summary): Remember that rmail-summary-buffer is buffer-local.
Fixes: debbugs:9964
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/mail/rmailsum.el | 21 |
2 files changed, 15 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8f28e033419..676c0c6b180 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-11-14 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * mail/rmailsum.el (rmail-summary, rmail-new-summary) | ||
| 4 | (rmail-new-summary-1): Allow empty summaries. (Bug#9964) | ||
| 5 | (rmail-new-summary): Remember that rmail-summary-buffer is buffer-local. | ||
| 6 | |||
| 1 | 2011-11-12 Martin Rudalics <rudalics@gmx.at> | 7 | 2011-11-12 Martin Rudalics <rudalics@gmx.at> |
| 2 | 8 | ||
| 3 | * window.el (window-resize, delete-window): Use window-splits | 9 | * window.el (window-resize, delete-window): Use window-splits |
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 8e28201e31f..b95651d3b69 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el | |||
| @@ -269,7 +269,8 @@ Setting this option to nil might speed up the generation of summaries." | |||
| 269 | "Display a summary of all messages, one line per message." | 269 | "Display a summary of all messages, one line per message." |
| 270 | (interactive) | 270 | (interactive) |
| 271 | (rmail-new-summary "All" '(rmail-summary) nil) | 271 | (rmail-new-summary "All" '(rmail-summary) nil) |
| 272 | (unless (get-buffer-window rmail-buffer) | 272 | (unless (or (zerop (buffer-size)) ; empty summary |
| 273 | (get-buffer-window rmail-buffer)) | ||
| 273 | (rmail-summary-beginning-of-message))) | 274 | (rmail-summary-beginning-of-message))) |
| 274 | 275 | ||
| 275 | ;;;###autoload | 276 | ;;;###autoload |
| @@ -404,13 +405,13 @@ nil for FUNCTION means all messages." | |||
| 404 | (message "Computing summary lines...") | 405 | (message "Computing summary lines...") |
| 405 | (unless rmail-buffer | 406 | (unless rmail-buffer |
| 406 | (error "No RMAIL buffer found")) | 407 | (error "No RMAIL buffer found")) |
| 407 | (let (mesg was-in-summary) | 408 | (let (mesg was-in-summary sumbuf) |
| 408 | (if (eq major-mode 'rmail-summary-mode) | 409 | (if (eq major-mode 'rmail-summary-mode) |
| 409 | (setq was-in-summary t)) | 410 | (setq was-in-summary t)) |
| 410 | (with-current-buffer rmail-buffer | 411 | (with-current-buffer rmail-buffer |
| 411 | (if (zerop (setq mesg rmail-current-message)) | 412 | (setq rmail-summary-buffer (rmail-new-summary-1 desc redo func args) |
| 412 | (error "No messages to summarize")) | 413 | ;; r-s-b is buffer-local. |
| 413 | (setq rmail-summary-buffer (rmail-new-summary-1 desc redo func args))) | 414 | sumbuf rmail-summary-buffer)) |
| 414 | ;; Now display the summary buffer and go to the right place in it. | 415 | ;; Now display the summary buffer and go to the right place in it. |
| 415 | (unless was-in-summary | 416 | (unless was-in-summary |
| 416 | (if (and (one-window-p) | 417 | (if (and (one-window-p) |
| @@ -420,13 +421,12 @@ nil for FUNCTION means all messages." | |||
| 420 | (progn | 421 | (progn |
| 421 | (split-window (selected-window) rmail-summary-window-size) | 422 | (split-window (selected-window) rmail-summary-window-size) |
| 422 | (select-window (next-window (frame-first-window))) | 423 | (select-window (next-window (frame-first-window))) |
| 423 | (rmail-pop-to-buffer rmail-summary-buffer) | 424 | (rmail-pop-to-buffer sumbuf) |
| 424 | ;; If pop-to-buffer did not use that window, delete that | 425 | ;; If pop-to-buffer did not use that window, delete that |
| 425 | ;; window. (This can happen if it uses another frame.) | 426 | ;; window. (This can happen if it uses another frame.) |
| 426 | (if (not (eq rmail-summary-buffer | 427 | (if (not (eq sumbuf (window-buffer (frame-first-window)))) |
| 427 | (window-buffer (frame-first-window)))) | ||
| 428 | (delete-other-windows))) | 428 | (delete-other-windows))) |
| 429 | (rmail-pop-to-buffer rmail-summary-buffer)) | 429 | (rmail-pop-to-buffer sumbuf)) |
| 430 | (set-buffer rmail-buffer) | 430 | (set-buffer rmail-buffer) |
| 431 | ;; This is how rmail makes the summary buffer reappear. | 431 | ;; This is how rmail makes the summary buffer reappear. |
| 432 | ;; We do this here to make the window the proper size. | 432 | ;; We do this here to make the window the proper size. |
| @@ -490,9 +490,6 @@ message." | |||
| 490 | ;; Temporarily, while summary buffer is unfinished, | 490 | ;; Temporarily, while summary buffer is unfinished, |
| 491 | ;; we "don't have" a summary. | 491 | ;; we "don't have" a summary. |
| 492 | (setq rmail-summary-buffer nil) | 492 | (setq rmail-summary-buffer nil) |
| 493 | (unless summary-msgs | ||
| 494 | (kill-buffer sumbuf) | ||
| 495 | (error "Nothing to summarize")) | ||
| 496 | ;; I have not a clue what this clause is doing. If you read this | 493 | ;; I have not a clue what this clause is doing. If you read this |
| 497 | ;; chunk of code and have a clue, then please email that clue to | 494 | ;; chunk of code and have a clue, then please email that clue to |
| 498 | ;; pmr@pajato.com | 495 | ;; pmr@pajato.com |