From 81ef89602dcb5817f521e9a991034df7d9723f3b Mon Sep 17 00:00:00 2001 From: Michael Kifer Date: Mon, 13 Oct 2003 01:28:49 +0000 Subject: [PATCH] 2003-10-12 Michael Kifer * 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. --- lisp/ChangeLog | 16 ++++++++ lisp/ediff-mult.el | 13 ++++++- lisp/ediff-util.el | 8 +++- lisp/ediff.el | 107 ++++++++++++++++++++++++++++++++++------------------- 4 files changed, 103 insertions(+), 41 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 427c0068d3f..59511feebca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2003-10-12 Michael Kifer + + * 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 * international/mule-cmds.el (locale-charset-language-names): diff --git a/lisp/ediff-mult.el b/lisp/ediff-mult.el index 536fdf4d47b..f5eff1eb49d 100644 --- a/lisp/ediff-mult.el +++ b/lisp/ediff-mult.el @@ -1689,6 +1689,7 @@ all marked sessions must be active." (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 @@ all marked sessions must be active." ;; 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 diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el index c4f8ae52657..d69997394e4 100644 --- a/lisp/ediff-util.el +++ b/lisp/ediff-util.el @@ -826,7 +826,8 @@ Reestablish the default three-window display." (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 @@ Hit \\[ediff-recenter] to reset the windows afterward." )) (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 @@ Hit \\[ediff-recenter] to reset the windows afterward." (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 diff --git a/lisp/ediff.el b/lisp/ediff.el index 259bd657338..78ea48f4a1c 100644 --- a/lisp/ediff.el +++ b/lisp/ediff.el @@ -501,6 +501,7 @@ the same name in both. The third argument, REGEXP, is nil or a regular 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 @@ expression; only file names that match the regexp are considered." 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 @@ expression; only file names that match the regexp are considered." 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 @@ regular 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)) (setq f (ediff-read-file-name "Directory B to compare:" @@ -565,11 +575,14 @@ regular expression; only file names that match the regexp are considered." 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 @@ the same name in both. The third argument, REGEXP, is nil or a regular 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 @@ expression; only file names that match the regexp are considered." 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 @@ without ancestor. The fourth argument, REGEXP, is nil or a regular 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)) (setq f (ediff-read-file-name "Directory B to merge:" @@ -629,11 +647,14 @@ only file names that match the regexp are considered." 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 @@ only file names that match the regexp are considered." 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 @@ names. Only the files that are under revision control are taken into account." 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 -- 2.11.4.GIT