diff options
author | Oleh Krehel <ohwoeowho@gmail.com> | 2015-10-14 11:19:21 +0200 |
---|---|---|
committer | Oleh Krehel <ohwoeowho@gmail.com> | 2015-10-14 11:24:08 +0200 |
commit | 0e38e94b1c4125951b198b213a67e010cafcd724 (patch) | |
tree | cbb6748441cf76c3cd6fafe760299eb9c3bb2bf7 /lisp/dired-x.el | |
parent | f147c0f3a5f32343b381e8412907235ade27a81d (diff) | |
download | emacs-0e38e94b1c4125951b198b213a67e010cafcd724.tar.gz |
Make dired-jump work with tar-subfile-mode
* lisp/dired-x.el (dired-jump): When in `tar-subfile-mode', instead of
emitting an error, switch to `tar-superior-buffer'.
Diffstat (limited to 'lisp/dired-x.el')
-rw-r--r-- | lisp/dired-x.el | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 1b6909141a6..b6704bb34fd 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -402,6 +402,7 @@ See variables `dired-texinfo-unclean-extensions', dired-tex-unclean-extensions (list ".dvi")))) +(defvar tar-superior-buffer) ;;; JUMP. ;;;###autoload @@ -416,30 +417,32 @@ Interactively with prefix argument, read FILE-NAME and move to its line in dired." (interactive (list nil (and current-prefix-arg - (read-file-name "Jump to Dired file: ")))) - (let* ((file (or file-name buffer-file-name)) - (dir (if file (file-name-directory file) default-directory))) - (if (and (eq major-mode 'dired-mode) (null file-name)) - (progn - (setq dir (dired-current-directory)) - (dired-up-directory other-window) - (unless (dired-goto-file dir) - ;; refresh and try again - (dired-insert-subdir (file-name-directory dir)) - (dired-goto-file dir))) - (if other-window - (dired-other-window dir) - (dired dir)) - (if file - (or (dired-goto-file file) + (read-file-name "Jump to Dired file: ")))) + (if (bound-and-true-p tar-subfile-mode) + (switch-to-buffer tar-superior-buffer) + (let* ((file (or file-name buffer-file-name)) + (dir (if file (file-name-directory file) default-directory))) + (if (and (eq major-mode 'dired-mode) (null file-name)) + (progn + (setq dir (dired-current-directory)) + (dired-up-directory other-window) + (unless (dired-goto-file dir) ;; refresh and try again - (progn - (dired-insert-subdir (file-name-directory file)) - (dired-goto-file file)) - ;; Toggle omitting, if it is on, and try again. - (when dired-omit-mode - (dired-omit-mode) - (dired-goto-file file))))))) + (dired-insert-subdir (file-name-directory dir)) + (dired-goto-file dir))) + (if other-window + (dired-other-window dir) + (dired dir)) + (if file + (or (dired-goto-file file) + ;; refresh and try again + (progn + (dired-insert-subdir (file-name-directory file)) + (dired-goto-file file)) + ;; Toggle omitting, if it is on, and try again. + (when dired-omit-mode + (dired-omit-mode) + (dired-goto-file file)))))))) ;;;###autoload (defun dired-jump-other-window (&optional file-name) |