From 2777ccbfdea689327c54278ff6b5303c1fe8bac0 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 1 Mar 2011 23:59:02 -0800 Subject: Make dired-default-directory obsolete. As far as I can tell, it was never used outside of dired-smart-shell-command. It doesn't seem worth keeping around as a separate function. * lisp/dired-x.el (dired-default-directory-alist, dired-default-directory): Mark as obsolete. (dired-smart-shell-command): Just call dired-current-directory. * doc/misc/dired-x.texi (Multiple Dired Directories): Remove mentions of dired-default-directory-alist and dired-default-directory. Move dired-smart-shell-command here... (Miscellaneous Commands): ... from here. --- lisp/dired-x.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lisp/dired-x.el') diff --git a/lisp/dired-x.el b/lisp/dired-x.el index e3ba03e318e..a049bd00ccd 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -710,6 +710,8 @@ 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. @@ -717,6 +719,12 @@ If none, return `default-directory'." (or (eval (cdr (assq major-mode dired-default-directory-alist))) 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 does not seem worth keeping around (?). +(make-obsolete 'dired-default-directory + "this feature is due to be removed." "24.1") + (defun dired-smart-shell-command (command &optional output-buffer error-buffer) "Like function `shell-command', but in the current Virtual Dired directory." (interactive @@ -727,7 +735,9 @@ If none, return `default-directory'." ((eq major-mode 'dired-mode) (dired-get-filename t t)))) current-prefix-arg shell-command-default-error-buffer)) - (let ((default-directory (dired-default-directory))) + (let ((default-directory (if (eq major-mode 'dired-mode) + (dired-current-directory) + default-directory))) (shell-command command output-buffer error-buffer))) -- cgit v1.2.3