CVS update by michaelk packages/xemacs-packages/ediff, ediff-vers.el, ediff-mult.el, ediff-hook.el ...

xemacs-cvs at xemacs.org xemacs-cvs at xemacs.org
Fri Nov 2 02:12:09 EDT 2007


  User: michaelk
  Date: 07/11/02 07:12:09

  Modified:    packages/xemacs-packages/ediff ediff.el ediff-wind.el
                        ediff-vers.el ediff-util.el ediff-ptch.el
                        ediff-mult.el ediff-merg.el ediff-init.el
                        ediff-hook.el ediff-help.el ediff-diff.el ChangeLog
Log:
	* ediff-util.el (ediff-make-current-diff-overlay): do not use face-name.
	Got rid of ediff-copy-list.

	* ediff-diff.el (ediff-set-fine-diff-properties-in-one-buffer): do not
	use face-name.
	(ediff-test-utility,ediff-diff-mandatory-option)
	(ediff-reset-diff-options): removed to simplify yhe mandatory option
	handling on windows.
	(ediff-set-diff-options): added.
	(ediff-diff-options): changed.

	* ediff-vers.el (ediff-vc-internal): use ediff-vc-revision-other-window.
	(ediff-vc-merge-internal): use ediff-vc-revision-other-window and
	ediff-vc-working-revision.
	Require vc-hooks.

Revision  Changes    Path
1.40      +1 -15     XEmacs/packages/xemacs-packages/ediff/ediff.el

Index: ediff.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ediff/ediff.el,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -p -r1.39 -r1.40
--- ediff.el	2007/08/19 13:50:51	1.39
+++ ediff.el	2007/11/02 06:12:05	1.40
@@ -15,7 +15,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -1302,20 +1302,6 @@ buffer."
     (funcall
      (intern (format "ediff-%S-merge-internal" ediff-version-control-package))
      rev1 rev2 ancestor-rev startup-hooks merge-buffer-file)))
-
-;; MK: Check. This function doesn't seem to be used any more by pcvs or pcl-cvs
-;;;###autoload
-(defun run-ediff-from-cvs-buffer (pos)
-  "Run Ediff-merge on appropriate revisions of the selected file.
-First run after `M-x cvs-update'.  Then place the cursor on a line describing a
-file and then run `run-ediff-from-cvs-buffer'."
-  (interactive "d")
-  (ediff-load-version-control)
-  (let ((tin (tin-locate cvs-cookie-handle pos)))
-    (if tin
-	(cvs-run-ediff-on-file-descriptor tin)
-      (error "There is no file to merge"))))
-
 
 ;;; Apply patch
 



1.26      +17 -10    XEmacs/packages/xemacs-packages/ediff/ediff-wind.el

Index: ediff-wind.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ediff/ediff-wind.el,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -p -r1.25 -r1.26
--- ediff-wind.el	2007/01/23 21:42:43	1.25
+++ ediff-wind.el	2007/11/02 06:12:05	1.26
@@ -9,7 +9,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -72,15 +72,15 @@
   :group 'frames)
 
 
