stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [STUMP] please critique my code


From: Scott Jaderholm
Subject: Re: [STUMP] please critique my code
Date: Mon, 7 Dec 2015 12:40:33 -0800

Have you seen repack-window-numbers in window.lisp?

Scott

On Mon, Dec 7, 2015 at 6:25 AM, Tamas Papp <address@hidden> 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
address@hidden
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]