comparison lisp/efs/dired.el @ 187:b405438285a2 r20-3b20

Import from CVS: tag r20-3b20
author cvs
date Mon, 13 Aug 2007 09:56:28 +0200
parents e121b013d1f0
children 850242ba4a81
comparison
equal deleted inserted replaced
186:24ac94803b48 187:b405438285a2
2205 ;;;; -------------------------------------------------------------- 2205 ;;;; --------------------------------------------------------------
2206 2206
2207 (defun dired-next-line (arg) 2207 (defun dired-next-line (arg)
2208 "Move down lines then position at filename. 2208 "Move down lines then position at filename.
2209 Optional prefix ARG says how many lines to move; default is one line." 2209 Optional prefix ARG says how many lines to move; default is one line."
2210 (interactive "p") 2210 (interactive "_p")
2211 (condition-case err 2211 (condition-case err
2212 (next-line arg) 2212 (next-line arg)
2213 (error 2213 (error
2214 (if (eobp) 2214 (if (eobp)
2215 (error "End of buffer") 2215 (error "End of buffer")
2218 (dired-update-mode-line)) 2218 (dired-update-mode-line))
2219 2219
2220 (defun dired-previous-line (arg) 2220 (defun dired-previous-line (arg)
2221 "Move up lines then position at filename. 2221 "Move up lines then position at filename.
2222 Optional prefix ARG says how many lines to move; default is one line." 2222 Optional prefix ARG says how many lines to move; default is one line."
2223 (interactive "p") 2223 (interactive "_p")
2224 (previous-line arg) 2224 (previous-line arg)
2225 (dired-move-to-filename) 2225 (dired-move-to-filename)
2226 (dired-update-mode-line)) 2226 (dired-update-mode-line))
2227 2227
2228 (defun dired-scroll-up (arg) 2228 (defun dired-scroll-up (arg)
2229 "Dired version of scroll up. 2229 "Dired version of scroll up.
2230 Scroll text of current window upward ARG lines; or near full screen if no ARG. 2230 Scroll text of current window upward ARG lines; or near full screen if no ARG.
2231 When calling from a program, supply a number as argument or nil." 2231 When calling from a program, supply a number as argument or nil."
2232 (interactive "P") 2232 (interactive "_P")
2233 (scroll-up arg) 2233 (scroll-up arg)
2234 (dired-move-to-filename) 2234 (dired-move-to-filename)
2235 (dired-update-mode-line)) 2235 (dired-update-mode-line))
2236 2236
2237 (defun dired-scroll-down (arg) 2237 (defun dired-scroll-down (arg)
2238 "Dired version of scroll-down. 2238 "Dired version of scroll-down.
2239 Scroll text of current window down ARG lines; or near full screen if no ARG. 2239 Scroll text of current window down ARG lines; or near full screen if no ARG.
2240 When calling from a program, supply a number as argument or nil." 2240 When calling from a program, supply a number as argument or nil."
2241 (interactive "P") 2241 (interactive "_P")
2242 (scroll-down arg) 2242 (scroll-down arg)
2243 (dired-move-to-filename) 2243 (dired-move-to-filename)
2244 (dired-update-mode-line)) 2244 (dired-update-mode-line))
2245 2245
2246 (defun dired-beginning-of-buffer (arg) 2246 (defun dired-beginning-of-buffer (arg)
2247 "Dired version of `beginning of buffer'." 2247 "Dired version of `beginning of buffer'."
2248 (interactive "P") 2248 (interactive "_P")
2249 (beginning-of-buffer arg) 2249 (beginning-of-buffer arg)
2250 (dired-update-mode-line)) 2250 (dired-update-mode-line))
2251 2251
2252 (defun dired-end-of-buffer (arg) 2252 (defun dired-end-of-buffer (arg)
2253 "Dired version of `end-of-buffer'." 2253 "Dired version of `end-of-buffer'."
2254 (interactive "P") 2254 (interactive "_P")
2255 (end-of-buffer arg) 2255 (end-of-buffer arg)
2256 (while (not (or (dired-move-to-filename) (dired-get-subdir) (bobp))) 2256 (while (not (or (dired-move-to-filename) (dired-get-subdir) (bobp)))
2257 (forward-line -1)) 2257 (forward-line -1))
2258 (dired-update-mode-line t)) 2258 (dired-update-mode-line t))
2259 2259
2260 (defun dired-next-dirline (arg &optional opoint) 2260 (defun dired-next-dirline (arg &optional opoint)
2261 "Goto ARG'th next directory file line." 2261 "Goto ARG'th next directory file line."
2262 (interactive "p") 2262 (interactive "_p")
2263 (if dired-re-dir 2263 (if dired-re-dir
2264 (progn 2264 (progn
2265 (dired-check-ls-l) 2265 (dired-check-ls-l)
2266 (or opoint (setq opoint (point))) 2266 (or opoint (setq opoint (point)))
2267 (if (if (> arg 0) 2267 (if (if (> arg 0)
2274 (goto-char opoint) 2274 (goto-char opoint)
2275 (error "No more subdirectories"))))) 2275 (error "No more subdirectories")))))
2276 2276
2277 (defun dired-prev-dirline (arg) 2277 (defun dired-prev-dirline (arg)
2278 "Goto ARG'th previous directory file line." 2278 "Goto ARG'th previous directory file line."
2279 (interactive "p") 2279 (interactive "_p")
2280 (dired-next-dirline (- arg))) 2280 (dired-next-dirline (- arg)))
2281 2281
2282 (defun dired-next-marked-file (arg &optional wrap opoint) 2282 (defun dired-next-marked-file (arg &optional wrap opoint)
2283 "Move to the next marked file, wrapping around the end of the buffer." 2283 "Move to the next marked file, wrapping around the end of the buffer."
2284 (interactive "p\np") 2284 (interactive "_p\np")
2285 (or opoint (setq opoint (point))) ; return to where interactively started 2285 (or opoint (setq opoint (point))) ; return to where interactively started
2286 (if (if (> arg 0) 2286 (if (if (> arg 0)
2287 (re-search-forward dired-re-mark nil t arg) 2287 (re-search-forward dired-re-mark nil t arg)
2288 (beginning-of-line) 2288 (beginning-of-line)
2289 (re-search-backward dired-re-mark nil t (- arg))) 2289 (re-search-backward dired-re-mark nil t (- arg)))
2297 (dired-next-marked-file arg nil opoint))) 2297 (dired-next-marked-file arg nil opoint)))
2298 (dired-update-mode-line)) 2298 (dired-update-mode-line))
2299 2299
2300 (defun dired-prev-marked-file (arg &optional wrap) 2300 (defun dired-prev-marked-file (arg &optional wrap)
2301 "Move to the previous marked file, wrapping around the end of the buffer." 2301 "Move to the previous marked file, wrapping around the end of the buffer."
2302 (interactive "p\np") 2302 (interactive "_p\np")
2303 (dired-next-marked-file (- arg) wrap) 2303 (dired-next-marked-file (- arg) wrap)
2304 (dired-update-mode-line)) 2304 (dired-update-mode-line))
2305 2305
2306 (defun dired-goto-file (file) 2306 (defun dired-goto-file (file)
2307 "Goto file line of FILE in this dired buffer." 2307 "Goto file line of FILE in this dired buffer."