From 203784ccb151e37d6b1e1306b1f3a63d3b6d66f3 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 18 Feb 2011 20:12:23 -0800 Subject: [PATCH] Merge dired-x's redefinition of dired-initial-position into the main version. * lisp/dired-x.el (dired-initial-position): Merge into dired.el's version. * lisp/dired.el (dired-initial-position): Merge dired-x's version here. (dired-find-subdir): Declare. * doc/misc/dired-x.texi (Technical Details): No longer redefines dired-initial-position. --- doc/misc/ChangeLog | 3 ++- doc/misc/dired-x.texi | 4 ++-- lisp/ChangeLog | 4 ++++ lisp/dired-x.el | 13 +------------ lisp/dired.el | 10 +++++++--- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index c11618649da..882eec34193 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,6 +1,7 @@ 2011-02-19 Glenn Morris - * dired-x.texi (Technical Details): No longer redefines dired-add-entry. + * dired-x.texi (Technical Details): No longer redefines dired-add-entry, + or dired-initial-position. 2011-02-18 Glenn Morris diff --git a/doc/misc/dired-x.texi b/doc/misc/dired-x.texi index 931af07be4e..9f7b40ceb58 100644 --- a/doc/misc/dired-x.texi +++ b/doc/misc/dired-x.texi @@ -185,14 +185,14 @@ from @file{dired.el} @code{dired-clean-up-after-deletion} @item @code{dired-find-buffer-nocreate} -@item -@code{dired-initial-position} @end itemize @noindent and from @file{dired-aux.el} the function @code{dired-read-shell-command}. In addition, once @file{dired.el} is loaded, @code{dired-add-entry} obeys Dired Omit mode (@pxref{Omitting Files in Dired}), if it is active. +Similarly, @code{dired-initial-position} obeys @code{dired-find-subdir} +(@pxref{Miscellaneous Commands}). @node Installation, Omitting Files in Dired, Introduction, Top @chapter Installation diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8e54788610e..824f5f24d06 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2011-02-19 Glenn Morris + * dired-x.el (dired-initial-position): Merge into dired.el's version. + * dired.el (dired-initial-position): Merge dired-x's version here. + (dired-find-subdir): Declare. + * dired-x.el (dired-omit-new-add-entry): Merge into dired-add-entry. * dired-aux.el (dired-add-entry): Give it a doc-string. Merge dired-x's dired-omit handling here. diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 0bdf4950a58..901614e49d0 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -48,8 +48,7 @@ ;; User customization: M-x customize-group RET dired-x RET. ;; When loaded this code redefines the following functions of GNU Emacs: -;; From dired.el: dired-clean-up-after-deletion, dired-find-buffer-nocreate, -;; and dired-initial-position. +;; From dired.el: dired-clean-up-after-deletion, dired-find-buffer-nocreate. ;; From dired-aux.el: dired-read-shell-command. ;; *Please* see the `dired-x' info pages for more details. @@ -1408,16 +1407,6 @@ Considers buffers closer to the car of `buffer-list' to be more recent." ;; (setq dired-buffers (delq elt dired-buffers))))) ;; result)) -;; REDEFINE. -;; Redefines dired.el's version of `dired-initial-position' -(defun dired-initial-position (dirname) - "Where point should go in a new listing of DIRNAME. -Point assumed at beginning of new subdir line. -You may redefine this function as you wish, e.g. like in `dired-x.el'." - (end-of-line) - (if dired-find-subdir (dired-goto-subdir dirname)) ; new - (if dired-trivial-filenames (dired-goto-next-nontrivial-file))) - ;; Does anyone use this? - lrd 6/29/93. ;; Apparently people do use it. - lrd 12/22/97. diff --git a/lisp/dired.el b/lisp/dired.el index 22d9f91648c..ab327d9afbc 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2544,11 +2544,15 @@ instead of `dired-actual-switches'." ;; return value of point (i.e., FOUND): (goto-char found)))) +(defvar dired-find-subdir) + +;; FIXME document whatever dired-x is doing. (defun dired-initial-position (dirname) - ;; Where point should go in a new listing of DIRNAME. - ;; Point assumed at beginning of new subdir line. - ;; You may redefine this function as you wish, e.g. like in dired-x.el. + "Where point should go in a new listing of DIRNAME. +Point assumed at beginning of new subdir line." (end-of-line) + (and (featurep 'dired-x) dired-find-subdir + (dired-goto-subdir dirname)) (if dired-trivial-filenames (dired-goto-next-nontrivial-file))) ;; These are hooks which make tree dired work. -- 2.11.4.GIT