diff options
| author | Michael Kifer | 1995-10-06 01:00:10 +0000 |
|---|---|---|
| committer | Michael Kifer | 1995-10-06 01:00:10 +0000 |
| commit | 6853a9373580494f1841f7761fa7b243612e0215 (patch) | |
| tree | 99881af639fab0bec697cbf41561345c61e887b6 | |
| parent | 651342bcb1b4e21d1f944d9b5bf44534834cd189 (diff) | |
| download | emacs-6853a9373580494f1841f7761fa7b243612e0215.tar.gz emacs-6853a9373580494f1841f7761fa7b243612e0215.zip | |
(ediff-make-frame-position): fixed bugs.
(ediff-control-frame-parameters): fixed defaults.
| -rw-r--r-- | lisp/ediff-wind.el | 211 |
1 files changed, 138 insertions, 73 deletions
diff --git a/lisp/ediff-wind.el b/lisp/ediff-wind.el index 39747977f7e..749ca89a4f5 100644 --- a/lisp/ediff-wind.el +++ b/lisp/ediff-wind.el | |||
| @@ -87,16 +87,17 @@ In this case, Ediff will use those frames to display these buffers.") | |||
| 87 | '(name . "Ediff") | 87 | '(name . "Ediff") |
| 88 | ;;'(unsplittable . t) | 88 | ;;'(unsplittable . t) |
| 89 | '(minibuffer . nil) | 89 | '(minibuffer . nil) |
| 90 | '(user-position . t) ; Emacs only | ||
| 90 | '(vertical-scroll-bars . nil) ; Emacs only | 91 | '(vertical-scroll-bars . nil) ; Emacs only |
| 91 | '(scrollbar-width . 0) ; XEmacs only | 92 | '(scrollbar-width . 0) ; XEmacs only |
| 92 | '(menu-bar-lines . 0) ; Emacs only | 93 | '(menu-bar-lines . 0) ; Emacs only |
| 94 | '(visibility . nil) ; doesn't work for XEmacs yet | ||
| 93 | ;; don't lower and auto-raise | 95 | ;; don't lower and auto-raise |
| 94 | '(auto-lower . nil) | 96 | '(auto-lower . nil) |
| 95 | '(auto-raise . t) | 97 | '(auto-raise . t) |
| 96 | ;; this blocks queries from window manager as to where to put | 98 | ;; this blocks queries from window manager as to where to put |
| 97 | ;; ediff's control frame. we put the frame outside the display, | 99 | ;; ediff's control frame. we put the frame outside the display, |
| 98 | ;; so the initial frame won't jump all over the screen | 100 | ;; so the initial frame won't jump all over the screen |
| 99 | '(user-position . t) | ||
| 100 | (cons 'top (if (fboundp 'ediff-display-pixel-height) | 101 | (cons 'top (if (fboundp 'ediff-display-pixel-height) |
| 101 | (1+ (ediff-display-pixel-height)) | 102 | (1+ (ediff-display-pixel-height)) |
| 102 | 3000)) | 103 | 3000)) |
| @@ -107,13 +108,27 @@ In this case, Ediff will use those frames to display these buffers.") | |||
| 107 | "Frame parameters for displaying Ediff Control Panel. | 108 | "Frame parameters for displaying Ediff Control Panel. |
| 108 | Do not specify width and height here. These are computed automatically.") | 109 | Do not specify width and height here. These are computed automatically.") |
| 109 | 110 | ||
| 111 | ;; position of the mouse; used to decide whether to warp the mouse into ctl | ||
| 112 | ;; frame | ||
| 113 | (ediff-defvar-local ediff-mouse-pixel-position nil "") | ||
| 114 | |||
| 115 | ;; not used for now | ||
| 116 | (defvar ediff-mouse-pixel-threshhold 30 | ||
| 117 | "If the user moves mouse more than this many pixels, Ediff won't warp mouse into control window.") | ||
| 118 | |||
| 119 | (defvar ediff-grab-mouse t | ||
| 120 | "*If t, Ediff will always grab the mouse and put it in the control frame. | ||
| 121 | If 'maybe, Ediff will do it sometimes, but not after operations that require | ||
| 122 | relatively long time. If nil, the mouse will be entirely user's | ||
| 123 | responsibility.") | ||
| 124 | |||
| 110 | (defvar ediff-control-frame-position-function 'ediff-make-frame-position | 125 | (defvar ediff-control-frame-position-function 'ediff-make-frame-position |
| 111 | "Function to call to determine the desired location for the control panel. | 126 | "Function to call to determine the desired location for the control panel. |
| 112 | Expects three parameters: the control buffer, the desired width and height | 127 | Expects three parameters: the control buffer, the desired width and height |
| 113 | of the control frame. It returns an association list | 128 | of the control frame. It returns an association list |
| 114 | of the form \(\(top . <position>\) \(left . <position>\)\)") | 129 | of the form \(\(top . <position>\) \(left . <position>\)\)") |
| 115 | 130 | ||
| 116 | (defvar ediff-control-frame-upward-shift (if ediff-xemacs-p 36 4) | 131 | (defvar ediff-control-frame-upward-shift (if ediff-xemacs-p 42 14) |
| 117 | "*The upward shift of control frame from the top of buffer A's frame. | 132 | "*The upward shift of control frame from the top of buffer A's frame. |
| 118 | Measured in pixels. | 133 | Measured in pixels. |
| 119 | This is used by the default control frame positioning function, | 134 | This is used by the default control frame positioning function, |
| @@ -219,7 +234,7 @@ into icons, regardless of the window manager.") | |||
| 219 | (defun ediff-setup-windows (buffer-A buffer-B buffer-C control-buffer) | 234 | (defun ediff-setup-windows (buffer-A buffer-B buffer-C control-buffer) |
| 220 | ;; Make sure we are not in the minibuffer window when we try to delete | 235 | ;; Make sure we are not in the minibuffer window when we try to delete |
| 221 | ;; all other windows. | 236 | ;; all other windows. |
| 222 | (run-hooks 'ediff-before-setup-windows-hooks) | 237 | (run-hooks 'ediff-before-setup-windows-hook) |
| 223 | (if (eq (selected-window) (minibuffer-window)) | 238 | (if (eq (selected-window) (minibuffer-window)) |
| 224 | (other-window 1)) | 239 | (other-window 1)) |
| 225 | 240 | ||
| @@ -231,7 +246,7 @@ into icons, regardless of the window manager.") | |||
| 231 | (funcall | 246 | (funcall |
| 232 | (ediff-eval-in-buffer control-buffer ediff-window-setup-function) | 247 | (ediff-eval-in-buffer control-buffer ediff-window-setup-function) |
| 233 | buffer-A buffer-B buffer-C control-buffer)) | 248 | buffer-A buffer-B buffer-C control-buffer)) |
| 234 | (run-hooks 'ediff-after-setup-windows-hooks)) | 249 | (run-hooks 'ediff-after-setup-windows-hook)) |
| 235 | 250 | ||
| 236 | ;; Just set up 3 windows. | 251 | ;; Just set up 3 windows. |
| 237 | ;; Usually used without windowing systems | 252 | ;; Usually used without windowing systems |
| @@ -268,9 +283,10 @@ into icons, regardless of the window manager.") | |||
| 268 | (switch-to-buffer buf-A) | 283 | (switch-to-buffer buf-A) |
| 269 | (setq wind-A (selected-window)) | 284 | (setq wind-A (selected-window)) |
| 270 | 285 | ||
| 271 | ;; XEmacs seems to have a lot of trouble with display | 286 | ;; XEmacs used to have a lot of trouble with display |
| 272 | ;; It won't set things right unless we tell it to sit still | 287 | ;; It did't set things right unless we tell it to sit still |
| 273 | (if ediff-xemacs-p (sit-for 0)) | 288 | ;; 19.12 seems ok. |
| 289 | ;;(if ediff-xemacs-p (sit-for 0)) | ||
| 274 | 290 | ||
| 275 | (split-window-vertically (max 2 (- (window-height) merge-window-lines))) | 291 | (split-window-vertically (max 2 (- (window-height) merge-window-lines))) |
| 276 | (if (eq (selected-window) wind-A) | 292 | (if (eq (selected-window) wind-A) |
| @@ -330,9 +346,10 @@ into icons, regardless of the window manager.") | |||
| 330 | (window-width wind-A)) | 346 | (window-width wind-A)) |
| 331 | 3))) | 347 | 3))) |
| 332 | 348 | ||
| 333 | ;; XEmacs seems to have a lot of trouble with display | 349 | ;; XEmacs used to have a lot of trouble with display |
| 334 | ;; It won't set things right unless we tell it to sit still | 350 | ;; It did't set things right unless we told it to sit still |
| 335 | (if ediff-xemacs-p (sit-for 0)) | 351 | ;; 19.12 seems ok. |
| 352 | ;;(if ediff-xemacs-p (sit-for 0)) | ||
| 336 | 353 | ||
| 337 | (funcall split-window-function wind-width-or-height) | 354 | (funcall split-window-function wind-width-or-height) |
| 338 | 355 | ||
| @@ -486,9 +503,9 @@ into icons, regardless of the window manager.") | |||
| 486 | (switch-to-buffer buf-A) | 503 | (switch-to-buffer buf-A) |
| 487 | (setq wind-A (selected-window)) | 504 | (setq wind-A (selected-window)) |
| 488 | 505 | ||
| 489 | ;; XEmacs seems to have a lot of trouble with display | 506 | ;; XEmacs used to have a lot of trouble with display |
| 490 | ;; It won't set things right unless we tell it to catch breath | 507 | ;; It did't set things right unless we told it to catch breath |
| 491 | (if ediff-xemacs-p (sit-for 0)) | 508 | ;;(if ediff-xemacs-p (sit-for 0)) |
| 492 | 509 | ||
| 493 | (split-window-vertically | 510 | (split-window-vertically |
| 494 | (max 2 (- (window-height) merge-window-lines))) | 511 | (max 2 (- (window-height) merge-window-lines))) |
| @@ -652,9 +669,9 @@ into icons, regardless of the window manager.") | |||
| 652 | (switch-to-buffer buf-A) | 669 | (switch-to-buffer buf-A) |
| 653 | (setq wind-A (selected-window)) | 670 | (setq wind-A (selected-window)) |
| 654 | 671 | ||
| 655 | ;; XEmacs seems to have a lot of trouble with display | 672 | ;; XEmacs used to have a lot of trouble with display |
| 656 | ;; It won't set things right unless we tell it to catch breath | 673 | ;; It didn't set things right unless we told it to catch breath |
| 657 | (if ediff-xemacs-p (sit-for 0)) | 674 | ;;(if ediff-xemacs-p (sit-for 0)) |
| 658 | 675 | ||
| 659 | (if three-way-comparison | 676 | (if three-way-comparison |
| 660 | (setq wind-width-or-height | 677 | (setq wind-width-or-height |
| @@ -751,12 +768,13 @@ into icons, regardless of the window manager.") | |||
| 751 | (defun ediff-setup-control-frame (ctl-buffer designated-minibuffer-frame) | 768 | (defun ediff-setup-control-frame (ctl-buffer designated-minibuffer-frame) |
| 752 | (let ((window-min-height 2) | 769 | (let ((window-min-height 2) |
| 753 | ctl-frame-iconified-p dont-iconify-ctl-frame deiconify-ctl-frame | 770 | ctl-frame-iconified-p dont-iconify-ctl-frame deiconify-ctl-frame |
| 754 | ctl-frame old-ctl-frame lines | 771 | ctl-frame old-ctl-frame lines user-grabbed-mouse |
| 755 | fheight fwidth adjusted-parameters) | 772 | fheight fwidth adjusted-parameters) |
| 756 | 773 | ||
| 757 | (ediff-eval-in-buffer ctl-buffer | 774 | (ediff-eval-in-buffer ctl-buffer |
| 758 | (if ediff-xemacs-p (set-buffer-menubar nil)) | 775 | (if ediff-xemacs-p (set-buffer-menubar nil)) |
| 759 | (run-hooks 'ediff-before-setup-control-frame-hooks)) | 776 | ;;(setq user-grabbed-mouse (ediff-user-grabbed-mouse)) |
| 777 | (run-hooks 'ediff-before-setup-control-frame-hook)) | ||
| 760 | 778 | ||
| 761 | (setq old-ctl-frame (ediff-eval-in-buffer ctl-buffer ediff-control-frame)) | 779 | (setq old-ctl-frame (ediff-eval-in-buffer ctl-buffer ediff-control-frame)) |
| 762 | ;; Delete the old ctl frame and get a new ctl frame. | 780 | ;; Delete the old ctl frame and get a new ctl frame. |
| @@ -782,11 +800,11 @@ into icons, regardless of the window manager.") | |||
| 782 | (switch-to-buffer ctl-buffer)) | 800 | (switch-to-buffer ctl-buffer)) |
| 783 | 801 | ||
| 784 | ;; must be before ediff-setup-control-buffer | 802 | ;; must be before ediff-setup-control-buffer |
| 785 | (if ediff-xemacs-p | 803 | ;; just a precaution--we should be in ctl-buffer already |
| 786 | ;; just a precaution--we should be in ctl-buffer already | 804 | (ediff-eval-in-buffer ctl-buffer |
| 787 | (ediff-eval-in-buffer ctl-buffer | 805 | (make-local-variable 'frame-title-format) |
| 788 | (make-local-variable 'frame-title-format) | 806 | (make-local-variable 'frame-icon-title-format) ; XEmacs |
| 789 | (make-local-variable 'frame-icon-title-format))) | 807 | (make-local-variable 'icon-title-format)) ; Emacs |
| 790 | 808 | ||
| 791 | (ediff-setup-control-buffer ctl-buffer) | 809 | (ediff-setup-control-buffer ctl-buffer) |
| 792 | (setq dont-iconify-ctl-frame | 810 | (setq dont-iconify-ctl-frame |
| @@ -802,22 +820,28 @@ into icons, regardless of the window manager.") | |||
| 802 | fheight lines | 820 | fheight lines |
| 803 | fwidth (+ (ediff-help-message-line-length) 2) | 821 | fwidth (+ (ediff-help-message-line-length) 2) |
| 804 | adjusted-parameters (append (list | 822 | adjusted-parameters (append (list |
| 823 | '(visibility . t) | ||
| 805 | (cons 'width fwidth) | 824 | (cons 'width fwidth) |
| 806 | (cons 'height fheight)) | 825 | (cons 'height fheight)) |
| 807 | (funcall | 826 | (funcall |
| 808 | ediff-control-frame-position-function | 827 | ediff-control-frame-position-function |
| 809 | ctl-buffer fwidth fheight))) | 828 | ctl-buffer fwidth fheight))) |
| 829 | (if ediff-prefer-long-help-message | ||
| 830 | (setq adjusted-parameters | ||
| 831 | (cons '(auto-raise . nil) adjusted-parameters))) | ||
| 810 | 832 | ||
| 811 | ;; In XEmacs, buffer menubar needs to be killed before frame parameters | 833 | ;; In XEmacs, buffer menubar needs to be killed before frame parameters |
| 812 | ;; are changed. XEmacs needs to redisplay, as it has trouble setting | 834 | ;; are changed. |
| 813 | ;; height correctly otherwise. | ||
| 814 | (if ediff-xemacs-p | 835 | (if ediff-xemacs-p |
| 815 | (progn | 836 | (progn |
| 816 | (set-specifier top-toolbar-height (list ctl-frame 0)) | 837 | (set-specifier top-toolbar-height (list ctl-frame 0)) |
| 817 | (set-specifier bottom-toolbar-height (list ctl-frame 0)) | 838 | (set-specifier bottom-toolbar-height (list ctl-frame 0)) |
| 818 | (set-specifier left-toolbar-width (list ctl-frame 0)) | 839 | (set-specifier left-toolbar-width (list ctl-frame 0)) |
| 819 | (set-specifier right-toolbar-width (list ctl-frame 0)) | 840 | (set-specifier right-toolbar-width (list ctl-frame 0)) |
| 820 | (sit-for 0))) | 841 | ;; XEmacs needed a redisplay, as it had trouble setting |
| 842 | ;; height correctly otherwise. | ||
| 843 | ;;(sit-for 0) | ||
| 844 | )) | ||
| 821 | 845 | ||
| 822 | ;; Under OS/2 (emx) we have to call modify frame parameters twice, in | 846 | ;; Under OS/2 (emx) we have to call modify frame parameters twice, in |
| 823 | ;; order to make sure that at least once we do it for non-iconified | 847 | ;; order to make sure that at least once we do it for non-iconified |
| @@ -828,13 +852,7 @@ into icons, regardless of the window manager.") | |||
| 828 | 852 | ||
| 829 | (goto-char (point-min)) | 853 | (goto-char (point-min)) |
| 830 | 854 | ||
| 831 | (cond ((and ediff-prefer-iconified-control-frame | 855 | (modify-frame-parameters ctl-frame adjusted-parameters) |
| 832 | (not ctl-frame-iconified-p) | ||
| 833 | (not dont-iconify-ctl-frame)) | ||
| 834 | (iconify-frame ctl-frame)) | ||
| 835 | ((or deiconify-ctl-frame | ||
| 836 | (not ctl-frame-iconified-p)) | ||
| 837 | (raise-frame ctl-frame))) | ||
| 838 | 856 | ||
| 839 | ;; This works around a bug in 19.25 and earlier. There, if frame gets | 857 | ;; This works around a bug in 19.25 and earlier. There, if frame gets |
| 840 | ;; iconified, the current buffer changes to that of the frame that | 858 | ;; iconified, the current buffer changes to that of the frame that |
| @@ -843,16 +861,27 @@ into icons, regardless of the window manager.") | |||
| 843 | (select-frame ctl-frame) | 861 | (select-frame ctl-frame) |
| 844 | (ediff-refresh-control-frame) | 862 | (ediff-refresh-control-frame) |
| 845 | 863 | ||
| 846 | (modify-frame-parameters ctl-frame adjusted-parameters) | 864 | (cond ((and ediff-prefer-iconified-control-frame |
| 865 | (not ctl-frame-iconified-p) (not dont-iconify-ctl-frame)) | ||
| 866 | (iconify-frame ctl-frame)) | ||
| 867 | ((or deiconify-ctl-frame (not ctl-frame-iconified-p)) | ||
| 868 | (raise-frame ctl-frame))) | ||
| 847 | 869 | ||
| 848 | (if ediff-xemacs-p | 870 | (if ediff-xemacs-p |
| 849 | (set-window-buffer-dedicated (selected-window) ctl-buffer) | 871 | (set-window-buffer-dedicated (selected-window) ctl-buffer) |
| 850 | (set-window-dedicated-p (selected-window) t)) | 872 | (set-window-dedicated-p (selected-window) t)) |
| 851 | 873 | ||
| 852 | (or ediff-xemacs-p (sit-for 0 200)) ; emacs has trouble here, needs time | 874 | ;; resynch so the cursor will move to control frame |
| 875 | ;; per RMS suggestion | ||
| 876 | (let ((count 7)) | ||
| 877 | (sit-for .1) | ||
| 878 | (while (and (not (frame-visible-p ctl-frame)) (> count 0)) | ||
| 879 | (setq count (1- count)) | ||
| 880 | (sit-for .3))) | ||
| 881 | |||
| 853 | (or (ediff-frame-iconified-p ctl-frame) | 882 | (or (ediff-frame-iconified-p ctl-frame) |
| 854 | (ediff-reset-mouse ctl-frame)) | 883 | ;; don't warp the mouse, unless ediff-grab-mouse = t |
| 855 | (or ediff-xemacs-p (unfocus-frame)) | 884 | (ediff-reset-mouse ctl-frame (not (eq ediff-grab-mouse t)))) |
| 856 | 885 | ||
| 857 | (if ediff-xemacs-p | 886 | (if ediff-xemacs-p |
| 858 | (ediff-eval-in-buffer ctl-buffer | 887 | (ediff-eval-in-buffer ctl-buffer |
| @@ -861,7 +890,7 @@ into icons, regardless of the window manager.") | |||
| 861 | )) | 890 | )) |
| 862 | 891 | ||
| 863 | (ediff-eval-in-buffer ctl-buffer | 892 | (ediff-eval-in-buffer ctl-buffer |
| 864 | (run-hooks 'ediff-after-setup-control-frame-hooks)) | 893 | (run-hooks 'ediff-after-setup-control-frame-hook)) |
| 865 | )) | 894 | )) |
| 866 | 895 | ||
| 867 | (defun ediff-destroy-control-frame (ctl-buffer) | 896 | (defun ediff-destroy-control-frame (ctl-buffer) |
| @@ -870,12 +899,12 @@ into icons, regardless of the window manager.") | |||
| 870 | (let ((ctl-frame ediff-control-frame)) | 899 | (let ((ctl-frame ediff-control-frame)) |
| 871 | (if ediff-xemacs-p | 900 | (if ediff-xemacs-p |
| 872 | (set-buffer-menubar default-menubar)) | 901 | (set-buffer-menubar default-menubar)) |
| 873 | ;;(redraw-display) | ||
| 874 | (setq ediff-control-frame nil) | 902 | (setq ediff-control-frame nil) |
| 875 | (delete-frame ctl-frame) | 903 | (delete-frame ctl-frame) |
| 876 | ))) | 904 | ))) |
| 877 | (ediff-skip-unsuitable-frames) | 905 | (ediff-skip-unsuitable-frames) |
| 878 | (ediff-reset-mouse)) | 906 | ;;(ediff-reset-mouse nil) |
| 907 | ) | ||
| 879 | 908 | ||
| 880 | 909 | ||
| 881 | ;; finds a good place to clip control frame | 910 | ;; finds a good place to clip control frame |
| @@ -883,12 +912,12 @@ into icons, regardless of the window manager.") | |||
| 883 | (ediff-eval-in-buffer ctl-buffer | 912 | (ediff-eval-in-buffer ctl-buffer |
| 884 | (let* ((frame-A (window-frame ediff-window-A)) | 913 | (let* ((frame-A (window-frame ediff-window-A)) |
| 885 | (frame-A-parameters (frame-parameters frame-A)) | 914 | (frame-A-parameters (frame-parameters frame-A)) |
| 886 | (frame-A-top (cdr (assoc 'top frame-A-parameters))) | 915 | (frame-A-top (eval (cdr (assoc 'top frame-A-parameters)))) |
| 887 | (frame-A-left (cdr (assoc 'left frame-A-parameters))) | 916 | (frame-A-left (eval (cdr (assoc 'left frame-A-parameters)))) |
| 888 | (frame-A-width (frame-width frame-A)) | 917 | (frame-A-width (frame-width frame-A)) |
| 889 | (ctl-frame ediff-control-frame) | 918 | (ctl-frame ediff-control-frame) |
| 890 | horizontal-adjustment upward-adjustment | 919 | horizontal-adjustment upward-adjustment |
| 891 | ctl-frame-top) | 920 | ctl-frame-top ctl-frame-left) |
| 892 | 921 | ||
| 893 | ;; Multiple control frames are clipped based on the value of | 922 | ;; Multiple control frames are clipped based on the value of |
| 894 | ;; ediff-control-buffer-number. This is done in order not to obscure | 923 | ;; ediff-control-buffer-number. This is done in order not to obscure |
| @@ -896,25 +925,39 @@ into icons, regardless of the window manager.") | |||
| 896 | (setq horizontal-adjustment (* 2 ediff-control-buffer-number) | 925 | (setq horizontal-adjustment (* 2 ediff-control-buffer-number) |
| 897 | upward-adjustment (* -14 ediff-control-buffer-number)) | 926 | upward-adjustment (* -14 ediff-control-buffer-number)) |
| 898 | 927 | ||
| 899 | (setq ctl-frame-top (- frame-A-top | 928 | (setq ctl-frame-top |
| 900 | upward-adjustment | 929 | (- frame-A-top upward-adjustment ediff-control-frame-upward-shift) |
| 901 | ediff-control-frame-upward-shift)) | 930 | ctl-frame-left |
| 902 | (list | 931 | (+ frame-A-left |
| 903 | (cons 'top (if (> ctl-frame-top 0) ctl-frame-top 1)) | 932 | (if ediff-prefer-long-help-message |
| 904 | (cons 'left (+ frame-A-left | 933 | (* (ediff-frame-char-width ctl-frame) |
| 905 | (if ediff-prefer-long-help-message | 934 | (+ ediff-wide-control-frame-rightward-shift |
| 906 | (* (ediff-frame-char-width ctl-frame) | 935 | horizontal-adjustment)) |
| 907 | (+ ediff-wide-control-frame-rightward-shift | 936 | (- (* frame-A-width (ediff-frame-char-width frame-A)) |
| 908 | horizontal-adjustment)) | 937 | (* (ediff-frame-char-width ctl-frame) |
| 909 | (- (* frame-A-width | 938 | (+ ctl-frame-width |
| 910 | (ediff-frame-char-width frame-A)) | 939 | ediff-narrow-control-frame-leftward-shift |
| 911 | (* (ediff-frame-char-width ctl-frame) | 940 | horizontal-adjustment)))))) |
| 912 | (+ ctl-frame-width | 941 | ;; keep ctl frame within the visible bounds |
| 913 | ediff-narrow-control-frame-leftward-shift | 942 | (setq ctl-frame-top (max ctl-frame-top 1) |
| 914 | horizontal-adjustment)))))))))) | 943 | ctl-frame-left (max ctl-frame-left 1)) |
| 944 | (setq ctl-frame-top | ||
| 945 | (min ctl-frame-top | ||
| 946 | (- (ediff-display-pixel-height) | ||
| 947 | (* 2 ctl-frame-height | ||
| 948 | (ediff-frame-char-height ctl-frame)))) | ||
| 949 | ctl-frame-left | ||
| 950 | (min ctl-frame-left | ||
| 951 | (- (ediff-display-pixel-width) | ||
| 952 | (* ctl-frame-width (ediff-frame-char-width ctl-frame))))) | ||
| 953 | |||
| 954 | (list (cons 'top ctl-frame-top) | ||
| 955 | (cons 'left ctl-frame-left)) | ||
| 956 | ))) | ||
| 915 | 957 | ||
| 916 | (defun ediff-xemacs-select-frame-hook () | 958 | (defun ediff-xemacs-select-frame-hook () |
| 917 | (if (equal (selected-frame) ediff-control-frame) | 959 | (if (and (equal (selected-frame) ediff-control-frame) |
| 960 | (not ediff-prefer-long-help-message)) | ||
| 918 | (raise-frame ediff-control-frame))) | 961 | (raise-frame ediff-control-frame))) |
| 919 | 962 | ||
| 920 | (defun ediff-make-wide-display () | 963 | (defun ediff-make-wide-display () |
| @@ -930,7 +973,7 @@ It assumes that it is called from within the control buffer." | |||
| 930 | (cw (ediff-frame-char-width frame-A)) | 973 | (cw (ediff-frame-char-width frame-A)) |
| 931 | (wd (- (/ (ediff-display-pixel-width) cw) 5))) | 974 | (wd (- (/ (ediff-display-pixel-width) cw) 5))) |
| 932 | (setq ediff-wide-display-orig-parameters | 975 | (setq ediff-wide-display-orig-parameters |
| 933 | (list (cons 'left (max 0 (cdr (assoc 'left frame-A-params)))) | 976 | (list (cons 'left (max 0 (eval (cdr (assoc 'left frame-A-params))))) |
| 934 | (cons 'width (cdr (assoc 'width frame-A-params)))) | 977 | (cons 'width (cdr (assoc 'width frame-A-params)))) |
| 935 | ediff-wide-display-frame frame-A) | 978 | ediff-wide-display-frame frame-A) |
| 936 | (modify-frame-parameters frame-A (list (cons 'left cw) | 979 | (modify-frame-parameters frame-A (list (cons 'left cw) |
| @@ -958,11 +1001,16 @@ It assumes that it is called from within the control buffer." | |||
| 958 | "") | 1001 | "") |
| 959 | buf-C-state-diff (if (and (ediff-buffer-live-p ediff-buffer-C) | 1002 | buf-C-state-diff (if (and (ediff-buffer-live-p ediff-buffer-C) |
| 960 | (or buf-C-state-diff buf-C-state-merge)) | 1003 | (or buf-C-state-diff buf-C-state-merge)) |
| 961 | (format "[%s%s] " | 1004 | (format "[%s%s%s] " |
| 962 | (or buf-C-state-diff "") | 1005 | (or buf-C-state-diff "") |
| 963 | (if buf-C-state-merge | 1006 | (if buf-C-state-merge |
| 964 | (concat " " buf-C-state-merge) | 1007 | (concat " " buf-C-state-merge) |
| 965 | "")) | 1008 | "") |
| 1009 | (if (ediff-get-state-of-ancestor | ||
| 1010 | ediff-current-difference) | ||
| 1011 | " AncestorEmpty" | ||
| 1012 | "") | ||
| 1013 | ) | ||
| 966 | "")) | 1014 | "")) |
| 967 | (setq buf-A-state-diff "" | 1015 | (setq buf-A-state-diff "" |
| 968 | buf-B-state-diff "" | 1016 | buf-B-state-diff "" |
| @@ -1003,20 +1051,37 @@ It assumes that it is called from within the control buffer." | |||
| 1003 | (setq mode-line-format | 1051 | (setq mode-line-format |
| 1004 | (list " C: " 'ediff-diff-status mode-line-format)) | 1052 | (list " C: " 'ediff-diff-status mode-line-format)) |
| 1005 | (force-mode-line-update))) | 1053 | (force-mode-line-update))) |
| 1054 | (if (ediff-buffer-live-p ediff-ancestor-buffer) | ||
| 1055 | (ediff-eval-in-buffer ediff-ancestor-buffer | ||
| 1056 | (ediff-strip-mode-line-format) | ||
| 1057 | ;; we keep the second dummy string in the mode line format of the | ||
| 1058 | ;; ancestor, since for other buffers Ediff prepends 2 strings and | ||
| 1059 | ;; ediff-strip-mode-line-format expects that. | ||
| 1060 | (setq mode-line-format | ||
| 1061 | (list " Ancestor: " | ||
| 1062 | (cond ((not (stringp buf-C-state-merge)) | ||
| 1063 | "") | ||
| 1064 | ((string-match "prefer-A" buf-C-state-merge) | ||
| 1065 | "[=diff(B)] ") | ||
| 1066 | ((string-match "prefer-B" buf-C-state-merge) | ||
| 1067 | "[=diff(A)] ") | ||
| 1068 | (t "")) | ||
| 1069 | mode-line-format)))) | ||
| 1006 | )) | 1070 | )) |
| 1007 | 1071 | ||
| 1008 | 1072 | ||
| 1009 | (defun ediff-refresh-control-frame () | 1073 | (defun ediff-refresh-control-frame () |
| 1010 | (if ediff-xemacs-p | 1074 | (setq frame-title-format (ediff-make-narrow-control-buffer-id) |
| 1011 | (progn | 1075 | frame-icon-title-format (ediff-make-narrow-control-buffer-id) ; XEmacs |
| 1012 | (setq frame-title-format (ediff-make-narrow-control-buffer-id) | 1076 | icon-title-format (ediff-make-narrow-control-buffer-id)) ; Emacs |
| 1013 | frame-icon-title-format (ediff-make-narrow-control-buffer-id)) | 1077 | ;; the emacs part will be modified once the 'name and 'title |
| 1014 | ;; this forces update of the frame title | 1078 | ;; frame parameters are separated |
| 1015 | (modify-frame-parameters ediff-control-frame '(()))) | 1079 | (if ediff-emacs-p |
| 1016 | (modify-frame-parameters | 1080 | (modify-frame-parameters |
| 1017 | ediff-control-frame | 1081 | ediff-control-frame |
| 1018 | (list (cons 'name (ediff-make-narrow-control-buffer-id)))) | 1082 | (list (cons 'name (ediff-make-narrow-control-buffer-id)))) |
| 1019 | )) | 1083 | ;; force an update of the frame title |
| 1084 | (modify-frame-parameters ediff-control-frame '(())))) | ||
| 1020 | 1085 | ||
| 1021 | 1086 | ||
| 1022 | (defun ediff-make-narrow-control-buffer-id (&optional skip-name) | 1087 | (defun ediff-make-narrow-control-buffer-id (&optional skip-name) |