emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108040: Adapt ediff window handli


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108040: Adapt ediff window handling to multi-tty.
Date: Fri, 02 Nov 2012 02:26:05 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108040
fixes bug: http://debbugs.gnu.org/2138
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Thu 2012-04-26 11:04:36 +0800
message:
  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.
modified:
  lisp/ChangeLog
  lisp/vc/ediff-init.el
  lisp/vc/ediff-wind.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-25 19:00:18 +0000
+++ b/lisp/ChangeLog    2012-04-26 03:04:36 +0000
@@ -1,3 +1,12 @@
+2012-04-26  Chong Yidong  <address@hidden>
+
+       * 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 (Bug#2138).
+       (ediff-choose-window-setup-function-automatically): Make obsolete.
+
+       * vc/ediff-init.el: Always define ediff-pixel-width/height.
+
 2012-04-25  Stefan Monnier  <address@hidden>
 
        * ffap.el: Remove old code for obsolete package.

=== modified file 'lisp/vc/ediff-init.el'
--- a/lisp/vc/ediff-init.el     2012-04-09 13:05:48 +0000
+++ b/lisp/vc/ediff-init.el     2012-04-26 03:04:36 +0000
@@ -786,19 +786,12 @@
   "")
 
 
-(if (ediff-window-display-p)
-    (if (featurep 'xemacs)
-       (progn
-         (defalias 'ediff-display-pixel-width 'device-pixel-width)
-         (defalias 'ediff-display-pixel-height 'device-pixel-height))
-      (defalias 'ediff-display-pixel-width
-       (if (fboundp 'display-pixel-width)
-           'display-pixel-width
-         'x-display-pixel-width))
-      (defalias 'ediff-display-pixel-height
-       (if (fboundp 'display-pixel-height)
-           'display-pixel-height
-         'x-display-pixel-height))))
+(if (featurep 'xemacs)
+    (progn
+      (defalias 'ediff-display-pixel-width 'device-pixel-width)
+      (defalias 'ediff-display-pixel-height 'device-pixel-height))
+  (defalias 'ediff-display-pixel-width 'display-pixel-width)
+  (defalias 'ediff-display-pixel-height 'display-pixel-height))
 
 ;; A-list of current-diff-overlay symbols associated with buf types
 (defconst ediff-current-diff-overlay-alist

=== modified file 'lisp/vc/ediff-wind.el'
--- a/lisp/vc/ediff-wind.el     2012-01-19 07:21:25 +0000
+++ b/lisp/vc/ediff-wind.el     2012-04-26 03:04:36 +0000
@@ -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 @@
        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 @@
        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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]