summaryrefslogtreecommitdiff
path: root/lisp/dired-x.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/dired-x.el')
-rw-r--r--lisp/dired-x.el147
1 files changed, 13 insertions, 134 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 2f2a32e0a6b..b7ec41aa95f 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -137,13 +137,8 @@ folding to be used on case-insensitive filesystems only."
(file-name-case-insensitive-p dir)
dired-omit-case-fold))
-;; For backward compatibility
-(define-obsolete-variable-alias 'dired-omit-files-p 'dired-omit-mode "22.1")
(define-minor-mode dired-omit-mode
"Toggle omission of uninteresting files in Dired (Dired-Omit mode).
-With a prefix argument ARG, enable Dired-Omit mode if ARG is
-positive, and disable it otherwise. If called from Lisp, enable
-the mode if ARG is omitted or nil.
Dired-Omit mode is a buffer-local minor mode. When enabled in a
Dired buffer, Dired does not list files whose filenames match
@@ -164,7 +159,7 @@ See Info node `(dired-x) Omitting Variables' for more information."
(put 'dired-omit-mode 'safe-local-variable 'booleanp)
-(defcustom dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.$"
+(defcustom dired-omit-files "\\`[.]?#\\|\\`[.][.]?\\'"
"Filenames matching this regexp will not be displayed.
This only has effect when `dired-omit-mode' is t. See interactive function
`dired-omit-mode' (\\[dired-omit-mode]) and variable
@@ -194,21 +189,6 @@ toggle between those two."
:type 'boolean
:group 'dired-x)
-(defcustom dired-enable-local-variables t
- "Control use of local-variables lists in Dired.
-This temporarily overrides the value of `enable-local-variables' when
-listing a directory. See also `dired-local-variables-file'."
- :risky t
- :type '(choice (const :tag "Query Unsafe" t)
- (const :tag "Safe Only" :safe)
- (const :tag "Do all" :all)
- (const :tag "Ignore" nil)
- (other :tag "Query" other))
- :group 'dired-x)
-
-(make-obsolete-variable 'dired-enable-local-variables
- "use a standard `dir-locals-file' instead." "24.1")
-
(defcustom dired-guess-shell-gnutar
(catch 'found
(dolist (exe '("tar" "gtar"))
@@ -332,7 +312,6 @@ See also the functions:
`dired-do-find-marked-files'"
(interactive)
;; These must be done in each new dired buffer.
- (dired-hack-local-variables)
(dired-omit-startup))
@@ -466,6 +445,7 @@ See variables `dired-texinfo-unclean-extensions',
dired-tex-unclean-extensions
(list ".dvi"))))
+(defvar archive-superior-buffer)
(defvar tar-superior-buffer)
;;; JUMP.
@@ -482,8 +462,14 @@ Interactively with prefix argument, read FILE-NAME."
(interactive
(list nil (and current-prefix-arg
(read-file-name "Jump to Dired file: "))))
- (if (bound-and-true-p tar-subfile-mode)
- (switch-to-buffer tar-superior-buffer)
+ (cond
+ ((and (bound-and-true-p archive-subfile-mode)
+ (buffer-live-p archive-superior-buffer))
+ (switch-to-buffer archive-superior-buffer))
+ ((and (bound-and-true-p tar-subfile-mode)
+ (buffer-live-p tar-superior-buffer))
+ (switch-to-buffer tar-superior-buffer))
+ (t
;; Expand file-name before `dired-goto-file' call:
;; `dired-goto-file' requires its argument to be an absolute
;; file name; the result of `read-file-name' could be
@@ -511,7 +497,7 @@ Interactively with prefix argument, read FILE-NAME."
;; Toggle omitting, if it is on, and try again.
(when dired-omit-mode
(dired-omit-mode)
- (dired-goto-file file))))))))
+ (dired-goto-file file)))))))))
;;;###autoload
(defun dired-jump-other-window (&optional file-name)
@@ -787,34 +773,6 @@ Also useful for `auto-mode-alist' like this:
;; mechanism is provided for special handling of the working directory in
;; special major modes.
-(define-obsolete-variable-alias 'default-directory-alist
- 'dired-default-directory-alist "24.1")
-
-;; It's easier to add to this alist than redefine function
-;; default-directory while keeping the old information.
-(defconst dired-default-directory-alist
- '((dired-mode . (if (fboundp 'dired-current-directory)
- (dired-current-directory)
- default-directory)))
- "Alist of major modes and their opinion on `default-directory'.
-Each element has the form (MAJOR . EXPRESSION).
-The function `dired-default-directory' evaluates EXPRESSION to
-determine a default directory.")
-
-(put 'dired-default-directory-alist 'risky-local-variable t) ; gets eval'd
-(make-obsolete-variable 'dired-default-directory-alist
- "this feature is due to be removed." "24.1")
-
-(defun dired-default-directory ()
- "Return the `dired-default-directory-alist' entry for the current major-mode.
-If none, return `default-directory'."
- ;; It looks like this was intended to be something of a "general"
- ;; feature, but it only ever seems to have been used in
- ;; dired-smart-shell-command, and doesn't seem worth keeping around.
- (declare (obsolete nil "24.1"))
- (or (eval (cdr (assq major-mode dired-default-directory-alist)))
- default-directory))
-
(defun dired-smart-shell-command (command &optional output-buffer error-buffer)
"Like function `shell-command', but in the current Virtual Dired directory."
(interactive
@@ -831,85 +789,6 @@ If none, return `default-directory'."
(shell-command command output-buffer error-buffer)))
-;;; LOCAL VARIABLES FOR DIRED BUFFERS.
-
-;; Brief Description (This feature is obsolete as of Emacs 24.1)
-;;
-;; * `dired-extra-startup' is part of the `dired-mode-hook'.
-;;
-;; * `dired-extra-startup' calls `dired-hack-local-variables'
-;;
-;; * `dired-hack-local-variables' checks the value of
-;; `dired-local-variables-file'
-;;
-;; * Check if `dired-local-variables-file' is a non-nil string and is a
-;; filename found in the directory of the Dired Buffer being created.
-;;
-;; * If `dired-local-variables-file' satisfies the above, then temporarily
-;; include it in the Dired Buffer at the bottom.
-;;
-;; * Set `enable-local-variables' temporarily to the user variable
-;; `dired-enable-local-variables' and run `hack-local-variables' on the
-;; Dired Buffer.
-
-(defcustom dired-local-variables-file (convert-standard-filename ".dired")
- "Filename, as string, containing local Dired buffer variables to be hacked.
-If this file found in current directory, then it will be inserted into dired
-buffer and `hack-local-variables' will be run. See Info node
-`(emacs)File Variables' for more information on local variables.
-See also `dired-enable-local-variables'."
- :type 'file
- :group 'dired)
-
-(make-obsolete-variable 'dired-local-variables-file 'dir-locals-file "24.1")
-
-(defun dired-hack-local-variables ()
- "Evaluate local variables in `dired-local-variables-file' for Dired buffer."
- (declare (obsolete hack-dir-local-variables-non-file-buffer "24.1"))
- (and (stringp dired-local-variables-file)
- (file-exists-p dired-local-variables-file)
- (let ((opoint (point-max))
- (inhibit-read-only t)
- ;; In case user has `enable-local-variables' set to nil we
- ;; override it locally with dired's variable.
- (enable-local-variables dired-enable-local-variables))
- ;; Insert 'em.
- (save-excursion
- (goto-char opoint)
- (insert "\^L\n")
- (insert-file-contents dired-local-variables-file))
- ;; Hack 'em.
- (unwind-protect
- (let ((buffer-file-name dired-local-variables-file))
- (hack-local-variables))
- ;; Delete this stuff: `eobp' is used to find last subdir by dired.el.
- (delete-region opoint (point-max)))
- ;; Make sure that the mode line shows the proper information.
- (dired-sort-set-mode-line))))
-
-;; Does not seem worth a dedicated command.
-;; See the more general features in files-x.el.
-(defun dired-omit-here-always ()
- "Create `dir-locals-file' setting `dired-omit-mode' to t in `dired-mode'.
-If in a Dired buffer, reverts it."
- (declare (obsolete add-dir-local-variable "24.1"))
- (interactive)
- (if (file-exists-p dired-local-variables-file)
- (error "Old-style dired-local-variables-file `./%s' found;
-replace it with a dir-locals-file `./%s'"
- dired-local-variables-file
- dir-locals-file))
- (if (file-exists-p dir-locals-file)
- (message "File `./%s' already exists." dir-locals-file)
- (add-dir-local-variable 'dired-mode 'subdirs nil)
- (add-dir-local-variable 'dired-mode 'dired-omit-mode t)
- ;; Run extra-hooks and revert directory.
- (when (derived-mode-p 'dired-mode)
- (hack-dir-local-variables-non-file-buffer)
- (dired-extra-startup)
- (dired-revert))))
-
-
;;; GUESS SHELL COMMAND.
;; Brief Description:
@@ -1335,7 +1214,8 @@ displayed this way is restricted by the height of the current window and
To keep Dired buffer displayed, type \\[split-window-below] first.
To display just marked files, type \\[delete-other-windows] first."
(interactive "P")
- (dired-simultaneous-find-file (dired-get-marked-files) noselect))
+ (dired-simultaneous-find-file (dired-get-marked-files nil nil nil nil t)
+ noselect))
(defun dired-simultaneous-find-file (file-list noselect)
"Visit all files in FILE-LIST and display them simultaneously.
@@ -1718,7 +1598,6 @@ If `current-prefix-arg' is non-nil, uses name at point as guess."
(provide 'dired-x)
;; Local Variables:
-;; byte-compile-dynamic: t
;; generated-autoload-file: "dired-loaddefs.el"
;; End: