Commit 4ae69eac authored by Michael Kifer's avatar Michael Kifer
Browse files

*** empty log message ***

parent ae37fce9
......@@ -25,8 +25,10 @@
(require 'ediff-init)
(defvar ediff-shell
(cond ((eq system-type 'emx) "cmd") ; OS/2
((eq system-type 'ms-dos) shell-file-name) ; no standard name on MS-DOS
((memq system-type '(vax-vms axp-vms)) "*dcl*") ; VMS
(t "sh")) ; UNIX
"*The shell used to run diff and patch. If user's .profile or
......@@ -84,7 +86,7 @@ Lines that do not match are assumed to be error messages.")
;;; Fine differences
(ediff-defvar-local ediff-auto-refine (if (ediff-window-display-p) 'on 'nix)
(ediff-defvar-local ediff-auto-refine (if (ediff-has-face-support-p) 'on 'nix)
"If `on', Ediff auto-highlights fine diffs for the current diff region.
If `off', auto-highlighting is not used. If `nix', no fine diffs are shown
at all, unless the user force-refines the region by hitting `*'.
......@@ -132,9 +134,9 @@ one optional arguments, diff-number to refine.")
;; ediff-setup-diff-regions-function, which can also have the value
;; ediff-setup-diff-regions3, which takes 4 arguments.
(defun ediff-setup-diff-regions (file-A file-B file-C)
;; Force all minibuffers to display ediff's messages.
;; When xemacs implements minibufferless frames, this won't be necessary
(if ediff-xemacs-p (setq synchronize-minibuffers t))
;;; ;; Force all minibuffers to display ediff's messages.
;;; ;; When xemacs implements minibufferless frames, this won't be necessary
;;; (if ediff-xemacs-p (setq synchronize-minibuffers t))
(or (ediff-buffer-live-p ediff-diff-buffer)
(setq ediff-diff-buffer
......@@ -148,8 +150,7 @@ one optional arguments, diff-number to refine.")
;;(message "Computing differences ... done")
(ediff-convert-diffs-to-overlays
(ediff-extract-diffs
ediff-diff-buffer ediff-word-mode ediff-narrow-bounds))
)
ediff-diff-buffer ediff-word-mode ediff-narrow-bounds)))
;; If file-A/B/C is nil, do 2-way comparison with the non-nil buffers
;; This function works for diff3 and diff2 jobs
......@@ -178,7 +179,8 @@ one optional arguments, diff-number to refine.")
) ; exec process
(ediff-prepare-error-list ok-regexp ediff-fine-diff-buffer)
;;(ediff-message-if-verbose
(ediff-message-if-verbose
"")
;; "Refining difference region %d ... done" (1+ reg-num))
(setq diff-list
......@@ -463,15 +465,9 @@ one optional arguments, diff-number to refine.")
(setq pt-saved (ediff-eval-in-buffer buff (point)))))
(setq overlay (ediff-make-bullet-proof-overlay begin end buff))
;; Priorities of overlays should be equal in all ediff control
;; panel buffers. Otherwise it won't work due to Emacs
;; bug, as insert-in-front-hooks will be called
;; only on behalf of the buffer with higher priority.
(ediff-overlay-put overlay 'priority ediff-shadow-overlay-priority)
(ediff-overlay-put overlay 'ediff-diff-num current-diff)
(ediff-overlay-put
overlay 'insert-in-front-hooks '(ediff-insert-in-front))
(if (and (ediff-window-display-p)
(if (and (ediff-has-face-support-p)
ediff-use-faces ediff-highlight-all-diffs)
(ediff-set-overlay-face
overlay (ediff-background-face buf-type current-diff)))
......@@ -502,7 +498,7 @@ one optional arguments, diff-number to refine.")
(or n (setq n ediff-current-difference))
(if (< ediff-number-of-differences 1)
(error "No differences found"))
(error "Sorry, it is not my job to munch identical variants..."))
(if ediff-word-mode
(setq flag 'skip
......@@ -668,10 +664,10 @@ one optional arguments, diff-number to refine.")
;; if fine diff vector is not set for diff N, then do nothing
(defun ediff-set-fine-diff-properties (n &optional default)
(or (not (ediff-window-display-p))
(or (not (ediff-has-face-support-p))
(< n 0)
(>= n ediff-number-of-differences)
;; in a window system, set faces and priorities of fine overlays
;; when faces are supported, set faces and priorities of fine overlays
(progn
(ediff-set-fine-diff-properties-in-one-buffer 'A n default)
(ediff-set-fine-diff-properties-in-one-buffer 'B n default)
......@@ -966,9 +962,9 @@ one optional arguments, diff-number to refine.")
;; or it is the ancestor file.
(defun ediff-setup-diff-regions3 (file-A file-B file-C)
;; force all minibuffers to display ediff's messages.
;; when xemacs implements minibufferless frames, this won't be necessary
(if ediff-xemacs-p (setq synchronize-minibuffers t))
;;; ;; force all minibuffers to display ediff's messages.
;;; ;; when xemacs implements minibufferless frames, this won't be necessary
;;; (if ediff-xemacs-p (setq synchronize-minibuffers t))
(or (ediff-buffer-live-p ediff-diff-buffer)
(setq ediff-diff-buffer
......@@ -987,11 +983,11 @@ one optional arguments, diff-number to refine.")
))
;; Execute PROGRAM asynchronously, unless OS/2 or unless SYNC is non-nil.
;; BUFFER must be a buffer object, and must be alive.
;; All arguments in ARGS must be strings. The first arg may be a blank string,
;; in which case we delete it from ARGS list. We also delete nil from args.
(defun ediff-exec-process (program buffer sync &rest args)
;; Execute PROGRAM asynchronously, unless OS/2, Windows-*, or DOS, or unless
;; SYNCH is non-nil. BUFFER must be a buffer object, and must be alive. All
;; arguments in ARGS must be strings. The first arg may be a blank string, in
;; which case we delete it from ARGS list. We also delete nil from args.
(defun ediff-exec-process (program buffer synch &rest args)
(let ((data (match-data)))
(if (string-match "^[ \t]*$" (car args)) ; delete blank string
(setq args (cdr args)))
......@@ -1004,13 +1000,17 @@ one optional arguments, diff-number to refine.")
(set-buffer buffer)
(erase-buffer)
(setq default-directory directory)
(if (or (eq system-type 'emx) sync)
;; In OS/2 do it synchronously, since OS/2 doesn't let us
(if (or (memq system-type '(emx ms-dos windows-nt windows-95))
synch)
;; In OS/2 (emx) do it synchronously, since OS/2 doesn't let us
;; delete files used by other processes. Thus, in ediff-buffers
;; and similar functions, we can't delete temp files because
;; they might be used by the async process that computes
;; they might be used by the asynch process that computes
;; custom diffs. So, we have to wait till custom diff
;; subprocess is done.
;; Similarly for Windows-*
;; In DOS, must synchronize because DOS doesn't have
;; asynchronous processes.
(apply 'call-process program nil buffer nil args)
;; On other systems, do it asynchronously.
(setq proc (get-buffer-process buffer))
......@@ -1164,4 +1164,5 @@ argument to `skip-chars-forward'."
(provide 'ediff-diff)
;; ediff-diff.el ends here
......@@ -23,10 +23,12 @@
;;; Code:
;; These must be placed in menu-bar.el in Emacs
;;; These must be placed in menu-bar.el in Emacs
;;
;; (define-key menu-bar-tools-menu [ediff-doc]
;; '("Ediff Manual..." . ediff-documentation))
;; (define-key menu-bar-tools-menu [eregistry]
;; '("List Ediff Sessions" . ediff-show-registry))
;; '("List Ediff Sessions..." . ediff-show-registry))
;; (define-key menu-bar-tools-menu [epatch]
;; '("Apply Patch" . menu-bar-epatch-menu))
;; (define-key menu-bar-tools-menu [ediff-merge]
......@@ -46,14 +48,16 @@
'("Tools") epatch-menu "OO-Browser...")
(add-menu-button
'("Tools")
["List Ediff Sessions" ediff-show-registry t] "OO-Browser...")
["List Ediff Sessions..." ediff-show-registry t] "OO-Browser...")
(add-menu-button
'("Tools")
["---" nil nil] "OO-Browser...")
["Ediff Manual..." ediff-documentation t] "OO-Browser...")
(add-menu-button
'("Tools")
["-------" nil nil] "OO-Browser...")
)))
;; explicit string-match is needed: ediff-xemacs-p is not defined at build time
(cond ((string-match "XEmacs" emacs-version)
(defvar ediff-menu
......@@ -73,7 +77,8 @@
["Windows Line-by-line..." ediff-windows-linewise t]
"---"
["Regions Word-by-word..." ediff-regions-wordwise t]
["Regions Line-by-line..." ediff-regions-linewise t]))
["Regions Line-by-line..." ediff-regions-linewise t]
))
(defvar ediff-merge-menu
'("Merge"
["Files..." ediff-merge-files t]
......@@ -91,15 +96,16 @@
ediff-merge-revisions-with-ancestor t]
["Directory Revisions..." ediff-merge-directory-revisions t]
["Directory Revisions with Ancestor..."
ediff-merge-directory-revisions-with-ancestor t]))
ediff-merge-directory-revisions-with-ancestor t]
))
(defvar epatch-menu
'("Apply Patch"
["To a file..." ediff-patch-file t]
["To a buffer..." ediff-patch-buffer t]))
["To a buffer..." ediff-patch-buffer t]
))
;; put these menus before Object-Oriented-Browser in Tools menu
(add-hook 'before-init-hook 'ediff-xemacs-init-menus)
;; this `if' is to be deleted before going into distribution
(if (not purify-flag)
(ediff-xemacs-init-menus))
)
......@@ -117,7 +123,17 @@
;; define ediff-menu
(define-key menu-bar-ediff-menu [window]
'("This Window And Next Window" . compare-windows))
'("This Window and Next Window" . compare-windows))
(define-key menu-bar-ediff-menu [ediff-windows-linewise]
'("Windows Line-by-line..." . ediff-windows-linewise))
(define-key menu-bar-ediff-menu [ediff-windows-wordwise]
'("Windows Word-by-word..." . ediff-windows-wordwise))
(define-key menu-bar-ediff-menu [separator-ediff-windows] '("--"))
(define-key menu-bar-ediff-menu [ediff-regions-linewise]
'("Regions Line-by-line..." . ediff-regions-linewise))
(define-key menu-bar-ediff-menu [ediff-regions-wordwise]
'("Regions Word-by-word..." . ediff-regions-wordwise))
(define-key menu-bar-ediff-menu [separator-ediff-regions] '("--"))
(define-key menu-bar-ediff-menu [ediff-dir-revision]
'("Directory Revisions..." . ediff-directory-revisions))
(define-key menu-bar-ediff-menu [ediff-revision]
......@@ -136,16 +152,6 @@
'("Two Buffers..." . ediff-buffers))
(define-key menu-bar-ediff-menu [ediff-files]
'("Two Files..." . ediff-files))
(define-key menu-bar-ediff-menu [separator-ediff-regions] '("--"))
(define-key menu-bar-ediff-menu [ediff-regions-linewise]
'("Regions Line-by-line..." . ediff-regions-linewise))
(define-key menu-bar-ediff-menu [ediff-regions-wordwise]
'("Regions Word-by-word..." . ediff-regions-wordwise))
(define-key menu-bar-ediff-menu [separator-ediff-windows] '("--"))
(define-key menu-bar-ediff-menu [ediff-windows-linewise]
'("Windows Line-by-line..." . ediff-windows-linewise))
(define-key menu-bar-ediff-menu [ediff-windows-wordwise]
'("Windows Word-by-word..." . ediff-windows-wordwise))
;; define merge menu
(define-key
......@@ -268,7 +274,7 @@
;; misc
(autoload 'ediff-show-registry
"ediff-mult"
"ediff-meta"
"Display the registry of active Ediff sessions"
t)
(autoload 'ediff-version
......
This diff is collapsed.
......@@ -25,12 +25,12 @@
(require 'ediff-init)
(defvar ediff-default-variant 'default-A
(defvar ediff-default-variant 'combined
"*The variant to be used as a default for buffer C in merging.
Valid values are the symbols `default-A', `default-B', and `combined'.")
(defvar ediff-combination-pattern
'("#ifdef NEW /* variant A */" "#else /* variant B */" "#endif /* NEW */")
'("<<<<<<<<<<<<<< variant A" ">>>>>>>>>>>>>> variant B" "======= end of combination")
"*Pattern to be used for combining difference regions in buffers A and B.
The value is (STRING1 STRING2 STRING3). The combined text will look like this:
......@@ -213,9 +213,11 @@ Used only for merging jobs."
;; N here is the user's region number. It is 1+ what Ediff uses internally.
(defun ediff-combine-diffs (n &optional batch-invocation)
"Combine Nth diff regions of buffers A and B and place the combination in C.
Combining is done using the list in variable `ediff-combination-pattern'."
N is a prefix argument. If nil, combine the current difference regions.
Combining is done according to the specifications in variable
`ediff-combination-pattern'."
(interactive "P")
(setq n (if n (1- n) ediff-current-difference))
(setq n (if (numberp n) (1- n) ediff-current-difference))
(let (regA regB reg-combined)
(setq regA (ediff-get-region-contents n 'A ediff-control-buffer)
......@@ -224,7 +226,7 @@ Combining is done using the list in variable `ediff-combination-pattern'."
(setq reg-combined (ediff-make-combined-diff regA regB))
(ediff-copy-diff n nil 'C batch-invocation reg-combined))
(or batch-invocation (ediff-recenter)))
(or batch-invocation (ediff-jump-to-difference (1+ n))))
;; Checks if the region in buff C looks like a combination of the regions
......
......@@ -23,7 +23,7 @@
;;; Commentary:
;; Users are strongly encourage to add functionality to this file.
;; Users are strongly encouraged to add functionality to this file.
;; In particular, epatch needs to be enhanced to work with multi-file
;; patches. The present file contains all the infrastructure needed for that.
;;
......@@ -300,9 +300,9 @@ Moves in circular fashion. With numeric prefix arg, skip this many items."
;; ((dir1 dir2 dir3) (file . num) (file . num)...)
;; where num encodes the set of dirs where the file is found:
;; 2 - only dir1; 3 - only dir2; 5 - only dir3; 6 - dir1&2; 10 - dir1&3; etc.
(defun ediff-intersect-directories (jobname diff-var regexp dir1 dir2
&optional dir3 comparison-func)
(require 'cl)
(defun ediff-intersect-directories (jobname
diff-var regexp dir1 dir2
&optional dir3 comparison-func)
(setq comparison-func (or comparison-func 'string=))
(let (lis1 lis2 lis3 common auxdir1 auxdir2 auxdir3 difflist)
......@@ -318,7 +318,7 @@ Moves in circular fashion. With numeric prefix arg, skip this many items."
(setq lis1 (delete "." lis1)
lis1 (delete ".." lis1))
(setq common (intersection lis1 lis2 ':test comparison-func))
(setq common (ediff-intersection lis1 lis2 comparison-func))
;; get rid of files that are directories in dir1 but not dir2
(mapcar (function (lambda (elt)
(if (Xor (file-directory-p (concat auxdir1 elt))
......@@ -326,7 +326,7 @@ Moves in circular fashion. With numeric prefix arg, skip this many items."
(setq common (delq elt common)))))
common)
;; intersect with the third dir
(if lis3 (setq common (intersection common lis3 ':test comparison-func)))
(if lis3 (setq common (ediff-intersection common lis3 comparison-func)))
(if (ediff-comparison-metajob3 jobname)
(mapcar (function (lambda (elt)
(if (Xor (file-directory-p (concat auxdir1 elt))
......@@ -334,19 +334,20 @@ Moves in circular fashion. With numeric prefix arg, skip this many items."
(setq common (delq elt common)))))
common))
;; trying to avoid side effects of sorting
(setq common (sort (copy-list common) 'string-lessp))
;; copying is needed because sort sorts via side effects
(setq common (sort (ediff-copy-list common) 'string-lessp))
;; compute difference list
(setq difflist (set-difference
(union (union lis1 lis2 ':test comparison-func)
lis3
':test comparison-func)
(setq difflist (ediff-set-difference
(ediff-union (ediff-union lis1 lis2 comparison-func)
lis3
comparison-func)
common
':test comparison-func)
comparison-func)
difflist (delete "." difflist)
;; copy-list needed because sort sorts it by side effects
difflist (sort (copy-list (delete ".." difflist)) 'string-lessp))
;; copying is needed because sort sorts via side effects
difflist (sort (ediff-copy-list (delete ".." difflist))
'string-lessp))
(setq difflist (mapcar (function (lambda (elt) (cons elt 1))) difflist))
......@@ -377,7 +378,6 @@ Moves in circular fashion. With numeric prefix arg, skip this many items."
;; find directory files that are under revision.
;; display subdirectories, too, since we may visit them recursively.
(defun ediff-get-directory-files-under-revision (jobname regexp dir1)
(require 'cl)
(let (lis1 elt common auxdir1)
(setq auxdir1 (file-name-as-directory dir1)
lis1 (directory-files auxdir1 nil regexp))
......@@ -389,14 +389,17 @@ Moves in circular fashion. With numeric prefix arg, skip this many items."
(cond ((file-directory-p (concat auxdir1 elt))
(setq common (cons elt common)))
((file-exists-p (concat auxdir1 elt ",v"))
(setq common (cons elt common))))
(setq common (cons elt common)))
((file-exists-p (concat auxdir1 "RCS/" elt ",v"))
(setq common (cons elt common)))
) ; cond
) ; while
(setq common (delete "." common)
common (delete ".." common))
;; trying to avoid side effects of sorting
(setq common (sort (copy-list common) 'string-lessp))
;; copying is needed because sort sorts via side effects
(setq common (sort (ediff-copy-list common) 'string-lessp))
;; return result
(cons (list regexp auxdir1 nil nil)
......@@ -942,7 +945,9 @@ Useful commands:
(if (ediff-buffer-live-p session-buf)
(ediff-eval-in-buffer session-buf
(if (eq ediff-control-buffer session-buf) ; individual session
(setq custom-diff-buf ediff-custom-diff-buffer))))
(progn
(ediff-compute-custom-diffs-maybe)
(setq custom-diff-buf ediff-custom-diff-buffer)))))
(or (ediff-buffer-live-p meta-diff-buff)
(error "Ediff: something wrong--no multiple diffs buffer"))
......@@ -953,7 +958,9 @@ Useful commands:
(goto-char (point-max))
(insert-buffer custom-diff-buf)
(insert "\n")))
((eq metajob 'ediff-directories)
((memq metajob '(ediff-directories
ediff-merge-directories
ediff-merge-directories-with-ancestor))
;; get diffs by calling shell command on ediff-custom-diff-program
(save-excursion
(set-buffer (setq tmp-buf (get-buffer-create ediff-tmp-buffer)))
......@@ -970,10 +977,8 @@ Useful commands:
(insert-buffer tmp-buf)
(insert "\n")))
(t
(error
"Session %d is marked but inactive--can't make its diff"
sessionNum)))
))
(error "Can't make context diff for Session %d" sessionNum )))
))
(defun ediff-collect-custom-diffs ()
"Collect custom diffs of marked sessions in buffer `*Ediff Multifile Diffs*'.
......@@ -1185,10 +1190,11 @@ all marked sessions must be active."
(t (ediff-skip-unsuitable-frames 'ok-unsplittable)
(set-window-buffer (selected-window) meta-buf)))
))
(if (ediff-window-display-p)
(if (and (ediff-window-display-p)
(window-live-p
(setq wind (ediff-get-visible-buffer-window meta-buf))))
(progn
(setq frame
(window-frame (ediff-get-visible-buffer-window meta-buf)))
(setq frame (window-frame wind))
(raise-frame frame)
(ediff-reset-mouse frame)))
(run-hooks 'ediff-show-session-group-hook)
......@@ -1213,7 +1219,7 @@ all marked sessions must be active."
(error "No active Ediff sessions or corrupted session registry"))
(let (wind frame)
;; for some reason, point moves in ediff-registry-buffer, so we preserve it
;; explictly
;; explicitly
(ediff-eval-in-buffer ediff-registry-buffer
(save-excursion
(cond ((setq wind
......@@ -1322,7 +1328,7 @@ If this is a session registry buffer then just bury it."
(bury-buffer)
(beep)
(message
"Group has active sessions, panel not deleted")))
"Session group suspended, not deleted (has active sessions)")))
(ediff-cleanup-meta-buffer parent-buf)
(ediff-kill-buffer-carefully dir-diffs-buffer)
(ediff-kill-buffer-carefully meta-diff-buffer)
......@@ -1342,7 +1348,7 @@ If this is a session registry buffer then just bury it."
(kill-buffer buf))
;; obtain information on a meta record where the user clicked or typed
;; Obtain information on a meta record where the user clicked or typed
;; BUF is the buffer where this happened and POINT is the position
;; If optional NOERROR arg is given, don't report error and return nil if no
;; meta info is found on line.
......
This diff is collapsed.
......@@ -85,29 +85,28 @@ This variable has no effect when buffer-A/B/C are shown in different frames.
In this case, Ediff will use those frames to display these buffers.")
(defconst ediff-control-frame-parameters
(if (ediff-window-display-p)
(list
'(name . "Ediff")
;;'(unsplittable . t)
'(minibuffer . nil)
'(user-position . t) ; Emacs only
'(vertical-scroll-bars . nil) ; Emacs only
'(scrollbar-width . 0) ; XEmacs only
'(menu-bar-lines . 0) ; Emacs only
'(visibility . nil) ; doesn't work for XEmacs yet
;; don't lower and auto-raise
'(auto-lower . nil)
'(auto-raise . t)
;; this blocks queries from window manager as to where to put
;; ediff's control frame. we put the frame outside the display,
;; so the initial frame won't jump all over the screen
(cons 'top (if (fboundp 'ediff-display-pixel-height)
(1+ (ediff-display-pixel-height))
3000))
(cons 'left (if (fboundp 'ediff-display-pixel-width)
(1+ (ediff-display-pixel-width))
3000))
))
(list
'(name . "Ediff")
;;'(unsplittable . t)
'(minibuffer . nil)
'(user-position . t) ; Emacs only
'(vertical-scroll-bars . nil) ; Emacs only
'(scrollbar-width . 0) ; XEmacs only
'(menu-bar-lines . 0) ; Emacs only
'(visibility . nil) ; doesn't work for XEmacs yet
;; don't lower and auto-raise
'(auto-lower . nil)
'(auto-raise . t)
;; this blocks queries from window manager as to where to put
;; ediff's control frame. we put the frame outside the display,
;; so the initial frame won't jump all over the screen
(cons 'top (if (fboundp 'ediff-display-pixel-height)
(1+ (ediff-display-pixel-height))
3000))
(cons 'left (if (fboundp 'ediff-display-pixel-width)
(1+ (ediff-display-pixel-width))
3000))
)
"Frame parameters for displaying Ediff Control Panel.
Do not specify width and height here. These are computed automatically.")
......@@ -266,7 +265,7 @@ into icons, regardless of the window manager.")
(defun ediff-setup-windows-plain-merge (buf-A buf-B buf-C control-buffer)
;; skip dedicated and unsplittable frames
(ediff-destroy-control-frame control-buffer)
(let ((window-min-height 2)
(let ((window-min-height 1)
split-window-function
merge-window-share merge-window-lines
wind-A wind-B wind-C)
......@@ -319,7 +318,7 @@ into icons, regardless of the window manager.")
(defun ediff-setup-windows-plain-compare (buf-A buf-B buf-C control-buffer)
;; skip dedicated and unsplittable frames
(ediff-destroy-control-frame control-buffer)
(let ((window-min-height 2)
(let ((window-min-height 1)
split-window-function wind-width-or-height
three-way-comparison
wind-A-start wind-B-start wind-A wind-B wind-C)
......@@ -386,7 +385,7 @@ into icons, regardless of the window manager.")
))
;; dispatch the appropriate window setup function
;; dispatch an appropriate window setup function
(defun ediff-setup-windows-multiframe (buf-A buf-B buf-C control-buf)
(ediff-eval-in-buffer control-buf
(setq ediff-multiframe t))
......@@ -408,7 +407,7 @@ into icons, regardless of the window manager.")
;; Unsplittable frames are taken care of later.
(ediff-skip-unsuitable-frames 'ok-unsplittable)
(let* ((window-min-height 2)
(let* ((window-min-height 1)
(wind-A (ediff-get-visible-buffer-window buf-A))
(wind-B (ediff-get-visible-buffer-window buf-B))
(wind-C (ediff-get-visible-buffer-window buf-C))
......@@ -486,7 +485,7 @@ into icons, regardless of the window manager.")
(if use-same-frame
(let ((curr-frame (selected-frame))
(window-min-height 2))
(window-min-height 1))
;; avoid dedicated and non-splittable windows
(ediff-skip-unsuitable-frames)
(or (eq curr-frame (selected-frame))
......@@ -583,7 +582,7 @@ into icons, regardless of the window manager.")
;; Unsplittable frames are taken care of later.
(ediff-skip-unsuitable-frames 'ok-unsplittable)
(let* ((window-min-height 2)
(let* ((window-min-height 1)
(wind-A (ediff-get-visible-buffer-window buf-A))
(wind-B (ediff-get-visible-buffer-window buf-B))
(wind-C (ediff-get-visible-buffer-window buf-C))
......@@ -754,6 +753,8 @@ into icons, regardless of the window manager.")
(or
(window-dedicated-p (selected-window))
(ediff-frame-iconified-p (selected-frame))
(< (frame-height (selected-frame))
(* 3 window-min-height))
(if ok-unsplittable
nil
(ediff-frame-unsplittable-p (selected-frame)))))
......@@ -769,7 +770,7 @@ into icons, regardless of the window manager.")
;; Prepare or refresh control frame
(defun ediff-setup-control-frame (ctl-buffer designated-minibuffer-frame)
(let ((window-min-height 2)
(let ((window-min-height 1)
ctl-frame-iconified-p dont-iconify-ctl-frame deiconify-ctl-frame
ctl-frame old-ctl-frame lines user-grabbed-mouse
fheight fwidth adjusted-parameters)
......@@ -780,20 +781,11 @@ into icons, regardless of the window manager.")
(run-hooks 'ediff-before-setup-control-frame-hook))
(setq old-ctl-frame (ediff-eval-in-buffer ctl-buffer ediff-control-frame))
;; Delete the old ctl frame and get a new ctl frame.
;; The old ctl frame is deleted to let emacs reset default minibuffer
;; frame or when the ctl frame needs to be moved.
;; The old frame isn't reused, since ediff-setup-control-frame is called
;; very rarely, so the overhead is minimal.
(if (frame-live-p old-ctl-frame) (delete-frame old-ctl-frame))
;;(redraw-display)
;; new ctl frame should be created while ctl-buff is current, so that
;; the local default-minibuffer-frame will be consulted and
;; that ediff-control-frame-parameters will have the right value.
(ediff-eval-in-buffer ctl-buffer
(let ((default-minibuffer-frame designated-minibuffer-frame))
(setq ctl-frame (make-frame ediff-control-frame-parameters)
ediff-control-frame ctl-frame)))
(setq ctl-frame (if (frame-live-p old-ctl-frame)
old-ctl-frame
(make-frame ediff-control-frame-parameters))
ediff-control-frame ctl-frame))
(setq ctl-frame-iconified-p (ediff-frame-iconified-p ctl-frame))
(select-frame ctl-frame)
......@@ -817,19 +809,21 @@ into icons, regardless of the window manager.")
dont-iconify-ctl-frame))
;; 1 more line for the modeline
(setq lines (if ediff-xemacs-p
(+ 2 (count-lines (point-min) (point-max)))
(1+ (count-lines (point-min) (point-max))))
(setq lines (1+ (count-lines (point-min) (point-max)))
fheight lines
fwidth (+ (ediff-help-message-line-length) 2)
adjusted-parameters (append (list
'(visibility . t)
;; possibly change surrogate minibuffer
(cons 'minibuffer
(minibuffer-window
designated-minibuffer-frame))
(cons 'width fwidth)
(cons 'height fheight))
(funcall
ediff-control-frame-position-function
ctl-buffer fwidth fheight)))
(if ediff-prefer-long-help-message
(if ediff-use-long-help-message
(setq adjusted-parameters
(cons '(auto-raise . nil) adjusted-parameters)))