diff options
| author | Chong Yidong | 2012-04-26 11:04:36 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-04-26 11:04:36 +0800 |
| commit | f08ae1c9b5ee79aef764f4ef35ae4c84009333e6 (patch) | |
| tree | 0f460a3f901a584004ecc37c37764a61a364ac83 | |
| parent | 823ad1d7e83d2e98ba19d686f3c310707ca27c9a (diff) | |
| download | emacs-f08ae1c9b5ee79aef764f4ef35ae4c84009333e6.tar.gz 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
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/vc/ediff-init.el | 19 | ||||
| -rw-r--r-- | lisp/vc/ediff-wind.el | 37 |
3 files changed, 41 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eb09afc0b55..04271849758 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2012-04-26 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * vc/ediff-wind.el (ediff-setup-windows-default): New function. | ||
| 4 | (ediff-window-setup-function): Use it as the default, to set up | ||
| 5 | windows based on whether the current frame is graphical (Bug#2138). | ||
| 6 | (ediff-choose-window-setup-function-automatically): Make obsolete. | ||
| 7 | |||
| 8 | * vc/ediff-init.el: Always define ediff-pixel-width/height. | ||
| 9 | |||
| 1 | 2012-04-25 Stefan Monnier <monnier@iro.umontreal.ca> | 10 | 2012-04-25 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 11 | ||
| 3 | * ffap.el: Remove old code for obsolete package. | 12 | * ffap.el: Remove old code for obsolete package. |
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index ad6d69ee924..80ed9356850 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el | |||
| @@ -786,19 +786,12 @@ TYPE-OF-EMACS is either 'xemacs or 'emacs." | |||
| 786 | "") | 786 | "") |
| 787 | 787 | ||
| 788 | 788 | ||
| 789 | (if (ediff-window-display-p) | 789 | (if (featurep 'xemacs) |
| 790 | (if (featurep 'xemacs) | 790 | (progn |
| 791 | (progn | 791 | (defalias 'ediff-display-pixel-width 'device-pixel-width) |
| 792 | (defalias 'ediff-display-pixel-width 'device-pixel-width) | 792 | (defalias 'ediff-display-pixel-height 'device-pixel-height)) |
| 793 | (defalias 'ediff-display-pixel-height 'device-pixel-height)) | 793 | (defalias 'ediff-display-pixel-width 'display-pixel-width) |
| 794 | (defalias 'ediff-display-pixel-width | 794 | (defalias 'ediff-display-pixel-height 'display-pixel-height)) |
| 795 | (if (fboundp 'display-pixel-width) | ||
| 796 | 'display-pixel-width | ||
| 797 | 'x-display-pixel-width)) | ||
| 798 | (defalias 'ediff-display-pixel-height | ||
| 799 | (if (fboundp 'display-pixel-height) | ||
| 800 | 'display-pixel-height | ||
| 801 | 'x-display-pixel-height)))) | ||
| 802 | 795 | ||
| 803 | ;; A-list of current-diff-overlay symbols associated with buf types | 796 | ;; A-list of current-diff-overlay symbols associated with buf types |
| 804 | (defconst ediff-current-diff-overlay-alist | 797 | (defconst ediff-current-diff-overlay-alist |
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 @@ | |||
| 67 | 'ediff-setup-windows-multiframe | 67 | 'ediff-setup-windows-multiframe |
| 68 | 'ediff-setup-windows-plain)) | 68 | 'ediff-setup-windows-plain)) |
| 69 | 69 | ||
| 70 | (defcustom ediff-window-setup-function (ediff-choose-window-setup-function-automatically) | 70 | (make-obsolete 'ediff-choose-window-setup-function-automatically |
| 71 | 'ediff-setup-windows-default "24.2") | ||
| 72 | |||
| 73 | (defcustom ediff-window-setup-function 'ediff-setup-windows-default | ||
| 71 | "Function called to set up windows. | 74 | "Function called to set up windows. |
| 72 | Ediff provides a choice of two functions: `ediff-setup-windows-plain', for | 75 | Ediff provides a choice of three functions: |
| 73 | doing everything in one frame and `ediff-setup-windows-multiframe', which sets | 76 | (1) `ediff-setup-windows-multiframe', which sets the control panel |
| 74 | the control panel in a separate frame. By default, the appropriate function is | 77 | in a separate frame. |
| 75 | chosen automatically depending on the current window system. | 78 | (2) `ediff-setup-windows-plain', which does everything in one frame |
| 76 | However, `ediff-toggle-multiframe' can be used to toggle between the multiframe | 79 | (3) `ediff-setup-windows-default' (the default), which does (1) |
| 77 | display and the single frame display. | 80 | on a graphical display and (2) on a text terminal. |
| 78 | If the multiframe function detects that one of the buffers A/B is seen in some | 81 | |
| 79 | other frame, it will try to keep that buffer in that frame. | 82 | The command \\[ediff-toggle-multiframe] can be used to toggle |
| 83 | between the multiframe display and the single frame display. If | ||
| 84 | the multiframe function detects that one of the buffers A/B is | ||
| 85 | seen in some other frame, it will try to keep that buffer in that | ||
| 86 | frame. | ||
| 80 | 87 | ||
| 81 | If you don't like any of the two provided functions, write your own one. | 88 | If you don't like any of the two provided functions, write your own one. |
| 82 | The basic guidelines: | 89 | The basic guidelines: |
| @@ -90,10 +97,12 @@ The basic guidelines: | |||
| 90 | Buffer C may not be used in jobs that compare only two buffers. | 97 | Buffer C may not be used in jobs that compare only two buffers. |
| 91 | If you plan to do something fancy, take a close look at how the two | 98 | If you plan to do something fancy, take a close look at how the two |
| 92 | provided functions are written." | 99 | provided functions are written." |
| 93 | :type '(choice (const :tag "Multi Frame" ediff-setup-windows-multiframe) | 100 | :type '(choice (const :tag "Choose Automatically" ediff-setup-windows-default) |
| 101 | (const :tag "Multi Frame" ediff-setup-windows-multiframe) | ||
| 94 | (const :tag "Single Frame" ediff-setup-windows-plain) | 102 | (const :tag "Single Frame" ediff-setup-windows-plain) |
| 95 | (function :tag "Other function")) | 103 | (function :tag "Other function")) |
| 96 | :group 'ediff-window) | 104 | :group 'ediff-window |
| 105 | :version "24.2") | ||
| 97 | 106 | ||
| 98 | ;; indicates if we are in a multiframe setup | 107 | ;; indicates if we are in a multiframe setup |
| 99 | (ediff-defvar-local ediff-multiframe nil "") | 108 | (ediff-defvar-local ediff-multiframe nil "") |
| @@ -333,6 +342,12 @@ into icons, regardless of the window manager." | |||
| 333 | buffer-A buffer-B buffer-C control-buffer)) | 342 | buffer-A buffer-B buffer-C control-buffer)) |
| 334 | (run-hooks 'ediff-after-setup-windows-hook)) | 343 | (run-hooks 'ediff-after-setup-windows-hook)) |
| 335 | 344 | ||
| 345 | (defun ediff-setup-windows-default (buffer-A buffer-B buffer-C control-buffer) | ||
| 346 | (funcall (if (display-graphic-p) | ||
| 347 | 'ediff-setup-windows-multiframe | ||
| 348 | 'ediff-setup-windows-plain) | ||
| 349 | buffer-A buffer-B buffer-C control-buffer)) | ||
| 350 | |||
| 336 | ;; Just set up 3 windows. | 351 | ;; Just set up 3 windows. |
| 337 | ;; Usually used without windowing systems | 352 | ;; Usually used without windowing systems |
| 338 | ;; With windowing, we want to use dedicated frames. | 353 | ;; With windowing, we want to use dedicated frames. |