diff options
author | Chong Yidong <cyd@gnu.org> | 2012-04-26 11:04:36 +0800 |
---|---|---|
committer | Chong Yidong <cyd@gnu.org> | 2012-04-26 11:04:36 +0800 |
commit | f08ae1c9b5ee79aef764f4ef35ae4c84009333e6 (patch) | |
tree | 0f460a3f901a584004ecc37c37764a61a364ac83 /lisp/vc/ediff-wind.el | |
parent | 823ad1d7e83d2e98ba19d686f3c310707ca27c9a (diff) | |
download | emacs-f08ae1c9b5ee79aef764f4ef35ae4c84009333e6.tar.gz emacs-f08ae1c9b5ee79aef764f4ef35ae4c84009333e6.tar.bz2 emacs-f08ae1c9b5ee79aef764f4ef35ae4c84009333e6.zip |
Adapt ediff window handling to multi-tty.
* vc/ediff-init.el: Always define ediff-pixel-width/height.
* vc/ediff-wind.el (ediff-setup-windows-default): New function.
(ediff-window-setup-function): Use it as the default, to set up
windows based on whether the current frame is graphical.
(ediff-choose-window-setup-function-automatically): Make obsolete.
Fixes: debbugs:2138
Diffstat (limited to 'lisp/vc/ediff-wind.el')
-rw-r--r-- | lisp/vc/ediff-wind.el | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el index 83098fcb0c7..50f2be3b8dc 100644 --- a/lisp/vc/ediff-wind.el +++ b/lisp/vc/ediff-wind.el @@ -67,16 +67,23 @@ 'ediff-setup-windows-multiframe 'ediff-setup-windows-plain)) -(defcustom ediff-window-setup-function (ediff-choose-window-setup-function-automatically) +(make-obsolete 'ediff-choose-window-setup-function-automatically + 'ediff-setup-windows-default "24.2") + +(defcustom ediff-window-setup-function 'ediff-setup-windows-default "Function called to set up windows. -Ediff provides a choice of two functions: `ediff-setup-windows-plain', for -doing everything in one frame and `ediff-setup-windows-multiframe', which sets -the control panel in a separate frame. By default, the appropriate function is -chosen automatically depending on the current window system. -However, `ediff-toggle-multiframe' can be used to toggle between the multiframe -display and the single frame display. -If the multiframe function detects that one of the buffers A/B is seen in some -other frame, it will try to keep that buffer in that frame. +Ediff provides a choice of three functions: + (1) `ediff-setup-windows-multiframe', which sets the control panel + in a separate frame. + (2) `ediff-setup-windows-plain', which does everything in one frame + (3) `ediff-setup-windows-default' (the default), which does (1) + on a graphical display and (2) on a text terminal. + +The command \\[ediff-toggle-multiframe] can be used to toggle +between the multiframe display and the single frame display. If +the multiframe function detects that one of the buffers A/B is +seen in some other frame, it will try to keep that buffer in that +frame. If you don't like any of the two provided functions, write your own one. The basic guidelines: @@ -90,10 +97,12 @@ The basic guidelines: Buffer C may not be used in jobs that compare only two buffers. If you plan to do something fancy, take a close look at how the two provided functions are written." - :type '(choice (const :tag "Multi Frame" ediff-setup-windows-multiframe) + :type '(choice (const :tag "Choose Automatically" ediff-setup-windows-default) + (const :tag "Multi Frame" ediff-setup-windows-multiframe) (const :tag "Single Frame" ediff-setup-windows-plain) (function :tag "Other function")) - :group 'ediff-window) + :group 'ediff-window + :version "24.2") ;; indicates if we are in a multiframe setup (ediff-defvar-local ediff-multiframe nil "") @@ -333,6 +342,12 @@ into icons, regardless of the window manager." buffer-A buffer-B buffer-C control-buffer)) (run-hooks 'ediff-after-setup-windows-hook)) +(defun ediff-setup-windows-default (buffer-A buffer-B buffer-C control-buffer) + (funcall (if (display-graphic-p) + 'ediff-setup-windows-multiframe + 'ediff-setup-windows-plain) + buffer-A buffer-B buffer-C control-buffer)) + ;; Just set up 3 windows. ;; Usually used without windowing systems ;; With windowing, we want to use dedicated frames. |