Commit bb694792 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(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.
parent 7da64e5c
...@@ -323,11 +323,13 @@ nil for FUNCTION means all messages." ...@@ -323,11 +323,13 @@ nil for FUNCTION means all messages."
(defun rmail-summary-next-all (&optional number) (defun rmail-summary-next-all (&optional number)
(interactive "p") (interactive "p")
(forward-line (if number number 1))) (forward-line (if number number 1))
(display-buffer rmail-buffer))
(defun rmail-summary-previous-all (&optional number) (defun rmail-summary-previous-all (&optional number)
(interactive "p") (interactive "p")
(forward-line (- (if number number 1)))) (forward-line (- (if number number 1)))
(display-buffer rmail-buffer))
(defun rmail-summary-next-msg (&optional number) (defun rmail-summary-next-msg (&optional number)
"Display next non-deleted msg from rmail file. "Display next non-deleted msg from rmail file.
...@@ -342,7 +344,8 @@ messages, or backward if NUMBER is negative." ...@@ -342,7 +344,8 @@ messages, or backward if NUMBER is negative."
(while (and (> count 0) (setq non-del-msg-found (while (and (> count 0) (setq non-del-msg-found
(or (funcall search "^.....[^D]" nil t) (or (funcall search "^.....[^D]" nil t)
non-del-msg-found))) non-del-msg-found)))
(setq count (1- count))))) (setq count (1- count))))
(display-buffer rmail-buffer))
(defun rmail-summary-previous-msg (&optional number) (defun rmail-summary-previous-msg (&optional number)
(interactive "p") (interactive "p")
...@@ -478,29 +481,31 @@ Instead, all of the Rmail Mode commands are available, plus: ...@@ -478,29 +481,31 @@ Instead, all of the Rmail Mode commands are available, plus:
(add-hook 'post-command-hook 'rmail-summary-rmail-update) (add-hook 'post-command-hook 'rmail-summary-rmail-update)
(run-hooks 'rmail-summary-mode-hook)) (run-hooks 'rmail-summary-mode-hook))
;; Show in Rmail the message described by the summary line that point is on. ;; Show in Rmail the message described by the summary line that point is on,
;; but only if the Rmail buffer is already visible.
;; This is a post-command-hook in summary buffers. ;; This is a post-command-hook in summary buffers.
(defun rmail-summary-rmail-update () (defun rmail-summary-rmail-update ()
(let (buffer-read-only) (if (get-buffer-window rmail-buffer)
(save-excursion (let (buffer-read-only)
(beginning-of-line) (save-excursion
(skip-chars-forward " ") (beginning-of-line)
(let ((beg (point)) (skip-chars-forward " ")
msg-num (let ((beg (point))
(buf rmail-buffer)) msg-num
(skip-chars-forward "0-9") (buf rmail-buffer))
(setq msg-num (string-to-int (buffer-substring beg (point)))) (skip-chars-forward "0-9")
(or (eq rmail-current-message msg-num) (setq msg-num (string-to-int (buffer-substring beg (point))))
(progn (or (eq rmail-current-message msg-num)
(setq rmail-current-message msg-num) (progn
(if (= (following-char) ?-) (setq rmail-current-message msg-num)
(progn (if (= (following-char) ?-)
(delete-char 1) (progn
(insert " "))) (delete-char 1)
(setq window (display-buffer rmail-buffer)) (insert " ")))
(save-window-excursion (setq window (display-buffer rmail-buffer))
(select-window window) (save-window-excursion
(rmail-show-message msg-num)))))))) (select-window window)
(rmail-show-message msg-num)))))))))
(defvar rmail-summary-mode-map nil) (defvar rmail-summary-mode-map nil)
...@@ -528,13 +533,11 @@ Instead, all of the Rmail Mode commands are available, plus: ...@@ -528,13 +533,11 @@ Instead, all of the Rmail Mode commands are available, plus:
(define-key rmail-summary-mode-map "m" 'rmail-summary-mail) (define-key rmail-summary-mode-map "m" 'rmail-summary-mail)
(define-key rmail-summary-mode-map "\M-m" 'rmail-summary-retry-failure) (define-key rmail-summary-mode-map "\M-m" 'rmail-summary-retry-failure)
(define-key rmail-summary-mode-map "n" 'rmail-summary-next-msg) (define-key rmail-summary-mode-map "n" 'rmail-summary-next-msg)
(define-key rmail-summary-mode-map "\C-n" 'rmail-summary-next-all)
(define-key rmail-summary-mode-map "\en" 'rmail-summary-next-all) (define-key rmail-summary-mode-map "\en" 'rmail-summary-next-all)
(define-key rmail-summary-mode-map "\e\C-n" 'rmail-summary-next-labeled-message) (define-key rmail-summary-mode-map "\e\C-n" 'rmail-summary-next-labeled-message)
(define-key rmail-summary-mode-map "o" 'rmail-summary-output-to-rmail-file) (define-key rmail-summary-mode-map "o" 'rmail-summary-output-to-rmail-file)
(define-key rmail-summary-mode-map "\C-o" 'rmail-summary-output) (define-key rmail-summary-mode-map "\C-o" 'rmail-summary-output)
(define-key rmail-summary-mode-map "p" 'rmail-summary-previous-msg) (define-key rmail-summary-mode-map "p" 'rmail-summary-previous-msg)
(define-key rmail-summary-mode-map "\C-p" 'rmail-summary-previous-all)
(define-key rmail-summary-mode-map "\ep" 'rmail-summary-previous-all) (define-key rmail-summary-mode-map "\ep" 'rmail-summary-previous-all)
(define-key rmail-summary-mode-map "\e\C-p" 'rmail-summary-previous-labeled-message) (define-key rmail-summary-mode-map "\e\C-p" 'rmail-summary-previous-labeled-message)
(define-key rmail-summary-mode-map "q" 'rmail-summary-quit) (define-key rmail-summary-mode-map "q" 'rmail-summary-quit)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment