Function: dired-next-marked-file

dired-next-marked-file is an interactive and byte-compiled function defined in dired.el.gz.

Signature

(dired-next-marked-file ARG &optional WRAP OPOINT)

Documentation

Move to the ARGth next marked file.

ARG is the numeric prefix argument and defaults to 1. If WRAP is non-nil, which happens interactively, wrap around to the beginning of the buffer and search from there, if no marked file is found after this line. Optional argument OPOINT specifies the buffer position to return to if no ARGth marked file is found; it defaults to the position where this command was invoked.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/dired.el.gz
(defun dired-next-marked-file (arg &optional wrap opoint)
  "Move to the ARGth next marked file.
ARG is the numeric prefix argument and defaults to 1.
If WRAP is non-nil, which happens interactively, wrap around
to the beginning of the buffer and search from there, if no
marked file is found after this line.
Optional argument OPOINT specifies the buffer position to
return to if no ARGth marked file is found; it defaults to
the position where this command was invoked."
  (interactive "p\np")
  (or opoint (setq opoint (point)));; return to where interactively started
  (if (if (> arg 0)
	  (re-search-forward dired-re-mark nil t arg)
	(beginning-of-line)
	(re-search-backward dired-re-mark nil t (- arg)))
      (dired-move-to-filename)
    (if (null wrap)
	(progn
	  (goto-char opoint)
	  (error "No next marked file"))
      (message "(Wraparound for next marked file)")
      (goto-char (if (> arg 0) (point-min) (point-max)))
      (dired-next-marked-file arg nil opoint))))