From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: words starting with call_ confuse C-c C-c and export Date: Mon, 16 Dec 2013 08:12:11 -0700 Message-ID: <87wqj425kk.fsf@gmail.com> References: <87ob4ytoqf.wl%n142857@gmail.com> <87zjohvem7.fsf@gmail.com> <87iov16b3d.fsf@gmail.com> <87wqjhu5i1.fsf@gmail.com> <8761r14cjr.fsf@gmail.com> <87k3f7ad2w.fsf@gmail.com> <878uvl3if1.fsf@gmail.com> <87d2kxag62.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsZrQ-0002gc-Qg for emacs-orgmode@gnu.org; Mon, 16 Dec 2013 10:13:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsZrL-0004X8-L6 for emacs-orgmode@gnu.org; Mon, 16 Dec 2013 10:13:32 -0500 Received: from mail-pb0-x234.google.com ([2607:f8b0:400e:c01::234]:44702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsZrL-0004X4-Ci for emacs-orgmode@gnu.org; Mon, 16 Dec 2013 10:13:27 -0500 Received: by mail-pb0-f52.google.com with SMTP id uo5so5582981pbc.25 for ; Mon, 16 Dec 2013 07:13:26 -0800 (PST) In-Reply-To: <87d2kxag62.fsf@gmail.com> (Nicolas Goaziou's message of "Sun, 15 Dec 2013 23:43:49 +0100") 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Eric Schulte writes: > >> Nicolas Goaziou writes: >>> In fact, they are already mandatory. The problem is different. Current >>> regexp is: >>> >>> "\\([^\n]*?\\)call_\\([^()\n]+?\\)\\(\\[\\(.*?\\)\\]\\|\\(\\)\\)(\\([^\n]*?\\))\\(\\[\\(.*?\\)\\]\\)?" >>> >>> In particular, name is \\([^()\n]+?\\), and can include whitespace >>> characters. Therefore "call_name (args)" is valid. Isn't it too much >>> permissive in the context of an Org (i.e. textual) document? >>> >>> Also, couldn't we limit names to alphanumeric characters and, maybe, >>> some puctuation (e.g. hypen)? >>> >> >> Why don't we exclude whitespace from names. Do you think that would be >> sufficient? > > It would solve the current problem, but there are still many problematic > characters allowed (e.g., commas, curly brackets). I think there's no > point in allowing "call_{i=1}()" as a valid inline Babel call. > > Furthermore, I don't think it's a real limitation to use alphanumeric > characters (and hyphen) only for a function name. I would even require > an alphabetic character as the first char, to avoid calls like: > "call_1()". > I often use "/" in function names, and in general I'd prefer not to remove characters (e.g., "{") unless there is a specific reason. I've changed the name portion of the regular expression to disallow space characters. > > BTW, later in that regexp, there is a dubious "(\\([^\n]*?\\))". Is > there any reason not to use "(\\(.*?\\))" instead? I've made this change and all tests continue to pass, so we can stick with the simpler and less explicit option. > Also, what about the empty matcher "\\(\\)"? I don't get its use. > I'm hesitant to make changes that could affect the match data, it is possible this is present so that match data is similar to other regular expressions matching callable elements. The heavy use of regular expressions in Babel code is difficult to maintain, but I'm not sure if there is any practical alternative. Regardless this particular two-lines regular expression could really use many more than two lines of comments... Best, > > > Regards, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D