Mercurial > emacs
comparison lisp/ediff-wind.el @ 26934:7583f44512d7
dummy
author | Dave Love <fx@gnu.org> |
---|---|
date | Sat, 18 Dec 1999 16:14:32 +0000 |
parents | 4f315ca65976 |
children | 42f9a58e0fc4 |
comparison
equal
deleted
inserted
replaced
26933:73340d009a9f | 26934:7583f44512d7 |
---|---|
71 | 71 |
72 (defcustom ediff-window-setup-function (if (ediff-window-display-p) | 72 (defcustom ediff-window-setup-function (if (ediff-window-display-p) |
73 'ediff-setup-windows-multiframe | 73 'ediff-setup-windows-multiframe |
74 'ediff-setup-windows-plain) | 74 'ediff-setup-windows-plain) |
75 "*Function called to set up windows. | 75 "*Function called to set up windows. |
76 Ediff provides a choice of two functions: ediff-setup-windows-plain, for | 76 Ediff provides a choice of two functions: `ediff-setup-windows-plain', for |
77 doing everything in one frame, and ediff-setup-windows-multiframe, | 77 doing everything in one frame, and `ediff-setup-windows-multiframe', |
78 which sets the control panel in a separate frame. Also, if the latter | 78 which sets the control panel in a separate frame. Also, if the latter |
79 function detects that one of the buffers A/B is seen in some other frame, | 79 function detects that one of the buffers A/B is seen in some other frame, |
80 it will try to keep that buffer in that frame. | 80 it will try to keep that buffer in that frame. |
81 | 81 |
82 If you don't like the two functions provided---write your own one. | 82 If you don't like the two functions provided---write your own one. |
83 The basic guidelines: | 83 The basic guidelines: |
84 1. It should leave the control buffer current and the control window | 84 1. It should leave the control buffer current and the control window |
85 selected. | 85 selected. |
86 2. It should set ediff-window-A, ediff-window-B, ediff-window-C, | 86 2. It should set `ediff-window-A', `ediff-window-B', `ediff-window-C', |
87 and ediff-control-window to contain window objects that display | 87 and `ediff-control-window' to contain window objects that display |
88 the corresponding buffers. | 88 the corresponding buffers. |
89 3. It should accept the following arguments: | 89 3. It should accept the following arguments: |
90 buffer-A, buffer-B, buffer-C, control-buffer | 90 buffer-A, buffer-B, buffer-C, control-buffer |
91 Buffer C may not be used in jobs that compare only two buffers. | 91 Buffer C may not be used in jobs that compare only two buffers. |
92 If you plan to do something fancy, take a close look at how the two | 92 If you plan to do something fancy, take a close look at how the two |
141 In this case, Ediff will use those frames to display these buffers." | 141 In this case, Ediff will use those frames to display these buffers." |
142 :type 'function | 142 :type 'function |
143 :group 'ediff-window) | 143 :group 'ediff-window) |
144 | 144 |
145 (defconst ediff-control-frame-parameters | 145 (defconst ediff-control-frame-parameters |
146 (list | 146 (list |
147 '(name . "Ediff") | 147 '(name . "Ediff") |
148 ;;'(unsplittable . t) | 148 ;;'(unsplittable . t) |
149 '(minibuffer . nil) | 149 '(minibuffer . nil) |
150 '(user-position . t) ; Emacs only | 150 '(user-position . t) ; Emacs only |
151 '(vertical-scroll-bars . nil) ; Emacs only | 151 '(vertical-scroll-bars . nil) ; Emacs only |
227 ;; Wide frame display | 227 ;; Wide frame display |
228 | 228 |
229 ;; t means Ediff is using wide display | 229 ;; t means Ediff is using wide display |
230 (ediff-defvar-local ediff-wide-display-p nil "") | 230 (ediff-defvar-local ediff-wide-display-p nil "") |
231 ;; keeps frame config for toggling wide display | 231 ;; keeps frame config for toggling wide display |
232 (ediff-defvar-local ediff-wide-display-orig-parameters nil | 232 (ediff-defvar-local ediff-wide-display-orig-parameters nil |
233 "Frame parameters to be restored when the user wants to toggle the wide | 233 "Frame parameters to be restored when the user wants to toggle the wide |
234 display off.") | 234 display off.") |
235 (ediff-defvar-local ediff-wide-display-frame nil | 235 (ediff-defvar-local ediff-wide-display-frame nil |
236 "Frame to be used for wide display.") | 236 "Frame to be used for wide display.") |
237 (ediff-defvar-local ediff-make-wide-display-function 'ediff-make-wide-display | 237 (ediff-defvar-local ediff-make-wide-display-function 'ediff-make-wide-display |
272 (event-window event) | 272 (event-window event) |
273 (posn-window (event-start event)))) | 273 (posn-window (event-start event)))) |
274 )) | 274 )) |
275 | 275 |
276 | 276 |
277 ;; Select the lowest window on the frame. | |
278 (defun ediff-select-lowest-window () | 277 (defun ediff-select-lowest-window () |
278 "Select the lowest window on the frame." | |
279 (if ediff-xemacs-p | 279 (if ediff-xemacs-p |
280 (select-window (frame-lowest-window)) | 280 (select-window (frame-lowest-window)) |
281 (let* ((lowest-window (selected-window)) | 281 (let* ((lowest-window (selected-window)) |
282 (bottom-edge (car (cdr (cdr (cdr (window-edges)))))) | 282 (bottom-edge (car (cdr (cdr (cdr (window-edges)))))) |
283 (last-window (save-excursion | 283 (last-window (save-excursion |
315 ;; in case user did a no-no on a tty | 315 ;; in case user did a no-no on a tty |
316 (or (ediff-window-display-p) | 316 (or (ediff-window-display-p) |
317 (setq ediff-window-setup-function 'ediff-setup-windows-plain)) | 317 (setq ediff-window-setup-function 'ediff-setup-windows-plain)) |
318 | 318 |
319 (or (ediff-keep-window-config control-buffer) | 319 (or (ediff-keep-window-config control-buffer) |
320 (funcall | 320 (funcall |
321 (ediff-with-current-buffer control-buffer ediff-window-setup-function) | 321 (ediff-with-current-buffer control-buffer ediff-window-setup-function) |
322 buffer-A buffer-B buffer-C control-buffer)) | 322 buffer-A buffer-B buffer-C control-buffer)) |
323 (run-hooks 'ediff-after-setup-windows-hook)) | 323 (run-hooks 'ediff-after-setup-windows-hook)) |
324 | 324 |
325 ;; Just set up 3 windows. | 325 ;; Just set up 3 windows. |
329 (ediff-with-current-buffer control-buffer | 329 (ediff-with-current-buffer control-buffer |
330 (setq ediff-multiframe nil)) | 330 (setq ediff-multiframe nil)) |
331 (if ediff-merge-job | 331 (if ediff-merge-job |
332 (ediff-setup-windows-plain-merge | 332 (ediff-setup-windows-plain-merge |
333 buffer-A buffer-B buffer-C control-buffer) | 333 buffer-A buffer-B buffer-C control-buffer) |
334 (ediff-setup-windows-plain-compare | 334 (ediff-setup-windows-plain-compare |
335 buffer-A buffer-B buffer-C control-buffer))) | 335 buffer-A buffer-B buffer-C control-buffer))) |
336 | 336 |
337 (defun ediff-setup-windows-plain-merge (buf-A buf-B buf-C control-buffer) | 337 (defun ediff-setup-windows-plain-merge (buf-A buf-B buf-C control-buffer) |
338 ;; skip dedicated and unsplittable frames | 338 ;; skip dedicated and unsplittable frames |
339 (ediff-destroy-control-frame control-buffer) | 339 (ediff-destroy-control-frame control-buffer) |
340 (let ((window-min-height 1) | 340 (let ((window-min-height 1) |
341 split-window-function | 341 split-window-function |
342 merge-window-share merge-window-lines | 342 merge-window-share merge-window-lines |
343 wind-A wind-B wind-C) | 343 wind-A wind-B wind-C) |
344 (ediff-with-current-buffer control-buffer | 344 (ediff-with-current-buffer control-buffer |
345 (setq merge-window-share ediff-merge-window-share | 345 (setq merge-window-share ediff-merge-window-share |
346 ;; this lets us have local versions of ediff-split-window-function | 346 ;; this lets us have local versions of ediff-split-window-function |
349 (split-window-vertically) | 349 (split-window-vertically) |
350 (ediff-select-lowest-window) | 350 (ediff-select-lowest-window) |
351 (ediff-setup-control-buffer control-buffer) | 351 (ediff-setup-control-buffer control-buffer) |
352 | 352 |
353 ;; go to the upper window and split it betw A, B, and possibly C | 353 ;; go to the upper window and split it betw A, B, and possibly C |
354 (other-window 1) | 354 (other-window 1) |
355 (setq merge-window-lines | 355 (setq merge-window-lines |
356 (max 2 (round (* (window-height) merge-window-share)))) | 356 (max 2 (round (* (window-height) merge-window-share)))) |
357 (switch-to-buffer buf-A) | 357 (switch-to-buffer buf-A) |
358 (setq wind-A (selected-window)) | 358 (setq wind-A (selected-window)) |
359 | 359 |
361 ;; It did't set things right unless we tell it to sit still | 361 ;; It did't set things right unless we tell it to sit still |
362 ;; 19.12 seems ok. | 362 ;; 19.12 seems ok. |
363 ;;(if ediff-xemacs-p (sit-for 0)) | 363 ;;(if ediff-xemacs-p (sit-for 0)) |
364 | 364 |
365 (split-window-vertically (max 2 (- (window-height) merge-window-lines))) | 365 (split-window-vertically (max 2 (- (window-height) merge-window-lines))) |
366 (if (eq (selected-window) wind-A) | 366 (if (eq (selected-window) wind-A) |
367 (other-window 1)) | 367 (other-window 1)) |
368 (setq wind-C (selected-window)) | 368 (setq wind-C (selected-window)) |
369 (switch-to-buffer buf-C) | 369 (switch-to-buffer buf-C) |
370 | 370 |
371 (select-window wind-A) | 371 (select-window wind-A) |
408 (split-window-vertically) | 408 (split-window-vertically) |
409 (ediff-select-lowest-window) | 409 (ediff-select-lowest-window) |
410 (ediff-setup-control-buffer control-buffer) | 410 (ediff-setup-control-buffer control-buffer) |
411 | 411 |
412 ;; go to the upper window and split it betw A, B, and possibly C | 412 ;; go to the upper window and split it betw A, B, and possibly C |
413 (other-window 1) | 413 (other-window 1) |
414 (switch-to-buffer buf-A) | 414 (switch-to-buffer buf-A) |
415 (setq wind-A (selected-window)) | 415 (setq wind-A (selected-window)) |
416 (if three-way-comparison | 416 (if three-way-comparison |
417 (setq wind-width-or-height | 417 (setq wind-width-or-height |
418 (/ (if (eq split-window-function 'split-window-vertically) | 418 (/ (if (eq split-window-function 'split-window-vertically) |
468 (defun ediff-setup-windows-multiframe-merge (buf-A buf-B buf-C control-buf) | 468 (defun ediff-setup-windows-multiframe-merge (buf-A buf-B buf-C control-buf) |
469 ;;; Algorithm: | 469 ;;; Algorithm: |
470 ;;; 1. Never use frames that have dedicated windows in them---it is bad to | 470 ;;; 1. Never use frames that have dedicated windows in them---it is bad to |
471 ;;; destroy dedicated windows. | 471 ;;; destroy dedicated windows. |
472 ;;; 2. If A and B are in the same frame but C's frame is different--- use one | 472 ;;; 2. If A and B are in the same frame but C's frame is different--- use one |
473 ;;; frame for A and B and use a separate frame for C. | 473 ;;; frame for A and B and use a separate frame for C. |
474 ;;; 3. If C's frame is non-existent, then: if the first suitable | 474 ;;; 3. If C's frame is non-existent, then: if the first suitable |
475 ;;; non-dedicated frame is different from A&B's, then use it for C. | 475 ;;; non-dedicated frame is different from A&B's, then use it for C. |
476 ;;; Otherwise, put A,B, and C in one frame. | 476 ;;; Otherwise, put A,B, and C in one frame. |
477 ;;; 4. If buffers A, B, C are is separate frames, use them to display these | 477 ;;; 4. If buffers A, B, C are is separate frames, use them to display these |
478 ;;; buffers. | 478 ;;; buffers. |
479 | 479 |
480 ;; Skip dedicated or iconified frames. | 480 ;; Skip dedicated or iconified frames. |
481 ;; Unsplittable frames are taken care of later. | 481 ;; Unsplittable frames are taken care of later. |
482 (ediff-skip-unsuitable-frames 'ok-unsplittable) | 482 (ediff-skip-unsuitable-frames 'ok-unsplittable) |
483 | 483 |
484 (let* ((window-min-height 1) | 484 (let* ((window-min-height 1) |
485 (wind-A (ediff-get-visible-buffer-window buf-A)) | 485 (wind-A (ediff-get-visible-buffer-window buf-A)) |
487 (wind-C (ediff-get-visible-buffer-window buf-C)) | 487 (wind-C (ediff-get-visible-buffer-window buf-C)) |
488 (frame-A (if wind-A (window-frame wind-A))) | 488 (frame-A (if wind-A (window-frame wind-A))) |
489 (frame-B (if wind-B (window-frame wind-B))) | 489 (frame-B (if wind-B (window-frame wind-B))) |
490 (frame-C (if wind-C (window-frame wind-C))) | 490 (frame-C (if wind-C (window-frame wind-C))) |
491 ;; on wide display, do things in one frame | 491 ;; on wide display, do things in one frame |
492 (force-one-frame | 492 (force-one-frame |
493 (ediff-with-current-buffer control-buf ediff-wide-display-p)) | 493 (ediff-with-current-buffer control-buf ediff-wide-display-p)) |
494 ;; this lets us have local versions of ediff-split-window-function | 494 ;; this lets us have local versions of ediff-split-window-function |
495 (split-window-function | 495 (split-window-function |
496 (ediff-with-current-buffer control-buf ediff-split-window-function)) | 496 (ediff-with-current-buffer control-buf ediff-split-window-function)) |
497 (orig-wind (selected-window)) | 497 (orig-wind (selected-window)) |
498 (orig-frame (selected-frame)) | 498 (orig-frame (selected-frame)) |
499 (use-same-frame (or force-one-frame | 499 (use-same-frame (or force-one-frame |
500 ;; A and C must be in one frame | 500 ;; A and C must be in one frame |
554 (setq wind-C (selected-window)) | 554 (setq wind-C (selected-window)) |
555 (setq done-C t))) | 555 (setq done-C t))) |
556 | 556 |
557 (if (and use-same-frame-for-AB ; implies wind A and B are suitable | 557 (if (and use-same-frame-for-AB ; implies wind A and B are suitable |
558 (window-live-p wind-A)) | 558 (window-live-p wind-A)) |
559 (progn | 559 (progn |
560 ;; wind-A must already be displaying buf-A | 560 ;; wind-A must already be displaying buf-A |
561 (select-window wind-A) | 561 (select-window wind-A) |
562 (delete-other-windows) | 562 (delete-other-windows) |
563 (setq wind-A (selected-window)) | 563 (setq wind-A (selected-window)) |
564 | 564 |
565 (funcall split-window-function) | 565 (funcall split-window-function) |
566 (if (eq (selected-window) wind-A) | 566 (if (eq (selected-window) wind-A) |
567 (other-window 1)) | 567 (other-window 1)) |
568 (switch-to-buffer buf-B) | 568 (switch-to-buffer buf-B) |
569 (setq wind-B (selected-window)) | 569 (setq wind-B (selected-window)) |
570 | 570 |
571 (setq done-A t | 571 (setq done-A t |
585 (switch-to-buffer buf-A) | 585 (switch-to-buffer buf-A) |
586 (setq wind-A (selected-window)) | 586 (setq wind-A (selected-window)) |
587 | 587 |
588 (split-window-vertically | 588 (split-window-vertically |
589 (max 2 (- (window-height) merge-window-lines))) | 589 (max 2 (- (window-height) merge-window-lines))) |
590 (if (eq (selected-window) wind-A) | 590 (if (eq (selected-window) wind-A) |
591 (other-window 1)) | 591 (other-window 1)) |
592 (setq wind-C (selected-window)) | 592 (setq wind-C (selected-window)) |
593 (switch-to-buffer buf-C) | 593 (switch-to-buffer buf-C) |
594 | 594 |
595 (select-window wind-A) | 595 (select-window wind-A) |
596 | 596 |
597 (funcall split-window-function) | 597 (funcall split-window-function) |
598 (if (eq (selected-window) wind-A) | 598 (if (eq (selected-window) wind-A) |
599 (other-window 1)) | 599 (other-window 1)) |
600 (switch-to-buffer buf-B) | 600 (switch-to-buffer buf-B) |
601 (setq wind-B (selected-window)) | 601 (setq wind-B (selected-window)) |
602 | 602 |
603 (setq done-A t | 603 (setq done-A t |
650 | 650 |
651 | 651 |
652 ;; Window setup for all comparison jobs, including 3way comparisons | 652 ;; Window setup for all comparison jobs, including 3way comparisons |
653 (defun ediff-setup-windows-multiframe-compare (buf-A buf-B buf-C control-buf) | 653 (defun ediff-setup-windows-multiframe-compare (buf-A buf-B buf-C control-buf) |
654 ;;; Algorithm: | 654 ;;; Algorithm: |
655 ;;; If a buffer is seen in a frame, use that frame for that buffer. | 655 ;;; If a buffer is seen in a frame, use that frame for that buffer. |
656 ;;; If it is not seen, use the current frame. | 656 ;;; If it is not seen, use the current frame. |
657 ;;; If both buffers are not seen, they share the current frame. If one | 657 ;;; If both buffers are not seen, they share the current frame. If one |
658 ;;; of the buffers is not seen, it is placed in the current frame (where | 658 ;;; of the buffers is not seen, it is placed in the current frame (where |
659 ;;; ediff started). If that frame is displaying the other buffer, it is | 659 ;;; ediff started). If that frame is displaying the other buffer, it is |
660 ;;; shared between the two buffers. | 660 ;;; shared between the two buffers. |
675 (frame-B (if wind-B (window-frame wind-B))) | 675 (frame-B (if wind-B (window-frame wind-B))) |
676 (frame-C (if wind-C (window-frame wind-C))) | 676 (frame-C (if wind-C (window-frame wind-C))) |
677 (ctl-frame-exists-p (ediff-with-current-buffer control-buf | 677 (ctl-frame-exists-p (ediff-with-current-buffer control-buf |
678 (frame-live-p ediff-control-frame))) | 678 (frame-live-p ediff-control-frame))) |
679 ;; on wide display, do things in one frame | 679 ;; on wide display, do things in one frame |
680 (force-one-frame | 680 (force-one-frame |
681 (ediff-with-current-buffer control-buf ediff-wide-display-p)) | 681 (ediff-with-current-buffer control-buf ediff-wide-display-p)) |
682 ;; this lets us have local versions of ediff-split-window-function | 682 ;; this lets us have local versions of ediff-split-window-function |
683 (split-window-function | 683 (split-window-function |
684 (ediff-with-current-buffer control-buf ediff-split-window-function)) | 684 (ediff-with-current-buffer control-buf ediff-split-window-function)) |
685 (three-way-comparison | 685 (three-way-comparison |
686 (ediff-with-current-buffer control-buf ediff-3way-comparison-job)) | 686 (ediff-with-current-buffer control-buf ediff-3way-comparison-job)) |
687 (orig-wind (selected-window)) | 687 (orig-wind (selected-window)) |
688 (use-same-frame (or force-one-frame | 688 (use-same-frame (or force-one-frame |
700 (or ctl-frame-exists-p | 700 (or ctl-frame-exists-p |
701 (eq frame-A (selected-frame)))) | 701 (eq frame-A (selected-frame)))) |
702 (and (not (frame-live-p frame-A)) | 702 (and (not (frame-live-p frame-A)) |
703 (or ctl-frame-exists-p | 703 (or ctl-frame-exists-p |
704 (eq frame-B (selected-frame)))))) | 704 (eq frame-B (selected-frame)))))) |
705 wind-A-start wind-B-start | 705 wind-A-start wind-B-start |
706 designated-minibuffer-frame | 706 designated-minibuffer-frame |
707 done-A done-B done-C) | 707 done-A done-B done-C) |
708 | 708 |
709 (ediff-with-current-buffer control-buf | 709 (ediff-with-current-buffer control-buf |
710 (setq wind-A-start (ediff-overlay-start | 710 (setq wind-A-start (ediff-overlay-start |
755 (window-height wind-A) | 755 (window-height wind-A) |
756 (window-width wind-A)) | 756 (window-width wind-A)) |
757 3))) | 757 3))) |
758 | 758 |
759 (funcall split-window-function wind-width-or-height) | 759 (funcall split-window-function wind-width-or-height) |
760 (if (eq (selected-window) wind-A) | 760 (if (eq (selected-window) wind-A) |
761 (other-window 1)) | 761 (other-window 1)) |
762 (switch-to-buffer buf-B) | 762 (switch-to-buffer buf-B) |
763 (setq wind-B (selected-window)) | 763 (setq wind-B (selected-window)) |
764 | 764 |
765 (if three-way-comparison | 765 (if three-way-comparison |
774 done-C t) | 774 done-C t) |
775 )) | 775 )) |
776 | 776 |
777 (or done-A ; Buf A to be set in its own frame | 777 (or done-A ; Buf A to be set in its own frame |
778 ;;; or it was set before because use-same-frame = 1 | 778 ;;; or it was set before because use-same-frame = 1 |
779 (progn | 779 (progn |
780 ;; Buf-A was not set up yet as it wasn't visible, | 780 ;; Buf-A was not set up yet as it wasn't visible, |
781 ;; and use-same-frame = nil | 781 ;; and use-same-frame = nil |
782 (select-window orig-wind) | 782 (select-window orig-wind) |
783 (delete-other-windows) | 783 (delete-other-windows) |
784 (switch-to-buffer buf-A) | 784 (switch-to-buffer buf-A) |
785 (setq wind-A (selected-window)) | 785 (setq wind-A (selected-window)) |
786 )) | 786 )) |
787 (or done-B ; Buf B to be set in its own frame | 787 (or done-B ; Buf B to be set in its own frame |
788 ;;; or it was set before because use-same-frame = 1 | 788 ;;; or it was set before because use-same-frame = 1 |
789 (progn | 789 (progn |
790 ;; Buf-B was not set up yet as it wasn't visible, | 790 ;; Buf-B was not set up yet as it wasn't visible, |
791 ;; and use-same-frame = nil | 791 ;; and use-same-frame = nil |
792 (select-window orig-wind) | 792 (select-window orig-wind) |
793 (delete-other-windows) | 793 (delete-other-windows) |
794 (switch-to-buffer buf-B) | 794 (switch-to-buffer buf-B) |
796 )) | 796 )) |
797 | 797 |
798 (if three-way-comparison | 798 (if three-way-comparison |
799 (or done-C ; Buf C to be set in its own frame | 799 (or done-C ; Buf C to be set in its own frame |
800 ;;; or it was set before because use-same-frame = 1 | 800 ;;; or it was set before because use-same-frame = 1 |
801 (progn | 801 (progn |
802 ;; Buf-C was not set up yet as it wasn't visible, | 802 ;; Buf-C was not set up yet as it wasn't visible, |
803 ;; and use-same-frame = nil | 803 ;; and use-same-frame = nil |
804 (select-window orig-wind) | 804 (select-window orig-wind) |
805 (delete-other-windows) | 805 (delete-other-windows) |
806 (switch-to-buffer buf-C) | 806 (switch-to-buffer buf-C) |
870 ;; The idea is that it is bad to destroy dedicated windows while creating an | 870 ;; The idea is that it is bad to destroy dedicated windows while creating an |
871 ;; ediff window setup | 871 ;; ediff window setup |
872 (defun ediff-window-ok-for-display (wind) | 872 (defun ediff-window-ok-for-display (wind) |
873 (and | 873 (and |
874 (window-live-p wind) | 874 (window-live-p wind) |
875 (or | 875 (or |
876 ;; only one window | 876 ;; only one window |
877 (eq wind (next-window wind 'ignore-minibuffer (window-frame wind))) | 877 (eq wind (next-window wind 'ignore-minibuffer (window-frame wind))) |
878 ;; none is dedicated | 878 ;; none is dedicated |
879 (not (ediff-frame-has-dedicated-windows (window-frame wind))) | 879 (not (ediff-frame-has-dedicated-windows (window-frame wind))) |
880 ))) | 880 ))) |
881 | 881 |
882 ;; Prepare or refresh control frame | 882 ;; Prepare or refresh control frame |
883 (defun ediff-setup-control-frame (ctl-buffer designated-minibuffer-frame) | 883 (defun ediff-setup-control-frame (ctl-buffer designated-minibuffer-frame) |
884 (let ((window-min-height 1) | 884 (let ((window-min-height 1) |
885 ctl-frame-iconified-p dont-iconify-ctl-frame deiconify-ctl-frame | 885 ctl-frame-iconified-p dont-iconify-ctl-frame deiconify-ctl-frame |
886 ctl-frame old-ctl-frame lines | 886 ctl-frame old-ctl-frame lines |
887 ;; user-grabbed-mouse | 887 ;; user-grabbed-mouse |
888 fheight fwidth adjusted-parameters) | 888 fheight fwidth adjusted-parameters) |
889 | 889 |
890 (ediff-with-current-buffer ctl-buffer | 890 (ediff-with-current-buffer ctl-buffer |
891 (if ediff-xemacs-p (set-buffer-menubar nil)) | 891 (if ediff-xemacs-p (set-buffer-menubar nil)) |
892 ;;(setq user-grabbed-mouse (ediff-user-grabbed-mouse)) | 892 ;;(setq user-grabbed-mouse (ediff-user-grabbed-mouse)) |
893 (run-hooks 'ediff-before-setup-control-frame-hook)) | 893 (run-hooks 'ediff-before-setup-control-frame-hook)) |
914 (make-local-variable 'icon-title-format)) ; Emacs | 914 (make-local-variable 'icon-title-format)) ; Emacs |
915 | 915 |
916 (ediff-setup-control-buffer ctl-buffer) | 916 (ediff-setup-control-buffer ctl-buffer) |
917 (setq dont-iconify-ctl-frame | 917 (setq dont-iconify-ctl-frame |
918 (not (string= ediff-help-message ediff-brief-help-message))) | 918 (not (string= ediff-help-message ediff-brief-help-message))) |
919 (setq deiconify-ctl-frame | 919 (setq deiconify-ctl-frame |
920 (and (eq this-command 'ediff-toggle-help) | 920 (and (eq this-command 'ediff-toggle-help) |
921 dont-iconify-ctl-frame)) | 921 dont-iconify-ctl-frame)) |
922 | 922 |
923 ;; 1 more line for the modeline | 923 ;; 1 more line for the modeline |
924 (setq lines (1+ (count-lines (point-min) (point-max))) | 924 (setq lines (1+ (count-lines (point-min) (point-max))) |
937 (if ediff-use-long-help-message | 937 (if ediff-use-long-help-message |
938 (setq adjusted-parameters | 938 (setq adjusted-parameters |
939 (cons '(auto-raise . nil) adjusted-parameters))) | 939 (cons '(auto-raise . nil) adjusted-parameters))) |
940 | 940 |
941 ;; In XEmacs, buffer menubar needs to be killed before frame parameters | 941 ;; In XEmacs, buffer menubar needs to be killed before frame parameters |
942 ;; are changed. | 942 ;; are changed. |
943 (if (ediff-has-toolbar-support-p) | 943 (if (ediff-has-toolbar-support-p) |
944 (progn | 944 (progn |
945 (set-specifier top-toolbar-height (list ctl-frame 2)) | 945 (set-specifier top-toolbar-height (list ctl-frame 2)) |
946 (sit-for 0) | 946 (sit-for 0) |
947 (set-specifier top-toolbar-height (list ctl-frame 0)) | 947 (set-specifier top-toolbar-height (list ctl-frame 0)) |
1035 (frame-A-top (eval (cdr (assoc 'top frame-A-parameters)))) | 1035 (frame-A-top (eval (cdr (assoc 'top frame-A-parameters)))) |
1036 (frame-A-left (eval (cdr (assoc 'left frame-A-parameters)))) | 1036 (frame-A-left (eval (cdr (assoc 'left frame-A-parameters)))) |
1037 (frame-A-width (frame-width frame-A)) | 1037 (frame-A-width (frame-width frame-A)) |
1038 (ctl-frame ediff-control-frame) | 1038 (ctl-frame ediff-control-frame) |
1039 horizontal-adjustment upward-adjustment | 1039 horizontal-adjustment upward-adjustment |
1040 ctl-frame-top ctl-frame-left) | 1040 ctl-frame-top ctl-frame-left) |
1041 | 1041 |
1042 ;; Multiple control frames are clipped based on the value of | 1042 ;; Multiple control frames are clipped based on the value of |
1043 ;; ediff-control-buffer-number. This is done in order not to obscure | 1043 ;; ediff-control-buffer-number. This is done in order not to obscure |
1044 ;; other active control panels. | 1044 ;; other active control panels. |
1045 (setq horizontal-adjustment (* 2 ediff-control-buffer-number) | 1045 (setq horizontal-adjustment (* 2 ediff-control-buffer-number) |
1085 Saves the old frame parameters in `ediff-wide-display-orig-parameters'. | 1085 Saves the old frame parameters in `ediff-wide-display-orig-parameters'. |
1086 The frame to be resized is kept in `ediff-wide-display-frame'. | 1086 The frame to be resized is kept in `ediff-wide-display-frame'. |
1087 This function modifies only the left margin and the width of the display. | 1087 This function modifies only the left margin and the width of the display. |
1088 It assumes that it is called from within the control buffer." | 1088 It assumes that it is called from within the control buffer." |
1089 (if (not (fboundp 'ediff-display-pixel-width)) | 1089 (if (not (fboundp 'ediff-display-pixel-width)) |
1090 (error "Can't determine display width.")) | 1090 (error "Can't determine display width")) |
1091 (let* ((frame-A (window-frame ediff-window-A)) | 1091 (let* ((frame-A (window-frame ediff-window-A)) |
1092 (frame-A-params (frame-parameters frame-A)) | 1092 (frame-A-params (frame-parameters frame-A)) |
1093 (cw (ediff-frame-char-width frame-A)) | 1093 (cw (ediff-frame-char-width frame-A)) |
1094 (wd (- (/ (ediff-display-pixel-width) cw) 5))) | 1094 (wd (- (/ (ediff-display-pixel-width) cw) 5))) |
1095 (setq ediff-wide-display-orig-parameters | 1095 (setq ediff-wide-display-orig-parameters |
1096 (list (cons 'left (max 0 (eval (cdr (assoc 'left frame-A-params))))) | 1096 (list (cons 'left (max 0 (eval (cdr (assoc 'left frame-A-params))))) |
1097 (cons 'width (cdr (assoc 'width frame-A-params)))) | 1097 (cons 'width (cdr (assoc 'width frame-A-params)))) |
1098 ediff-wide-display-frame frame-A) | 1098 ediff-wide-display-frame frame-A) |
1099 (modify-frame-parameters frame-A (list (cons 'left cw) | 1099 (modify-frame-parameters frame-A (list (cons 'left cw) |
1100 (cons 'width wd))))) | 1100 (cons 'width wd))))) |
1124 (format "[%s%s%s] " | 1124 (format "[%s%s%s] " |
1125 (or buf-C-state-diff "") | 1125 (or buf-C-state-diff "") |
1126 (if buf-C-state-merge | 1126 (if buf-C-state-merge |
1127 (concat " " buf-C-state-merge) | 1127 (concat " " buf-C-state-merge) |
1128 "") | 1128 "") |
1129 (if (ediff-get-state-of-ancestor | 1129 (if (ediff-get-state-of-ancestor |
1130 ediff-current-difference) | 1130 ediff-current-difference) |
1131 " AncestorEmpty" | 1131 " AncestorEmpty" |
1132 "") | 1132 "") |
1133 ) | 1133 ) |
1134 "")) | 1134 "")) |
1140 (setq mode-line-format | 1140 (setq mode-line-format |
1141 (if (ediff-narrow-control-frame-p) | 1141 (if (ediff-narrow-control-frame-p) |
1142 (list " " mode-line-buffer-identification) | 1142 (list " " mode-line-buffer-identification) |
1143 (list "-- " mode-line-buffer-identification " Quick Help"))) | 1143 (list "-- " mode-line-buffer-identification " Quick Help"))) |
1144 ;; control buffer id | 1144 ;; control buffer id |
1145 (setq mode-line-buffer-identification | 1145 (setq mode-line-buffer-identification |
1146 (if (ediff-narrow-control-frame-p) | 1146 (if (ediff-narrow-control-frame-p) |
1147 (ediff-make-narrow-control-buffer-id 'skip-name) | 1147 (ediff-make-narrow-control-buffer-id 'skip-name) |
1148 (ediff-make-wide-control-buffer-id))) | 1148 (ediff-make-wide-control-buffer-id))) |
1149 ;; Force mode-line redisplay | 1149 ;; Force mode-line redisplay |
1150 (force-mode-line-update) | 1150 (force-mode-line-update) |
1208 (defun ediff-make-narrow-control-buffer-id (&optional skip-name) | 1208 (defun ediff-make-narrow-control-buffer-id (&optional skip-name) |
1209 (concat | 1209 (concat |
1210 (if skip-name | 1210 (if skip-name |
1211 " " | 1211 " " |
1212 (ediff-make-base-title)) | 1212 (ediff-make-base-title)) |
1213 (cond ((< ediff-current-difference 0) | 1213 (cond ((< ediff-current-difference 0) |
1214 (format " _/%d" ediff-number-of-differences)) | 1214 (format " _/%d" ediff-number-of-differences)) |
1215 ((>= ediff-current-difference ediff-number-of-differences) | 1215 ((>= ediff-current-difference ediff-number-of-differences) |
1216 (format " $/%d" ediff-number-of-differences)) | 1216 (format " $/%d" ediff-number-of-differences)) |
1217 (t | 1217 (t |
1218 (format " %d/%d" | 1218 (format " %d/%d" |