diff options
| author | Karoly Lorentey | 2006-03-12 04:12:31 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-03-12 04:12:31 +0000 |
| commit | 632210dd8530dc84a40ae9c127a4baf7b19f4a63 (patch) | |
| tree | 44110d97b10e10fe3b155f4b15d267b03b8fb74a | |
| parent | d2b86d7f40873f053489f386f7ab926bbb226bef (diff) | |
| download | emacs-632210dd8530dc84a40ae9c127a4baf7b19f4a63.tar.gz emacs-632210dd8530dc84a40ae9c127a4baf7b19f4a63.zip | |
Fix ediff problems. (Reported by Dan Nicolaescu.)
* lisp/subr.el (with-selected-frame): Make sure the current buffer is
restored as well.
* src/xfns.c (Fx_create_frame): Use `store_frame_param' to set
`window-system' frame parameter, and make sure it overrides any
user-supplied setting.
* src/xfns.c (x_icon): Disable redundant call to
`x_wm_set_window_state'. (Also applied in CVS.)
* lisp/faces.el (x-create-frame-with-faces): Don't make frame visible
until we are done setting up all its parameters.
* lisp/ediff-wind.el (ediff-setup-windows-automatic): New function.
(ediff-window-setup-function): Use it as default.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-528
| -rw-r--r-- | lisp/ediff-wind.el | 25 | ||||
| -rw-r--r-- | lisp/faces.el | 6 | ||||
| -rw-r--r-- | lisp/subr.el | 17 | ||||
| -rw-r--r-- | src/xfns.c | 7 |
4 files changed, 35 insertions, 20 deletions
diff --git a/lisp/ediff-wind.el b/lisp/ediff-wind.el index 28369f9f6bd..5e9381f5dab 100644 --- a/lisp/ediff-wind.el +++ b/lisp/ediff-wind.el | |||
| @@ -72,15 +72,15 @@ | |||
| 72 | :group 'frames) | 72 | :group 'frames) |
| 73 | 73 | ||
| 74 | 74 | ||
| 75 | (defcustom ediff-window-setup-function (if (ediff-window-display-p) | 75 | (defcustom ediff-window-setup-function 'ediff-setup-windows-automatic) |
| 76 | 'ediff-setup-windows-multiframe | ||
| 77 | 'ediff-setup-windows-plain) | ||
| 78 | "*Function called to set up windows. | 76 | "*Function called to set up windows. |
| 79 | Ediff provides a choice of two functions: `ediff-setup-windows-plain', for | 77 | Ediff provides a choice of three functions: `ediff-setup-windows-plain', for |
| 80 | doing everything in one frame, and `ediff-setup-windows-multiframe', | 78 | doing everything in one frame, `ediff-setup-windows-multiframe', which sets |
| 81 | which sets the control panel in a separate frame. Also, if the latter | 79 | the control panel in a separate frame, and |
| 82 | function detects that one of the buffers A/B is seen in some other frame, | 80 | `ediff-setup-windows-automatic' (the default), which chooses an appropriate |
| 83 | it will try to keep that buffer in that frame. | 81 | behaviour based on the current window system. If the multiframe function |
| 82 | detects that one of the buffers A/B is seen in some other frame, it will try | ||
| 83 | to keep that buffer in that frame. | ||
| 84 | 84 | ||
| 85 | If you don't like the two functions provided---write your own one. | 85 | If you don't like the two functions provided---write your own one. |
| 86 | The basic guidelines: | 86 | The basic guidelines: |
| @@ -94,7 +94,8 @@ The basic guidelines: | |||
| 94 | Buffer C may not be used in jobs that compare only two buffers. | 94 | Buffer C may not be used in jobs that compare only two buffers. |
| 95 | If you plan to do something fancy, take a close look at how the two | 95 | If you plan to do something fancy, take a close look at how the two |
| 96 | provided functions are written." | 96 | provided functions are written." |
| 97 | :type '(choice (const :tag "Multi Frame" ediff-setup-windows-multiframe) | 97 | :type '(choice (const :tag "Automatic" ediff-setup-windows-automatic) |
| 98 | (const :tag "Multi Frame" ediff-setup-windows-multiframe) | ||
| 98 | (const :tag "Single Frame" ediff-setup-windows-plain) | 99 | (const :tag "Single Frame" ediff-setup-windows-plain) |
| 99 | (function :tag "Other function")) | 100 | (function :tag "Other function")) |
| 100 | :group 'ediff-window) | 101 | :group 'ediff-window) |
| @@ -333,6 +334,12 @@ into icons, regardless of the window manager." | |||
| 333 | buffer-A buffer-B buffer-C control-buffer)) | 334 | buffer-A buffer-B buffer-C control-buffer)) |
| 334 | (run-hooks 'ediff-after-setup-windows-hook)) | 335 | (run-hooks 'ediff-after-setup-windows-hook)) |
| 335 | 336 | ||
| 337 | ;; Set up windows using the correct method based on the current window system. | ||
| 338 | (defun ediff-setup-windows-automatic (buffer-A buffer-B buffer-C control-buffer) | ||
| 339 | (if (ediff-window-display-p) | ||
| 340 | (ediff-setup-windows-multiframe buffer-A buffer-B buffer-C control-buffer) | ||
| 341 | (ediff-setup-windows-plain buffer-A buffer-B buffer-C control-buffer))) | ||
| 342 | |||
| 336 | ;; Just set up 3 windows. | 343 | ;; Just set up 3 windows. |
| 337 | ;; Usually used without windowing systems | 344 | ;; Usually used without windowing systems |
| 338 | ;; With windowing, we want to use dedicated frames. | 345 | ;; With windowing, we want to use dedicated frames. |
diff --git a/lisp/faces.el b/lisp/faces.el index ee11868b549..b1906faee87 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1734,14 +1734,14 @@ Value is the new frame created." | |||
| 1734 | (x-handle-reverse-video frame parameters) | 1734 | (x-handle-reverse-video frame parameters) |
| 1735 | (frame-set-background-mode frame) | 1735 | (frame-set-background-mode frame) |
| 1736 | (face-set-after-frame-default frame) | 1736 | (face-set-after-frame-default frame) |
| 1737 | (if (or (null frame-list) (null visibility-spec)) | ||
| 1738 | (make-frame-visible frame) | ||
| 1739 | (modify-frame-parameters frame (list visibility-spec))) | ||
| 1740 | ;; Arrange for the kill and yank functions to set and check the clipboard. | 1737 | ;; Arrange for the kill and yank functions to set and check the clipboard. |
| 1741 | (modify-frame-parameters | 1738 | (modify-frame-parameters |
| 1742 | frame '((interprogram-cut-function . x-select-text))) | 1739 | frame '((interprogram-cut-function . x-select-text))) |
| 1743 | (modify-frame-parameters | 1740 | (modify-frame-parameters |
| 1744 | frame '((interprogram-paste-function . x-cut-buffer-or-selection-value))) | 1741 | frame '((interprogram-paste-function . x-cut-buffer-or-selection-value))) |
| 1742 | (if (or (null frame-list) (null visibility-spec)) | ||
| 1743 | (make-frame-visible frame) | ||
| 1744 | (modify-frame-parameters frame (list visibility-spec))) | ||
| 1745 | (setq success t)) | 1745 | (setq success t)) |
| 1746 | (unless success | 1746 | (unless success |
| 1747 | (delete-frame frame))) | 1747 | (delete-frame frame))) |
diff --git a/lisp/subr.el b/lisp/subr.el index ef49c9b1c9a..6c473e5a686 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2130,12 +2130,17 @@ See also `with-temp-buffer'." | |||
| 2130 | The value returned is the value of the last form in BODY. | 2130 | The value returned is the value of the last form in BODY. |
| 2131 | See also `with-temp-buffer'." | 2131 | See also `with-temp-buffer'." |
| 2132 | (declare (indent 1) (debug t)) | 2132 | (declare (indent 1) (debug t)) |
| 2133 | `(let ((save-selected-frame (selected-frame))) | 2133 | (let ((old-frame (make-symbol "old-frame")) |
| 2134 | (unwind-protect | 2134 | (old-buffer (make-symbol "old-buffer"))) |
| 2135 | (progn (select-frame ,frame) | 2135 | `(let ((,old-frame (selected-frame)) |
| 2136 | ,@body) | 2136 | (,old-buffer (current-buffer))) |
| 2137 | (if (frame-live-p save-selected-frame) | 2137 | (unwind-protect |
| 2138 | (select-frame save-selected-frame))))) | 2138 | (progn (select-frame ,frame) |
| 2139 | ,@body) | ||
| 2140 | (if (frame-live-p ,old-frame) | ||
| 2141 | (select-frame ,old-frame)) | ||
| 2142 | (if (buffer-live-p ,old-buffer) | ||
| 2143 | (set-buffer ,old-buffer)))))) | ||
| 2139 | 2144 | ||
| 2140 | (defmacro with-temp-file (file &rest body) | 2145 | (defmacro with-temp-file (file &rest body) |
| 2141 | "Create a new buffer, evaluate BODY there, and write the buffer to FILE. | 2146 | "Create a new buffer, evaluate BODY there, and write the buffer to FILE. |
diff --git a/src/xfns.c b/src/xfns.c index 3616b4a7100..d3067e00fe8 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2830,12 +2830,15 @@ x_icon (f, parms) | |||
| 2830 | if (! EQ (icon_x, Qunbound)) | 2830 | if (! EQ (icon_x, Qunbound)) |
| 2831 | x_wm_set_icon_position (f, XINT (icon_x), XINT (icon_y)); | 2831 | x_wm_set_icon_position (f, XINT (icon_x), XINT (icon_y)); |
| 2832 | 2832 | ||
| 2833 | #if 0 /* x_get_arg removes the visibility parameter as a side effect, | ||
| 2834 | but x_create_frame still needs it. */ | ||
| 2833 | /* Start up iconic or window? */ | 2835 | /* Start up iconic or window? */ |
| 2834 | x_wm_set_window_state | 2836 | x_wm_set_window_state |
| 2835 | (f, (EQ (x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL), | 2837 | (f, (EQ (x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL), |
| 2836 | Qicon) | 2838 | Qicon) |
| 2837 | ? IconicState | 2839 | ? IconicState |
| 2838 | : NormalState)); | 2840 | : NormalState)); |
| 2841 | #endif | ||
| 2839 | 2842 | ||
| 2840 | x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name) | 2843 | x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name) |
| 2841 | ? f->icon_name | 2844 | ? f->icon_name |
| @@ -3169,8 +3172,6 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3169 | specbind (Qx_resource_name, name); | 3172 | specbind (Qx_resource_name, name); |
| 3170 | } | 3173 | } |
| 3171 | 3174 | ||
| 3172 | Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qx), Qnil)); | ||
| 3173 | |||
| 3174 | /* Extract the window parameters from the supplied values | 3175 | /* Extract the window parameters from the supplied values |
| 3175 | that are needed to determine window geometry. */ | 3176 | that are needed to determine window geometry. */ |
| 3176 | { | 3177 | { |
| @@ -3410,6 +3411,8 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3410 | if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) | 3411 | if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) |
| 3411 | f->param_alist = Fcons (XCAR (tem), f->param_alist); | 3412 | f->param_alist = Fcons (XCAR (tem), f->param_alist); |
| 3412 | 3413 | ||
| 3414 | store_frame_param (f, Qwindow_system, Qx); | ||
| 3415 | |||
| 3413 | UNGCPRO; | 3416 | UNGCPRO; |
| 3414 | 3417 | ||
| 3415 | /* Make sure windows on this frame appear in calls to next-window | 3418 | /* Make sure windows on this frame appear in calls to next-window |