Commit c3912d54 authored by Michael Kifer's avatar Michael Kifer
Browse files

* ediff-init.el: comments.

* ediff-hook.el: Got rid of autoloads. Not needed, since the hook
is loaded.

* ediff-mult.el (ediff-intersect-directories,
ediff-prepare-meta-buffer,ediff-get-directory-files-under-revision):
cleanup.
(ediff-draw-dir-diffs): now supports the "C" command in directory
difference buffer.
(ediff-dir-diff-copy-file): new function that implements copying
of files from one Ediff dir to another
(ediff-bury-dir-diffs-buffer): kills the buffer instead.
(ediff-append-custom-diff): better error msgs.

* ediff-util.el (ediff-compute-custom-diffs-maybe): buglet fix.
(ediff-inferior-compare-regions): Use
ediff-clone-buffer-for-region-comparison. Better and simpler interface.

* ediff.el (ediff-directories-internal): Cleanup.
(ediff-clone-buffer-for-region-comparison): Better interface.
parent 31ade731
2002-03-05 Michael Kifer <kifer@cs.stonybrook.edu>
* ediff-init.el: comments.
* ediff-hook.el: Got rid of autoloads. Not needed, since the hook
is loaded.
* ediff-mult.el (ediff-intersect-directories,
ediff-prepare-meta-buffer,ediff-get-directory-files-under-revision):
cleanup.
(ediff-draw-dir-diffs): now supports the "C" command in directory
difference buffer.
(ediff-dir-diff-copy-file): new function that implements copying
of files from one Ediff dir to another
(ediff-bury-dir-diffs-buffer): kills the buffer instead.
(ediff-append-custom-diff): better error msgs.
* ediff-util.el (ediff-compute-custom-diffs-maybe): buglet fix.
(ediff-inferior-compare-regions): Use
ediff-clone-buffer-for-region-comparison. Better and simpler interface.
* ediff.el (ediff-directories-internal): Cleanup.
(ediff-clone-buffer-for-region-comparison): Better interface.
2002-03-04 Richard M. Stallman <rms@gnu.org>
 
