From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Lexical binding bug in org-list.el? Date: Sat, 07 Nov 2015 01:20:34 +0100 Message-ID: <87ziyq7j8t.fsf@nicolasgoaziou.fr> References: <87wptuua9n.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZurDX-0002G1-6B for emacs-orgmode@gnu.org; Fri, 06 Nov 2015 19:18:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZurDW-0003ig-D9 for emacs-orgmode@gnu.org; Fri, 06 Nov 2015 19:18:51 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:55279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZurDW-0003iW-6K for emacs-orgmode@gnu.org; Fri, 06 Nov 2015 19:18:50 -0500 In-Reply-To: <87wptuua9n.fsf@gmail.com> (Aaron Ecay's message of "Fri, 06 Nov 2015 20:45:56 +0000") 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: Kaushal Modi Cc: emacs-org list Hello, Aaron Ecay writes: > The org-list code is a mess, and I think we should hold off on converting > it to lexical scoping until it can be refactored in a more dedicated > way. It seems a bit strong considering there's only one issue so far. I don't think the code is a mess, but "Send and receive lists" part clearly needs an overhaul. > Nonetheless I include the patch, in case it=E2=80=99s helpful to anyone. Lifting `org-list--get-text', `org-list--parse-item', etc. isn't necessary. I just forgot a `letrec' in `org-list-parse-list'. The problem comes from `org-list-to-substree'. `org-list-to-generic' mechanism is not adequate for this function, which relied so far on a kludge to get the job done (i.e., undocumented `eval'ing of :istart and :icount values). Actually, `org-list-to-generic' in its current form isn't adequate for anything. Even `org-list-to-*' functions do not use it. As a temporary fix, besides using `letrec' per above, we can re-implement `org-list-to-subtree' without using `org-list-to-generic'. Later, `org-list-to-*' could be re-implemented like `orgtbl-to-generic'. Also, some parameters should be able to be set to a function generating a string, which would be called with the current depth of the item. In the process I think `org-list-parse-list' should be simplified, too, as its current return value is useless (e.g., nothing uses [CBON] anymore in the code base). WDYT? Regards, --=20 Nicolas Goaziou