aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleh Krehel2015-10-14 11:19:21 +0200
committerOleh Krehel2015-10-14 11:24:08 +0200
commit0e38e94b1c4125951b198b213a67e010cafcd724 (patch)
treecbb6748441cf76c3cd6fafe760299eb9c3bb2bf7
parentf147c0f3a5f32343b381e8412907235ade27a81d (diff)
downloademacs-0e38e94b1c4125951b198b213a67e010cafcd724.tar.gz
emacs-0e38e94b1c4125951b198b213a67e010cafcd724.zip
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'.
-rw-r--r--lisp/dired-x.el49
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',
402 dired-tex-unclean-extensions 402 dired-tex-unclean-extensions
403 (list ".dvi")))) 403 (list ".dvi"))))
404 404
405(defvar tar-superior-buffer)
405;;; JUMP. 406;;; JUMP.
406 407
407;;;###autoload 408;;;###autoload
@@ -416,30 +417,32 @@ Interactively with prefix argument, read FILE-NAME and
416move to its line in dired." 417move to its line in dired."
417 (interactive 418 (interactive
418 (list nil (and current-prefix-arg 419 (list nil (and current-prefix-arg
419 (read-file-name "Jump to Dired file: ")))) 420 (read-file-name "Jump to Dired file: "))))
420 (let* ((file (or file-name buffer-file-name)) 421 (if (bound-and-true-p tar-subfile-mode)
421 (dir (if file (file-name-directory file) default-directory))) 422 (switch-to-buffer tar-superior-buffer)
422 (if (and (eq major-mode 'dired-mode) (null file-name)) 423 (let* ((file (or file-name buffer-file-name))
423 (progn 424 (dir (if file (file-name-directory file) default-directory)))
424 (setq dir (dired-current-directory)) 425 (if (and (eq major-mode 'dired-mode) (null file-name))
425 (dired-up-directory other-window) 426 (progn
426 (unless (dired-goto-file dir) 427 (setq dir (dired-current-directory))
427 ;; refresh and try again 428 (dired-up-directory other-window)
428 (dired-insert-subdir (file-name-directory dir)) 429 (unless (dired-goto-file dir)
429 (dired-goto-file dir)))
430 (if other-window
431 (dired-other-window dir)
432 (dired dir))
433 (if file
434 (or (dired-goto-file file)
435 ;; refresh and try again 430 ;; refresh and try again
436 (progn 431 (dired-insert-subdir (file-name-directory dir))
437 (dired-insert-subdir (file-name-directory file)) 432 (dired-goto-file dir)))
438 (dired-goto-file file)) 433 (if other-window
439 ;; Toggle omitting, if it is on, and try again. 434 (dired-other-window dir)
440 (when dired-omit-mode 435 (dired dir))
441 (dired-omit-mode) 436 (if file
442 (dired-goto-file file))))))) 437 (or (dired-goto-file file)
438 ;; refresh and try again
439 (progn
440 (dired-insert-subdir (file-name-directory file))
441 (dired-goto-file file))
442 ;; Toggle omitting, if it is on, and try again.
443 (when dired-omit-mode
444 (dired-omit-mode)
445 (dired-goto-file file))))))))
443 446
444;;;###autoload 447;;;###autoload
445(defun dired-jump-other-window (&optional file-name) 448(defun dired-jump-other-window (&optional file-name)