aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1993-03-13 21:52:43 +0000
committerRichard M. Stallman1993-03-13 21:52:43 +0000
commitbb69479208e8adc9dc09f765d4c49651ec7dce89 (patch)
treeeefe89ac14baf6491a7f070f5f06bbbe9f3ab1d9 /lisp
parent7da64e5c76df71238bf6c1383a2c183bbbb7108c (diff)
downloademacs-bb69479208e8adc9dc09f765d4c49651ec7dce89.tar.gz
emacs-bb69479208e8adc9dc09f765d4c49651ec7dce89.zip
(rmail-summary-next-msg): Call display-buffer.
(rmail-summary-previous-all, rmail-summary-next-all): Likewise. (rmail-summary-rmail-update): Do nothing if rmail buffer not visible. (rmail-summary-mode-map): Don't bind C-n, C-p. Use ordinary move cmds.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mail/rmailsum.el55
1 files changed, 29 insertions, 26 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 6a3804e5ddc..7888e9799a0 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -323,11 +323,13 @@ nil for FUNCTION means all messages."
323 323
324(defun rmail-summary-next-all (&optional number) 324(defun rmail-summary-next-all (&optional number)
325 (interactive "p") 325 (interactive "p")
326 (forward-line (if number number 1))) 326 (forward-line (if number number 1))
327 (display-buffer rmail-buffer))
327 328
328(defun rmail-summary-previous-all (&optional number) 329(defun rmail-summary-previous-all (&optional number)
329 (interactive "p") 330 (interactive "p")
330 (forward-line (- (if number number 1)))) 331 (forward-line (- (if number number 1)))
332 (display-buffer rmail-buffer))
331 333
332(defun rmail-summary-next-msg (&optional number) 334(defun rmail-summary-next-msg (&optional number)
333 "Display next non-deleted msg from rmail file. 335 "Display next non-deleted msg from rmail file.
@@ -342,7 +344,8 @@ messages, or backward if NUMBER is negative."
342 (while (and (> count 0) (setq non-del-msg-found 344 (while (and (> count 0) (setq non-del-msg-found
343 (or (funcall search "^.....[^D]" nil t) 345 (or (funcall search "^.....[^D]" nil t)
344 non-del-msg-found))) 346 non-del-msg-found)))
345 (setq count (1- count))))) 347 (setq count (1- count))))
348 (display-buffer rmail-buffer))
346 349
347(defun rmail-summary-previous-msg (&optional number) 350(defun rmail-summary-previous-msg (&optional number)
348 (interactive "p") 351 (interactive "p")
@@ -478,29 +481,31 @@ Instead, all of the Rmail Mode commands are available, plus:
478 (add-hook 'post-command-hook 'rmail-summary-rmail-update) 481 (add-hook 'post-command-hook 'rmail-summary-rmail-update)
479 (run-hooks 'rmail-summary-mode-hook)) 482 (run-hooks 'rmail-summary-mode-hook))
480 483
481;; Show in Rmail the message described by the summary line that point is on. 484;; Show in Rmail the message described by the summary line that point is on,
485;; but only if the Rmail buffer is already visible.
482;; This is a post-command-hook in summary buffers. 486;; This is a post-command-hook in summary buffers.
483(defun rmail-summary-rmail-update () 487(defun rmail-summary-rmail-update ()
484 (let (buffer-read-only) 488 (if (get-buffer-window rmail-buffer)
485 (save-excursion 489 (let (buffer-read-only)
486 (beginning-of-line) 490 (save-excursion
487 (skip-chars-forward " ") 491 (beginning-of-line)
488 (let ((beg (point)) 492 (skip-chars-forward " ")
489 msg-num 493 (let ((beg (point))
490 (buf rmail-buffer)) 494 msg-num
491 (skip-chars-forward "0-9") 495 (buf rmail-buffer))
492 (setq msg-num (string-to-int (buffer-substring beg (point)))) 496 (skip-chars-forward "0-9")
493 (or (eq rmail-current-message msg-num) 497 (setq msg-num (string-to-int (buffer-substring beg (point))))
494 (progn 498 (or (eq rmail-current-message msg-num)
495 (setq rmail-current-message msg-num) 499 (progn
496 (if (= (following-char) ?-) 500 (setq rmail-current-message msg-num)
497 (progn 501 (if (= (following-char) ?-)
498 (delete-char 1) 502 (progn
499 (insert " "))) 503 (delete-char 1)
500 (setq window (display-buffer rmail-buffer)) 504 (insert " ")))
501 (save-window-excursion 505 (setq window (display-buffer rmail-buffer))
502 (select-window window) 506 (save-window-excursion
503 (rmail-show-message msg-num)))))))) 507 (select-window window)
508 (rmail-show-message msg-num)))))))))
504 509
505(defvar rmail-summary-mode-map nil) 510(defvar rmail-summary-mode-map nil)
506 511
@@ -528,13 +533,11 @@ Instead, all of the Rmail Mode commands are available, plus:
528 (define-key rmail-summary-mode-map "m" 'rmail-summary-mail) 533 (define-key rmail-summary-mode-map "m" 'rmail-summary-mail)
529 (define-key rmail-summary-mode-map "\M-m" 'rmail-summary-retry-failure) 534 (define-key rmail-summary-mode-map "\M-m" 'rmail-summary-retry-failure)
530 (define-key rmail-summary-mode-map "n" 'rmail-summary-next-msg) 535 (define-key rmail-summary-mode-map "n" 'rmail-summary-next-msg)
531 (define-key rmail-summary-mode-map "\C-n" 'rmail-summary-next-all)
532 (define-key rmail-summary-mode-map "\en" 'rmail-summary-next-all) 536 (define-key rmail-summary-mode-map "\en" 'rmail-summary-next-all)
533 (define-key rmail-summary-mode-map "\e\C-n" 'rmail-summary-next-labeled-message) 537 (define-key rmail-summary-mode-map "\e\C-n" 'rmail-summary-next-labeled-message)
534 (define-key rmail-summary-mode-map "o" 'rmail-summary-output-to-rmail-file) 538 (define-key rmail-summary-mode-map "o" 'rmail-summary-output-to-rmail-file)
535 (define-key rmail-summary-mode-map "\C-o" 'rmail-summary-output) 539 (define-key rmail-summary-mode-map "\C-o" 'rmail-summary-output)
536 (define-key rmail-summary-mode-map "p" 'rmail-summary-previous-msg) 540 (define-key rmail-summary-mode-map "p" 'rmail-summary-previous-msg)
537 (define-key rmail-summary-mode-map "\C-p" 'rmail-summary-previous-all)
538 (define-key rmail-summary-mode-map "\ep" 'rmail-summary-previous-all) 541 (define-key rmail-summary-mode-map "\ep" 'rmail-summary-previous-all)
539 (define-key rmail-summary-mode-map "\e\C-p" 'rmail-summary-previous-labeled-message) 542 (define-key rmail-summary-mode-map "\e\C-p" 'rmail-summary-previous-labeled-message)
540 (define-key rmail-summary-mode-map "q" 'rmail-summary-quit) 543 (define-key rmail-summary-mode-map "q" 'rmail-summary-quit)