Function: rmail-summary-next-same-subject

rmail-summary-next-same-subject is an interactive and byte-compiled function defined in rmailsum.el.gz.

Signature

(rmail-summary-next-same-subject N)

Documentation

Go to the next message in the summary having the same subject.

With prefix argument N, do this N times. If N is negative, go backwards.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mail/rmailsum.el.gz
(defun rmail-summary-next-same-subject (n)
  "Go to the next message in the summary having the same subject.
With prefix argument N, do this N times.
If N is negative, go backwards."
  (interactive "p")
  (let ((forward (> n 0))
	subject i found)
    (with-current-buffer rmail-buffer
      (setq subject (rmail-simplified-subject)
	    i rmail-current-message))
    (save-excursion
      (while (and (/= n 0)
		  (if forward
		      (not (eobp))
		    (not (bobp))))
	(let (done)
	  (while (and (not done)
		      (if forward
			  (not (eobp))
			(not (bobp))))
	    ;; Advance thru summary.
	    (forward-line (if forward 1 -1))
	    ;; Get msg number of this line.
	    (setq i (string-to-number
		     (buffer-substring (point)
				       (min (point-max) (+ 6 (point))))))
	    (setq done (string-equal subject (rmail-simplified-subject i))))
	  (if done (setq found i)))
	(setq n (if forward (1- n) (1+ n)))))
    (if found
	(rmail-summary-goto-msg found)
      (error "No %s message with same subject"
	     (if forward "following" "previous")))))