emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109940: Don't bind M-= in Dired.


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109940: Don't bind M-= in Dired.
Date: Sat, 08 Sep 2012 22:48:26 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109940
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2012-09-08 22:48:26 +0800
message:
  Don't bind M-= in Dired.
  
  * lisp/dired.el (dired-mode-map): Don't bind M-=.
  
  * lisp/dired-aux.el (dired-diff): Use backup file as default.
modified:
  etc/NEWS
  lisp/ChangeLog
  lisp/dired-aux.el
  lisp/dired.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2012-09-08 13:28:11 +0000
+++ b/etc/NEWS  2012-09-08 14:48:26 +0000
@@ -423,6 +423,13 @@
 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

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-09-08 14:30:09 +0000
+++ b/lisp/ChangeLog    2012-09-08 14:48:26 +0000
@@ -1,3 +1,9 @@
+2012-09-08  Chong Yidong  <address@hidden>
+
+       * dired.el (dired-mode-map): Don't bind M-=.
+
+       * dired-aux.el (dired-diff): Use backup file as default.
+
 2012-09-08  Drew Adams  <address@hidden>
 
        * subr.el (add-to-history): Fix delete usage (Bug#12314).

=== modified file 'lisp/dired-aux.el'
--- a/lisp/dired-aux.el 2012-07-17 18:40:15 +0000
+++ b/lisp/dired-aux.el 2012-09-08 14:48:26 +0000
@@ -54,43 +54,30 @@
 ;;;###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))

=== modified file 'lisp/dired.el'
--- a/lisp/dired.el     2012-09-03 08:54:25 +0000
+++ b/lisp/dired.el     2012-09-08 14:48:26 +0000
@@ -1410,7 +1410,6 @@
     (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 @@
 ;;;;;;  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'.
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]