From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: New feature: loop over siblings for some commands Date: Tue, 19 Jul 2011 20:27:26 +0200 Message-ID: <87zkkayvld.wl%dmaus@ictsoc.de> References: <87aacchtv8.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Tue_Jul_19_20:27:26_2011-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjF16-0007Hy-DJ for emacs-orgmode@gnu.org; Tue, 19 Jul 2011 14:27:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjF11-0002QR-AE for emacs-orgmode@gnu.org; Tue, 19 Jul 2011 14:27:36 -0400 Received: from app1b.xlhost.de ([213.202.242.162]:36671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjF10-0002Pz-Kn for emacs-orgmode@gnu.org; Tue, 19 Jul 2011 14:27:30 -0400 In-Reply-To: <87aacchtv8.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode@gnu.org --pgp-sign-Multipart_Tue_Jul_19_20:27:26_2011-1 Content-Type: text/plain; charset=US-ASCII At Mon, 18 Jul 2011 10:32:11 +0200, Bastien wrote: > > Dear all, > > from latest git repo: > > (setq org-loop-over-siblings-within-active-region-p t) > > will allow you to run some commands on several siblings in > the active region. > > For example: > > > * Item 1 > * Item 2 > * Item 3 > > > Then `C-c C-s' (org-schedule) will ask for a schedule date > for each of the item in the active region. See the commit > log for more details: > > http://orgmode.org/w/?p=org-mode.git;a=commit;h=366254217ac6faea20a5d43fae065bd028806eab > > I'm interested in allowing this for org-todo as well, but I > would first like some feedback on the current feature and its > scope wrt actual needs. The macro suffers from leaking: It let-binds symbols like beg, end etc. that might be present in ,@body. The let-bound symbols will shadow body's. Minimal example: ,---- | (defmacro leak-it-baby (&rest body) | `(let ((foobar 0)) | (while (< foobar 10) | (setq foobar (1+ foobar)) | ,@body))) | | (let ((foobar 9)) | (leak-it-baby | (setq foobar 11) | (print foobar))) | | ELISP> (macroexpand '(leak-it-baby (setq foobar 11))) | (let | ((foobar 0)) | (while | (< foobar 10) | (setq foobar | (1+ foobar)) | (setq foobar 11))) | | ELISP> `---- The whole problem of leaking macros is discussed in Peter Seibel's "Practical Common Lisp", Chapter 8 http://www.gigamonkeys.com/book/macros-defining-your-own.html The solution is a heavy use of C-h f gensym RET for all symboles needed in the macro to create fresh, unique und uninterned symbols. If no one jumps on a fix for this I will provide one till next sunday. Always wanted to do some lecker macro programming :) Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Tue_Jul_19_20:27:26_2011-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAk4lzI4ACgkQma24O1pEeOaSlAD+K+5Y9rUHRWCEwyePkq0e35py +I8SkRyq90bI2UxGwqABAMKDwCnzfhH9dZgikJ5VL2rJ06lL5yQJbWSavlagf0cw =Je5n -----END PGP SIGNATURE----- --pgp-sign-Multipart_Tue_Jul_19_20:27:26_2011-1--