Commits

Anonymous committed 3ca7520

2009-12-07 Michael Kifer <kifer@cs.stonybrook.edu>

* ediff-init.el (ediff-event-key): use event-to-character instead of
event-key.

* ediff-mult.el (ediff-setup-meta-map, ediff-prepare-meta-buffer): add
menus to the meta mode. (Dan Nicolaescu's <dann@ics.uci.edu> patch.)

* ediff.el (ediff-buffers-internal): add unwind-protect.

* ediff-util.el (ediff-minibuffer-with-setup-hook): new macro from
Emacs tree.
(ediff-read-file-name): use that macro.

Comments (0)

Files changed (4)

+2009-12-07  Michael Kifer <kifer@cs.stonybrook.edu>
+	
+	* ediff-init.el (ediff-event-key): use event-to-character instead of
+	event-key.
+	
+	* ediff-mult.el (ediff-setup-meta-map, ediff-prepare-meta-buffer): add
+	menus to the meta mode. (Dan Nicolaescu's <dann@ics.uci.edu> patch.)
+	
+	* ediff.el (ediff-buffers-internal): add unwind-protect.
+	
+	* ediff-util.el (ediff-minibuffer-with-setup-hook): new macro from
+	Emacs tree.
+	(ediff-read-file-name): use that macro.
+	
 2009-11-27  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.79 released.
 
 (defun ediff-event-key (event-or-key)
   (if (featurep 'xemacs)
-      (if (eventp event-or-key) (event-key event-or-key) event-or-key)
+      ;;(if (eventp event-or-key) (event-key event-or-key) event-or-key)
+      (if (eventp event-or-key) (event-to-character event-or-key t t) event-or-key)
     event-or-key))
 
 (defun ediff-last-command-char ()
   )
 
 
+;; for compatibility
+(defmacro ediff-minibuffer-with-setup-hook (fun &rest body)
+  `(if (fboundp 'minibuffer-with-setup-hook)
+       (minibuffer-with-setup-hook ,fun ,@body)
+     ,@body))
+
 ;; This is adapted from a similar function in `emerge.el'.
 ;; PROMPT should not have a trailing ': ', so that it can be modified
 ;; according to context.
   (if (string= default-file "")
       (setq default-file nil))
 
-  (let (f)
-    (setq f (expand-file-name
-	     (read-file-name
-	      (format "%s%s "
-		      prompt
-		      (cond (default-file
-			      (concat " (default " default-file "):"))
-			    (t (concat " (default " default-dir "):"))))
-	      default-dir
-	      (or default-file default-dir)
-	      t  ; must match, no-confirm
-	      (if default-file (file-name-directory default-file))
-	      )
-	     default-dir
-	     ))
+  (let ((defaults (and (fboundp 'dired-dwim-target-defaults)
+		       (dired-dwim-target-defaults
+			(and default-file (list default-file))
+			default-dir)))
+	f)
+    (setq f (ediff-minibuffer-with-setup-hook
+		(lambda () (when defaults
+			     (setq minibuffer-default defaults)))
+	      (read-file-name
+	       (format "%s%s "
+		       prompt
+		       (cond (default-file
+			       (concat " (default " default-file "):"))
+			     (t (concat " (default " default-dir "):"))))
+	       default-dir
+	       (or default-file default-dir)
+	       t			; must match, no-confirm
+	       (if default-file (file-name-directory default-file)))))
+    (setq f (expand-file-name f default-dir))
     ;; If user entered a directory name, expand the default file in that
     ;; directory.  This allows the user to enter a directory name for the
     ;; B-file and diff against the default-file in that directory instead
 ;; of the bug report be sent to the maintainer's email address.
 
 (defconst ediff-version "2.81.4" "The current version of Ediff")
-(defconst ediff-date "November 26, 2009" "Date of last update")
+(defconst ediff-date "December 7, 2009" "Date of last update")
 
 
 ;; This file is part of GNU Emacs.