GNU bug report logs - #48917
28.0.50; allow user to choose what function is used when windmove create a window

Previous Next

Package: emacs;

Reported by: pillule <pillule <at> riseup.net>

Date: Tue, 8 Jun 2021 11:00:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48917 in the body.
You can then email your comments to 48917 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#48917; Package emacs. (Tue, 08 Jun 2021 11:00:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to pillule <pillule <at> riseup.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 08 Jun 2021 11:00:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: pillule <pillule <at> riseup.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; allow user to choose what function is used when windmove
 create a window
Date: Tue, 08 Jun 2021 12:31:58 +0200
[Message part 1 (text/plain, inline)]
Hi,

This is not directly related to bug#48916 but nonetheless derive 
from a same logic of window management.

Actually the user can choose if windmove will create a window when 
it encounter the edges of the frame. I propose to let the user 
eventually provides instead a function that will be triggered in 
that case.

The function will receive as arguments the `dir' and `window' 
bindings of `windmove-do-window-select' so it can adapt its 
behavior accordingly.

The simplest use case I found for this feature is to creates a 
dispatch function that choose from the direction to display eg, a 
dired side window on the left, a shell side window on the top, a 
message side window on the bottom, another thing on the right ; 
and that act as a toggle, eg :

windmove-left : creates a dired side window
windmove-left again : delete the dired side window

From here the function can be tuned again to behave differently in 
different contexts with eg, a local binding or by inspecting the 
WINDOW argument.

[0001-User-option-to-choose-a-function-triggered-by-windmo.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
The second attachment is a library I am currently working on that 
implement a functional dired side window and its windmove bindings 
in 200 loc, so you can eventually try it and feel what I am 
requesting.
I wrote it for testing purposes for bug#48493 so some of its 
functionalities relies on fixes that are not yet available, and it 
is less about dired in a side window than implementing local 
bindings on couples of buffer/windows.

[dired-side-window.tar.gz (application/gzip, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48917; Package emacs. (Tue, 08 Jun 2021 11:51:02 GMT) Full text and rfc822 format available.

Message #8 received at 48917 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: pillule <pillule <at> riseup.net>
Cc: 48917 <at> debbugs.gnu.org
Subject: Re: bug#48917: 28.0.50;
 allow user to choose what function is used when windmove create a
 window
Date: Tue, 08 Jun 2021 14:49:59 +0300
> From: pillule <pillule <at> riseup.net>
> Date: Tue, 08 Jun 2021 12:31:58 +0200
> 
>  (defcustom windmove-create-window nil
> -  "Whether movement off the edge of the frame creates a new window.
> +  "Whether movement off the edge of the frame creates a new window or
> +trigger a custom function.

The first line of a doc string should be a single complete sentence.
(The reason for this is that some Emacs commands, like "M-x apropos",
show only the first line of the doc string.)

>  If this variable is set to t, moving left from the leftmost window in
>  a frame will create a new window on the left, and similarly for the other
>  directions."
> -  :type 'boolean
> +  :type '(choice (const :tag "Don't create new windows" nil)
> +          (const :tag "Create new windows" t)
> +          (function :tag "Provide a function"))
>    :group 'windmove
>    :version "27.1")

The :version tag should be updated, because the defcustom was changed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48917; Package emacs. (Tue, 08 Jun 2021 14:16:02 GMT) Full text and rfc822 format available.

Message #11 received at 48917 <at> debbugs.gnu.org (full text, mbox):

From: pillule <pillule <at> riseup.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: pillule <pillule <at> riseup.net>, 48917 <at> debbugs.gnu.org
Subject: Re: bug#48917: 28.0.50; allow user to choose what function is used
 when windmove create a window
Date: Tue, 08 Jun 2021 16:12:56 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: pillule <pillule <at> riseup.net>
>> Date: Tue, 08 Jun 2021 12:31:58 +0200
>>
>>  (defcustom windmove-create-window nil
>> -  "Whether movement off the edge of the frame creates a new 
>> window.
>> +  "Whether movement off the edge of the frame creates a new 
>> window or
>> +trigger a custom function.
>
> The first line of a doc string should be a single complete 
> sentence.
> (The reason for this is that some Emacs commands, like "M-x 
> apropos",
> show only the first line of the doc string.)
>
>>  If this variable is set to t, moving left from the leftmost 
>>  window in
>>  a frame will create a new window on the left, and similarly 
>>  for the other
>>  directions."
>> -  :type 'boolean
>> +  :type '(choice (const :tag "Don't create new windows" nil)
>> +          (const :tag "Create new windows" t)
>> +          (function :tag "Provide a function"))
>>    :group 'windmove
>>    :version "27.1")
>
> The :version tag should be updated, because the defcustom was 
> changed.

[0002-User-option-to-choose-a-function-triggered-by-windmo.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
--

Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 09 Jun 2021 10:34:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48917; Package emacs. (Sat, 12 Jun 2021 22:13:02 GMT) Full text and rfc822 format available.

Message #16 received at 48917 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: pillule <pillule <at> riseup.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48917 <at> debbugs.gnu.org
Subject: Re: bug#48917: 28.0.50; allow user to choose what function is used
 when windmove create a window
Date: Sun, 13 Jun 2021 01:09:25 +0300
>>>    :version "27.1")
>>
>> The :version tag should be updated, because the defcustom was changed.
>
> -  :version "27.1")
> +  :version "28.0.50")

Thanks for sending two patches in bug#48916 and bug#48917.
If you have not signed papers yet, I guess
these patches are small enough to push.

But in both patches please change the :version tag to "28.1".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48917; Package emacs. (Tue, 15 Jun 2021 22:14:02 GMT) Full text and rfc822 format available.

Message #19 received at 48917 <at> debbugs.gnu.org (full text, mbox):

From: pillule <pillule <at> riseup.net>
To: Juri Linkov <juri <at> linkov.net>
Cc: pillule <pillule <at> riseup.net>, Eli Zaretskii <eliz <at> gnu.org>,
 48917 <at> debbugs.gnu.org
Subject: Re: bug#48917: 28.0.50; allow user to choose what function is used
 when windmove create a window
Date: Wed, 16 Jun 2021 00:04:12 +0200
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:

>>>>    :version "27.1")
>>>
>>> The :version tag should be updated, because the defcustom was changed.
>>
>> -  :version "27.1")
>> +  :version "28.0.50")

Done.

> Thanks for sending two patches in bug#48916 and bug#48917.
> If you have not signed papers yet, I guess
> these patches are small enough to push.
>
> But in both patches please change the :version tag to "28.1".

I get the papers now \o/

I was a little bit worried that this user-option is quite obscure to understand,
so among other little docstring fixes, I documented an usage with
'display-buffer-alist' in the commentary section of the package.

Please let me know if it is not desirable, in which case I will remove it.

Also I added the parent function ARG to be passed, it is an universal-argument.

[0003-User-option-to-choose-a-function-triggered-by-windmo.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
--

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48917; Package emacs. (Tue, 15 Jun 2021 22:23:02 GMT) Full text and rfc822 format available.

Message #22 received at 48917 <at> debbugs.gnu.org (full text, mbox):

From: pillule <pillule <at> riseup.net>
To: pillule <pillule <at> riseup.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48917 <at> debbugs.gnu.org,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#48917: 28.0.50; allow user to choose what function is used
 when windmove create a window
Date: Wed, 16 Jun 2021 00:20:31 +0200
[Message part 1 (text/plain, inline)]
pillule <pillule <at> riseup.net> writes:

> Juri Linkov <juri <at> linkov.net> writes:
>
>>>>>    :version "27.1")
>>>>
>>>> The :version tag should be updated, because the defcustom was changed.
>>>
>>> -  :version "27.1")
>>> +  :version "28.0.50")
>
> Done.
>
>> Thanks for sending two patches in bug#48916 and bug#48917.
>> If you have not signed papers yet, I guess
>> these patches are small enough to push.
>>
>> But in both patches please change the :version tag to "28.1".
>
> I get the papers now \o/
>
> I was a little bit worried that this user-option is quite obscure to understand,
> so among other little docstring fixes, I documented an usage with
> 'display-buffer-alist' in the commentary section of the package.
>
> Please let me know if it is not desirable, in which case I will remove it.
>
> Also I added the parent function ARG to be passed, it is an universal-argument.

hm I'm still making typos :/

[0004-User-option-to-choose-a-function-triggered-by-windmo.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]


--

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48917; Package emacs. (Tue, 15 Jun 2021 23:34:02 GMT) Full text and rfc822 format available.

Message #25 received at 48917 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: pillule <pillule <at> riseup.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48917 <at> debbugs.gnu.org
Subject: Re: bug#48917: 28.0.50; allow user to choose what function is used
 when windmove create a window
Date: Wed, 16 Jun 2021 02:32:46 +0300
tags 48917 fixed
close 48917 28.0.50
thanks

>> If you have not signed papers yet, I guess
>> these patches are small enough to push.
>>
>> But in both patches please change the :version tag to "28.1".
>
> I get the papers now \o/

Good news.  So now your patch is pushed.  Thanks for this useful feature.

> I was a little bit worried that this user-option is quite obscure to understand,
> so among other little docstring fixes, I documented an usage with
> 'display-buffer-alist' in the commentary section of the package.
>
> Please let me know if it is not desirable, in which case I will remove it.

It doesn't look like a suitable place to document its possible uses.
So pushed without commentary.

> Also I added the parent function ARG to be passed, it is an universal-argument.

This is a good change.




Added tag(s) fixed. Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Tue, 15 Jun 2021 23:34:03 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.0.50, send any further explanations to 48917 <at> debbugs.gnu.org and pillule <pillule <at> riseup.net> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Tue, 15 Jun 2021 23:34:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48917; Package emacs. (Wed, 16 Jun 2021 01:28:02 GMT) Full text and rfc822 format available.

Message #32 received at 48917 <at> debbugs.gnu.org (full text, mbox):

From: pillule <pillule <at> riseup.net>
To: Juri Linkov <juri <at> linkov.net>
Cc: pillule <pillule <at> riseup.net>, Eli Zaretskii <eliz <at> gnu.org>,
 48917 <at> debbugs.gnu.org
Subject: Re: bug#48917: 28.0.50; allow user to choose what function is used
 when windmove create a window
Date: Wed, 16 Jun 2021 03:26:08 +0200
Juri Linkov <juri <at> linkov.net> writes:

> tags 48917 fixed
> close 48917 28.0.50
> thanks
>
>>> If you have not signed papers yet, I guess
>>> these patches are small enough to push.
>>>
>>> But in both patches please change the :version tag to "28.1".
>>
>> I get the papers now \o/
>
> Good news.  So now your patch is pushed.  Thanks for this useful feature.
>
>> I was a little bit worried that this user-option is quite obscure to understand,
>> so among other little docstring fixes, I documented an usage with
>> 'display-buffer-alist' in the commentary section of the package.
>>
>> Please let me know if it is not desirable, in which case I will remove it.
>
> It doesn't look like a suitable place to document its possible uses.
> So pushed without commentary.
>
>> Also I added the parent function ARG to be passed, it is an universal-argument.
>
> This is a good change.

thanks !
--




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 14 Jul 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 285 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.