stumpwm-devel
[Top][All Lists]
Advanced

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

Re: [STUMP] group-format-map and window-format-map


From: Ben Spencer
Subject: Re: [STUMP] group-format-map and window-format-map
Date: Sun, 3 Apr 2011 13:15:53 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Hi Matt,

On Mon, Mar 28, 2011 at 09:12:04PM -0700, Matt Spear wrote:
> Got it.  Changed window-number type to take the element of the
> window-number-map and return the index (this requires no changes to
> select-window-by-number).

Note that this means that select-window-by-number will take different
values when called as a function than when used interactively.  Maybe
this makes sense though, as *window-number-map* is a high-level UI
feature and in code you'd probably want to use the real numbers.


> +      (let ((indx (position (elt n 0) *window-number-map*)))

This only works when *window-number-map* consists of characters, and
it doesn't work at all for non-mapped window numbers (ie ones that are
higher than *window-number-map goes).  I think it would be preferable
for this to work more like the :group code does, using find and
window-map-number across (group-windows (current-group)).  Something
like (untested):

(find n (group-windows (current-group))
      :test #'string=
      :key (lambda (w) (princ-to-string (window-map-number w))))

Then grab the real window-number of the result, if any.

(side note: maybe window-map-number and group-map-number should always
return strings so we don't have to keep printing them).


Ben



reply via email to

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