Mercurial > hg > xemacs-beta
comparison lisp/ediff/ediff-wind.el @ 16:0293115a14e9 r19-15b91
Import from CVS: tag r19-15b91
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:49:20 +0200 |
parents | 9ee227acff29 |
children | e04119814345 |
comparison
equal
deleted
inserted
replaced
15:ad457d5f7d04 | 16:0293115a14e9 |
---|---|
1 ;;; ediff-wind.el --- window manipulation utilities | 1 ;;; ediff-wind.el --- window manipulation utilities |
2 | 2 |
3 ;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Michael Kifer <kifer@cs.sunysb.edu> | 5 ;; Author: Michael Kifer <kifer@cs.sunysb.edu> |
6 | 6 |
7 ;; This file is part of GNU Emacs. | 7 ;; This file is part of GNU Emacs. |
8 | 8 |
36 (defvar default-menubar) | 36 (defvar default-menubar) |
37 (defvar frame-icon-title-format) | 37 (defvar frame-icon-title-format) |
38 (defvar ediff-diff-status) | 38 (defvar ediff-diff-status) |
39 | 39 |
40 (eval-when-compile | 40 (eval-when-compile |
41 (let ((load-path (cons "." load-path))) | 41 (let ((load-path (cons (expand-file-name ".") load-path))) |
42 (or (featurep 'ediff-init) | 42 (or (featurep 'ediff-init) |
43 (load "ediff-init.el" nil nil 'nosuffix)) | 43 (load "ediff-init.el" nil nil 'nosuffix)) |
44 (or (featurep 'ediff-util) | |
45 (load "ediff-util.el" nil nil 'nosuffix)) | |
44 (or (featurep 'ediff-help) | 46 (or (featurep 'ediff-help) |
45 (load "ediff-help.el" nil nil 'nosuffix)) | 47 (load "ediff-help.el" nil nil 'nosuffix)) |
46 (or (featurep 'ediff-util) | |
47 (load "ediff-util.el" nil nil 'nosuffix)) | |
48 (or (featurep 'ediff-tbar) | 48 (or (featurep 'ediff-tbar) |
49 (load "ediff-tbar.el" 'noerror nil 'nosuffix)) | 49 (load "ediff-tbar.el" 'noerror nil 'nosuffix)) |
50 )) | 50 )) |
51 ;; end pacifier | 51 ;; end pacifier |
52 | 52 |
876 ;; 1 more line for the modeline | 876 ;; 1 more line for the modeline |
877 (setq lines (1+ (count-lines (point-min) (point-max))) | 877 (setq lines (1+ (count-lines (point-min) (point-max))) |
878 fheight lines | 878 fheight lines |
879 fwidth (max (+ (ediff-help-message-line-length) 2) | 879 fwidth (max (+ (ediff-help-message-line-length) 2) |
880 (ediff-compute-toolbar-width)) | 880 (ediff-compute-toolbar-width)) |
881 adjusted-parameters (append (list | 881 adjusted-parameters ;;(append |
882 ;; possibly change surrogate minibuffer | 882 (list |
883 (cons 'minibuffer | 883 ;; possibly change surrogate minibuffer |
884 (minibuffer-window | 884 (cons 'minibuffer |
885 designated-minibuffer-frame)) | 885 (minibuffer-window |
886 (cons 'width fwidth) | 886 designated-minibuffer-frame)) |
887 (cons 'height fheight)) | 887 (cons 'width fwidth) |
888 (funcall | 888 (cons 'height fheight)) |
889 ediff-control-frame-position-function | 889 ;;(funcall |
890 ctl-buffer fwidth fheight))) | 890 ;;ediff-control-frame-position-function |
891 ;;ctl-buffer fwidth fheight) | |
892 ;;) | |
893 ) | |
891 (if ediff-use-long-help-message | 894 (if ediff-use-long-help-message |
892 (setq adjusted-parameters | 895 (setq adjusted-parameters |
893 (cons '(auto-raise . nil) adjusted-parameters))) | 896 (cons '(auto-raise . nil) adjusted-parameters))) |
894 | 897 |
895 ;; In XEmacs, buffer menubar needs to be killed before frame parameters | 898 ;; In XEmacs, buffer menubar needs to be killed before frame parameters |
896 ;; are changed. | 899 ;; are changed. |
897 (if ediff-xemacs-p | 900 (if ediff-xemacs-p |
898 (progn | 901 (progn |
902 (set-specifier top-toolbar-height (list ctl-frame 2)) | |
903 (sit-for 0) | |
899 (set-specifier top-toolbar-height (list ctl-frame 0)) | 904 (set-specifier top-toolbar-height (list ctl-frame 0)) |
900 (set-specifier bottom-toolbar-height (list ctl-frame 0)) | 905 ;;(set-specifier bottom-toolbar-height (list ctl-frame 0)) |
901 (set-specifier left-toolbar-width (list ctl-frame 0)) | 906 (set-specifier left-toolbar-width (list ctl-frame 0)) |
902 (set-specifier right-toolbar-width (list ctl-frame 0)) | 907 (set-specifier right-toolbar-width (list ctl-frame 0)) |
903 )) | 908 )) |
904 | 909 |
905 ;; Under OS/2 (emx) we have to call modify frame parameters twice, in order | 910 ;; Under OS/2 (emx) we have to call modify frame parameters twice, in order |
908 ;; parameters of iconified frames. As a precaution, we do likewise for | 913 ;; parameters of iconified frames. As a precaution, we do likewise for |
909 ;; windows-nt. | 914 ;; windows-nt. |
910 (if (memq system-type '(emx windows-nt windows-95)) | 915 (if (memq system-type '(emx windows-nt windows-95)) |
911 (modify-frame-parameters ctl-frame adjusted-parameters)) | 916 (modify-frame-parameters ctl-frame adjusted-parameters)) |
912 | 917 |
918 ;; make or zap toolbar (if not requested) | |
919 (ediff-make-bottom-toolbar ctl-frame) | |
920 | |
913 (goto-char (point-min)) | 921 (goto-char (point-min)) |
914 | 922 |
915 (modify-frame-parameters ctl-frame adjusted-parameters) | 923 (modify-frame-parameters ctl-frame adjusted-parameters) |
916 (make-frame-visible ctl-frame) | 924 (make-frame-visible ctl-frame) |
917 (ediff-make-bottom-toolbar) ; no effect if the toolbar is not requested | |
918 | 925 |
919 ;; This works around a bug in 19.25 and earlier. There, if frame gets | 926 ;; This works around a bug in 19.25 and earlier. There, if frame gets |
920 ;; iconified, the current buffer changes to that of the frame that | 927 ;; iconified, the current buffer changes to that of the frame that |
921 ;; becomes exposed as a result of this iconification. | 928 ;; becomes exposed as a result of this iconification. |
922 ;; So, we make sure the current buffer doesn't change. | 929 ;; So, we make sure the current buffer doesn't change. |
928 (iconify-frame ctl-frame)) | 935 (iconify-frame ctl-frame)) |
929 ((or deiconify-ctl-frame (not ctl-frame-iconified-p)) | 936 ((or deiconify-ctl-frame (not ctl-frame-iconified-p)) |
930 (raise-frame ctl-frame))) | 937 (raise-frame ctl-frame))) |
931 | 938 |
932 (set-window-dedicated-p (selected-window) t) | 939 (set-window-dedicated-p (selected-window) t) |
940 | |
941 ;; Now move the frame. We must do it separately due to an obscure bug in | |
942 ;; XEmacs | |
943 (modify-frame-parameters | |
944 ctl-frame | |
945 (funcall ediff-control-frame-position-function ctl-buffer fwidth fheight)) | |
933 | 946 |
934 ;; synchronize so the cursor will move to control frame | 947 ;; synchronize so the cursor will move to control frame |
935 ;; per RMS suggestion | 948 ;; per RMS suggestion |
936 (if (ediff-window-display-p) | 949 (if (ediff-window-display-p) |
937 (let ((count 7)) | 950 (let ((count 7)) |
953 )) | 966 )) |
954 | 967 |
955 (ediff-eval-in-buffer ctl-buffer | 968 (ediff-eval-in-buffer ctl-buffer |
956 (run-hooks 'ediff-after-setup-control-frame-hook)) | 969 (run-hooks 'ediff-after-setup-control-frame-hook)) |
957 )) | 970 )) |
971 | |
958 | 972 |
959 (defun ediff-destroy-control-frame (ctl-buffer) | 973 (defun ediff-destroy-control-frame (ctl-buffer) |
960 (ediff-eval-in-buffer ctl-buffer | 974 (ediff-eval-in-buffer ctl-buffer |
961 (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame)) | 975 (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame)) |
962 (let ((ctl-frame ediff-control-frame)) | 976 (let ((ctl-frame ediff-control-frame)) |
1079 buf-B-state-diff "" | 1093 buf-B-state-diff "" |
1080 buf-C-state-diff "")) | 1094 buf-C-state-diff "")) |
1081 | 1095 |
1082 ;; control buffer format | 1096 ;; control buffer format |
1083 (setq mode-line-format | 1097 (setq mode-line-format |
1084 (list (if (ediff-narrow-control-frame-p) " " "-- ") | 1098 (if (ediff-narrow-control-frame-p) |
1085 mode-line-buffer-identification | 1099 (list " " mode-line-buffer-identification) |
1086 " Quick Help")) | 1100 (list "-- " mode-line-buffer-identification " Quick Help"))) |
1087 ;; control buffer id | 1101 ;; control buffer id |
1088 (setq mode-line-buffer-identification | 1102 (setq mode-line-buffer-identification |
1089 (if (ediff-narrow-control-frame-p) | 1103 (if (ediff-narrow-control-frame-p) |
1090 (ediff-make-narrow-control-buffer-id 'skip-name) | 1104 (ediff-make-narrow-control-buffer-id 'skip-name) |
1091 (ediff-make-wide-control-buffer-id))) | 1105 (ediff-make-wide-control-buffer-id))) |