emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: words starting with call_ confuse C-c C-c and export
Date: Mon, 16 Dec 2013 08:12:11 -0700	[thread overview]
Message-ID: <87wqj425kk.fsf@gmail.com> (raw)
In-Reply-To: <87d2kxag62.fsf@gmail.com> (Nicolas Goaziou's message of "Sun, 15 Dec 2013 23:43:49 +0100")

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Eric Schulte <schulte.eric@gmail.com> writes:
>
>> Nicolas Goaziou <n.goaziou@gmail.com> 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

  reply	other threads:[~2013-12-16 15:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03  6:47 words starting with call_ confuse C-c C-c and export Daniel Clemente
2013-12-03 20:55 ` Nicolas Goaziou
2013-12-06 19:09   ` Eric Schulte
2013-12-06 19:46     ` Nicolas Goaziou
2013-12-06 21:12       ` Eric Schulte
2013-12-14 11:25         ` Nicolas Goaziou
2013-12-15 21:37           ` Eric Schulte
2013-12-15 22:43             ` Nicolas Goaziou
2013-12-16 15:12               ` Eric Schulte [this message]
2013-12-16 16:58                 ` Nicolas Goaziou
2014-03-06 22:12                   ` Eric Schulte
2014-03-10 14:28                     ` Nicolas Goaziou
2014-03-10 14:44                       ` Eric Schulte
2014-03-11 14:11                         ` Nicolas Goaziou
2014-03-11 15:57                           ` Eric Schulte
2014-03-11 20:49                             ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wqj425kk.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).