*** /usr/src/emacs/lisp/dired.el Wed Jul 14 18:59:08 2004 --- /home/tzz/emacs/mine/dired.el Mon Sep 13 15:09:54 2004 *************** *** 215,220 **** --- 215,227 ---- :type '(alist :key-type regexp :value-type string) :version "21.4") + ;; should we use next-error support? + (defcustom dired-next-error-support nil + "Specifies whether Dired should support the next-error + framework." + :group 'dired + :type 'boolean) + ;; Internal variables (defvar dired-marker-char ?* ; the answer is 42 *************** *** 1397,1402 **** --- 1404,1411 ---- selective-display t ; for subdirectory hiding mode-line-buffer-identification (propertized-buffer-identification "%17b")) + (when dired-next-error-support + (setq next-error-function 'dired-next-error)) (set (make-local-variable 'revert-buffer-function) (function dired-revert)) (set (make-local-variable 'buffer-stale-function) *************** *** 1450,1455 **** --- 1459,1490 ---- (message "Change in Dired buffer undone. Actual changes in files cannot be undone by Emacs.")) + (defun dired-next-error (&optional argp reset) + "Move to the ARGP (default 1) next match in an Dired mode buffer. + When RESET is given, starts from the beginning. + Compatibility function for \\[next-error] invocations." + (interactive "p") + + (when reset + ;; go to beginning of buffer + (goto-char (point-min))) + + (dired-next-error-move-n-file-lines + (prefix-numeric-value argp)) + + ;; visit file if possible + (when (dired-get-filename nil t) + (dired-find-file))) + + (defun dired-next-error-move-n-file-lines (argp) + "Move ARGP file lines from the current line. + File lines are lines with a file listed in them. + ONLY SUPPORT POSITIVE MOTION FOR NOW" + (when (> argp 0) + (dotimes (n argp) + (forward-line 1) + (dired-goto-next-nontrivial-file)))) + (defun dired-next-line (arg) "Move down lines then position at filename. Optional prefix ARG says how many lines to move; default is one line."