Commit 899a431b authored by Michael Kifer's avatar Michael Kifer
Browse files

2005-06-03 Michael Kifer <kifer@cs.stonybrook.edu>

	* ediff-diff.el (ediff-same-contents) Eliminate CL-type functions.

	* ediff-mult.el (ediff-intersect-directories) Make sure that ".." and
	"." files are deleted from all file lists before comparison

	* viper-keym.el
	(viper-toggle-key,viper-quoted-insert-key,viper-ESC-key):
	Made them customizable.

	* viper.el (viper-non-hook-settings): fixed the names of defadvices.
parent d06e3847
2005-06-03 Michael Kifer <kifer@cs.stonybrook.edu>
* ediff-diff.el (ediff-same-contents) Eliminate CL-type functions.
* ediff-mult.el (ediff-intersect-directories) Make sure that ".." and
"." files are deleted from all file lists before comparison
* viper-keym.el
(viper-toggle-key,viper-quoted-insert-key,viper-ESC-key):
Made them customizable.
* viper.el (viper-non-hook-settings): fixed the names of defadvices.
2005-06-01 Luc Teirlinck <teirllm@auburn.edu>
 
* autorevert.el (auto-revert-buffers): Use save-match-data.
......
......@@ -1353,7 +1353,7 @@ Symlinks and the likes are not handled.
If FILTER-RE is non-nil, recursive checking in directories
affects only files whose names match the expression."
;; Normalize empty filter RE to nil.
(unless (length filter-re) (setq filter-re nil))
(unless (> (length filter-re) 0) (setq filter-re nil))
;; Indicate progress
(message "Comparing '%s' and '%s' modulo '%s'" d1 d2 filter-re)
(cond
......@@ -1367,27 +1367,11 @@ affects only files whose names match the expression."
(if (eq ediff-recurse-to-subdirectories 'yes)
(let* ((all-entries-1 (directory-files d1 t filter-re))
(all-entries-2 (directory-files d2 t filter-re))
(entries-1 (remove-if (lambda (s)
(string-match "^\\.\\.?$"
(file-name-nondirectory s)))
all-entries-1))
(entries-2 (remove-if (lambda (s)
(string-match "^\\.\\.?$"
(file-name-nondirectory s)))
all-entries-2))
(entries-1 (ediff-delete-all-matches "^\\.\\.?$" all-entries-1))
(entries-2 (ediff-delete-all-matches "^\\.\\.?$" all-entries-2))
)
;; First, check only the names (works quickly and ensures a
;; precondition for subsequent code)
(if (and (= (length entries-1) (length entries-2))
(every (lambda (a b) (equal (file-name-nondirectory a)
(file-name-nondirectory b)))
entries-1 entries-2))
;; With name equality established, compare the entries
;; through recursion.
(every (lambda (a b)
(ediff-same-contents a b filter-re))
entries-1 entries-2)
)
(ediff-same-file-contents-lists entries-1 entries-2 filter-re)
))
) ; end of the directories case
;; D1 & D2 are both files => compare directly
......@@ -1398,6 +1382,42 @@ affects only files whose names match the expression."
)
)
;; If lists have the same length and names of files are pairwise equal
;; (removing the directories) then compare contents pairwise.
;; True if all contents are the same; false otherwise
(defun ediff-same-file-contents-lists (entries-1 entries-2 filter-re)
;; First, check only the names (works quickly and ensures a
;; precondition for subsequent code)
(if (and (= (length entries-1) (length entries-2))
(equal (mapcar 'file-name-nondirectory entries-1)
(mapcar 'file-name-nondirectory entries-2)))
;; With name equality established, compare the entries
;; through recursion.
(let ((continue t))
(while (and entries-1 continue)
(if (ediff-same-contents
(car entries-1) (car entries-2) filter-re)
(setq entries-1 (cdr entries-1)
entries-2 (cdr entries-2))
(setq continue nil))
)
;; if reached the end then lists are equal
(null entries-1))
)
)
;; ARG1 is a regexp, ARG2 is a list of full-filenames
;; Delete all entries that match the regexp
(defun ediff-delete-all-matches (regex file-list-list)
(let (result elt)
(while file-list-list
(setq elt (car file-list-list))
(or (string-match regex (file-name-nondirectory elt))
(setq result (cons elt result)))
(setq file-list-list (cdr file-list-list)))
(reverse result)))
;;; Local Variables:
;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
......
......@@ -132,7 +132,7 @@ Normally, not a user option. See `ediff-help-message' for details.")
"Normally, not a user option. See `ediff-help-message' for details.")
(defconst ediff-brief-message-string
" ? -quick help "
" Type ? for help"
"Contents of the brief help message.")
;; The actual brief help message
(ediff-defvar-local ediff-brief-help-message ""
......
......@@ -560,17 +560,23 @@ behavior."
(ediff-add-slash-if-directory auxdir1 elt))
lis1)
auxdir2 (file-name-as-directory dir2)
lis2 (directory-files auxdir2 nil regexp)
lis2 (delete "." lis2)
lis2 (delete ".." lis2)
lis2 (mapcar
(lambda (elt)
(ediff-add-slash-if-directory auxdir2 elt))
(directory-files auxdir2 nil regexp)))
lis2))
(if (stringp dir3)
(setq auxdir3 (file-name-as-directory dir3)
lis3 (directory-files auxdir3 nil regexp)
lis3 (delete "." lis3)
lis3 (delete ".." lis3)
lis3 (mapcar
(lambda (elt)
(ediff-add-slash-if-directory auxdir3 elt))
(directory-files auxdir3 nil regexp))))
lis3)))
(if (ediff-nonempty-string-p merge-autostore-dir)
(setq merge-autostore-dir
......
......@@ -117,7 +117,7 @@ Commands:
(kill-all-local-variables)
(setq major-mode 'ediff-mode)
(setq mode-name "Ediff")
(run-mode-hooks 'ediff-mode-hook))
(run-hooks 'ediff-mode-hook))
......
......@@ -7,7 +7,7 @@
;; Keywords: comparing, merging, patching, tools, unix
(defconst ediff-version "2.80" "The current version of Ediff")
(defconst ediff-date "February 19, 2005" "Date of last update")
(defconst ediff-date "June 3, 2005" "Date of last update")
;; This file is part of GNU Emacs.
......
......@@ -50,16 +50,25 @@
;;; Variables
(defvar viper-toggle-key "\C-z"
(defcustom viper-toggle-key "\C-z"
"The key used to change states from emacs to Vi and back.
In insert mode, this key also functions as Meta.
Must be set in .viper file or prior to loading Viper.
This setting cannot be changed interactively.")
This setting cannot be changed interactively."
:type 'string
:group 'viper)
(defcustom viper-quoted-insert-key "\C-v"
"The key used to quote special characters when inserting them in Insert state."
:type 'string
:group 'viper)
(defvar viper-ESC-key "\e"
(defcustom viper-ESC-key "\e"
"Key used to ESC.
Must be set in .viper file or prior to loading Viper.
This setting cannot be changed interactively.")
This setting cannot be changed interactively."
:type 'string
:group 'viper)
;;; Emacs keys in other states.
......@@ -242,7 +251,7 @@ viper-insert-basic-map. Not recommended, except for novice users.")
(define-key viper-insert-basic-map "\C-t" 'viper-forward-indent)
(define-key viper-insert-basic-map
(if viper-xemacs-p [(shift tab)] [S-tab]) 'viper-insert-tab)
(define-key viper-insert-basic-map "\C-v" 'quoted-insert)
(define-key viper-insert-basic-map viper-quoted-insert-key 'quoted-insert)
(define-key viper-insert-basic-map "\C-?" 'viper-del-backward-char-in-insert)
(define-key viper-insert-basic-map [backspace] 'viper-del-backward-char-in-insert)
(define-key viper-insert-basic-map "\C-\\" 'viper-alternate-Meta-key)
......
......@@ -990,12 +990,13 @@ remains buffer-local."
(setq global-mode-string
(append '("" viper-mode-string) (cdr global-mode-string))))
(defadvice describe-key (before viper-read-keyseq-ad protect activate)
(defadvice describe-key (before viper-describe-key-ad protect activate)
"Force to read key via `viper-read-key-sequence'."
(interactive (list (viper-read-key-sequence "Describe key: "))))
(interactive (list (viper-read-key-sequence "Describe key: "))
))
(defadvice describe-key-briefly
(before viper-read-keyseq-ad protect activate)
(before viper-describe-key-briefly-ad protect activate)
"Force to read key via `viper-read-key-sequence'."
(interactive (list (viper-read-key-sequence "Describe key briefly: "))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment