Re: quotation question + good lisp doc



Am Sat, 20 Feb 2010 14:54:09 +0900 (JST)
schrieb Teika Kazura <teika lavabit com>:

> Chris, are you going to replace the current jump-or-exec
> with cycle-or-exec? If so, I won't touch jump-or-exec.jl for a while.
> It seems good.

Nope. I wanted to have both. Besides cycle-or-exec (coe) technically can't replace
jump-or-exec (joe):

a) the case of multiple matches is pretty low as both start an app or switch to it,
more instances must be started manually and since I'm using joe the amount of
windows on my desktop dramatically decreased (yay!)

b) coe is a cycling command, therefore the binding must start with a modifier, fake
modifiers from macros ("nested keybindings") won't work, joe wins here.

Chris

> 
> But the *filename* jump-or-exec.jl is really good, so we should't 
> throw it away.
> 
> I'll work on it later, waiting my class enhancements, but what you
> want must look like this:
> ------------------------------------------------------------------------
> (define (cycle-or-exec re prog #!key name match-class)
>   (let (forward-name backward-name)
>     (when (stringp prog)
>       (setq name prog))
>     (if name
> 	(prog
> 	 (setq forward-name (concat "cycle-" name))
> 	 (setq backward-name (concat forward-name "-backwards")))
>       (setq forward-name
> 	    (concat "cycle-" (closure-name prog)))
>       (setq backward-name
> 	    (concat forward-name "-backwards")))
>     (if match-class
>         (define-cycle-command-pair
>           forward-name backward-name
>           (cycle-or-exec-backend (filter-windows-by-class re) prog))
>       (define-cycle-command-pair
>         forward-name backward-name
>         (cycle-or-exec-backend (filter-windows-by-name re) prog)))))
> ------------------------------------------------------------------------
> This is closer to the original one. Here, 'intern' is not necessary.
> (I learned what's 'intern'. :)

even more comfort with the key and name arg. key arg for joe would also be good,
wouldn't it?

Also shouldn't filter-windows-by-name/class go into windows.jl rather than
cycle-or-exec.jl, I thougth so, as they are usefull for other stuff, too.

> 1. 'prog' can be string or function, as original.
> 2. If 'name' is non-nil, it's used as the name for command.
> 3. Else, the function name is used for command.
> 
> On Sat, 13 Feb 2010 21:10:20 +0100, Christopher Roy Bratusek wrote:
> > 2. Someone got a link to a good lisp doc (got holidays next week, so
> > finally some time to get more familar with something different when
> > python).
> 
> It may be trivial, but it's good to ask at ML, too, if you come across
> a lisp riddle. If you don't know something, many don't, so asking here
> helps to share knowledge. :)
> 
> Regards,
> Teika (Teika kazura)
> 



-- 

Versteh ich nicht....
Gesendet von Hundertwasser am Mo, 4. Jun 2007 um 14:12

auf welcher Distribution beruht eigentlich der Emacs, ist doch ein eigenständiges
Betriebssystem, oder? Warum sollte ich mir neben Windows und Linux noch ein BS
aufbügeln? Kann mir da vielleicht jemand ein paar Argumente liefern?



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