changeset 52828:d08ef8842be1

2003-10-12 Michael Kifer <kifer@cs.stonybrook.edu> * ediff-mult.el (ediff-filegroup-action): use ediff-default-filtering-regexp. * ediff-util.el (ediff-recenter): don't call ediff-restore-highlighting twice. (ediff-select-difference): set current difference. (ediff-unselect-and-select-difference): added comment. * ediff.el (ediff-directories,ediff-directory-revisions, ediff-directories3,ediff-merge-directories, ediff-merge-directories-with-ancestor,ediff-merge-directory-revisions, ediff-merge-directory-revisions-with-ancestor): use ediff-default-filtering-regexp.
author Michael Kifer <kifer@cs.stonybrook.edu>
date Mon, 13 Oct 2003 01:28:49 +0000
parents 7d76fa8c5eda
children ff3ace564547
files lisp/ChangeLog lisp/ediff-mult.el lisp/ediff-util.el lisp/ediff.el
diffstat 4 files changed, 103 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Oct 13 00:07:10 2003 +0000
+++ b/lisp/ChangeLog	Mon Oct 13 01:28:49 2003 +0000
@@ -1,3 +1,19 @@
+2003-10-12  Michael Kifer  <kifer@cs.stonybrook.edu>
+	
+	* ediff-mult.el (ediff-filegroup-action): use
+	ediff-default-filtering-regexp.
+	
+	* ediff-util.el (ediff-recenter): don't call
+	ediff-restore-highlighting twice.
+	(ediff-select-difference): set current difference.
+	(ediff-unselect-and-select-difference): added comment.
+	
+	* ediff.el (ediff-directories,ediff-directory-revisions,
+	ediff-directories3,ediff-merge-directories,
+	ediff-merge-directories-with-ancestor,ediff-merge-directory-revisions,
+	ediff-merge-directory-revisions-with-ancestor): use
+	ediff-default-filtering-regexp.
+	
 2003-10-12  Andreas Schwab  <schwab@suse.de>
 
 	* international/mule-cmds.el (locale-charset-language-names):
--- a/lisp/ediff-mult.el	Mon Oct 13 00:07:10 2003 +0000
+++ b/lisp/ediff-mult.el	Mon Oct 13 01:28:49 2003 +0000
@@ -1689,6 +1689,7 @@
 	 (info (ediff-get-meta-info meta-buf pos))
 	 (session-buf (ediff-get-session-buffer info))
 	 (session-number (ediff-get-session-number-at-pos pos meta-buf))
+	 (default-regexp (eval ediff-default-filtering-regexp))
 	 merge-autostore-dir file1 file2 file3 regexp)
 
     (setq file1 (ediff-get-session-objA-name info)
@@ -1717,8 +1718,16 @@
 	     ;; do ediff/ediff-merge on subdirectories
 	     (if (ediff-buffer-live-p session-buf)
 		 (ediff-show-meta-buffer session-buf)
-	       (setq regexp (read-string "Filter through regular expression: "
-					 nil 'ediff-filtering-regexp-history))
+	       (setq regexp
+		     (read-string
+		      (if (stringp default-regexp)
+			  (format
+			   "Filter through regular expression (default %s): "
+			   default-regexp)
+			"Filter through regular expression: ")
+		      nil
+		      'ediff-filtering-regexp-history
+		      (eval ediff-default-filtering-regexp)))
 	       (ediff-directories-internal
 		file1 file2 file3 regexp
 		ediff-session-action-function
--- a/lisp/ediff-util.el	Mon Oct 13 00:07:10 2003 +0000
+++ b/lisp/ediff-util.el	Mon Oct 13 01:28:49 2003 +0000
@@ -826,7 +826,8 @@
 		 (eq this-command 'ediff-quit))))
 	  ))
 
-    (ediff-restore-highlighting)
+    (or no-rehighlight
+	(ediff-restore-highlighting))
     (ediff-with-current-buffer control-buf (ediff-refresh-mode-lines))
     ))
 
@@ -2940,6 +2941,8 @@
 	     ))
 
 	(ediff-install-fine-diff-if-necessary n)
