summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorErik Naggum <erik@naggum.no>1995-09-12 23:20:42 +0000
committerErik Naggum <erik@naggum.no>1995-09-12 23:20:42 +0000
commitac1ce3411f3021a3837d7c9f40fb3609816c2f83 (patch)
tree56c0283bef0841e069b16d7e378fe4e061666bac /lisp/dired.el
parentd23e6f972b5dc42dd678b703fc238d46db4d9ac6 (diff)
downloademacs-ac1ce3411f3021a3837d7c9f40fb3609816c2f83.tar.gz
(dired-up-directory): Add optional argument `other-window' to obviate
the need to redefine it in dired-x.el.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 8272ed9e0ff..8d6b4058e34 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1099,11 +1099,11 @@ Optional prefix ARG says how many lines to move; default is one line."
(interactive "p")
(dired-next-dirline (- arg)))
-(defun dired-up-directory ()
+(defun dired-up-directory (&optional other-window)
"Run dired on parent directory of current directory.
Find the parent directory either in this buffer or another buffer.
Creates a buffer if necessary."
- (interactive)
+ (interactive "P")
(let* ((dir (dired-current-directory))
(up (file-name-directory (directory-file-name dir))))
(or (dired-goto-file (directory-file-name dir))
@@ -1111,8 +1111,9 @@ Creates a buffer if necessary."
(and (cdr dired-subdir-alist)
(dired-goto-subdir up))
(progn
- (dired
-up)
+ (if other-window
+ (dired-other-window up)
+ (dired up))
(dired-goto-file dir)))))
;; Force `f' rather than `e' in the mode doc: