unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
@ 2021-06-08 10:09 pillule
  2021-06-08 11:44 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: pillule @ 2021-06-08 10:09 UTC (permalink / raw)
  To: 48916

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


Hi,

One may want to customize its `display-buffer-alist' carefully to 
apply the 'no-other-window parameter to eg side windows so they 
are not selected by the `other-window' command and to create 
custom functions of the family (eg creating a 
`find-file-in-other-window' that does not select windows with the 
no-other-window parameter)

Unfortunately by doing so, we actually limit the use of the 
windmove commands since `windmove-find-other-window' always ignore 
windows with this parameter.
It is not a fatality since `window-in-direction' can receive an 
argument to choose if we want to ignore this parameter or not.

This draft implements an user option to let the user choose that 
behavior.

Because it applies to `windmove-find-other-window', it allows the 
commands windmove-right, windmove-left, windmove-down, windmove-up 
to select windows with the no-other-window parameter, but not for 
the `windmove-display-*' functions. I suppose it is the desired 
behavior.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: allow windmove to select windows with the 'no-other-window parameter --]
[-- Type: text/x-diff, Size: 1783 bytes --]

From 8997dcd61e68cb0cd6251987fbc8c291ef0c7bbe Mon Sep 17 00:00:00 2001
From: Trust me I am a doctor <pillule@riseup.net>
Date: Tue, 8 Jun 2021 11:51:55 +0200
Subject: [PATCH] User option to select 'no-other-window with windmove

* lisp/windmove.el
   (windmove-ignore-no-other-window): add this new user option
   (windmove-find-other-window): uses windmove-ignore-no-other-window
to choose whether windmove can access to the window with the
'no-other-window property.
---
 lisp/windmove.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/windmove.el b/lisp/windmove.el
index d648613e10..23bbc0908e 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -165,6 +165,14 @@ windmove-window-distance-delta
 (make-obsolete-variable 'windmove-window-distance-delta
                         "no longer used." "27.1")
 
+(defcustom windmove-ignore-no-other-window nil
+  "Whether the windmove commands are allowed to target all type of windows,
+If this variable is set to t, `windmove-find-other-window--side' and
+subsequently all interactive windmove commandswill ignore the
+no-other-window parameter."
+  :type 'boolean
+  :group 'windmove)
+
 \f
 ;; Note:
 ;;
@@ -345,7 +353,8 @@ windmove-find-other-window
 Optional ARG, if negative, means to use the right or bottom edge of
 WINDOW as reference position, instead of `window-point'; if positive,
 use the left or top edge of WINDOW as reference point."
-  (window-in-direction dir window nil arg windmove-wrap-around t))
+  (window-in-direction dir window windmove-ignore-no-other-window
+                       arg windmove-wrap-around t))
 
 ;; Selects the window that's hopefully at the location returned by
 ;; `windmove-find-other-window', or screams if there's no window there.
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-08 10:09 bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter pillule
@ 2021-06-08 11:44 ` Eli Zaretskii
  2021-06-08 13:28   ` pillule
  2021-06-08 13:57   ` pillule
  2021-06-08 16:46 ` Juri Linkov
  2021-06-15 19:50 ` pillule
  2 siblings, 2 replies; 14+ messages in thread
From: Eli Zaretskii @ 2021-06-08 11:44 UTC (permalink / raw)
  To: pillule; +Cc: 48916

> From: pillule <pillule@riseup.net>
> Date: Tue, 08 Jun 2021 12:09:21 +0200
> 
> One may want to customize its `display-buffer-alist' carefully to 
> apply the 'no-other-window parameter to eg side windows so they 
> are not selected by the `other-window' command and to create 
> custom functions of the family (eg creating a 
> `find-file-in-other-window' that does not select windows with the 
> no-other-window parameter)
> 
> Unfortunately by doing so, we actually limit the use of the 
> windmove commands since `windmove-find-other-window' always ignore 
> windows with this parameter.
> It is not a fatality since `window-in-direction' can receive an 
> argument to choose if we want to ignore this parameter or not.
> 
> This draft implements an user option to let the user choose that 
> behavior.

Thanks.  I don't use windmove, so I will let others comment.  But
please allow me a few minor nits:

> * lisp/windmove.el
>    (windmove-ignore-no-other-window): add this new user option
>    (windmove-find-other-window): uses windmove-ignore-no-other-window
> to choose whether windmove can access to the window with the
> 'no-other-window property.

This isn't formatted accoring to our rules.  In particular, each
sentence after the colon should begin with a capital letter and end
with a period.  See CONTRIBUTE for more details (and I suggest to use
Emacs commands for writing log messages, as they will take care of
some routine parts of the formatting for you).

> +(defcustom windmove-ignore-no-other-window nil

This name is not the best one.  For starters, "ignore-no" is a kind of
double negation, which makes it harder to understand and remember.
Can you come up with a better description of what exactly is ignored
here?

> +  "Whether the windmove commands are allowed to target all type of windows,

The first line of a doc string should be a complete sentence (it is)
and end with a period.

> +If this variable is set to t, `windmove-find-other-window--side' and
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"If non-nil, ..."

> +subsequently all interactive windmove commandswill ignore the
                                         ^^^^^^^^^^^^
A typo.

> +no-other-window parameter."

If you reference this parameter, I think you should say that it's a
parameter to be applied by display-buffer-alist's actions.

> +  :type 'boolean
> +  :group 'windmove)

New defcustoms should have a :version tag.  Also, I believe we don't
like redundant :group tags, such as the one here.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-08 11:44 ` Eli Zaretskii
@ 2021-06-08 13:28   ` pillule
  2021-06-08 14:12     ` Eli Zaretskii
  2021-06-08 13:57   ` pillule
  1 sibling, 1 reply; 14+ messages in thread
From: pillule @ 2021-06-08 13:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: pillule, 48916

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


Eli Zaretskii <eliz@gnu.org> writes:

> Thanks.  I don't use windmove, so I will let others comment. 
> But
> please allow me a few minor nits:

Your ‘minor nits’ are indeed welcome.

>> * lisp/windmove.el
>>    (windmove-ignore-no-other-window): add this new user option
>>    (windmove-find-other-window): uses 
>>    windmove-ignore-no-other-window
>> to choose whether windmove can access to the window with the
>> 'no-other-window property.
>
> This isn't formatted accoring to our rules.  In particular, each
> sentence after the colon should begin with a capital letter and 
> end
> with a period.  See CONTRIBUTE for more details (and I suggest 
> to use
> Emacs commands for writing log messages, as they will take care 
> of
> some routine parts of the formatting for you).

So that means you are recommending to use VC instead of Magit 
(that I used) for committing changes ?
Maybe Magit have a something that I am not aware for this purpose 
?

>> +(defcustom windmove-ignore-no-other-window nil
>
> This name is not the best one.  For starters, "ignore-no" is a 
> kind of
> double negation, which makes it harder to understand and 
> remember.
> Can you come up with a better description of what exactly is 
> ignored
> here?

Yes, i think 'windmove-move-in-all-windows' will be more explicit.

>> +  "Whether the windmove commands are allowed to target all 
>> type of windows,
>
> The first line of a doc string should be a complete sentence (it 
> is)
> and end with a period.
>
>> +If this variable is set to t, 
>> `windmove-find-other-window--side' and
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> "If non-nil, ..."
>
>> +subsequently all interactive windmove commandswill ignore the
>                                          ^^^^^^^^^^^^
> A typo.
>
>> +no-other-window parameter."
>
> If you reference this parameter, I think you should say that 
> it's a
> parameter to be applied by display-buffer-alist's actions.
>> +  :type 'boolean
>> +  :group 'windmove)
>
> New defcustoms should have a :version tag.
> Also, I believe we don't  like redundant :group tags, such as 
> the one here.

got them. the last one may be a little bit confusing for the 
reader that is not aware of it because all others defcustoms of 
window.el applies a :group tag. Do you want that I remove the 
others unnecessary ones ?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: minor nits --]
[-- Type: text/x-diff, Size: 1783 bytes --]

From 8997dcd61e68cb0cd6251987fbc8c291ef0c7bbe Mon Sep 17 00:00:00 2001
From: Trust me I am a doctor <pillule@riseup.net>
Date: Tue, 8 Jun 2021 11:51:55 +0200
Subject: [PATCH] User option to select 'no-other-window with windmove

* lisp/windmove.el
   (windmove-ignore-no-other-window): add this new user option
   (windmove-find-other-window): uses windmove-ignore-no-other-window
to choose whether windmove can access to the window with the
'no-other-window property.
---
 lisp/windmove.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/windmove.el b/lisp/windmove.el
index d648613e10..23bbc0908e 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -165,6 +165,14 @@ windmove-window-distance-delta
 (make-obsolete-variable 'windmove-window-distance-delta
                         "no longer used." "27.1")
 
+(defcustom windmove-ignore-no-other-window nil
+  "Whether the windmove commands are allowed to target all type of windows,
+If this variable is set to t, `windmove-find-other-window--side' and
+subsequently all interactive windmove commandswill ignore the
+no-other-window parameter."
+  :type 'boolean
+  :group 'windmove)
+
 \f
 ;; Note:
 ;;
@@ -345,7 +353,8 @@ windmove-find-other-window
 Optional ARG, if negative, means to use the right or bottom edge of
 WINDOW as reference position, instead of `window-point'; if positive,
 use the left or top edge of WINDOW as reference point."
-  (window-in-direction dir window nil arg windmove-wrap-around t))
+  (window-in-direction dir window windmove-ignore-no-other-window
+                       arg windmove-wrap-around t))
 
 ;; Selects the window that's hopefully at the location returned by
 ;; `windmove-find-other-window', or screams if there's no window there.
-- 
2.20.1


[-- Attachment #3: Type: text/plain, Size: 4 bytes --]


--

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-08 11:44 ` Eli Zaretskii
  2021-06-08 13:28   ` pillule
@ 2021-06-08 13:57   ` pillule
  2021-06-08 14:13     ` Eli Zaretskii
  1 sibling, 1 reply; 14+ messages in thread
From: pillule @ 2021-06-08 13:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: pillule, 48916


Eli Zaretskii <eliz@gnu.org> writes:

>> +subsequently all interactive windmove commandswill ignore the
>                                          ^^^^^^^^^^^^
> A typo.
>

No, it seems to be a bug on my end. Somewhere on a file 
transfer. Sorry I am not sure I will be able to fix that one 
easily.

--





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-08 13:28   ` pillule
@ 2021-06-08 14:12     ` Eli Zaretskii
  2021-06-08 14:48       ` Robert Pluim
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2021-06-08 14:12 UTC (permalink / raw)
  To: pillule; +Cc: 48916

> From: pillule <pillule@riseup.net>
> Cc: pillule <pillule@riseup.net>, 48916@debbugs.gnu.org
> Date: Tue, 08 Jun 2021 15:28:34 +0200
> 
> > This isn't formatted accoring to our rules.  In particular, each
> > sentence after the colon should begin with a capital letter and
> > end with a period.  See CONTRIBUTE for more details (and I suggest
> > to use Emacs commands for writing log messages, as they will take
> > care of some routine parts of the formatting for you).
> 
> So that means you are recommending to use VC instead of Magit 
> (that I used) for committing changes ?
> Maybe Magit have a something that I am not aware for this purpose 
> ?

AFAIK, Magit does have such a command, but don't ask me what it is...

> > Also, I believe we don't  like redundant :group tags, such as 
> > the one here.
> 
> got them. the last one may be a little bit confusing for the 
> reader that is not aware of it because all others defcustoms of 
> window.el applies a :group tag. Do you want that I remove the 
> others unnecessary ones ?

Fine with me if you remove them.

(The patch you sent was the old one, right?)

Thanks.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-08 13:57   ` pillule
@ 2021-06-08 14:13     ` Eli Zaretskii
  2021-06-08 14:26       ` pillule
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2021-06-08 14:13 UTC (permalink / raw)
  To: pillule; +Cc: 48916

> From: pillule <pillule@riseup.net>
> Cc: pillule <pillule@riseup.net>, 48916@debbugs.gnu.org
> Date: Tue, 08 Jun 2021 15:57:49 +0200
> 
> >> +subsequently all interactive windmove commandswill ignore the
> >                                          ^^^^^^^^^^^^
> > A typo.
> >
> 
> No, it seems to be a bug on my end. Somewhere on a file 
> transfer. Sorry I am not sure I will be able to fix that one 
> easily.

If that's the case, I suggest to send the patch as an attachment.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-08 14:13     ` Eli Zaretskii
@ 2021-06-08 14:26       ` pillule
  0 siblings, 0 replies; 14+ messages in thread
From: pillule @ 2021-06-08 14:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: pillule, 48916

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


Eli Zaretskii <eliz@gnu.org> writes:

>> got them. the last one may be a little bit confusing for the
>> reader that is not aware of it because all others defcustoms of
>> window.el applies a :group tag. Do you want that I remove the
>> others unnecessary ones ?
>
> Fine with me if you remove them.
>
> (The patch you sent was the old one, right?)
>> [...]
>
> If that's the case, I suggest to send the patch as an 
> attachment.

My bad the bug was me ;)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: minor nits --]
[-- Type: text/x-diff, Size: 4818 bytes --]

From dff7eedd24f5ff85b075b3616fca6c0fa090ff90 Mon Sep 17 00:00:00 2001
From: Trust me I am a doctor <pillule@riseup.net>
Date: Tue, 8 Jun 2021 11:51:55 +0200
Subject: [PATCH] User option to select 'no-other-window with windmove

* lisp/windmove.el (windmove-ignore-no-other-window): Add new user
option, remove superfluous :group tag.
(windmove-find-other-window): Use windmove-ignore-no-other-window
to choose whether windmove can access to the window with the
'no-other-window property.
(windmove-wrap-around): Remove superfluous :group tag.
(windmove-create-window): Remove superfluous :group tag.
(windmove-window-distance-delta): Remove superfluous :group tag.
(windmove-display-no-select): Remove superfluous :group tag.
(windmove-default-keybindings): Remove superfluous :group tag.
(windmove-display-default-keybindings): Remove superfluous :group tag.
(windmove-delete-default-keybindings): Remove superfluous :group tag.
(windmove-swap-states-default-keybindings): Remove superfluous :group tag.
---
 lisp/windmove.el | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/lisp/windmove.el b/lisp/windmove.el
index f558903681..b883824413 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -138,8 +138,7 @@ windmove-wrap-around
 a frame will find the rightmost one, and similarly for the other
 directions.  The minibuffer is skipped over in up/down movements if it
 is inactive."
-  :type 'boolean
-  :group 'windmove)
+  :type 'boolean)
 
 (defcustom windmove-create-window nil
   "Whether movement off the edge of the frame creates a new window.
@@ -147,7 +146,6 @@ windmove-create-window
 a frame will create a new window on the left, and similarly for the other
 directions."
   :type 'boolean
-  :group 'windmove
   :version "27.1")
 
 ;; If your Emacs sometimes places an empty column between two adjacent
@@ -157,11 +155,18 @@ windmove-window-distance-delta
 Measured in characters either horizontally or vertically; setting this
 to a value larger than 1 may be useful in getting around window-
 placement bugs in old versions of Emacs."
-  :type 'number
-  :group 'windmove)
+  :type 'number)
 (make-obsolete-variable 'windmove-window-distance-delta
                         "no longer used." "27.1")
 
+(defcustom windmove-move-in-all-windows nil
+  "Whether the windmove commands are allowed to target all type of windows.
+If this variable is set to non-nil, `windmove-find-other-window--side' and
+subsequently all interactive windmove commands will ignore the
+no-other-window parameter applied with `display-buffer-alist'."
+  :type 'boolean
+  :version "28.0.50")
+
 \f
 ;; Note:
 ;;
@@ -342,7 +347,8 @@ windmove-find-other-window
 Optional ARG, if negative, means to use the right or bottom edge of
 WINDOW as reference position, instead of `window-point'; if positive,
 use the left or top edge of WINDOW as reference point."
-  (window-in-direction dir window nil arg windmove-wrap-around t))
+  (window-in-direction dir window windmove-move-in-all-windows
+                       arg windmove-wrap-around t))
 
 ;; Selects the window that's hopefully at the location returned by
 ;; `windmove-find-other-window', or screams if there's no window there.
@@ -480,7 +486,6 @@ windmove-default-keybindings
 (defcustom windmove-display-no-select nil
   "Whether the window should be selected after displaying the buffer in it."
   :type 'boolean
-  :group 'windmove
   :version "27.1")
 
 (defun windmove-display-in-direction (dir &optional arg)
@@ -761,8 +766,7 @@ windmove-default-keybindings
           (null val))
          (set-default sym val))
   :type windmove--default-keybindings-type
-  :version "28.1"
-  :group 'windmove)
+  :version "28.1")
 
 (defcustom windmove-display-default-keybindings nil
   "Default keybindings for windmove directional buffer display commands.
@@ -780,8 +784,7 @@ windmove-display-default-keybindings
           (null val))
          (set-default sym val))
   :type windmove--default-keybindings-type
-  :version "28.1"
-  :group 'windmove)
+  :version "28.1")
 
 (defcustom windmove-delete-default-keybindings nil
   "Default keybindings for windmove directional window deletion commands.
@@ -796,8 +799,7 @@ windmove-delete-default-keybindings
           (null val))
          (set-default sym val))
   :type windmove--default-keybindings-type
-  :version "28.1"
-  :group 'windmove)
+  :version "28.1")
 
 (defcustom windmove-swap-states-default-keybindings nil
   "Default keybindings for windmove's directional window swap-state commands.
@@ -812,8 +814,7 @@ windmove-swap-states-default-keybindings
           (null val))
          (set-default sym val))
   :type windmove--default-keybindings-type
-  :version "28.1"
-  :group 'windmove)
+  :version "28.1")
 
 \f
 (provide 'windmove)
-- 
2.20.1


[-- Attachment #3: Type: text/plain, Size: 5 bytes --]



--

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-08 14:12     ` Eli Zaretskii
@ 2021-06-08 14:48       ` Robert Pluim
  2021-06-09 17:37         ` pillule
  0 siblings, 1 reply; 14+ messages in thread
From: Robert Pluim @ 2021-06-08 14:48 UTC (permalink / raw)
  To: pillule; +Cc: 48916

>>>>> On Tue, 08 Jun 2021 17:12:08 +0300, Eli Zaretskii <eliz@gnu.org> said:

    >> From: pillule <pillule@riseup.net>
    >> Cc: pillule <pillule@riseup.net>, 48916@debbugs.gnu.org
    >> Date: Tue, 08 Jun 2021 15:28:34 +0200
    >> 
    >> > This isn't formatted accoring to our rules.  In particular, each
    >> > sentence after the colon should begin with a capital letter and
    >> > end with a period.  See CONTRIBUTE for more details (and I suggest
    >> > to use Emacs commands for writing log messages, as they will take
    >> > care of some routine parts of the formatting for you).
    >> 
    >> So that means you are recommending to use VC instead of Magit 
    >> (that I used) for committing changes ?

How you commit is up to you. This is about how to create the commit
message.

    >> Maybe Magit have a something that I am not aware for this purpose 
    >> ?

    Eli> AFAIK, Magit does have such a command, but don't ask me what it is...

'magit-generate-changelog', which you can run from your Magit commit
buffer. It's pretty much the same as C-x 4 A
(diff-add-change-log-entries-other-window), which you'd run from a
*vc-diff* buffer. The main difference is that C-x 4 A and C-x 4 a will
put entries into a ChangeLog file or buffer.

Robert
-- 





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-08 10:09 bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter pillule
  2021-06-08 11:44 ` Eli Zaretskii
@ 2021-06-08 16:46 ` Juri Linkov
  2021-06-15 19:50 ` pillule
  2 siblings, 0 replies; 14+ messages in thread
From: Juri Linkov @ 2021-06-08 16:46 UTC (permalink / raw)
  To: pillule; +Cc: 48916

>>> +(defcustom windmove-ignore-no-other-window nil
>>
>> This name is not the best one.  For starters, "ignore-no" is a kind of
>> double negation, which makes it harder to understand and remember.
>> Can you come up with a better description of what exactly is ignored
>> here?

> Yes, i think 'windmove-move-in-all-windows' will be more explicit.

Repeating words "...move-move..." doesn't look nice.  Maybe a better name
would be 'windmove-allow-all-windows'.

> Because it applies to `windmove-find-other-window', it allows the commands
> windmove-right, windmove-left, windmove-down, windmove-up to select windows
> with the no-other-window parameter, but not for the `windmove-display-*'
> functions. I suppose it is the desired behavior.

You could try using new option in all functions that call window-in-direction:
in windmove-display-in-direction, in windmove-delete-in-direction,
in windmove-swap-states-in-direction.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-08 14:48       ` Robert Pluim
@ 2021-06-09 17:37         ` pillule
  2021-06-09 20:13           ` Juri Linkov
  0 siblings, 1 reply; 14+ messages in thread
From: pillule @ 2021-06-09 17:37 UTC (permalink / raw)
  To: Robert Pluim; +Cc: pillule, 48916, Juri Linkov

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


Robert Pluim <rpluim@gmail.com> writes:

>     >> Maybe Magit have a something that I am not aware for this 
>     >> purpose
>     >> ?
>
>     Eli> AFAIK, Magit does have such a command, but don't ask me 
>     what it is...
>
> 'magit-generate-changelog', which you can run from your Magit 
> commit
> buffer. It's pretty much the same as C-x 4 A
> (diff-add-change-log-entries-other-window), which you'd run from 
> a
> *vc-diff* buffer. The main difference is that C-x 4 A and C-x 4 
> a will
> put entries into a ChangeLog file or buffer.

Thanks you for the guidance, I think I would have had difficulties 
to find it
myself because it seems dependant of the context (at least the 
magit one)
and I couldn't find them directly with eg 'helpfull-function'.
However it don't seems to always works and another annoyance but 
it is
another topic.

Very much appreciated.

Juri Linkov <juri@linkov.net> writes:

>>>> +(defcustom windmove-ignore-no-other-window nil
>>>
>>> This name is not the best one.  For starters, "ignore-no" is a 
>>> kind of
>>> double negation, which makes it harder to understand and 
>>> remember.
>>> Can you come up with a better description of what exactly is 
>>> ignored
>>> here?
>
>> Yes, i think 'windmove-move-in-all-windows' will be more 
>> explicit.
>
> Repeating words "...move-move..." doesn't look nice.  Maybe a 
> better name
> would be 'windmove-allow-all-windows'.

That is better, indeed, thank you.

>> Because it applies to `windmove-find-other-window', it allows 
>> the commands
>> windmove-right, windmove-left, windmove-down, windmove-up to 
>> select windows
>> with the no-other-window parameter, but not for the 
>> `windmove-display-*'
>> functions. I suppose it is the desired behavior.
>
> You could try using new option in all functions that call 
> window-in-direction:
> in windmove-display-in-direction, in 
> windmove-delete-in-direction,
> in windmove-swap-states-in-direction.

Done.
I am in terra incognita for theses commands, The opportunity to 
add new
keybindings in my configuration is always nice :p

It was really simple and my tests seems to works fine with
'windmove-allow-all-windows' for all functions.

See the patch attached.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: windmove-allow-all-windows --]
[-- Type: text/x-diff, Size: 6690 bytes --]

From f1e8eb238305b4c956fe3dc02edfa96bdbcb67c6 Mon Sep 17 00:00:00 2001
From: Trust me I am a doctor <pillule@riseup.net>
Date: Tue, 8 Jun 2021 11:51:55 +0200
Subject: [PATCH] User option to select 'no-other-window with windmove

* lisp/windmove.el (windmove-wrap-around): Remove superfluous :group
tag.
(windmove-create-window): Remove superfluous :group tag.
(windmove-window-distance-delta): Remove superfluous :group tag.
(windmove-allow-all-windows): Add new user option to allow the
commands of windmove to target windows with the 'no-other-window
parameter.
(windmove-find-other-window): Use windmove-allow-all-windows.
(windmove-display-no-select): Remove superfluous :group tag.
(windmove-display-in-direction): Use windmove-allow-all-windows.
(windmove-delete-in-direction): Use windmove-allow-all-windows.
(windmove-swap-states-in-direction): Use windmove-allow-all-windows.
(windmove-default-keybindings): Remove superfluous :group tag.
(windmove-display-default-keybindings): Remove superfluous :group tag.
(windmove-delete-default-keybindings): Remove superfluous :group tag.
(windmove-swap-states-default-keybindings): Remove superfluous :group tag.
---
 lisp/windmove.el | 41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/lisp/windmove.el b/lisp/windmove.el
index f558903681..8ba1242519 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -138,8 +138,7 @@ windmove-wrap-around
 a frame will find the rightmost one, and similarly for the other
 directions.  The minibuffer is skipped over in up/down movements if it
 is inactive."
-  :type 'boolean
-  :group 'windmove)
+  :type 'boolean)
 
 (defcustom windmove-create-window nil
   "Whether movement off the edge of the frame creates a new window.
@@ -147,7 +146,6 @@ windmove-create-window
 a frame will create a new window on the left, and similarly for the other
 directions."
   :type 'boolean
-  :group 'windmove
   :version "27.1")
 
 ;; If your Emacs sometimes places an empty column between two adjacent
@@ -157,11 +155,18 @@ windmove-window-distance-delta
 Measured in characters either horizontally or vertically; setting this
 to a value larger than 1 may be useful in getting around window-
 placement bugs in old versions of Emacs."
-  :type 'number
-  :group 'windmove)
+  :type 'number)
 (make-obsolete-variable 'windmove-window-distance-delta
                         "no longer used." "27.1")
 
+(defcustom windmove-allow-all-windows nil
+  "Whether the windmove commands are allowed to target all type of windows.
+If this variable is set to non-nil, `windmove-find-other-window--side' and
+subsequently all interactive windmove commands will ignore the
+no-other-window parameter applied with `display-buffer-alist'."
+  :type 'boolean
+  :version "28.0.50")
+
 \f
 ;; Note:
 ;;
