all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: sbaugh@catern.com
To: Robert Pluim <rpluim@gmail.com>
Cc: luangruo@yahoo.com, Spencer Baugh <sbaugh@janestreet.com>,
	Eli Zaretskii <eliz@gnu.org>,
	62164@debbugs.gnu.org
Subject: bug#62164: 29.0.60; ediff behaves poorly by default on tiling window managers
Date: Mon, 03 Jul 2023 19:21:53 +0000 (UTC)	[thread overview]
Message-ID: <87edloreb3.fsf@catern.com> (raw)
In-Reply-To: <87jzvnd7rs.fsf@gmail.com> (Robert Pluim's message of "Wed, 28 Jun 2023 15:40:55 +0200")

[-- Attachment #1: Type: text/plain, Size: 1840 bytes --]

Robert Pluim <rpluim@gmail.com> writes:

>>>>>> On Wed, 28 Jun 2023 08:55:13 -0400, Spencer Baugh <sbaugh@janestreet.com> said:
>
>     Spencer> * lisp/vc/ediff-wind.el (ediff-floating-control-frame): Add
>     Spencer> defcustom.
>     Spencer> (ediff-frame-make-utility, ediff-setup-control-frame): Allow setting
>     Spencer> the control frame up as a utility window under X. (bug#62164)
>
> Two spaces after full stop. And I think the convention is to
> capitalize 'Bug', but we donʼt follow that very consistently.
>
> I think the new user option warrants an entry in etc/NEWS

Added, patch at the end.

>     Spencer> ---
>     Spencer>  lisp/vc/ediff-wind.el | 22 ++++++++++++++++++++++
>     Spencer>  1 file changed, 22 insertions(+)
>
>     Spencer> diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el
>     Spencer> index eb903f093f9..74e0e1f9b9f 100644
>     Spencer> --- a/lisp/vc/ediff-wind.el
>     Spencer> +++ b/lisp/vc/ediff-wind.el
>     Spencer> @@ -69,6 +69,16 @@ ediff-window-setup-function
>     Spencer>  		 (function :tag "Other function"))
>     Spencer>    :version "24.3")
>  
>     Spencer> +(defcustom ediff-floating-control-frame nil
>     Spencer> +  "If not-nil, try making the control frame be floating rather than tiled.
>     Spencer> +
>
> Style: the description of the option should state the action that
> follows from a non-nil value:
>
> "Whether to request a floating control frame rather than a tiled one."

No, this is correct style, see (info "(elisp) Documentation Tips")

   • The documentation string for a variable that is a yes-or-no flag
     should start with words such as “Non-nil means”, to make it clear
     that all non-‘nil’ values are equivalent and indicate explicitly
     what ‘nil’ and non-‘nil’ mean.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Allow-floating-the-ediff-control-frame-under-X.patch --]
[-- Type: text/x-patch, Size: 3213 bytes --]

From 6b347e419898ade96f459ddec9f1fda8d7dfef84 Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@catern.com>
Date: Fri, 7 Apr 2023 17:54:06 -0400
Subject: [PATCH] Allow floating the ediff control frame under X

This is a step in the direction of making ediff behave better by
default under tiling window managers and fixing Bug#62164.

* lisp/vc/ediff-wind.el (ediff-floating-control-frame): Add
defcustom.
(ediff-frame-make-utility, ediff-setup-control-frame): Allow setting
the control frame up as a utility window under X.  (Bug#62164)
---
 etc/NEWS              | 11 +++++++++++
 lisp/vc/ediff-wind.el | 22 ++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 9e6f0c16bcd..9c99cf6c725 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2314,6 +2314,17 @@ your mail user agent.  The behavior of 'vc-prepare-patch' can be
 modified by the user options 'vc-prepare-patches-separately' and
 'vc-default-patch-addressee'.
 
+** Ediff
+
+---
+*** New user option 'ediff-floating-control-frame'.
+If non-nil, try making the control frame be floating rather than tiled.
+
+Many X tiling window managers make the Ediff control frame a tiled
+window equal in size to the main Emacs frame, which works poorly.
+This option is useful to set if you use such a window manager, and
+will be harmless (or helpful) on most other modern window managers.
+
 ** Message
 
 ---
diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el
index eb903f093f9..3077c562d63 100644
--- a/lisp/vc/ediff-wind.el
+++ b/lisp/vc/ediff-wind.el
@@ -69,6 +69,16 @@ ediff-window-setup-function
 		 (function :tag "Other function"))
   :version "24.3")
 
+(defcustom ediff-floating-control-frame nil
+  "If non-nil, try making the control frame be floating rather than tiled.
+
+If your X window manager makes the Ediff control frame a tiled one,
+set this to a non-nil value, and Emacs will try to make it floating.
+This only has effect on X displays."
+  :type '(choice (const :tag "Control frame floats" t)
+                 (const :tag "Control frame has default WM behavior" nil))
+  :version "30.1")
+
 (ediff-defvar-local ediff-multiframe nil
   "Indicates if we are in a multiframe setup.")
 
@@ -873,6 +883,16 @@ ediff-window-ok-for-display
     (not (ediff-frame-has-dedicated-windows (window-frame wind)))
     )))
 
+(defun ediff-frame-make-utility (frame)
+  (let ((x-fast-protocol-requests t))
+    (x-change-window-property
+     "_NET_WM_WINDOW_TYPE" '("_NET_WM_WINDOW_TYPE_UTILITY")
+     frame "ATOM" 32 t)
+    (x-change-window-property
+     "WM_TRANSIENT_FOR"
+     (list (string-to-number (frame-parameter nil 'window-id)))
+     frame "WINDOW" 32 t)))
+
 ;; Prepare or refresh control frame
 (defun ediff-setup-control-frame (ctl-buffer designated-minibuffer-frame)
   (let ((window-min-height 1)
@@ -948,6 +968,8 @@ ediff-setup-control-frame
     (goto-char (point-min))
 
     (modify-frame-parameters ctl-frame adjusted-parameters)
+    (when (and ediff-floating-control-frame (eq (window-system ctl-frame) 'x))
+      (ediff-frame-make-utility ctl-frame))
     (make-frame-visible ctl-frame)
 
     ;; This works around a bug in 19.25 and earlier.  There, if frame gets
-- 
2.41.0


  reply	other threads:[~2023-07-03 19:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 16:44 bug#62164: 29.0.60; ediff behaves poorly by default on tiling window managers Spencer Baugh
2023-03-14  0:59 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-14  1:00   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-16 15:07     ` Spencer Baugh
2023-03-17  1:56       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-02  1:53         ` sbaugh
2023-04-02  5:55           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-02 11:33             ` sbaugh
2023-05-09 18:27               ` Spencer Baugh
2023-05-09 19:15                 ` Eli Zaretskii
2023-06-05 21:56                   ` Spencer Baugh
2023-06-05 23:51                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-06 11:29                     ` Eli Zaretskii
2023-06-28  1:13                       ` Spencer Baugh
2023-06-28  1:25                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-28 11:56                         ` Eli Zaretskii
2023-06-28 12:55                           ` Spencer Baugh
2023-06-28 13:40                             ` Robert Pluim
2023-07-03 19:21                               ` sbaugh [this message]
2023-07-06  7:51                                 ` Eli Zaretskii
2023-03-14  3:06   ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-14 13:13 ` Phil Sainty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edloreb3.fsf@catern.com \
    --to=sbaugh@catern.com \
    --cc=62164@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=rpluim@gmail.com \
    --cc=sbaugh@janestreet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.