* emacs-lisp/easy-mmode.el (define-minor-mode):
......
......@@ -344,12 +344,13 @@ It needs to be killed when we quit the session.")
(ediff-patch-metajob metajob)
;; add more here
))
;; jobs suitable for the operation of collecting diffs into a multifile patch
(defsubst ediff-collect-diffs-metajob (&optional metajob)
(memq (or metajob ediff-metajob-name)
'(ediff-directories
ediff-directory-revisions
ediff-merge-directories
ediff-merge-directories-with-ancestor
ediff-directory-revisions
ediff-merge-directory-revisions
ediff-merge-directory-revisions-with-ancestor
;; add more here
......
This diff is collapsed.
......@@ -3302,6 +3302,7 @@ Without an argument, it saves customized diff argument, if available
)
(save-buffer)))
;; This function operates only from an ediff control buffer
(defun ediff-compute-custom-diffs-maybe ()
(let ((buf-A-file-name (buffer-file-name ediff-buffer-A))
(buf-B-file-name (buffer-file-name ediff-buffer-B))
......@@ -3317,6 +3318,9 @@ Without an argument, it saves customized diff argument, if available
(setq ediff-custom-diff-buffer
(get-buffer-create
(ediff-unique-buffer-name "*ediff-custom-diff" "*"))))
(ediff-with-current-buffer ediff-custom-diff-buffer
(setq buffer-read-only nil)
(erase-buffer))
(ediff-exec-process
ediff-custom-diff-program ediff-custom-diff-buffer 'synchronize
ediff-custom-diff-options file-A file-B)
......@@ -3373,6 +3377,7 @@ Ediff Control Panel to restore highlighting."
(cond ((ediff-merge-job)
(setq bufB ediff-buffer-C)
;; ask which buffer to compare to the merge buffer
(while (cond ((eq answer ?A)
(setq bufA ediff-buffer-A
possibilities '(?B))
......@@ -3387,10 +3392,12 @@ Ediff Control Panel to restore highlighting."
(sit-for 2)
t))
(let ((cursor-in-echo-area t))
(message "Which buffer to compare to the merge buffer (A/B)? ")
(message
"Which buffer to compare to the merge buffer (A or B)? ")
(setq answer (capitalize (read-char-exclusive))))))
((ediff-3way-comparison-job)
;; ask which two buffers to compare
(while (cond ((memq answer possibilities)
(setq possibilities (delq answer possibilities))
(setq bufA
......@@ -3407,7 +3414,7 @@ Ediff Control Panel to restore highlighting."
t))
(let ((cursor-in-echo-area t))
(message "Enter the 1st buffer you want to compare (%s): "
(mapconcat 'char-to-string possibilities "/"))
(mapconcat 'char-to-string possibilities " or "))
(setq answer (capitalize (read-char-exclusive)))))
(setq answer "") ; silence error msg
(while (cond ((memq answer possibilities)
......@@ -3433,9 +3440,9 @@ Ediff Control Panel to restore highlighting."
bufB ediff-buffer-B
possibilities nil)))
(setq bufA (ediff-clone-buffer-for-region-comparison
(buffer-name bufA) "-Region.A-"))
(ediff-with-current-buffer bufA
(or (mark t)
(error "You forgot to specify a region in buffer %s" (buffer-name)))
(setq begA (region-beginning)
endA (region-end))
(goto-char begA)
......@@ -3445,9 +3452,10 @@ Ediff Control Panel to restore highlighting."
(end-of-line)
(or (eobp) (forward-char)) ; include the newline char
(setq endA (point)))
(setq bufB (ediff-clone-buffer-for-region-comparison
(buffer-name bufB) "-Region.B-"))
(ediff-with-current-buffer bufB
(or (mark t)
(error "You forgot to specify a region in buffer %s" (buffer-name)))
(setq begB (region-beginning)
endB (region-end))
(goto-char begB)
......@@ -3458,52 +3466,6 @@ Ediff Control Panel to restore highlighting."
(or (eobp) (forward-char)) ; include the newline char
(setq endB (point)))
(ediff-unselect-and-select-difference
ediff-current-difference 'unselect-only)
(ediff-paint-background-regions 'unhighlight)
(ediff-with-current-buffer bufA
(goto-char begA)
(set-mark endA)
(narrow-to-region begA endA)
;; (ediff-activate-mark)
)
;; (sit-for 0)
(ediff-with-current-buffer bufB
(goto-char begB)
(set-mark endB)
(narrow-to-region begB endB)
;; (ediff-activate-mark)
)
;; (sit-for 0)
;; At this point, possibilities contains either the window char A/B/C
;; that was not selected, or it is nil. We delete the window that is not
;; selected.
(if possibilities
(ediff-with-current-buffer ctl-buf
(let* ((wind-to-delete (eval
(ediff-get-symbol-from-alist
(car possibilities)
ediff-window-alist)))
(frame (window-frame wind-to-delete)))
(delete-window wind-to-delete)
(select-frame frame)
(balance-windows))))
(or (y-or-n-p
"Please check regions selected for comparison. Continue? ")
(setq quit-now t))
(ediff-with-current-buffer bufA
(widen))
(ediff-with-current-buffer bufB
(widen))
(if quit-now
(ediff-with-current-buffer ctl-buf
(ediff-recenter)
(sit-for 0)
(error "All right. Make up your mind and come back...")))
(ediff-regions-internal
bufA begA endA bufB begB endB
nil ; setup-hook
......
......@@ -6,8 +6,8 @@
;; Created: February 2, 1994
;; Keywords: comparing, merging, patching, tools, unix
(defconst ediff-version "2.76.1" "The current version of Ediff")
(defconst ediff-date "January 4, 2002" "Date of last update")
(defconst ediff-version "2.77" "The current version of Ediff")
(defconst ediff-date "March 5, 2002" "Date of last update")
;; This file is part of GNU Emacs.
......@@ -154,7 +154,7 @@
;; Last directory used by an Ediff command for the ancestor file.
(defvar ediff-last-dir-ancestor nil)
;; Last directory used by an Ediff command as the output directory for merge.
(defvar ediff-last-merge-autostore-dir)
(defvar ediff-last-merge-autostore-dir nil)
;; Used as a startup hook to set `_orig' patch file read-only.
......@@ -688,8 +688,11 @@ names. Only the files that are under revision control are taken into account."
(or (stringp merge-autostore-dir)
(error "%s: Directory for storing merged files must be a string"
jobname)))
(let (diffs ; var where ediff-intersect-directories returns the diff list
file-list meta-buf)
(let (;; dir-diff-struct is of the form (common-list diff-list)
;; It is a structure where ediff-intersect-directories returns
;; commonalities and differences among directories
dir-diff-struct
meta-buf)
(if (and ediff-autostore-merges
(ediff-merge-metajob jobname)
(not merge-autostore-dir))
......@@ -715,9 +718,9 @@ names. Only the files that are under revision control are taken into account."
"Directory for saving merged files = Ancestor Directory. Sure? ")
(error "Directory merge aborted")))))
(setq file-list (ediff-intersect-directories
jobname 'diffs
regexp dir1 dir2 dir3 merge-autostore-dir))
(setq dir-diff-struct (ediff-intersect-directories
jobname
regexp dir1 dir2 dir3 merge-autostore-dir))
(setq startup-hooks
;; this sets various vars in the meta buffer inside
;; ediff-prepare-meta-buffer
......@@ -725,11 +728,12 @@ names. Only the files that are under revision control are taken into account."
;; tell what to do if the user clicks on a session record
(setq ediff-session-action-function (quote ,action))
;; set ediff-dir-difference-list
(setq ediff-dir-difference-list (quote ,diffs)))
(setq ediff-dir-difference-list
(cdr (quote ,dir-diff-struct))))
startup-hooks))
(setq meta-buf (ediff-prepare-meta-buffer
'ediff-filegroup-action
file-list
(car dir-diff-struct)
"*Ediff Session Group Panel"
'ediff-redraw-directory-group-buffer
jobname
......@@ -839,10 +843,10 @@ If WIND-B is nil, use window next to WIND-A."
end-B (window-end))))
(setq buffer-A
(ediff-clone-buffer-for-window-comparison
buffer-A wind-A "-Window1-")
buffer-A wind-A "-Window.A-")
buffer-B
(ediff-clone-buffer-for-window-comparison
buffer-B wind-B "-Window2-"))
buffer-B wind-B "-Window.B-"))
(ediff-regions-internal
buffer-A beg-A end-A buffer-B beg-B end-B
startup-hooks job-name word-mode nil)))
......@@ -853,18 +857,32 @@ If WIND-B is nil, use window next to WIND-A."
buff-name
(concat buff-name region-name
(symbol-name (gensym)))))
(wind (ediff-get-visible-buffer-window buff-name)))
(wind (ediff-get-visible-buffer-window buff-name))
(pop-up-windows t)
other-wind
msg-buf)
(ediff-with-current-buffer cloned-buff
(setq ediff-temp-indirect-buffer t))
(if (window-live-p wind)
(set-window-buffer wind cloned-buff))
(pop-to-buffer cloned-buff)
(message
"Mark a region in buffer %s; then type %s. Use %s to abort."
(buffer-name cloned-buff)
(ediff-format-bindings-of 'exit-recursive-edit)
(ediff-format-bindings-of 'abort-recursive-edit))
(recursive-edit)
(with-temp-buffer
(erase-buffer)
(insert
(format "\n ******* Mark a region in buffer %s *******\n"
(buffer-name cloned-buff)))
(insert
(format "\n\t When done, type %s Use %s to abort\n "
(ediff-format-bindings-of 'exit-recursive-edit)
(ediff-format-bindings-of 'abort-recursive-edit)))
(goto-char (point-min))
(setq msg-buf (current-buffer))
(other-window 1)
(set-window-buffer (selected-window) msg-buf)
(shrink-window-if-larger-than-buffer)
(select-window wind)
(recursive-edit)
)
cloned-buff))
(defun ediff-clone-buffer-for-window-comparison (buff wind region-name)
......@@ -910,9 +928,9 @@ lines. For large regions, use `ediff-regions-linewise'."
(let ((buffer-A
(ediff-clone-buffer-for-region-comparison buffer-A "-Region1-"))
(ediff-clone-buffer-for-region-comparison buffer-A "-Region.A-"))
(buffer-B
(ediff-clone-buffer-for-region-comparison buffer-B "-Region2-"))
(ediff-clone-buffer-for-region-comparison buffer-B "-Region.B-"))
reg-A-beg reg-A-end reg-B-beg reg-B-end)
(save-excursion
(set-buffer buffer-A)
......@@ -954,9 +972,9 @@ lines. For small regions, use `ediff-regions-wordwise'."
(error "Buffer %S doesn't exist" buffer-B))
(let ((buffer-A
(ediff-clone-buffer-for-region-comparison buffer-A "-Region1-"))
(ediff-clone-buffer-for-region-comparison buffer-A "-Region.A-"))
(buffer-B
(ediff-clone-buffer-for-region-comparison buffer-B "-Region2-"))
(ediff-clone-buffer-for-region-comparison buffer-B "-Region.B-"))
reg-A-beg reg-A-end reg-B-beg reg-B-end)
(save-excursion
(set-buffer buffer-A)
......
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