@@ -342,7 +347,8 @@ windmove-find-other-window
 Optional ARG, if negative, means to use the right or bottom edge of
 WINDOW as reference position, instead of `window-point'; if positive,
 use the left or top edge of WINDOW as reference point."
-  (window-in-direction dir window nil arg windmove-wrap-around t))
+  (window-in-direction dir window windmove-allow-all-windows
+                       arg windmove-wrap-around t))
 
 ;; Selects the window that's hopefully at the location returned by
 ;; `windmove-find-other-window', or screams if there's no window there.
@@ -480,7 +486,6 @@ windmove-default-keybindings
 (defcustom windmove-display-no-select nil
   "Whether the window should be selected after displaying the buffer in it."
   :type 'boolean
-  :group 'windmove
   :version "27.1")
 
 (defun windmove-display-in-direction (dir &optional arg)
@@ -517,7 +522,7 @@ windmove-display-in-direction
                        ((eq dir 'same-window)
                         (selected-window))
                        (t (window-in-direction
-                           dir nil nil
+                           dir nil windmove-allow-all-windows
                            (and arg (prefix-numeric-value arg))
                            windmove-wrap-around 'nomini)))))
          (unless window
@@ -606,8 +611,8 @@ windmove-delete-in-direction
 select the window at direction DIR.
 When `windmove-wrap-around' is non-nil, takes the window
 from the opposite side of the frame."
-  (let ((other-window (window-in-direction dir nil nil arg
-                                           windmove-wrap-around 'nomini)))
+  (let ((other-window (window-in-direction dir nil windmove-allow-all-windows
+                                           arg windmove-wrap-around 'nomini)))
     (cond ((null other-window)
            (user-error "No window %s from selected window" dir))
           (t
@@ -680,8 +685,8 @@ windmove-swap-states-in-direction
   "Swap the states of the selected window and the window at direction DIR.
 When `windmove-wrap-around' is non-nil, takes the window
 from the opposite side of the frame."
-  (let ((other-window (window-in-direction dir nil nil nil
-                                           windmove-wrap-around 'nomini)))
+  (let ((other-window (window-in-direction dir nil windmove-allow-all-windows
+                                           nil windmove-wrap-around 'nomini)))
     (cond ((or (null other-window) (window-minibuffer-p other-window))
            (user-error "No window %s from selected window" dir))
           (t
@@ -761,8 +766,7 @@ windmove-default-keybindings
           (null val))
          (set-default sym val))
   :type windmove--default-keybindings-type
-  :version "28.1"
-  :group 'windmove)
+  :version "28.1")
 
 (defcustom windmove-display-default-keybindings nil
   "Default keybindings for windmove directional buffer display commands.
@@ -780,8 +784,7 @@ windmove-display-default-keybindings
           (null val))
          (set-default sym val))
   :type windmove--default-keybindings-type
-  :version "28.1"
-  :group 'windmove)
+  :version "28.1")
 
 (defcustom windmove-delete-default-keybindings nil
   "Default keybindings for windmove directional window deletion commands.
@@ -796,8 +799,7 @@ windmove-delete-default-keybindings
           (null val))
          (set-default sym val))
   :type windmove--default-keybindings-type
-  :version "28.1"
-  :group 'windmove)
+  :version "28.1")
 
 (defcustom windmove-swap-states-default-keybindings nil
   "Default keybindings for windmove's directional window swap-state commands.
@@ -812,8 +814,7 @@ windmove-swap-states-default-keybindings
           (null val))
          (set-default sym val))
   :type windmove--default-keybindings-type
-  :version "28.1"
-  :group 'windmove)
+  :version "28.1")
 
 \f
 (provide 'windmove)
-- 
2.20.1


[-- Attachment #3: Type: text/plain, Size: 721 bytes --]


As a side note, while reading these commands,

I think 'windmove-display-same-window', 
'windmove-display-new-frame',
'windmove-display-new-tab' are not really at they own place in 
windmove.

We have already "C-x 4 1" (same-window-prefix) and "C-x 5 5"
(other-frame-prefix) and (other-tab-prefix) --that is not bound to 
any
key on my system but would eventually have its place in the "C-x 
t" map.

Should we --for these windmove-commands :
 1. keep them as they are
 2. make aliases and clean-up 'windmove-display-in-direction'
 3. delete them and clean-up 'windmove-display-in-direction'
?

Since it becomes to get off the topic with the removal of the
:group tag, I can start another patch "clean-up" if requested.

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-09 17:37         ` pillule
@ 2021-06-09 20:13           ` Juri Linkov
  2021-06-10  8:58             ` pillule
  0 siblings, 1 reply; 14+ messages in thread
From: Juri Linkov @ 2021-06-09 20:13 UTC (permalink / raw)
  To: pillule; +Cc: Robert Pluim, 48916

>> You could try using new option in all functions that call
>> window-in-direction:
>> in windmove-display-in-direction, in windmove-delete-in-direction,
>> in windmove-swap-states-in-direction.
>
> Done.
> I am in terra incognita for theses commands, The opportunity to add new
> keybindings in my configuration is always nice :p
>
> It was really simple and my tests seems to works fine with
> 'windmove-allow-all-windows' for all functions.
>
> See the patch attached.

Thanks, now it's much better.

> As a side note, while reading these commands,
>
> I think 'windmove-display-same-window', 'windmove-display-new-frame',
> 'windmove-display-new-tab' are not really at they own place in windmove.
>
> We have already "C-x 4 1" (same-window-prefix) and "C-x 5 5"
> (other-frame-prefix) and (other-tab-prefix) --that is not bound to any
> key on my system but would eventually have its place in the "C-x t" map.

It's very strange that your configuration has unbound other-tab-prefix.
By default, it's bound to 'C-x t t'.

> Should we --for these windmove-commands :
> 1. keep them as they are
> 2. make aliases and clean-up 'windmove-display-in-direction'
> 3. delete them and clean-up 'windmove-display-in-direction'
> ?

Please keep them as they are.  It's very convenient
to bind these commands to use the same prefix keys
that are configured by windmove customization
(that was greatly improved recently!)





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-09 20:13           ` Juri Linkov
@ 2021-06-10  8:58             ` pillule
  0 siblings, 0 replies; 14+ messages in thread
From: pillule @ 2021-06-10  8:58 UTC (permalink / raw)
  To: Juri Linkov; +Cc: pillule, Robert Pluim, 48916


Juri Linkov <juri@linkov.net> writes:

>> Should we --for these windmove-commands :
>> 1. keep them as they are
>> 2. make aliases and clean-up 'windmove-display-in-direction'
>> 3. delete them and clean-up 'windmove-display-in-direction'
>> ?
>
> Please keep them as they are.  It's very convenient
> to bind these commands to use the same prefix keys
> that are configured by windmove customization
> (that was greatly improved recently!)

Ok fine.
--





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-08 10:09 bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter pillule
  2021-06-08 11:44 ` Eli Zaretskii
  2021-06-08 16:46 ` Juri Linkov
@ 2021-06-15 19:50 ` pillule
  2021-06-15 23:27   ` Juri Linkov
  2 siblings, 1 reply; 14+ messages in thread
From: pillule @ 2021-06-15 19:50 UTC (permalink / raw)
  To: pillule; +Cc: Robert Pluim, 48916, Juri Linkov

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

References: <878s3kzm66.fsf@riseup.net> <83czswfunl.fsf@gnu.org> <87zgw0xxya.fsf@riseup.net> <83y2bke98n.fsf@gnu.org> <878s3k76pe.fsf@gmail.com> <87mtryj28g.fsf@riseup.net> <87lf7ibxxf.fsf@mail.linkov.net> <87a6nyks9y.fsf@riseup.net>
User-agent: mu4e 1.5.11; emacs 28.0.50
In-reply-to: <87a6nyks9y.fsf@riseup.net>

pillule <pillule@riseup.net> writes:

> Juri Linkov <juri@linkov.net> writes:
>
>>> Should we --for these windmove-commands :
>>> 1. keep them as they are
>>> 2. make aliases and clean-up 'windmove-display-in-direction'
>>> 3. delete them and clean-up 'windmove-display-in-direction'
>>> ?
>>
>> Please keep them as they are.  It's very convenient
>> to bind these commands to use the same prefix keys
>> that are configured by windmove customization
>> (that was greatly improved recently!)
>
> Ok fine.

Hi, here the patch for this one  with v28.1 and an updated docstring.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: user-option for no-other-window --]
[-- Type: text/x-diff, Size: 6662 bytes --]

From e1052bbfb919e9988b14a12e136dfebac86521f1 Mon Sep 17 00:00:00 2001
From: Trust me I am a doctor <pillule@riseup.net>
Date: Tue, 8 Jun 2021 11:51:55 +0200
Subject: [PATCH] User-option to select 'no-other-window' with windmove
 (bug#48916)

* lisp/windmove.el (windmove-wrap-around): Remove superfluous :group
tag.
(windmove-create-window): Remove superfluous :group tag.
(windmove-window-distance-delta): Remove superfluous :group tag.
(windmove-allow-all-windows): Add new user option to allow the
commands of windmove to target windows with the 'no-other-window
parameter.
(windmove-find-other-window): Use windmove-allow-all-windows.
(windmove-display-no-select): Remove superfluous :group tag.
(windmove-display-in-direction): Use windmove-allow-all-windows.
(windmove-delete-in-direction): Use windmove-allow-all-windows.
(windmove-swap-states-in-direction): Use windmove-allow-all-windows.
(windmove-default-keybindings): Remove superfluous :group tag.
(windmove-display-default-keybindings): Remove superfluous :group tag.
(windmove-delete-default-keybindings): Remove superfluous :group tag.
(windmove-swap-states-default-keybindings): Remove superfluous :group tag.
---
 lisp/windmove.el | 41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/lisp/windmove.el b/lisp/windmove.el
index f558903681..3df4a01116 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -138,8 +138,7 @@ windmove-wrap-around
 a frame will find the rightmost one, and similarly for the other
 directions.  The minibuffer is skipped over in up/down movements if it
 is inactive."
-  :type 'boolean
-  :group 'windmove)
+  :type 'boolean)
 
 (defcustom windmove-create-window nil
   "Whether movement off the edge of the frame creates a new window.
@@ -147,7 +146,6 @@ windmove-create-window
 a frame will create a new window on the left, and similarly for the other
 directions."
   :type 'boolean
-  :group 'windmove
   :version "27.1")
 
 ;; If your Emacs sometimes places an empty column between two adjacent
@@ -157,11 +155,18 @@ windmove-window-distance-delta
 Measured in characters either horizontally or vertically; setting this
 to a value larger than 1 may be useful in getting around window-
 placement bugs in old versions of Emacs."
-  :type 'number
-  :group 'windmove)
+  :type 'number)
 (make-obsolete-variable 'windmove-window-distance-delta
                         "no longer used." "27.1")
 
+(defcustom windmove-allow-all-windows nil
+  "Whether the windmove commands are allowed to target all type of windows.
+If this variable is set to non-nil, all windmove commmands will
+ignore the no-other-window parameter applied by `display-buffer-alist'
+or `set-window-parameter'."
+  :type 'boolean
+  :version "28.1")
+
 \f
 ;; Note:
 ;;
@@ -342,7 +347,8 @@ windmove-find-other-window
 Optional ARG, if negative, means to use the right or bottom edge of
 WINDOW as reference position, instead of `window-point'; if positive,
 use the left or top edge of WINDOW as reference point."
-  (window-in-direction dir window nil arg windmove-wrap-around t))
+  (window-in-direction dir window windmove-allow-all-windows
+                       arg windmove-wrap-around t))
 
 ;; Selects the window that's hopefully at the location returned by
 ;; `windmove-find-other-window', or screams if there's no window there.
@@ -480,7 +486,6 @@ windmove-default-keybindings
 (defcustom windmove-display-no-select nil
   "Whether the window should be selected after displaying the buffer in it."
   :type 'boolean
-  :group 'windmove
   :version "27.1")
 
 (defun windmove-display-in-direction (dir &optional arg)
@@ -517,7 +522,7 @@ windmove-display-in-direction
                        ((eq dir 'same-window)
                         (selected-window))
                        (t (window-in-direction
-                           dir nil nil
+                           dir nil windmove-allow-all-windows
                            (and arg (prefix-numeric-value arg))
                            windmove-wrap-around 'nomini)))))
          (unless window
@@ -606,8 +611,8 @@ windmove-delete-in-direction
 select the window at direction DIR.
 When `windmove-wrap-around' is non-nil, takes the window
 from the opposite side of the frame."
-  (let ((other-window (window-in-direction dir nil nil arg
-                                           windmove-wrap-around 'nomini)))
+  (let ((other-window (window-in-direction dir nil windmove-allow-all-windows
+                                           arg windmove-wrap-around 'nomini)))
     (cond ((null other-window)
            (user-error "No window %s from selected window" dir))
           (t
@@ -680,8 +685,8 @@ windmove-swap-states-in-direction
   "Swap the states of the selected window and the window at direction DIR.
 When `windmove-wrap-around' is non-nil, takes the window
 from the opposite side of the frame."
-  (let ((other-window (window-in-direction dir nil nil nil
-                                           windmove-wrap-around 'nomini)))
+  (let ((other-window (window-in-direction dir nil windmove-allow-all-windows
+                                           nil windmove-wrap-around 'nomini)))
     (cond ((or (null other-window) (window-minibuffer-p other-window))
            (user-error "No window %s from selected window" dir))
           (t
@@ -761,8 +766,7 @@ windmove-default-keybindings
           (null val))
          (set-default sym val))
   :type windmove--default-keybindings-type
-  :version "28.1"
-  :group 'windmove)
+  :version "28.1")
 
 (defcustom windmove-display-default-keybindings nil
   "Default keybindings for windmove directional buffer display commands.
@@ -780,8 +784,7 @@ windmove-display-default-keybindings
           (null val))
          (set-default sym val))
   :type windmove--default-keybindings-type
-  :version "28.1"
-  :group 'windmove)
+  :version "28.1")
 
 (defcustom windmove-delete-default-keybindings nil
   "Default keybindings for windmove directional window deletion commands.
@@ -796,8 +799,7 @@ windmove-delete-default-keybindings
           (null val))
          (set-default sym val))
   :type windmove--default-keybindings-type
-  :version "28.1"
-  :group 'windmove)
+  :version "28.1")
 
 (defcustom windmove-swap-states-default-keybindings nil
   "Default keybindings for windmove's directional window swap-state commands.
@@ -812,8 +814,7 @@ windmove-swap-states-default-keybindings
           (null val))
          (set-default sym val))
   :type windmove--default-keybindings-type
-  :version "28.1"
-  :group 'windmove)
+  :version "28.1")
 
 \f
 (provide 'windmove)
-- 
2.20.1


[-- Attachment #3: Type: text/plain, Size: 4 bytes --]


--

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter
  2021-06-15 19:50 ` pillule
@ 2021-06-15 23:27   ` Juri Linkov
  0 siblings, 0 replies; 14+ messages in thread
From: Juri Linkov @ 2021-06-15 23:27 UTC (permalink / raw)
  To: pillule; +Cc: Robert Pluim, 48916

tags 48916 fixed
close 48916 28.0.50
thanks

>> Ok fine.
>
> Hi, here the patch for this one  with v28.1 and an updated docstring.

Thanks for the patch, now it's pushed.





^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-06-15 23:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08 10:09 bug#48916: 28.0.50; allow windmove to select windows with the 'no-other-window parameter pillule
2021-06-08 11:44 ` Eli Zaretskii
2021-06-08 13:28   ` pillule
2021-06-08 14:12     ` Eli Zaretskii
2021-06-08 14:48       ` Robert Pluim
2021-06-09 17:37         ` pillule
2021-06-09 20:13           ` Juri Linkov
2021-06-10  8:58             ` pillule
2021-06-08 13:57   ` pillule
2021-06-08 14:13     ` Eli Zaretskii
2021-06-08 14:26       ` pillule
2021-06-08 16:46 ` Juri Linkov
2021-06-15 19:50 ` pillule
2021-06-15 23:27   ` Juri Linkov

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).