+	;; set current difference here so the hook will be able to refer to it
+	(setq ediff-current-difference n)
 	(run-hooks 'ediff-select-hook))))
 
 
@@ -2991,6 +2994,9 @@
 
 	  (or (eq flag 'unselect-only)
 	      (ediff-select-difference n))
+	  ;; need to set current diff here even though it is also set in
+	  ;; ediff-select-difference because ediff-select-difference might not
+	  ;; be called if unselect-only is specified
 	  (setq ediff-current-difference n)
 	  ) ; end protected section
 
--- a/lisp/ediff.el	Mon Oct 13 00:07:10 2003 +0000
+++ b/lisp/ediff.el	Mon Oct 13 01:28:49 2003 +0000
@@ -501,6 +501,7 @@
 expression; only file names that match the regexp are considered."
   (interactive
    (let ((dir-A (ediff-get-default-directory-name))
+	 (default-regexp (eval ediff-default-filtering-regexp))
 	 f)
      (list (setq f (ediff-read-file-name "Directory A to compare:" dir-A nil))
 	   (ediff-read-file-name "Directory B to compare:"
@@ -508,11 +509,14 @@
 				     ediff-last-dir-B
 				   (ediff-strip-last-dir f))
 				 nil)
-	   (read-string (format
-			 "Filter through regular expression (default %S): "
-			 (eval ediff-default-filtering-regexp))
-			(eval ediff-default-filtering-regexp)
-			'ediff-filtering-regexp-history)
+	   (read-string
+	    (if (stringp default-regexp)
+		(format "Filter through regular expression (default %s): "
+			 default-regexp)
+	      "Filter through regular expression: ")
+	    nil
+	    'ediff-filtering-regexp-history
+	    (eval ediff-default-filtering-regexp))
 	   )))
   (ediff-directories-internal
    dir1 dir2 nil regexp 'ediff-files 'ediff-directories
@@ -528,14 +532,19 @@
 The second argument, REGEXP, is a regular expression that filters the file
 names.  Only the files that are under revision control are taken into account."
   (interactive
-   (let ((dir-A (ediff-get-default-directory-name)))
+   (let ((dir-A (ediff-get-default-directory-name))
+	 (default-regexp (eval ediff-default-filtering-regexp))
+	 )
      (list (ediff-read-file-name
 	    "Directory to compare with revision:" dir-A nil)
-	   (read-string (format
-			 "Filter through regular expression (default %S): "
-			 (eval ediff-default-filtering-regexp))
-			(eval ediff-default-filtering-regexp)
-			'ediff-filtering-regexp-history)
+	   (read-string
+	    (if (stringp default-regexp)
+		(format "Filter through regular expression (default %s): "
+			 default-regexp)
+	      "Filter through regular expression: ")
+	    nil
+	    'ediff-filtering-regexp-history
+	    (eval ediff-default-filtering-regexp))
 	   )))
   (ediff-directory-revisions-internal
    dir1 regexp 'ediff-revision 'ediff-directory-revisions
@@ -553,6 +562,7 @@
 
   (interactive
    (let ((dir-A (ediff-get-default-directory-name))
+	 (default-regexp (eval ediff-default-filtering-regexp))
 	 f)
      (list (setq f (ediff-read-file-name "Directory A to compare:" dir-A nil))
 	   (setq f (ediff-read-file-name "Directory B to compare:"
@@ -565,11 +575,14 @@
 				     ediff-last-dir-C
 				   (ediff-strip-last-dir f))
 				 nil)
-	   (read-string (format
-			 "Filter through regular expression (default %S): "
-			 (eval ediff-default-filtering-regexp))
-			(eval ediff-default-filtering-regexp)
-			'ediff-filtering-regexp-history)
+	   (read-string
+	    (if (stringp default-regexp)
+		(format "Filter through regular expression (default %s): "
+			 default-regexp)
+	      "Filter through regular expression: ")
+	    nil
+	    'ediff-filtering-regexp-history
+	    (eval ediff-default-filtering-regexp))
 	   )))
   (ediff-directories-internal
    dir1 dir2 dir3 regexp 'ediff-files3 'ediff-directories3
@@ -585,6 +598,7 @@
 expression; only file names that match the regexp are considered."
   (interactive
    (let ((dir-A (ediff-get-default-directory-name))
+	 (default-regexp (eval ediff-default-filtering-regexp))
 	 f)
      (list (setq f (ediff-read-file-name "Directory A to merge:" dir-A nil))
 	   (ediff-read-file-name "Directory B to merge:"
@@ -592,11 +606,14 @@
 				     ediff-last-dir-B
 				   (ediff-strip-last-dir f))
 				 nil)
-	   (read-string (format
-			 "Filter through regular expression (default %S): "
-			 (eval ediff-default-filtering-regexp))
-			(eval ediff-default-filtering-regexp)
-			'ediff-filtering-regexp-history)
+	   (read-string
+	    (if (stringp default-regexp)
+		(format "Filter through regular expression (default %s): "
+			 default-regexp)
+	      "Filter through regular expression: ")
+	    nil
+	    'ediff-filtering-regexp-history
+	    (eval ediff-default-filtering-regexp))
 	   )))
   (ediff-directories-internal
    dir1 dir2 nil regexp 'ediff-merge-files 'ediff-merge-directories
@@ -617,6 +634,7 @@
 only file names that match the regexp are considered."
   (interactive
    (let ((dir-A (ediff-get-default-directory-name))
+	 (default-regexp (eval ediff-default-filtering-regexp))
 	 f)
      (list (setq f (ediff-read-file-name "Directory A to merge:" dir-A nil))
 	   (setq f (ediff-read-file-name "Directory B to merge:"
@@ -629,11 +647,14 @@
 				     ediff-last-dir-C
 				   (ediff-strip-last-dir f))
 				 nil)
-	   (read-string (format
-			 "Filter through regular expression (default %S): "
-			 (eval ediff-default-filtering-regexp))
-			(eval ediff-default-filtering-regexp)
-			'ediff-filtering-regexp-history)
+	   (read-string
+	    (if (stringp default-regexp)
+		(format "Filter through regular expression (default %s): "
+			 default-regexp)
+	      "Filter through regular expression: ")
+	    nil
+	    'ediff-filtering-regexp-history
+	    (eval ediff-default-filtering-regexp))
 	   )))
   (ediff-directories-internal
    dir1 dir2 ancestor-dir regexp
@@ -648,14 +669,19 @@
 The second argument, REGEXP, is a regular expression that filters the file
 names.  Only the files that are under revision control are taken into account."
   (interactive
-   (let ((dir-A (ediff-get-default-directory-name)))
+   (let ((dir-A (ediff-get-default-directory-name))
+	 (default-regexp (eval ediff-default-filtering-regexp))
+	 )
      (list (ediff-read-file-name
 	    "Directory to merge with revisions:" dir-A nil)
-	   (read-string (format
-			 "Filter through regular expression (default %S): "
-			 (eval ediff-default-filtering-regexp))
-			(eval ediff-default-filtering-regexp)
-			'ediff-filtering-regexp-history)
+	   (read-string
+	    (if (stringp default-regexp)
+		(format "Filter through regular expression (default %s): "
+			 default-regexp)
+	      "Filter through regular expression: ")
+	    nil
+	    'ediff-filtering-regexp-history
+	    (eval ediff-default-filtering-regexp))
 	   )))
   (ediff-directory-revisions-internal
    dir1 regexp 'ediff-merge-revisions 'ediff-merge-directory-revisions
@@ -673,14 +699,19 @@
 The second argument, REGEXP, is a regular expression that filters the file
 names.  Only the files that are under revision control are taken into account."
   (interactive
-   (let ((dir-A (ediff-get-default-directory-name)))
+   (let ((dir-A (ediff-get-default-directory-name))
+	 (default-regexp (eval ediff-default-filtering-regexp))
+	 )
      (list (ediff-read-file-name
 	    "Directory to merge with revisions and ancestors:" dir-A nil)
-	   (read-string (format
-			 "Filter through regular expression (default %S): "
-			 (eval ediff-default-filtering-regexp))
-			(eval ediff-default-filtering-regexp)
-			'ediff-filtering-regexp-history)
+	   (read-string
+	    (if (stringp default-regexp)
+		(format "Filter through regular expression (default %s): "
+			 default-regexp)
+	      "Filter through regular expression: ")
+	    nil
+	    'ediff-filtering-regexp-history
+	    (eval ediff-default-filtering-regexp))
 	   )))
   (ediff-directory-revisions-internal
    dir1 regexp 'ediff-merge-revisions-with-ancestor