1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-19 18:13:55 +00:00

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'.
This commit is contained in:
Oleh Krehel 2015-10-14 11:19:21 +02:00
parent f147c0f3a5
commit 0e38e94b1c

View File

@ -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)
(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
(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)))))))
(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)