aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2018-05-14 17:06:33 +0200
committerMichael Albinus2018-05-14 17:06:33 +0200
commitb01e6dd7b202fd9fbed8f1afa6cb6065ed85ff66 (patch)
tree8dc0a816cfbc31c13239ed63eb2c8512f874fc1b
parent15fa8de1ae3228413fde95e583008d9b9f19e7c7 (diff)
downloademacs-b01e6dd7b202fd9fbed8f1afa6cb6065ed85ff66.tar.gz
emacs-b01e6dd7b202fd9fbed8f1afa6cb6065ed85ff66.zip
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.
-rw-r--r--doc/misc/dired-x.texi72
-rw-r--r--lisp/dired-x.el123
2 files changed, 0 insertions, 195 deletions
diff --git a/doc/misc/dired-x.texi b/doc/misc/dired-x.texi
index a502667ab83..36179200f4e 100644
--- a/doc/misc/dired-x.texi
+++ b/doc/misc/dired-x.texi
@@ -92,7 +92,6 @@ For @file{dired-x.el} as distributed with GNU Emacs @value{EMACSVER}.
92* Introduction:: 92* Introduction::
93* Installation:: 93* Installation::
94* Omitting Files in Dired:: 94* Omitting Files in Dired::
95* Local Variables::
96* Shell Command Guessing:: 95* Shell Command Guessing::
97* Virtual Dired:: 96* Virtual Dired::
98* Advanced Mark Commands:: 97* Advanced Mark Commands::
@@ -478,77 +477,6 @@ Loading @file{dired-x.el} will install Dired Omit by putting
478call @code{dired-extra-startup}, which in turn calls @code{dired-omit-startup} 477call @code{dired-extra-startup}, which in turn calls @code{dired-omit-startup}
479in your @code{dired-mode-hook}. 478in your @code{dired-mode-hook}.
480 479
481@node Local Variables
482@chapter Local Variables for Dired Directories
483
484@cindex Local Variables for Dired Directories
485@vindex dired-local-variables-file
486@vindex dired-enable-local-variables
487@noindent
488This Dired-X feature is obsolete as of Emacs 24.1. The standard Emacs
489directory local variables mechanism (@pxref{Directory
490Variables,,,emacs,The GNU Emacs manual}) replaces it. For an example of
491the new mechanisms, @pxref{Omitting Variables}.
492
493When Dired visits a directory, it looks for a file whose name is the
494value of variable @code{dired-local-variables-file} (default: @file{.dired}).
495If such a file is found, Dired will temporarily insert it into the Dired
496buffer and run @code{hack-local-variables}.
497
498@noindent
499For example, if the user puts
500
501@example
502Local Variables:
503dired-actual-switches: "-lat"
504dired-omit-mode: t
505End:
506@end example
507
508@noindent
509into a file called @file{.dired} in a directory then when that directory is
510viewed it will be
511
512@enumerate
513@item
514sorted by date
515@item
516omitted automatically
517@end enumerate
518
519@noindent
520You can set @code{dired-local-variables-file} to @code{nil} to suppress this.
521The value of @code{dired-enable-local-variables} controls if and how these
522local variables are read. This variable exists so that it may override the
523default value of @code{enable-local-variables}.
524
525@noindent
526Please see the GNU Emacs Manual to learn more about local variables.
527@xref{File Variables,Local Variables in Files,Local Variables in
528Files,emacs,The GNU Emacs Manual}.
529
530@noindent
531The following variables affect Dired Local Variables
532
533@table @code
534@vindex dired-local-variables-file
535@item dired-local-variables-file
536Default: @code{".dired"}
537
538If non-@code{nil}, file name for local variables for Dired. If Dired finds a
539file with that name in the current directory, it will temporarily insert it
540into the Dired buffer and run @code{hack-local-variables}.
541
542@vindex dired-enable-local-variables
543@item dired-enable-local-variables
544Default: @code{t}
545
546Controls the use of local-variables lists in Dired. This variable
547temporarily overrides the value of @code{enable-local-variables} when
548the Dired Local Variables are hacked. It takes the same values as that
549variable. A value of @code{nil} means to ignore any Dired Local Variables.
550@end table
551
552@node Shell Command Guessing 480@node Shell Command Guessing
553@chapter Shell Command Guessing 481@chapter Shell Command Guessing
554@cindex Guessing shell commands for files. 482@cindex Guessing shell commands for files.
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index a1c2f4484c5..4517dedeeb4 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -192,21 +192,6 @@ toggle between those two."
192 :type 'boolean 192 :type 'boolean
193 :group 'dired-x) 193 :group 'dired-x)
194 194
195(defcustom dired-enable-local-variables t
196 "Control use of local-variables lists in Dired.
197This temporarily overrides the value of `enable-local-variables' when
198listing a directory. See also `dired-local-variables-file'."
199 :risky t
200 :type '(choice (const :tag "Query Unsafe" t)
201 (const :tag "Safe Only" :safe)
202 (const :tag "Do all" :all)
203 (const :tag "Ignore" nil)
204 (other :tag "Query" other))
205 :group 'dired-x)
206
207(make-obsolete-variable 'dired-enable-local-variables
208 "use a standard `dir-locals-file' instead." "24.1")
209
210(defcustom dired-guess-shell-gnutar 195(defcustom dired-guess-shell-gnutar
211 (catch 'found 196 (catch 'found
212 (dolist (exe '("tar" "gtar")) 197 (dolist (exe '("tar" "gtar"))
@@ -330,7 +315,6 @@ See also the functions:
330 `dired-do-find-marked-files'" 315 `dired-do-find-marked-files'"
331 (interactive) 316 (interactive)
332 ;; These must be done in each new dired buffer. 317 ;; These must be done in each new dired buffer.
333 (dired-hack-local-variables)
334 (dired-omit-startup)) 318 (dired-omit-startup))
335 319
336 320
@@ -785,34 +769,6 @@ Also useful for `auto-mode-alist' like this:
785;; mechanism is provided for special handling of the working directory in 769;; mechanism is provided for special handling of the working directory in
786;; special major modes. 770;; special major modes.
787 771
788(define-obsolete-variable-alias 'default-directory-alist
789 'dired-default-directory-alist "24.1")
790
791;; It's easier to add to this alist than redefine function
792;; default-directory while keeping the old information.
793(defconst dired-default-directory-alist
794 '((dired-mode . (if (fboundp 'dired-current-directory)
795 (dired-current-directory)
796 default-directory)))
797 "Alist of major modes and their opinion on `default-directory'.
798Each element has the form (MAJOR . EXPRESSION).
799The function `dired-default-directory' evaluates EXPRESSION to
800determine a default directory.")
801
802(put 'dired-default-directory-alist 'risky-local-variable t) ; gets eval'd
803(make-obsolete-variable 'dired-default-directory-alist
804 "this feature is due to be removed." "24.1")
805
806(defun dired-default-directory ()
807 "Return the `dired-default-directory-alist' entry for the current major-mode.
808If none, return `default-directory'."
809 ;; It looks like this was intended to be something of a "general"
810 ;; feature, but it only ever seems to have been used in
811 ;; dired-smart-shell-command, and doesn't seem worth keeping around.
812 (declare (obsolete nil "24.1"))
813 (or (eval (cdr (assq major-mode dired-default-directory-alist)))
814 default-directory))
815
816(defun dired-smart-shell-command (command &optional output-buffer error-buffer) 772(defun dired-smart-shell-command (command &optional output-buffer error-buffer)
817 "Like function `shell-command', but in the current Virtual Dired directory." 773 "Like function `shell-command', but in the current Virtual Dired directory."
818 (interactive 774 (interactive
@@ -829,85 +785,6 @@ If none, return `default-directory'."
829 (shell-command command output-buffer error-buffer))) 785 (shell-command command output-buffer error-buffer)))
830 786
831 787
832;;; LOCAL VARIABLES FOR DIRED BUFFERS.
833
834;; Brief Description (This feature is obsolete as of Emacs 24.1)
835;;
836;; * `dired-extra-startup' is part of the `dired-mode-hook'.
837;;
838;; * `dired-extra-startup' calls `dired-hack-local-variables'
839;;
840;; * `dired-hack-local-variables' checks the value of
841;; `dired-local-variables-file'
842;;
843;; * Check if `dired-local-variables-file' is a non-nil string and is a
844;; filename found in the directory of the Dired Buffer being created.
845;;
846;; * If `dired-local-variables-file' satisfies the above, then temporarily
847;; include it in the Dired Buffer at the bottom.
848;;
849;; * Set `enable-local-variables' temporarily to the user variable
850;; `dired-enable-local-variables' and run `hack-local-variables' on the
851;; Dired Buffer.
852
853(defcustom dired-local-variables-file (convert-standard-filename ".dired")
854 "Filename, as string, containing local Dired buffer variables to be hacked.
855If this file found in current directory, then it will be inserted into dired
856buffer and `hack-local-variables' will be run. See Info node
857`(emacs)File Variables' for more information on local variables.
858See also `dired-enable-local-variables'."
859 :type 'file
860 :group 'dired)
861
862(make-obsolete-variable 'dired-local-variables-file 'dir-locals-file "24.1")
863
864(defun dired-hack-local-variables ()
865 "Evaluate local variables in `dired-local-variables-file' for Dired buffer."
866 (declare (obsolete hack-dir-local-variables-non-file-buffer "24.1"))
867 (and (stringp dired-local-variables-file)
868 (file-exists-p dired-local-variables-file)
869 (let ((opoint (point-max))
870 (inhibit-read-only t)
871 ;; In case user has `enable-local-variables' set to nil we
872 ;; override it locally with dired's variable.
873 (enable-local-variables dired-enable-local-variables))
874 ;; Insert 'em.
875 (save-excursion
876 (goto-char opoint)
877 (insert "\^L\n")
878 (insert-file-contents dired-local-variables-file))
879 ;; Hack 'em.
880 (unwind-protect
881 (let ((buffer-file-name dired-local-variables-file))
882 (hack-local-variables))
883 ;; Delete this stuff: `eobp' is used to find last subdir by dired.el.
884 (delete-region opoint (point-max)))
885 ;; Make sure that the mode line shows the proper information.
886 (dired-sort-set-mode-line))))
887
888;; Does not seem worth a dedicated command.
889;; See the more general features in files-x.el.
890(defun dired-omit-here-always ()
891 "Create `dir-locals-file' setting `dired-omit-mode' to t in `dired-mode'.
892If in a Dired buffer, reverts it."
893 (declare (obsolete add-dir-local-variable "24.1"))
894 (interactive)
895 (if (file-exists-p dired-local-variables-file)
896 (error "Old-style dired-local-variables-file `./%s' found;
897replace it with a dir-locals-file `./%s'"
898 dired-local-variables-file
899 dir-locals-file))
900 (if (file-exists-p dir-locals-file)
901 (message "File `./%s' already exists." dir-locals-file)
902 (add-dir-local-variable 'dired-mode 'subdirs nil)
903 (add-dir-local-variable 'dired-mode 'dired-omit-mode t)
904 ;; Run extra-hooks and revert directory.
905 (when (derived-mode-p 'dired-mode)
906 (hack-dir-local-variables-non-file-buffer)
907 (dired-extra-startup)
908 (dired-revert))))
909
910
911;;; GUESS SHELL COMMAND. 788;;; GUESS SHELL COMMAND.
912 789
913;; Brief Description: 790;; Brief Description: