(DynamicWorkspaces) Generalize new workspace addition functions to support arbitrary insertion

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

(DynamicWorkspaces) Generalize new workspace addition functions to support arbitrary insertion

Arjun Comar
This patch was developed based on a request for functionality at:
http://www.reddit.com/r/xmonad/comments/2pnjse/dynamic_workspaces_appending_new_workspace_from/

* Generalize new workspace addition functions to support arbitrary
insertion.

  The current DynamicWorkspaces module only supports adding new workspaces
  at the start of the list of workspaces. This means when binding workspaces
  to keys based on the position in the list, key bindings can change
  as workspaces are added in removed in a far more destructive way than
  necessary. Instead, supporting appending and arbitrary insertion allows
  the user to determine where the new workspace should be added.

  This patch is a straight generalization of the addHiddenWorkspace'
function.
  Rather than always using `(:)` to insert the new workspace into the list
  of workspaces, this patches causes it to use an arbitrary list insertion
  function instead. A few new functions are added to prevent breakage of
  external code while exported functions are left unchanged.

  List of new functions:
    appendWorkspace
    appendWorkspacePrompt
    addWorkspaceAt
    addHiddenWorkspaceAt

  Existing functions were modified to call their generalized brethren where
possible
  without changing functionality. This patch should not change behavior for
any
  existing users of this module.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20141218/d0544c7b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generalizedInsert.dpatch
Type: application/octet-stream
Size: 30729 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20141218/d0544c7b/attachment-0001.obj>

Reply | Threaded
Open this post in threaded view
|

(DynamicWorkspaces) Generalize new workspace addition functions to support arbitrary insertion

Adam Vogt
Thanks for the patch Arjun. I've pushed it.

On Thu, Dec 18, 2014 at 7:39 PM, Arjun Comar <nrujac at gmail.com> wrote:

> This patch was developed based on a request for functionality at:
> http://www.reddit.com/r/xmonad/comments/2pnjse/dynamic_workspaces_appending_new_workspace_from/
>
> * Generalize new workspace addition functions to support arbitrary
> insertion.
>
>   The current DynamicWorkspaces module only supports adding new workspaces
>   at the start of the list of workspaces. This means when binding workspaces
>   to keys based on the position in the list, key bindings can change
>   as workspaces are added in removed in a far more destructive way than
>   necessary. Instead, supporting appending and arbitrary insertion allows
>   the user to determine where the new workspace should be added.
>
>   This patch is a straight generalization of the addHiddenWorkspace'
> function.
>   Rather than always using `(:)` to insert the new workspace into the list
>   of workspaces, this patches causes it to use an arbitrary list insertion
>   function instead. A few new functions are added to prevent breakage of
>   external code while exported functions are left unchanged.
>
>   List of new functions:
>     appendWorkspace
>     appendWorkspacePrompt
>     addWorkspaceAt
>     addHiddenWorkspaceAt
>
>   Existing functions were modified to call their generalized brethren where
> possible
>   without changing functionality. This patch should not change behavior for
> any
>   existing users of this module.
>
> _______________________________________________
> xmonad mailing list
> xmonad at haskell.org
> http://www.haskell.org/mailman/listinfo/xmonad
>

Reply | Threaded
Open this post in threaded view
|

Applied: (DynamicWorkspaces) Generalize new workspace addition functions to support arbitrary insertion

darcswatch@nomeata.de
In reply to this post by Arjun Comar
This 1-patch bundle was just applied to http://code.haskell.org/XMonadContrib:

20141219002309  nrujac at gmail.com
 * Generalize new workspace addition functions to support arbitrary insertion.
 The current DynamicWorkspaces module only supports adding new workspaces
 at the start of the list of workspaces. This means when binding workspaces
 to keys based on the position in the list, key bindings can change
 as workspaces are added in removed in a far more destructive way than
 necessary. Instead, supporting appending and arbitrary insertion allows
 the user to determine where the new workspace should be added.
 
 This patch is a straight generalization of the addHiddenWorkspace' function.
 Rather than always using `(:)` to insert the new workspace into the list
 of workspaces, this patches causes it to use an arbitrary list insertion
 function instead. A few new functions are added to prevent breakage of
 external code while exported functions are left unchanged.
 
 List of new functions:
   appendWorkspace
   appendWorkspacePrompt
   addWorkspaceAt
   addHiddenWorkspaceAt
 
 Existing functions were modified to call their generalized brethren where possible
 without changing functionality. This patch should not change behavior for any
 existing users of this module.
 


--
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__code.haskell.org_XMonadContrib.html#bundle-7bd5422e259e5dc8b617cb5b9ff8b84867ff9f5d