Remove obsolete objects from dired-x.el
* doc/misc/dired-x.texi (Local Variables): Remove node. * lisp/dired-x.el (dired-enable-local-variables) (default-directory-alist, dired-default-directory-alist) (dired-default-directory, dired-local-variables-file) (dired-hack-local-variables, dired-omit-here-always): Remove obsolete variables, constants and functions.
This commit is contained in:
parent
15fa8de1ae
commit
b01e6dd7b2
2 changed files with 0 additions and 195 deletions
|
@ -92,7 +92,6 @@ For @file{dired-x.el} as distributed with GNU Emacs @value{EMACSVER}.
|
|||
* Introduction::
|
||||
* Installation::
|
||||
* Omitting Files in Dired::
|
||||
* Local Variables::
|
||||
* Shell Command Guessing::
|
||||
* Virtual Dired::
|
||||
* Advanced Mark Commands::
|
||||
|
@ -478,77 +477,6 @@ Loading @file{dired-x.el} will install Dired Omit by putting
|
|||
call @code{dired-extra-startup}, which in turn calls @code{dired-omit-startup}
|
||||
in your @code{dired-mode-hook}.
|
||||
|
||||
@node Local Variables
|
||||
@chapter Local Variables for Dired Directories
|
||||
|
||||
@cindex Local Variables for Dired Directories
|
||||
@vindex dired-local-variables-file
|
||||
@vindex dired-enable-local-variables
|
||||
@noindent
|
||||
This Dired-X feature is obsolete as of Emacs 24.1. The standard Emacs
|
||||
directory local variables mechanism (@pxref{Directory
|
||||
Variables,,,emacs,The GNU Emacs manual}) replaces it. For an example of
|
||||
the new mechanisms, @pxref{Omitting Variables}.
|
||||
|
||||
When Dired visits a directory, it looks for a file whose name is the
|
||||
value of variable @code{dired-local-variables-file} (default: @file{.dired}).
|
||||
If such a file is found, Dired will temporarily insert it into the Dired
|
||||
buffer and run @code{hack-local-variables}.
|
||||
|
||||
@noindent
|
||||
For example, if the user puts
|
||||
|
||||
@example
|
||||
Local Variables:
|
||||
dired-actual-switches: "-lat"
|
||||
dired-omit-mode: t
|
||||
End:
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
into a file called @file{.dired} in a directory then when that directory is
|
||||
viewed it will be
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
sorted by date
|
||||
@item
|
||||
omitted automatically
|
||||
@end enumerate
|
||||
|
||||
@noindent
|
||||
You can set @code{dired-local-variables-file} to @code{nil} to suppress this.
|
||||
The value of @code{dired-enable-local-variables} controls if and how these
|
||||
local variables are read. This variable exists so that it may override the
|
||||
default value of @code{enable-local-variables}.
|
||||
|
||||
@noindent
|
||||
Please see the GNU Emacs Manual to learn more about local variables.
|
||||
@xref{File Variables,Local Variables in Files,Local Variables in
|
||||
Files,emacs,The GNU Emacs Manual}.
|
||||
|
||||
@noindent
|
||||
The following variables affect Dired Local Variables
|
||||
|
||||
@table @code
|
||||
@vindex dired-local-variables-file
|
||||
@item dired-local-variables-file
|
||||
Default: @code{".dired"}
|
||||
|
||||
If non-@code{nil}, file name for local variables for Dired. If Dired finds a
|
||||
file with that name in the current directory, it will temporarily insert it
|
||||
into the Dired buffer and run @code{hack-local-variables}.
|
||||
|
||||
@vindex dired-enable-local-variables
|
||||
@item dired-enable-local-variables
|
||||
Default: @code{t}
|
||||
|
||||
Controls the use of local-variables lists in Dired. This variable
|
||||
temporarily overrides the value of @code{enable-local-variables} when
|
||||
the Dired Local Variables are hacked. It takes the same values as that
|
||||
variable. A value of @code{nil} means to ignore any Dired Local Variables.
|
||||
@end table
|
||||
|
||||
@node Shell Command Guessing
|
||||
@chapter Shell Command Guessing
|
||||
@cindex Guessing shell commands for files.
|
||||
|
|
123
lisp/dired-x.el
123
lisp/dired-x.el
|
@ -192,21 +192,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"))
|
||||
|
@ -330,7 +315,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))
|
||||
|
||||
|
||||
|
@ -785,34 +769,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
|
||||
|
@ -828,85 +784,6 @@ If none, return `default-directory'."
|
|||
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.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue