stumpwm-devel
[Top][All Lists]
Advanced

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

Re: [STUMP] Patch to STUMPWM::FORMAT-EXPANDER in primitives.lisp


From: Adlai Chandrasekhar
Subject: Re: [STUMP] Patch to STUMPWM::FORMAT-EXPANDER in primitives.lisp
Date: Sun, 25 Oct 2009 20:13:58 +0200 (IST)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 25 Oct 2009, Ben Spencer wrote:
On Sat, Oct 24, 2009 at 09:33:48AM +0200, Adlai Chandrasekhar wrote:
I've written a little patch for a friend, that enables the use of ^
after a number in a format expansion string (such as
*SCREEN-MODE-LINE-FORMAT* or *WINDOW-FORMAT*) to trim from the left,
instead of the right.

While reviewing this patch, I noticed what appears to be a
pre-existing bug.  Unless I'm missing something, the (format t "%~a"
len) in format-expand should actually be appending onto the output
(since the idea is to add the literal string if there's no format
char).

That looks like a bug to me too... I guess one solution would be to wrap
it with (setf output (concatenate 'string output (format nil ...))).

The patch itself has a minor bug in that from-left-p is referred to as
from-end-p at one point (only just spotted that thanks to a compile
warning).  Other than that it looks fine (although I think the
function as a whole could do with a cleanup, especially if we add more
stuff like this), and I'll push it shortly if nobody else has comments
to make.

Thank you for catching that bug. I'll try cleaning up that function as a whole (once you've pushed my fix, to avoid merge conflicts...), does anybody have any suggestions? I think a good approach would be to use WITH-OUTPUT-TO-STRING rather than the current approach.

Happy Tiling,

Adlai
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Topal (http://freshmeat.net/projects/topal)

iQEcBAEBAgAGBQJK5JnXAAoJEEQDvZxQqpedKFoIAK9BIEwMvteuHIptTeTDm6NA
UACzhavnbEs5essTk3nIAGajNt2Xr03F27VCkfBy4y89sS1R+D51zBXRMbOeWFtV
0L4ojig5nQKy1vQGqfokjH50uStoaBNa+doOIULvjI78ogd0JkqLVFd16ybJkkpW
AVOP28+EfF+Zw0JSKf+NtraYYxIwC8K8muiqW2XjNwWTqoR3hzRjBM+bPwXRuC0a
Va2vDMJ5HvfpogdePwiLyL+fbXaaPbIAzeVSyU9jnHx1+nGjCV+p/nDhoBgIFO5M
4T9G6DlnAejbcnO+pPFc7nfoIjkp5VuRXc5nfJDBqj28ni9o9wmFxlYNiI1WiZI=
=QVE3
-----END PGP SIGNATURE-----




reply via email to

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