From pbrochard at common-lisp.net Tue Mar 4 22:53:28 2014 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Tue, 04 Mar 2014 22:53:28 +0000 Subject: Problem with macro with-timer In-Reply-To: <878uspzvvj.fsf@argh.homenet.telecomitalia.it> (Andrea De Michele's message of "Tue, 04 Mar 2014 19:01:04 +0100") References: <87ioruyrdz.fsf@argh.homenet.telecomitalia.it> <87k3cakm2s.fsf@common-lisp.net> <878uspzvvj.fsf@argh.homenet.telecomitalia.it> Message-ID: <87fvmxlgnr.fsf@common-lisp.net> Andrea De Michele writes: [...] > I think that gensym it is not created only once at compile time, but gensym as > default value is evaluated each time before macroexpansion. > > If I evaluate several time this form: > > (with-timer (2) (focus-frame-by (find-frame-by-name "notification"))) > > the error is each time different: > > CLFSWM> (with-timer (2) (focus-frame-by (find-frame-by-name "notification"))) > ; Evaluation aborted on #. > CLFSWM> (with-timer (2) (focus-frame-by (find-frame-by-name "notification"))) > ; Evaluation aborted on #. > > gensym is evaluated each time and its return value is each time > different (#:G1462 and #:G1463 in this case) > The symbol is created at compile time (macro expansion) and is new each time we encounter a with-timer. When you quote it, you make (gensym) available at evaluation time. A test: (defmacro test (&optional (x '(gensym)) (y (gensym)) (z (gensym))) `(list ,x ,y ',z)) (defun test1 () (print (macroexpand-1 '(test))) (print (macroexpand-1 '(test))) (print (macroexpand-1 '(test)))) => (LIST (GENSYM) #:G3242 '#:G3243) (LIST (GENSYM) #:G3244 '#:G3245) (LIST (GENSYM) #:G3246 '#:G3247) The error comes from the fact that (gensym) create a new symbol but #G:3242 is a symbol not a bounded variable. And the list function try to evaluate #:G3242. So we can write it as the x or z parts to prevent the error. > I have found an old blog post that explains this strange macro parameter > behaviour: > > http://www.findinglisp.com/blog/2005/01/keyword-parameters-in-macro-expansions.html > Thanks for the blog post. Those type of bugs are pretty hard to spot. And the only place we used it is with a named id in a contrib module. I haven't tested sufficiently this macro :-( > PS: thank you very much for this wonderful windows manager. > Thanks a lot for using it! And welcome on this list if I haven't wish you this before. (I'm not accustomed to the new mailing list system to know new members). From andrea.demichele at gmail.com Tue Mar 4 18:01:04 2014 From: andrea.demichele at gmail.com (Andrea De Michele) Date: Tue, 04 Mar 2014 19:01:04 +0100 Subject: Problem with macro with-timer In-Reply-To: <87k3cakm2s.fsf@common-lisp.net> (Philippe Brochard's message of "Tue, 04 Mar 2014 15:41:47 +0000") References: <87ioruyrdz.fsf@argh.homenet.telecomitalia.it> <87k3cakm2s.fsf@common-lisp.net> Message-ID: <878uspzvvj.fsf@argh.homenet.telecomitalia.it> Philippe Brochard writes: > Andrea De Michele writes: > >> I tried to call the macro with-timer like this: >> >> (with-timer (2) (focus-frame-by (find-frame-by-name "notification"))) >> >> But sbcl give me the following error: >> >> The variable #:G1442 is unbound. >> >> If I call the macro with the optional parameter id like this all works: >> >> (with-timer (2 (gensym)) (focus-frame-by (find-frame-by-name "notification"))) >> >> I think (but I'm not sure) that the problem is that the default value >> for the optional parameter id is evaluated before macroexpansion. >> >> If I change the definition of with-timer from: >> >> (defmacro with-timer ((delay &optional (id (gensym))) &body body) >> "Same thing as add-timer but with syntaxic sugar" >> `(add-timer ,delay >> (lambda () >> , at body) >> ,id)) >> >> to: >> >> (defmacro with-timer ((delay &optional (id '(gensym))) &body body) >> "Same thing as add-timer but with syntaxic sugar" >> `(add-timer ,delay >> (lambda () >> , at body) >> ,id)) >> >> both the way to call the macro (with and without the optional id parameters) works. >> > Hi, thanks for the report. You're right, the gensym is created only > once at compilation time. Your second version is the right thing to do > since a gensym is created each time we call add-timer. > The fix is applied in your name. > > Regards, > > Philippe > I think that gensym it is not created only once at compile time, but gensym as default value is evaluated each time before macroexpansion. If I evaluate several time this form: (with-timer (2) (focus-frame-by (find-frame-by-name "notification"))) the error is each time different: CLFSWM> (with-timer (2) (focus-frame-by (find-frame-by-name "notification"))) ; Evaluation aborted on #. CLFSWM> (with-timer (2) (focus-frame-by (find-frame-by-name "notification"))) ; Evaluation aborted on #. gensym is evaluated each time and its return value is each time different (#:G1462 and #:G1463 in this case) I have found an old blog post that explains this strange macro parameter behaviour: http://www.findinglisp.com/blog/2005/01/keyword-parameters-in-macro-expansions.html PS: thank you very much for this wonderful windows manager. -- Andrea De Michele From pbrochard at common-lisp.net Tue Mar 4 15:41:47 2014 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Tue, 04 Mar 2014 15:41:47 +0000 Subject: Problem with macro with-timer In-Reply-To: <87ioruyrdz.fsf@argh.homenet.telecomitalia.it> (Andrea De Michele's message of "Tue, 04 Mar 2014 15:23:20 +0100") References: <87ioruyrdz.fsf@argh.homenet.telecomitalia.it> Message-ID: <87k3cakm2s.fsf@common-lisp.net> Andrea De Michele writes: > I tried to call the macro with-timer like this: > > (with-timer (2) (focus-frame-by (find-frame-by-name "notification"))) > > But sbcl give me the following error: > > The variable #:G1442 is unbound. > > If I call the macro with the optional parameter id like this all works: > > (with-timer (2 (gensym)) (focus-frame-by (find-frame-by-name "notification"))) > > I think (but I'm not sure) that the problem is that the default value > for the optional parameter id is evaluated before macroexpansion. > > If I change the definition of with-timer from: > > (defmacro with-timer ((delay &optional (id (gensym))) &body body) > "Same thing as add-timer but with syntaxic sugar" > `(add-timer ,delay > (lambda () > , at body) > ,id)) > > to: > > (defmacro with-timer ((delay &optional (id '(gensym))) &body body) > "Same thing as add-timer but with syntaxic sugar" > `(add-timer ,delay > (lambda () > , at body) > ,id)) > > both the way to call the macro (with and without the optional id parameters) works. > Hi, thanks for the report. You're right, the gensym is created only once at compilation time. Your second version is the right thing to do since a gensym is created each time we call add-timer. The fix is applied in your name. Regards, Philippe From michael at cadilhac.name Fri Mar 14 12:26:03 2014 From: michael at cadilhac.name (=?UTF-8?Q?Micha=C3=ABl_Cadilhac?=) Date: Fri, 14 Mar 2014 13:26:03 +0100 Subject: clisp can't find build-lisp-image In-Reply-To: <87zjl9k1dr.fsf@common-lisp.net> References: <87zjl9k1dr.fsf@common-lisp.net> Message-ID: Philippe; Thanks for your answer! On Sat, Mar 1, 2014 at 11:19 PM, Philippe Brochard wrote: > Here is what I've done to run clfswm under ubuntu 12.04 and 13.10: > > sudo apt-get install git sbcl > git clone git://common-lisp.net/projects/clfswm/clfswm.git > cd clfswm > make (accept to load clx) This failed on my system with: > CLX not found. Do you want to download it from git://github.com/sharplispers/clx.git ? (y or n) y > > debugger invoked on a SB-INT:C-STRING-DECODING-ERROR in thread > #: > c-string decoding error (:external-format :UTF-8): > the octet sequence 3 cannot be decoded. because of an environment variable the adminsys set which had some miscoding. Fixing the variable, plus the line quit>exit, everything went fine, thanks a bunch! With the latest Git, I still have the occasional crashes with the fast switch (a resounding CLFSWM Error: The value 3 is not of type (OR NULL SIMPLE-VECTOR)..), and I still have the focus problems with the popup term. Should you need any more infos on that, I can provide them. Happy hacking; M. From renaud at casenave-pere.fr Fri Mar 28 04:57:55 2014 From: renaud at casenave-pere.fr (=?iso-8859-1?Q?Renaud_Casenave-P=E9r=E9?=) Date: Fri, 28 Mar 2014 13:57:55 +0900 Subject: Hidden features Message-ID: <87txaizzqk.fsf@sandalphon.casenave.fr> Hi, I'm trying to find new ways to use clfswm and as I looked around in the menu I tried to understand how I could use the command "Remove the current child from its parent frame". When I use it for example on a frame containing conkeror, the frame and conkeror are indeed removed from the parent frame but there seems to be no way to get conkeror back although it is still running in the background. How is this command best used? Thanks, -- Renaud Casenave-P?r? From pbrochard at common-lisp.net Sat Mar 1 22:19:44 2014 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 01 Mar 2014 22:19:44 +0000 Subject: clisp can't find build-lisp-image In-Reply-To: (=?iso-8859-1?Q?=22Micha=EBl?= Cadilhac"'s message of "Wed, 26 Feb 2014 15:40:31 +0100") References: Message-ID: <87zjl9k1dr.fsf@common-lisp.net> Micha?l Cadilhac writes: > Hi there; > Hi, sorry for the lag but I have had to boot under ubuntu for tests (grub is a very nice piece of software for this with its ability to boot on iso files). > As you may recall, I'm not at all versed in lisp machinery (which is > evil, let it be noted). I just arrived at my new job (on a Ubuntu > 12.04) and wanted to show off my CLFSWM skills, but I can't seem to be > able to install it. The debian package seems outdated (at least, it > doesn't look at my config) hence I went on to compile my own. It gets > stuck with: > > undefined function BUILD-LISP-IMAGE > > My meager knowledge of this led me to believe that I had to install > the cl-acl-compat package, which was cumbersome enough as it required > to install an older version of asdf, which conflicted with the one > CLFSWM installs. Conclusion: still no build-lisp-image to be found. > > A hand would be greatly appreciated. > Here is what I've done to run clfswm under ubuntu 12.04 and 13.10: sudo apt-get install git sbcl git clone git://common-lisp.net/projects/clfswm/clfswm.git cd clfswm make (accept to load clx) echo xterm > ~/.xsession Control + Alt + F1 (switch to console) startx -- :1 cd clfswm ./clfswm For the sbcl in 12.04, you have to change the line 788 in src/tools.lisp from #+sbcl (sb-ext:exit) to #+sbcl (sb-ext:quit) you can also comment this line. It works also with clisp (both in 13.10 and 12.04). I haven't tried the tarball (I'll test now) but if it fails it'll be time to make a new one. Regards, Philippe From pbrochard at common-lisp.net Fri Mar 14 22:43:51 2014 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Fri, 14 Mar 2014 22:43:51 +0000 Subject: clisp can't find build-lisp-image In-Reply-To: (=?iso-8859-1?Q?=22Micha=EBl?= Cadilhac"'s message of "Fri, 14 Mar 2014 13:26:03 +0100") References: <87zjl9k1dr.fsf@common-lisp.net> Message-ID: <8761ng9za0.fsf@common-lisp.net> Micha?l Cadilhac writes: > Philippe; > > Thanks for your answer! > > On Sat, Mar 1, 2014 at 11:19 PM, Philippe Brochard > wrote: > >> Here is what I've done to run clfswm under ubuntu 12.04 and 13.10: >> >> sudo apt-get install git sbcl >> git clone git://common-lisp.net/projects/clfswm/clfswm.git >> cd clfswm >> make (accept to load clx) > > This failed on my system with: > >> CLX not found. Do you want to download it from git://github.com/sharplispers/clx.git ? (y or n) y >> >> debugger invoked on a SB-INT:C-STRING-DECODING-ERROR in thread >> #: >> c-string decoding error (:external-format :UTF-8): >> the octet sequence 3 cannot be decoded. > > because of an environment variable the adminsys set which had some > miscoding. Fixing the variable, plus the line quit>exit, everything > went fine, thanks a bunch! > Ok. Maybe, which variable is the cause of this bug? We can maybe prevent this. > With the latest Git, I still have the occasional crashes with the fast > switch (a resounding CLFSWM Error: The value 3 is not of type (OR NULL > SIMPLE-VECTOR)..), and I still have the focus problems with the popup > term. Should you need any more infos on that, I can provide them. > Oh, yes! If you can reproduce it or see when it happen, this will be greatly appreciated. Any feedback is welcome. > Happy hacking; > Thanks :-) > M. > Philippe From renaud at casenave-pere.fr Sun Mar 2 03:21:21 2014 From: renaud at casenave-pere.fr (=?iso-8859-1?Q?Renaud_Casenave-P=E9r=E9?=) Date: Sun, 02 Mar 2014 12:21:21 +0900 Subject: clisp can't find build-lisp-image In-Reply-To: <8761nx1qfr.fsf@common-lisp.net> (Philippe Brochard's message of "Sat, 01 Mar 2014 22:53:28 +0000") References: <87zjl9k1dr.fsf@common-lisp.net> <8761nx1qfr.fsf@common-lisp.net> Message-ID: <87txbhmgjy.fsf@zahikel.casenave.fr> On Sun, Mar 02 2014, Philippe Brochard wrote: [...] Hi, I myself have had to fiddle with load.lisp to be able to run it and I was thinking maybe you could use quicklisp for the loading and compiling process. What do you think? -- Renaud Casenave-P?r? From pbrochard at common-lisp.net Sat Mar 29 22:22:25 2014 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 29 Mar 2014 22:22:25 +0000 Subject: Hidden features In-Reply-To: <87txaizzqk.fsf@sandalphon.casenave.fr> ("Renaud \=\?iso-8859-1\?Q\?Casenave-P\=E9r\=E9\=22's\?\= message of "Fri, 28 Mar 2014 13:57:55 +0900") References: <87txaizzqk.fsf@sandalphon.casenave.fr> Message-ID: <87wqfcy7a6.fsf@common-lisp.net> Renaud Casenave-P?r? a ?crit : > Hi, > Hi, > I'm trying to find new ways to use clfswm and as I looked around in the menu I > tried to understand how I could use the command "Remove the current child from > its parent frame". When I use it for example on a frame containing conkeror, the > frame and conkeror are indeed removed from the parent frame but there seems to > be no way to get conkeror back although it is still running in the background. > > How is this command best used? > As the documentation says, this function "remove the current child from its parent frame". It is supposed to be used when you have copied the current child in more than one frame. This is useful when you want multiple view of a child (for example, with a layout per frame and the same children reorganized in each). But there is no guard: if you remove the last view of the child, you'll have no way to retrieve it. Maybe we must add this guard to prevent to remove the last instance of a child. Tell me if you think so. > Thanks, > Hope this help. Philippe From pbrochard at common-lisp.net Sun Mar 2 09:10:36 2014 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sun, 02 Mar 2014 09:10:36 +0000 Subject: clisp can't find build-lisp-image In-Reply-To: <87txbhmgjy.fsf@zahikel.casenave.fr> ("Renaud \=\?iso-8859-1\?Q\?Casenave-P\=E9r\=E9\=22's\?\= message of "Sun, 02 Mar 2014 12:21:21 +0900") References: <87zjl9k1dr.fsf@common-lisp.net> <8761nx1qfr.fsf@common-lisp.net> <87txbhmgjy.fsf@zahikel.casenave.fr> Message-ID: <87r46lc6er.fsf@common-lisp.net> Renaud Casenave-P?r? a ?crit : > On Sun, Mar 02 2014, Philippe Brochard wrote: > > [...] > > Hi, > > I myself have had to fiddle with load.lisp to be able to run it and I > was thinking maybe you could use quicklisp for the loading and compiling > process. What do you think? > Well, you can already use quicklisp to load clfswm if you want and you'll get the last git version: (ql:quickload "clfswm") (clfswm:main) I'd like to stay with something with as less dependency as possible. And I don't want to force someone to use quicklisp. But it's possible if it wants to. I have greatly simplified the building process since the old contrib/clfswm bash file. Now it's just a make which build a lisp executable image. Bug report on this part is very appreciated (as always it works for me :-)). In fact the make process is just a way to choose a lisp available to load load.lisp. Maybe we can have a separate load-with-quicklisp.lisp file which use quicklisp instead of a home made process. I don't feel a need for it but if you want it can be relatively simple to write it. The documentation will have to be clear on the choice of load.lisp or load-with-quicklisp.lisp. Regards, Philippe From andrea.demichele at gmail.com Tue Mar 4 14:23:20 2014 From: andrea.demichele at gmail.com (Andrea De Michele) Date: Tue, 04 Mar 2014 15:23:20 +0100 Subject: Problem with macro with-timer Message-ID: <87ioruyrdz.fsf@argh.homenet.telecomitalia.it> I tried to call the macro with-timer like this: (with-timer (2) (focus-frame-by (find-frame-by-name "notification"))) But sbcl give me the following error: The variable #:G1442 is unbound. If I call the macro with the optional parameter id like this all works: (with-timer (2 (gensym)) (focus-frame-by (find-frame-by-name "notification"))) I think (but I'm not sure) that the problem is that the default value for the optional parameter id is evaluated before macroexpansion. If I change the definition of with-timer from: (defmacro with-timer ((delay &optional (id (gensym))) &body body) "Same thing as add-timer but with syntaxic sugar" `(add-timer ,delay (lambda () , at body) ,id)) to: (defmacro with-timer ((delay &optional (id '(gensym))) &body body) "Same thing as add-timer but with syntaxic sugar" `(add-timer ,delay (lambda () , at body) ,id)) both the way to call the macro (with and without the optional id parameters) works. -- Andrea De Michele From pbrochard at common-lisp.net Sat Mar 1 22:53:28 2014 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sat, 01 Mar 2014 22:53:28 +0000 Subject: clisp can't find build-lisp-image In-Reply-To: <87zjl9k1dr.fsf@common-lisp.net> (Philippe Brochard's message of "Sat, 01 Mar 2014 22:19:44 +0000") References: <87zjl9k1dr.fsf@common-lisp.net> Message-ID: <8761nx1qfr.fsf@common-lisp.net> Philippe Brochard writes: [...] > It works also with clisp (both in 13.10 and 12.04). > > I haven't tried the tarball (I'll test now) but if it fails it'll be > time to make a new one. > Same thing with the tarball, you have to change the line as above in src/tool.lisp for the 12.04 version and then type make. All seems to works fine. Regards, Philippe From renaud at casenave-pere.fr Sun Mar 30 09:25:27 2014 From: renaud at casenave-pere.fr (=?iso-8859-1?Q?Renaud_Casenave-P=E9r=E9?=) Date: Sun, 30 Mar 2014 18:25:27 +0900 Subject: [Clfswm-devel] Hidden features In-Reply-To: <87wqfcy7a6.fsf@common-lisp.net> (Philippe Brochard's message of "Sat, 29 Mar 2014 22:22:25 +0000") References: <87txaizzqk.fsf@sandalphon.casenave.fr> <87wqfcy7a6.fsf@common-lisp.net> Message-ID: <87txagvy0o.fsf@zahikel.casenave.fr> Hi, On Sun, Mar 30 2014, Philippe Brochard wrote: > As the documentation says, this function "remove the current child from > its parent frame". It is supposed to be used when you have copied the > current child in more than one frame. This is useful when you want > multiple view of a child (for example, with a layout per frame and the > same children reorganized in each). > But there is no guard: if you remove the last view of the child, you'll > have no way to retrieve it. > Maybe we must add this guard to prevent to remove the last instance of a > child. Tell me if you think so. I see? Thanks for the explanation. You could indeed foolproof this feature by preventing deletion of the last child or you could put it in the list of hidden children (or another list) to let the user retrieve it if removed by error, but this would be quite similar to the "hide current child" feature? -- Renaud Casenave-P?r?