]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't bind M-= in Dired.
authorChong Yidong <cyd@gnu.org>
Sat, 8 Sep 2012 14:48:26 +0000 (22:48 +0800)
committerChong Yidong <cyd@gnu.org>
Sat, 8 Sep 2012 14:48:26 +0000 (22:48 +0800)
* lisp/dired.el (dired-mode-map): Don't bind M-=.

* lisp/dired-aux.el (dired-diff): Use backup file as default.

etc/NEWS
lisp/ChangeLog
lisp/dired-aux.el
lisp/dired.el

index 7a9c9a21c97c3e6c1474bc9ee1f5a84551264d7f..5beb47b7b003e26c0720c44b6e8aa0985e689e0c 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -423,6 +423,13 @@ channel keys found, if any.
 if the command ends in `;' (when operating on multiple files).
 Otherwise, it executes the command on each file in parallel.
 
+*** The minibuffer default for `=' (`dired-diff) has changed.
+It is now the backup file for the file at point, if one exists, rather
+than the file at the mark.
+
+*** `M-=' is no longer bound to `dired-backup-diff' in Dired buffers.
+The global binding for `M-=', `count-words-region' is in effect.
+
 ** Shell
 
 *** New option `async-shell-command-buffer' specifies what buffer to use
index b45d2fd823507be9ea75386c5072cf4eb7895dde..f9a0d45700374495e71a3b95bffc598ad071dc1f 100644 (file)
@@ -1,3 +1,9 @@
+2012-09-08  Chong Yidong  <cyd@gnu.org>
+
+       * dired.el (dired-mode-map): Don't bind M-=.
+
+       * dired-aux.el (dired-diff): Use backup file as default.
+
 2012-09-08  Drew Adams  <drew.adams@oracle.com>
 
        * subr.el (add-to-history): Fix delete usage (Bug#12314).
index 6186f762e0a891ed8f4c8974ce0cc3401d90ba45..1f8e8068de3c4e8d131832e70efd0fdcde614a09 100644 (file)
@@ -54,43 +54,30 @@ into this list; they also should call `dired-log' to log the errors.")
 ;;;###autoload
 (defun dired-diff (file &optional switches)
   "Compare file at point with file FILE using `diff'.
-FILE defaults to the file at the mark.  (That's the mark set by
-\\[set-mark-command], not by Dired's \\[dired-mark] command.)
-The prompted-for FILE is the first file given to `diff'.
+If called interactively, prompt for FILE; if the file at point
+has a backup file, use that as the default.
+
+FILE is the first file given to `diff'.
 With prefix arg, prompt for second argument SWITCHES,
 which is the string of command switches for `diff'."
   (interactive
    (let* ((current (dired-get-filename t))
-         ;; Get the file at the mark.
-         (file-at-mark (if (mark t)
-                           (save-excursion (goto-char (mark t))
-                                           (dired-get-filename t t))))
-         ;; Use it as default if it's not the same as the current file,
-         ;; and the target dir is the current dir or the mark is active.
-         (default (if (and (not (equal file-at-mark current))
-                           (or (equal (dired-dwim-target-directory)
-                                      (dired-current-directory))
-                               mark-active))
-                      file-at-mark))
-         (target-dir (if default
-                         (dired-current-directory)
-                       (dired-dwim-target-directory)))
-         (defaults (dired-dwim-target-defaults (list current) target-dir)))
-     (require 'diff)
-     (list
-      (minibuffer-with-setup-hook
-         (lambda ()
-           (set (make-local-variable 'minibuffer-default-add-function) nil)
-           (setq minibuffer-default defaults))
-       (read-file-name
-        (format "Diff %s with%s: " current
-                (if default (format " (default %s)" default) ""))
-        target-dir default t))
-      (if current-prefix-arg
-         (read-string "Options for diff: "
-                      (if (stringp diff-switches)
-                          diff-switches
-                        (mapconcat 'identity diff-switches " ")))))))
+         (oldf (file-newest-backup current))
+         (dir (if oldf (file-name-directory oldf))))
+     (list (read-file-name
+           (format "Diff %s with%s: "
+                   (file-name-nondirectory current)
+                   (if oldf
+                       (concat " (default "
+                               (file-name-nondirectory oldf)
+                               ")")
+                     ""))
+           dir oldf t)
+          (if current-prefix-arg
+              (read-string "Options for diff: "
+                           (if (stringp diff-switches)
+                               diff-switches
+                             (mapconcat 'identity diff-switches " ")))))))
   (let ((current (dired-get-filename t)))
     (when (or (equal (expand-file-name file)
                     (expand-file-name current))
index cd27b6b640456ba3285a29bd023dc0955a5d7f41..f4ae027181adb0412818f773a749dd264bc5a4de 100644 (file)
@@ -1410,7 +1410,6 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
     (define-key map "&" 'dired-do-async-shell-command)
     ;; Comparison commands
     (define-key map "=" 'dired-diff)
-    (define-key map "\M-=" 'dired-backup-diff)
     ;; Tree Dired commands
     (define-key map "\M-\C-?" 'dired-unmark-all-files)
     (define-key map "\M-\C-d" 'dired-tree-down)
@@ -3745,14 +3744,15 @@ Ask means pop up a menu for the user to select one of copy, move or link."
 ;;;;;;  dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
 ;;;;;;  dired-clean-directory dired-do-print dired-do-touch dired-do-chown
 ;;;;;;  dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
-;;;;;;  dired-diff) "dired-aux" "dired-aux.el" "9499f79f5853da0aa93d26465c7bf3a1")
+;;;;;;  dired-diff) "dired-aux" "dired-aux.el" "4b260eda371d319a6c8e8e5ec917e287")
 ;;; Generated autoloads from dired-aux.el
 
 (autoload 'dired-diff "dired-aux" "\
 Compare file at point with file FILE using `diff'.
-FILE defaults to the file at the mark.  (That's the mark set by
-\\[set-mark-command], not by Dired's \\[dired-mark] command.)
-The prompted-for FILE is the first file given to `diff'.
+If called interactively, prompt for FILE; if the file at point
+has a backup file, use that as the default.
+
+FILE is the first file given to `diff'.
 With prefix arg, prompt for second argument SWITCHES,
 which is the string of command switches for `diff'.