-(defcustom ediff-window-setup-function (if (ediff-window-display-p)
-					'ediff-setup-windows-multiframe
-				      'ediff-setup-windows-plain)
+(defcustom ediff-window-setup-function 'ediff-setup-windows-automatic
   "*Function called to set up windows.
-Ediff provides a choice of two functions: `ediff-setup-windows-plain', for
-doing everything in one frame, and `ediff-setup-windows-multiframe',
-which sets the control panel in a separate frame.  Also, if the latter
-function detects that one of the buffers A/B is seen in some other frame,
-it will try to keep that buffer in that frame.
+Ediff provides a choice of three functions: `ediff-setup-windows-plain', for
+doing everything in one frame, `ediff-setup-windows-multiframe', which sets
+the control panel in a separate frame, and
+`ediff-setup-windows-automatic' (the default), which chooses an appropriate
+behaviour based on the current window system.  If the multiframe function
+detects that one of the buffers A/B is seen in some other frame, it will try
+to keep that buffer in that frame.
 
 If you don't like the two functions provided---write your own one.
 The basic guidelines:
@@ -94,7 +94,8 @@ The basic guidelines:
        Buffer C may not be used in jobs that compare only two buffers.
 If you plan to do something fancy, take a close look at how the two
 provided functions are written."
-:type '(choice (const :tag "Multi Frame" ediff-setup-windows-multiframe)
+:type '(choice (const :tag "Automatic" ediff-setup-windows-automatic)
+		 (const :tag "Multi Frame" ediff-setup-windows-multiframe)
 		 (const :tag "Single Frame" ediff-setup-windows-plain)
 		 (function :tag "Other function"))
   :group 'ediff-window)
@@ -334,6 +335,12 @@ into icons, regardless of the window man
        (ediff-with-current-buffer control-buffer ediff-window-setup-function)
        buffer-A buffer-B buffer-C control-buffer))
   (run-hooks 'ediff-after-setup-windows-hook))
+
+;; Set up windows using the correct method based on the current window system.
+(defun ediff-setup-windows-automatic (buffer-A buffer-B buffer-C control-buffer)
+  (if (ediff-window-display-p)
+      (ediff-setup-windows-multiframe buffer-A buffer-B buffer-C control-buffer)
+    (ediff-setup-windows-plain buffer-A buffer-B buffer-C control-buffer)))
 
 ;; Just set up 3 windows.
 ;; Usually used without windowing systems



1.18      +21 -110   XEmacs/packages/xemacs-packages/ediff/ediff-vers.el

Index: ediff-vers.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ediff/ediff-vers.el,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -p -r1.17 -r1.18
--- ediff-vers.el	2007/01/23 21:42:43	1.17
+++ ediff-vers.el	2007/11/02 06:12:05	1.18
@@ -9,7 +9,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -39,13 +39,6 @@
        (let ((load-path (cons (expand-file-name ".") load-path)))
 	 (load "pcl-cvs" 'noerror)
 	 (load "rcs" 'noerror)
-	 ;; On 8+3 MS-DOS filesystems, generic-x.el is loaded
-	 ;; instead of (the missing) generic-sc.el.  Since the
-	 ;; version of Emacs which supports MS-DOS doesn't have
-	 ;; generic-sc, we simply avoid loading it.
-	 (or (and (fboundp 'msdos-long-file-names)
-		  (not (msdos-long-file-names)))
-	     (load "generic-sc" 'noerror))
 	 ;; (load "vc" 'noerror) ; this sometimes causes compiler error
 	 (or (featurep 'ediff-init)
 	     (load "ediff-init.el" nil nil 'nosuffix))
@@ -59,8 +52,22 @@ comparison or merge operations are being
   :group 'ediff-vers
   )
 
+(defalias 'ediff-vc-revision-other-window
+      (if (fboundp 'vc-revision-other-window)
+	  'vc-revision-other-window
+	'vc-version-other-window))
+
+(defalias 'ediff-vc-working-revision
+  (if (fboundp 'vc-working-revision)
+      'vc-working-revision
+    vc-workfile-version))
+
 ;; VC.el support
 
+(eval-when-compile
+  (require 'vc-hooks)) ;; for vc-call macro
+
+
 (defun ediff-vc-latest-version (file)
   "Return the version level of the latest version of FILE in repository."
   (if (fboundp 'vc-latest-version)
@@ -84,12 +91,12 @@ comparison or merge operations are being
 	(setq rev1 (ediff-vc-latest-version (buffer-file-name))))
     (save-window-excursion
       (save-excursion
-	(vc-version-other-window rev1)
+	(ediff-vc-revision-other-window rev1)
 	(setq rev1buf (current-buffer)
 	      file1 (buffer-file-name)))
       (save-excursion
 	(or (string= rev2 "") 		; use current buffer
-	    (vc-version-other-window rev2))
+	    (ediff-vc-revision-other-window rev2))
 	(setq rev2buf (current-buffer)
 	      file2 (buffer-file-name)))
       (setq startup-hooks
@@ -157,32 +164,6 @@ comparison or merge operations are being
     (ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision)
     ))
 
-
-;; GENERIC-SC.el support
-
-(defun generic-sc-get-latest-rev ()
-  (cond ((eq sc-mode 'CCASE)
-	 (eval "main/LATEST"))
-	(t (eval ""))))
-
-(defun ediff-generic-sc-internal (rev1 rev2 &optional startup-hooks)
-;; Run Ediff on versions of the current buffer.
-;; If REV2 is "" then compare current buffer with REV1.
-;; If the current buffer is named `F', the version is named `F.~REV~'.
-;; If `F.~REV~' already exists, it is used instead of being re-created.
-  (let (rev1buf rev2buf)
-    (save-excursion
-      (if (or (not rev1) (string= rev1 ""))
-	  (setq rev1 (generic-sc-get-latest-rev)))
-      (sc-visit-previous-revision rev1)
-      (setq rev1buf (current-buffer)))
-    (save-excursion
-      (or (string= rev2 "") 		; use current buffer
-	  (sc-visit-previous-revision rev2))
-      (setq rev2buf (current-buffer)))
-    (ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision)))
-
-
 ;;; Merge with Version Control
 
 (defun ediff-vc-merge-internal (rev1 rev2 ancestor-rev
@@ -191,17 +172,17 @@ comparison or merge operations are being
   (let (buf1 buf2 ancestor-buf)
     (save-window-excursion
       (save-excursion
-	(vc-version-other-window rev1)
+	(ediff-vc-revision-other-window rev1)
 	(setq buf1 (current-buffer)))
       (save-excursion
 	(or (string= rev2 "")
-	    (vc-version-other-window rev2))
+	    (ediff-vc-revision-other-window rev2))
 	(setq buf2 (current-buffer)))
       (if ancestor-rev
 	  (save-excursion
 	    (if (string= ancestor-rev "")
-		(setq ancestor-rev (vc-workfile-version buffer-file-name)))
-	    (vc-version-other-window ancestor-rev)
+		(setq ancestor-rev (ediff-vc-working-revision buffer-file-name)))
+	    (ediff-vc-revision-other-window ancestor-rev)
 	    (setq ancestor-buf (current-buffer))))
       (setq startup-hooks
 	    (cons
@@ -244,76 +225,6 @@ comparison or merge operations are being
 	 startup-hooks 'ediff-merge-revisions-with-ancestor merge-buffer-file)
       (ediff-merge-buffers
        buf1 buf2 startup-hooks 'ediff-merge-revisions merge-buffer-file))))
-
-(defun ediff-generic-sc-merge-internal (rev1 rev2 ancestor-rev
-					     &optional
-					     startup-hooks merge-buffer-file)
-  ;; If ANCESTOR-REV non-nil, merge with ancestor
-  (let (buf1 buf2 ancestor-buf)
-    (save-excursion
-      (if (string= rev1 "")
-	  (setq rev1 (generic-sc-get-latest-rev)))
-      (sc-visit-previous-revision rev1)
-      (setq buf1 (current-buffer)))
-    (save-excursion
-      (or (string= rev2 "")
-	  (sc-visit-previous-revision rev2))
-      (setq buf2 (current-buffer)))
-    (if ancestor-rev
-	(save-excursion
-	  (or (string= ancestor-rev "")
-	      (sc-visit-previous-revision ancestor-rev))
-	  (setq ancestor-buf (current-buffer))))
-    (if ancestor-rev
-	(ediff-merge-buffers-with-ancestor
-	 buf1 buf2 ancestor-buf
-	 startup-hooks 'ediff-merge-revisions-with-ancestor merge-buffer-file)
-      (ediff-merge-buffers
-       buf1 buf2 startup-hooks 'ediff-merge-revisions merge-buffer-file))))
-
-
-;; PCL-CVS.el support
-
-;; MK: Check. This function doesn't seem to be used any more by pcvs or pcl-cvs
-(defun cvs-run-ediff-on-file-descriptor (tin)
-;; This is a replacement for cvs-emerge-mode
-;; Runs after cvs-update.
-;; Ediff-merge appropriate revisions of the selected file.
-  (let* ((fileinfo (tin-cookie cvs-cookie-handle tin))
-	 (type (cvs-fileinfo->type fileinfo))
-	 (tmp-file
-	  (cvs-retrieve-revision-to-tmpfile fileinfo))
-	 (default-directory
-	   (file-name-as-directory (cvs-fileinfo->dir fileinfo)))
-	 ancestor-file)
-
-    (or (memq type '(MERGED CONFLICT MODIFIED))
-	(error
-	 "Can only merge `Modified', `Merged' or `Conflict' files"))
-
-    (cond ((memq type '(MERGED CONFLICT))
-	   (setq ancestor-file
-		 (cvs-retrieve-revision-to-tmpfile
-		  fileinfo
-		  ;; revision
-		  (cvs-fileinfo->base-revision fileinfo)))
-	   (ediff-merge-buffers-with-ancestor
-	    (find-file-noselect tmp-file)
-	    (find-file-noselect (cvs-fileinfo->backup-file fileinfo))
-	    (find-file-noselect ancestor-file)
-	    nil ; startup-hooks
-	    'ediff-merge-revisions-with-ancestor))
-	  ((eq type 'MODIFIED)
-	   (ediff-buffers
-	    (find-file-noselect tmp-file)
-	    (if (featurep 'xemacs)
-		;; XEmacs doesn't seem to have cvs-fileinfo->full-name
-		(find-file-noselect (cvs-fileinfo->full-path fileinfo))
-	      (find-file-noselect (cvs-fileinfo->full-name fileinfo)))
-	    nil ; startup-hooks
-	    'ediff-revisions)))
-    (if (stringp tmp-file) (ediff-delete-version-file tmp-file))
-    (if (stringp ancestor-file) (ediff-delete-version-file ancestor-file))))
 
 
 ;; delete version file on exit unless ediff-keep-tmp-versions is true



1.37      +51 -68    XEmacs/packages/xemacs-packages/ediff/ediff-util.el

Index: ediff-util.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ediff/ediff-util.el,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -p -r1.36 -r1.37
--- ediff-util.el	2007/08/19 13:50:51	1.36
+++ ediff-util.el	2007/11/02 06:12:05	1.37
@@ -9,7 +9,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -122,7 +122,7 @@ Commands:
   ;; modified by minor modes and such. So, run-mode-hooks doesn't do anything
   ;; useful here on top of what run-hooks does.
   ;; Second, changing run-hooks to run-mode-hooks would require an
-  ;; if-statement, since XEmacs doesn't have this. 
+  ;; if-statement, since XEmacs doesn't have this.
   (run-hooks 'ediff-mode-hook))
 
 
@@ -1141,7 +1141,7 @@ of the current buffer."
 	       (or (memq (vc-state file) '(edited needs-merge))
 		   (stringp (vc-state file)))
 	     ;; XEmacs has no vc-state
-	     (vc-locking-user file))
+	     (when (featurep 'xemacs) (vc-locking-user file)))
 	   )))
 
 (defun ediff-file-checked-in-p (file)
@@ -1153,7 +1153,7 @@ of the current buffer."
 	    (not (memq (vc-state file) '(edited needs-merge)))
 	    (not (stringp (vc-state file))))
 	 ;; XEmacs has no vc-state
-	 (not (vc-locking-user file)))
+	 (when (featurep 'xemacs) (not (vc-locking-user file))))
        ))
 
 (defun ediff-file-compressed-p (file)
@@ -1317,10 +1317,10 @@ which see."
   ;; change default
   (setq-default ediff-window-setup-function window-setup-func)
   ;; change in all active ediff sessions
-  (mapcar (lambda(buf) (ediff-with-current-buffer buf
-			 (setq ediff-window-setup-function window-setup-func
-			       ediff-window-B nil)))
-	  ediff-session-registry)
+  (mapc (lambda(buf) (ediff-with-current-buffer buf
+		       (setq ediff-window-setup-function window-setup-func
+			     ediff-window-B nil)))
+	ediff-session-registry)
   (if (ediff-in-control-buffer-p)
       (ediff-recenter 'no-rehighlight))))
 
@@ -1341,12 +1341,12 @@ To change the default, set the variable 
 	;; do this only after killing the toolbar
 	(setq ediff-use-toolbar-p (not ediff-use-toolbar-p))
 
-	(mapcar (lambda(buf)
-		  (ediff-with-current-buffer buf
-		    ;; force redisplay
-		    (setq ediff-window-config-saved "")
-		    ))
-		ediff-session-registry)
+	(mapc (lambda(buf)
+		(ediff-with-current-buffer buf
+		  ;; force redisplay
+		  (setq ediff-window-config-saved "")
+		  ))
+	      ediff-session-registry)
 	(if (ediff-in-control-buffer-p)
 	    (ediff-recenter 'no-rehighlight)))))
 
@@ -2439,14 +2439,14 @@ temporarily reverses the meaning of this
 
   ;; Apply selective display to narrow or widen
   (ediff-visible-region)
-  (mapcar (lambda (overl)
-	    (if (ediff-overlayp overl)
-		(ediff-delete-overlay overl)))
-	  ediff-wide-bounds)
-  (mapcar (lambda (overl)
-	    (if (ediff-overlayp overl)
-		(ediff-delete-overlay overl)))
-	  ediff-narrow-bounds)
+  (mapc (lambda (overl)
+	  (if (ediff-overlayp overl)
+	      (ediff-delete-overlay overl)))
+	ediff-wide-bounds)
+  (mapc (lambda (overl)
+	  (if (ediff-overlayp overl)
+	      (ediff-delete-overlay overl)))
+	ediff-narrow-bounds)
 
   ;; restore buffer mode line id's in buffer-A/B/C
   (let ((control-buffer ediff-control-buffer)
@@ -3747,13 +3747,13 @@ Ediff Control Panel to restore highlight
 ;; VEC is either a difference vector or a fine-diff vector
 (defun ediff-clear-diff-vector (vec-var &optional fine-diffs-also)
   (if (vectorp (symbol-value vec-var))
-      (mapcar (lambda (elt)
-		(ediff-delete-overlay
-		 (ediff-get-diff-overlay-from-diff-record elt))
-		(if fine-diffs-also
-		    (ediff-clear-fine-diff-vector elt))
-		)
-	      (symbol-value vec-var)))
+      (mapc (lambda (elt)
+	      (ediff-delete-overlay
+	       (ediff-get-diff-overlay-from-diff-record elt))
+	      (if fine-diffs-also
+		  (ediff-clear-fine-diff-vector elt))
+	      )
+	    (symbol-value vec-var)))
   ;; allow them to be garbage collected
   (set vec-var nil))
 
@@ -3802,9 +3802,8 @@ Ediff Control Panel to restore highlight
       (let ((overlay (ediff-get-symbol-from-alist
 		      type ediff-current-diff-overlay-alist))
 	    (buffer (ediff-get-buffer type))
-	    (face (face-name
-		   (ediff-get-symbol-from-alist
-		    type ediff-current-diff-face-alist))))
+	    (face (ediff-get-symbol-from-alist
+		    type ediff-current-diff-face-alist)))
 	(set overlay
 	     (ediff-make-bullet-proof-overlay (point-max) (point-max) buffer))
 	(ediff-set-overlay-face (symbol-value overlay) face)
@@ -4071,28 +4070,25 @@ Mail anyway? (y or n) ")
      )
    ))
 
-(cond ((fboundp 'nuke-selective-display)
-       ;; XEmacs has nuke-selective-display
-       (defalias 'ediff-nuke-selective-display 'nuke-selective-display))
-      (t
-       (defun ediff-nuke-selective-display ()
-	 (save-excursion
-	   (save-restriction
-	     (widen)
-	     (goto-char (point-min))
-	     (let ((mod-p (buffer-modified-p))
-		   buffer-read-only end)
-	       (and (eq t selective-display)
-		    (while (search-forward "\^M" nil t)
-		      (end-of-line)
-		      (setq end (point))
-		      (beginning-of-line)
-		      (while (search-forward "\^M" end t)
-			(delete-char -1)
-			(insert "\^J"))))
-	       (set-buffer-modified-p mod-p)
-	       (setq selective-display nil)))))
-       ))
+(defun ediff-nuke-selective-display ()
+  (if (featurep 'xemacs)
+      (nuke-selective-display)
+    (save-excursion
+      (save-restriction
+	(widen)
+	(goto-char (point-min))
+	(let ((mod-p (buffer-modified-p))
+	      buffer-read-only end)
+	  (and (eq t selective-display)
+	       (while (search-forward "\^M" nil t)
+		 (end-of-line)
+		 (setq end (point))
+		 (beginning-of-line)
+		 (while (search-forward "\^M" end t)
+		   (delete-char -1)
+		   (insert "\^J"))))
+	  (set-buffer-modified-p mod-p)
+	  (setq selective-display nil))))))
 
 
 ;; The next two are modified versions from emerge.el.
@@ -4295,20 +4291,7 @@ Mail anyway? (y or n) ")
       (add-to-history history-var newelt)
     (set history-var (cons newelt (symbol-value history-var)))))
 
-(if (fboundp 'copy-sequence)
-    (defalias 'ediff-copy-list 'copy-sequence)
-  (defun ediff-copy-list (list)
-    (if (consp list)
-      ;;;(let ((res nil))
-      ;;;  (while (consp list) (push (pop list) res))
-      ;;;  (prog1 (nreverse res) (setcdr res list)))
-	(let (res elt)
-	  (while (consp list)
-	    (setq elt (car list)
-		  res (cons elt res)
-		  list (cdr list)))
-	  (nreverse res))
-      (car list))))
+(defalias 'ediff-copy-list 'copy-sequence)
 
 
 ;; don't report error if version control package wasn't found



1.22      +76 -76    XEmacs/packages/xemacs-packages/ediff/ediff-ptch.el

Index: ediff-ptch.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ediff/ediff-ptch.el,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -p -r1.21 -r1.22
--- ediff-ptch.el	2007/08/19 13:50:51	1.21
+++ ediff-ptch.el	2007/11/02 06:12:05	1.22
@@ -9,7 +9,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -292,43 +292,43 @@ program."
 	)
 
     ;; chop off base-dirs
-    (mapcar (lambda (session-info)
-	      (let* ((proposed-file-names
-		      ;; Filename-spec is objA; it is represented as
-		      ;; (file1 . file2). Get it using ediff-get-session-objA.
-		      (ediff-get-session-objA-name session-info))
-		     ;; base-dir1 is  the dir part of the 1st file in the patch
-		     (base-dir1
-		      (or (file-name-directory (car proposed-file-names))
-			  ""))
-		     ;; directory part of the 2nd file in the patch
-		     (base-dir2
-		      (or (file-name-directory (cdr proposed-file-names))
-			  ""))
-		     )
-		;; If both base-dir1 and base-dir2 are relative and exist,
-		;; assume that
-		;; these dirs lead to the actual files starting at the present
-		;; directory. So, we don't strip these relative dirs from the
-		;; file names. This is a heuristic intended to improve guessing
-		(let ((default-directory (file-name-directory filename)))
-		  (unless (or (file-name-absolute-p base-dir1)
-			      (file-name-absolute-p base-dir2)
-			      (not (file-exists-p base-dir1))
-			      (not (file-exists-p base-dir2)))
-		    (setq base-dir1 ""
-			  base-dir2 "")))
-		(or (string= (car proposed-file-names) "/dev/null")
-		    (setcar proposed-file-names
-			    (ediff-file-name-sans-prefix
-			     (car proposed-file-names) base-dir1)))
-		(or (string=
-		     (cdr proposed-file-names) "/dev/null")
-		    (setcdr proposed-file-names
-			    (ediff-file-name-sans-prefix
-			     (cdr proposed-file-names) base-dir2)))
-		))
-	    ediff-patch-map)
+    (mapc (lambda (session-info)
+	    (let* ((proposed-file-names
+		    ;; Filename-spec is objA; it is represented as
+		    ;; (file1 . file2). Get it using ediff-get-session-objA.
+		    (ediff-get-session-objA-name session-info))
+		   ;; base-dir1 is  the dir part of the 1st file in the patch
+		   (base-dir1
+		    (or (file-name-directory (car proposed-file-names))
+			""))
+		   ;; directory part of the 2nd file in the patch
+		   (base-dir2
+		    (or (file-name-directory (cdr proposed-file-names))
+			""))
+		   )
+	      ;; If both base-dir1 and base-dir2 are relative and exist,
+	      ;; assume that
+	      ;; these dirs lead to the actual files starting at the present
+	      ;; directory. So, we don't strip these relative dirs from the
+	      ;; file names. This is a heuristic intended to improve guessing
+	      (let ((default-directory (file-name-directory filename)))
+		(unless (or (file-name-absolute-p base-dir1)
+			    (file-name-absolute-p base-dir2)
+			    (not (file-exists-p base-dir1))
+			    (not (file-exists-p base-dir2)))
+		  (setq base-dir1 ""
+			base-dir2 "")))
+	      (or (string= (car proposed-file-names) "/dev/null")
+		  (setcar proposed-file-names
+			  (ediff-file-name-sans-prefix
+			   (car proposed-file-names) base-dir1)))
+	      (or (string=
+		   (cdr proposed-file-names) "/dev/null")
+		  (setcdr proposed-file-names
+			  (ediff-file-name-sans-prefix
+			   (cdr proposed-file-names) base-dir2)))
+	      ))
+	  ediff-patch-map)
 
     ;; take the given file name into account
     (or (file-directory-p filename)
@@ -338,19 +338,19 @@ program."
 		      (file-name-nondirectory filename))))
 
     ;; prepend actual-dir
-    (mapcar (lambda (session-info)
-	      (let ((proposed-file-names
-		     (ediff-get-session-objA-name session-info)))
-		(if (and (string-match "^/null/" (car proposed-file-names))
-			 (string-match "^/null/" (cdr proposed-file-names)))
-		    ;; couldn't intuit the file name to patch, so
-		    ;; something is amiss
-		    (progn
-		      (with-output-to-temp-buffer ediff-msg-buffer
-			(ediff-with-current-buffer standard-output
-			  (fundamental-mode))
-			(princ
-			 (format "
+    (mapc (lambda (session-info)
+	    (let ((proposed-file-names
+		   (ediff-get-session-objA-name session-info)))
+	      (if (and (string-match "^/null/" (car proposed-file-names))
+		       (string-match "^/null/" (cdr proposed-file-names)))
+		  ;; couldn't intuit the file name to patch, so
+		  ;; something is amiss
+		  (progn
+		    (with-output-to-temp-buffer ediff-msg-buffer
+		      (ediff-with-current-buffer standard-output
+			(fundamental-mode))
+		      (princ
+		       (format "
 The patch file contains a context diff for
 	%s
 	%s
@@ -361,31 +361,31 @@ please enter it now.
 If you don't know and still would like to apply patches to
 other files, enter /dev/null
 "
-				 (substring (car proposed-file-names) 6)
-				 (substring (cdr proposed-file-names) 6))))
-		      (let ((directory t)
-			    user-file)
-			(while directory
-			  (setq user-file
-				(read-file-name
-				 "Please enter file name: "
-				 actual-dir actual-dir t))
-			  (if (not (file-directory-p user-file))
-			      (setq directory nil)
-			    (setq directory t)
-			    (beep)
-			    (message "%s is a directory" user-file)
-			    (sit-for 2)))
-			(setcar (ediff-get-session-objA session-info)
-				(cons user-file user-file))))
-		  (setcar proposed-file-names
-			  (expand-file-name
-			   (concat actual-dir (car proposed-file-names))))
-		  (setcdr proposed-file-names
-			  (expand-file-name
-			   (concat actual-dir (cdr proposed-file-names)))))
-		))
-	    ediff-patch-map)
+			       (substring (car proposed-file-names) 6)
+			       (substring (cdr proposed-file-names) 6))))
+		    (let ((directory t)
+			  user-file)
+		      (while directory
+			(setq user-file
+			      (read-file-name
+			       "Please enter file name: "
+			       actual-dir actual-dir t))
+			(if (not (file-directory-p user-file))
+			    (setq directory nil)
+			  (setq directory t)
+			  (beep)
+			  (message "%s is a directory" user-file)
+			  (sit-for 2)))
+		      (setcar (ediff-get-session-objA session-info)
+			      (cons user-file user-file))))
+		(setcar proposed-file-names
+			(expand-file-name
+			 (concat actual-dir (car proposed-file-names))))
+		(setcdr proposed-file-names
+			(expand-file-name
+			 (concat actual-dir (cdr proposed-file-names)))))
+	      ))
+	  ediff-patch-map)
     ;; Check for the existing files in each pair and discard the nonexisting
     ;; ones. If both exist, ask the user.
     (mapcar (lambda (session-info)



1.30      +19 -19    XEmacs/packages/xemacs-packages/ediff/ediff-mult.el

Index: ediff-mult.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ediff/ediff-mult.el,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -p -r1.29 -r1.30
--- ediff-mult.el	2007/06/12 19:25:25	1.29
+++ ediff-mult.el	2007/11/02 06:12:06	1.30
@@ -9,7 +9,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -370,7 +370,7 @@ buffers."
 (ediff-defvar-local ediff-verbose-help-enabled nil
   "If t, display redundant help in ediff-directories and other meta buffers.
 Toggled by ediff-toggle-verbose-help-meta-buffer" )
-  
+
 ;; Toggle verbose help in meta-buffers
 ;; TODO: Someone who understands all this can make it better.
 (defun ediff-toggle-verbose-help-meta-buffer ()
@@ -641,15 +641,15 @@ behavior."
     ;; If file belongs to dir 1 only, the membership code is 2.
     ;; If it is in dir1 and dir3, then the membership code is 2*5=10;
     ;; if it is in dir1 and dir2, then the membership code is 2*3=6, etc.
-    (mapcar (lambda (elt)
-	      (if (member (car elt) lis1)
-		  (setcdr elt (* (cdr elt) ediff-membership-code1)))
-	      (if (member (car elt) lis2)
-		  (setcdr elt (* (cdr elt) ediff-membership-code2)))
-	      (if (member (car elt) lis3)
-		  (setcdr elt (* (cdr elt) ediff-membership-code3)))
-	      )
-	    difflist)
+    (mapc (lambda (elt)
+	    (if (member (car elt) lis1)
+		(setcdr elt (* (cdr elt) ediff-membership-code1)))
+	    (if (member (car elt) lis2)
+		(setcdr elt (* (cdr elt) ediff-membership-code2)))
+	    (if (member (car elt) lis3)
+		(setcdr elt (* (cdr elt) ediff-membership-code3)))
+	    )
+	  difflist)
     (setq difflist (cons
 		    ;; diff metalist header
 		    (ediff-make-new-meta-list-header regexp
@@ -941,7 +941,7 @@ behavior."
       ;; was redrawn
       (ediff-cond-compile-for-xemacs-or-emacs
        (map-extents 'delete-extent)   ; xemacs
-       (mapcar 'delete-overlay (overlays-in 1 1))  ; emacs
+       (mapc 'delete-overlay (overlays-in 1 1))  ; emacs
        )
 
       (setq regexp (ediff-get-group-regexp meta-list)
@@ -1329,7 +1329,7 @@ Useful commands:
 
     ;; copy file to directories where it doesn't exist, update
     ;; ediff-dir-difference-list and redisplay
-    (mapcar
+    (mapc
      (lambda (otherfile-struct)
        (let ((otherfile (car otherfile-struct))
 	     (file-mem-code (cdr otherfile-struct)))
@@ -1390,7 +1390,7 @@ Useful commands:
       ;; was redrawn
       (ediff-cond-compile-for-xemacs-or-emacs
        (map-extents 'delete-extent) ; xemacs
-       (mapcar 'delete-overlay (overlays-in 1 1)) ; emacs
+       (mapc 'delete-overlay (overlays-in 1 1)) ; emacs
        )
 
       (insert "This is a registry of all active Ediff sessions.
@@ -1410,11 +1410,11 @@ Useful commands:
 
 ")
       ;; purge registry list from dead buffers
-      (mapcar (lambda (elt)
-		(if (not (ediff-buffer-live-p elt))
-		    (setq ediff-session-registry
-			  (delq elt ediff-session-registry))))
-	      ediff-session-registry)
+      (mapc (lambda (elt)
+	      (if (not (ediff-buffer-live-p elt))
+		  (setq ediff-session-registry
+			(delq elt ediff-session-registry))))
+	    ediff-session-registry)
 
       (if (null ediff-session-registry)
 	  (insert "       ******* No active Ediff sessions *******\n"))



1.16      +1 -1      XEmacs/packages/xemacs-packages/ediff/ediff-merg.el

Index: ediff-merg.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ediff/ediff-merg.el,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -p -r1.15 -r1.16
--- ediff-merg.el	2007/01/23 21:42:44	1.15
+++ ediff-merg.el	2007/11/02 06:12:06	1.16
@@ -9,7 +9,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,



1.39      +2 -2      XEmacs/packages/xemacs-packages/ediff/ediff-init.el

Index: ediff-init.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ediff/ediff-init.el,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -p -r1.38 -r1.39
--- ediff-init.el	2007/06/12 21:20:35	1.38
+++ ediff-init.el	2007/11/02 06:12:06	1.39
@@ -9,7 +9,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -1410,7 +1410,7 @@ This property can be toggled interactive
 ;;; Misc
 
 ;; if nil, this silences some messages
-(defconst ediff-verbose-p t)
+(defvar ediff-verbose-p t)
 
 (defcustom ediff-autostore-merges  'group-jobs-only
   "*Save the results of merge jobs automatically.



1.17      +3 -3      XEmacs/packages/xemacs-packages/ediff/ediff-hook.el

Index: ediff-hook.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ediff/ediff-hook.el,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -p -r1.16 -r1.17
--- ediff-hook.el	2007/01/23 21:42:44	1.16
+++ ediff-hook.el	2007/11/02 06:12:06	1.17
@@ -9,7 +9,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -53,10 +53,10 @@
 ;; compiler at hand (emacs or xemacs).
 ;; The autoload, below, is useless in Emacs because ediff-hook.el
 ;; is dumped with emacs, but it is needed in XEmacs
-;;;###autoload (defmacro ediff-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form) (if (string-match "XEmacs" emacs-version) xemacs-form emacs-form))
+;;;###autoload (defmacro ediff-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form) (if (featurep 'xemacs) xemacs-form emacs-form))
 
 (defmacro ediff-cond-compile-for-xemacs-or-emacs (xemacs-form emacs-form)
-  (if (string-match "XEmacs" emacs-version)
+  (if (featurep 'xemacs)
       xemacs-form emacs-form))
 
 ;; This autoload is useless in Emacs because ediff-hook.el is dumped with



1.14      +2 -2      XEmacs/packages/xemacs-packages/ediff/ediff-help.el

Index: ediff-help.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ediff/ediff-help.el,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- ediff-help.el	2007/01/23 21:42:44	1.13
+++ ediff-help.el	2007/11/02 06:12:06	1.14
@@ -9,7 +9,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -258,7 +258,7 @@ the value of this variable and the varia
   (save-excursion
     (goto-char (point-min))
     (if ediff-use-long-help-message
-	(next-line 1))
+	(forward-line 1))
     (end-of-line)
     (current-column)))
 



1.35      +29 -60    XEmacs/packages/xemacs-packages/ediff/ediff-diff.el

Index: ediff-diff.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ediff/ediff-diff.el,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -p -r1.34 -r1.35
--- ediff-diff.el	2007/08/19 13:50:51	1.34
+++ ediff-diff.el	2007/11/02 06:12:06	1.35
@@ -9,7 +9,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -48,7 +48,6 @@
   :prefix "ediff-"
   :group 'ediff)
 
-;; these two must be here to prevent ediff-test-utility from barking
 (defcustom ediff-diff-program "diff"
   "*Program to use for generating the differential of the two files."
   :type 'string
@@ -62,46 +61,8 @@ Must produce output compatible with Unix
 
 ;; The following functions must precede all defcustom-defined variables.
 
-;; The following functions needed for setting diff/diff3 options
-;; test if diff supports the --binary option
-(defsubst ediff-test-utility (diff-util option &optional files)
-  (condition-case nil
-      (eq 0 (apply 'call-process
-		   (append (list diff-util nil nil nil option) files)))
-    (error (format "Cannot execute program %S." diff-util)))
-  )
-
-(defun ediff-diff-mandatory-option (diff-util)
-  (let ((file (if (boundp 'null-device) null-device "/dev/null")))
-    (cond  ((not (memq system-type '(ms-dos windows-nt windows-95)))
-	    "")
-	   ((and (string= diff-util ediff-diff-program)
-		 (ediff-test-utility
-		  ediff-diff-program "--binary" (list file file)))
-	    "--binary ")
-	   ((and (string= diff-util ediff-diff3-program)
-		 (ediff-test-utility
-		  ediff-diff3-program "--binary" (list file file file)))
-	    "--binary ")
-	   (t ""))))
-
-
-;; must be before ediff-reset-diff-options to avoid compiler errors
 (fset 'ediff-set-actual-diff-options '(lambda () nil))
 
-;; make sure that mandatory options are added even if the user changes
-;; ediff-diff-options or ediff-diff3-options in the customization widget
-(defun ediff-reset-diff-options (symb val)
-  (let* ((diff-program
-	  (if (eq symb 'ediff-diff-options)
-	      ediff-diff-program
-	    ediff-diff3-program))
-	 (mandatory-option (ediff-diff-mandatory-option diff-program)))
-    (set symb (concat mandatory-option val))
-    (ediff-set-actual-diff-options)
-    ))
-
-
 (defcustom ediff-shell
   (cond ((eq system-type 'emx) "cmd") ; OS/2
 	((memq system-type '(ms-dos windows-nt windows-95))
@@ -130,17 +91,25 @@ are `-I REGEXP', to ignore changes whose
   :type '(repeat string)
   :group 'ediff-diff)
 
-(defcustom ediff-diff-options ""
+(defun ediff-set-diff-options (symbol value)
+  (set symbol value)
+  (ediff-set-actual-diff-options))
+
+(defcustom ediff-diff-options
+  (if (memq system-type '(ms-dos windows-nt windows-95)) "--binary" "")
   "*Options to pass to `ediff-diff-program'.
 If Unix diff is used as `ediff-diff-program',
 then a useful option is `-w', to ignore space.
 Options `-c', `-u', and `-i' are not allowed. Case sensitivity can be
 toggled interactively using \\[ediff-toggle-ignore-case].
 
+Do not remove the default options. If you need to change this variable, add new
+options after the default ones.
+
 This variable is not for customizing the look of the differences produced by
-the command \\[ediff-show-diff-output]. Use the variable 
+the command \\[ediff-show-diff-output]. Use the variable
 `ediff-custom-diff-options' for that."
-:set 'ediff-reset-diff-options
+:set 'ediff-set-diff-options
   :type 'string
   :group 'ediff-diff)
 
@@ -179,7 +148,7 @@ This output is not used by Ediff interna
   "Pattern to match lines produced by diff3 that describe differences.")
 (defcustom ediff-diff3-options ""
   "*Options to pass to `ediff-diff3-program'."
-:set 'ediff-reset-diff-options
+:set 'ediff-set-diff-options
   :type 'string
   :group 'ediff-diff)
 
@@ -348,20 +317,20 @@ one optional arguments, diff-number to r
     ;; fixup diff-list
     (if diff3-job
 	(cond ((not file-A)
-	       (mapcar (lambda (elt)
-			 (aset elt 0 nil)
-			 (aset elt 1 nil))
-		       (cdr diff-list)))
+	       (mapc (lambda (elt)
+		       (aset elt 0 nil)
+		       (aset elt 1 nil))
+		     (cdr diff-list)))
 	      ((not file-B)
-	       (mapcar (lambda (elt)
-			 (aset elt 2 nil)
-			 (aset elt 3 nil))
-		       (cdr diff-list)))
+	       (mapc (lambda (elt)
+		       (aset elt 2 nil)
+		       (aset elt 3 nil))
+		     (cdr diff-list)))
 	      ((not file-C)
-	       (mapcar (lambda (elt)
-			 (aset elt 4 nil)
-			 (aset elt 5 nil))
-		       (cdr diff-list)))
+	       (mapc (lambda (elt)
+		       (aset elt 4 nil)
+		       (aset elt 5 nil))
+		     (cdr diff-list)))
 	  ))
 
     (ediff-convert-fine-diffs-to-overlays diff-list reg-num)
@@ -889,9 +858,9 @@ one optional arguments, diff-number to r
   (let ((fine-diff-vector  (ediff-get-fine-diff-vector n buf-type))
 	(face (if default
 		  'default
-		(face-name
-		 (ediff-get-symbol-from-alist
-		  buf-type ediff-fine-diff-face-alist))))
+		(ediff-get-symbol-from-alist
+		 buf-type ediff-fine-diff-face-alist)
+		))
 	(priority (if default
 		      0
 		    (1+ (or (ediff-overlay-get
@@ -1533,7 +1502,7 @@ affects only files whose names match the
 
 (defun ediff-set-actual-diff-options ()
   (if ediff-ignore-case
-      (setq ediff-actual-diff-options 
+      (setq ediff-actual-diff-options
 	    (concat ediff-diff-options " " ediff-ignore-case-option)
 	    ediff-actual-diff3-options
 	    (concat ediff-diff3-options " " ediff-ignore-case-option3))



1.122     +18 -0     XEmacs/packages/xemacs-packages/ediff/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ediff/ChangeLog,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -p -r1.121 -r1.122
--- ChangeLog	2007/08/28 12:10:06	1.121
+++ ChangeLog	2007/11/02 06:12:07	1.122
@@ -1,3 +1,21 @@
+2007-11-02  Michael Kifer  <kifer at cs.stonybrook.edu>
+	
+	* ediff-util.el (ediff-make-current-diff-overlay): do not use face-name.
+	Got rid of ediff-copy-list.
+	
+	* ediff-diff.el (ediff-set-fine-diff-properties-in-one-buffer): do not
+	use face-name.
+	(ediff-test-utility,ediff-diff-mandatory-option)
+	(ediff-reset-diff-options): removed to simplify yhe mandatory option
+	handling on windows.
+	(ediff-set-diff-options): added.
+	(ediff-diff-options): changed.
+	
+	* ediff-vers.el (ediff-vc-internal): use ediff-vc-revision-other-window.
+	(ediff-vc-merge-internal): use ediff-vc-revision-other-window and
+	ediff-vc-working-revision.
+	Require vc-hooks.
+	
 2007-08-28  Norbert Koch  <viteno at xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.71 released.





More information about the XEmacs-CVS mailing list