Re: [STUMP] please critique my code

Scott Jaderholm <[email protected]>
Newsgroups gmane.comp.window-managers.stumpwm.devel
Message-ID <CAA9PRe_W95OGod_muT1V4Jb9=G2pf1z3i8yKURdsew+q_cs36g@mail.gmail.com>
Have you seen repack-window-numbers in window.lisp?

Scott

On Mon, Dec 7, 2015 at 6:25 AM, Tamas Papp <[email protected]> wrote:

> Hi,
>
> I am a new to Stumpwm, enjoying it immensely (frankly, I don't use CL
> lot these days for work any more, and I kind of miss it). I am now
> writing small scripts, learning from reading the sources, and I wonder
> if I could get some critique of my code. In particular, is the following
> idiomatic? Does it violate any implicit assumptions? As far as I could
> see, SORT-WINDOWS is already sorted, and window numbers are required to
> be nonnegative integers, so there should be no clashes.
>
> (defcommand renumber-windows (&optional (group (current-group))) ()
>   "Assign contiguous numbers to windows in GROUP, starting from 0. "
>   (let ((windows (sort-windows group)))
>     (loop for window in windows
>           for i from 0
>           do (setf (window-number window) i)))
>   (values))
>
> Best,
>
> Tamas
>
> _______________________________________________
> Stumpwm-devel mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
>

_______________________________________________
Stumpwm-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.