emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Radon Rosborough <radon.neon@gmail.com>
To: Emacs-orgmode@gnu.org
Subject: [BUG] org-compile-prefix-format regexp change breaks eval forms [9.4.6 (9.4.6-gf72a65)]
Date: Wed, 26 May 2021 16:42:30 -0700	[thread overview]
Message-ID: <CADB4rJHMwFLYVkDn9Ve=OSZ2afkPnREbmaT4Mcw=O=iXB-6LHg@mail.gmail.com> (raw)

Hello,

In commit 0260d2fcf603f30210e2b95d37727edd832c12e9 of 2021-04-26, the
regexp used in `org-agenda-prefix-format' was updated to use a
non-greedy regexp, in order to allow multiple %(expression) instances
in `org-agenda-prefix-format'. Unfortunately, this change breaks the
ability to use nested forms in %(expression) instances. For example, I
use the following setting for `org-agenda-prefix-format':

(setf (alist-get 'agenda org-agenda-prefix-format)
          "  %(format-time-string \"%a\" (org-get-deadline-time (point)))  ")

When running `org-agenda', I now receive the error
`org-compile-prefix-format: End of file during parsing'. This is
because of the updated regexp match, which stops at the first closing
parenthesis:

ELISP> myfmt
"  %(format-time-string \"%a\" (org-get-deadline-time (point)))  "
ELISP> (and (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([
.;,:!?=|/<>]?\\)\\([cltseib]\\|(.+?)\\)" myfmt) (match-string 4
myfmt))
"(format-time-string \"%a\" (org-get-deadline-time (point)"

With the previous regexp, it works fine:

ELISP> (and (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([
.;,:!?=|/<>]?\\)\\([cltseib]\\|(.+)\\)" myfmt) (match-string 4 myfmt))
"(format-time-string \"%a\" (org-get-deadline-time (point)))"

Thanks,
Radon Rosborough


             reply	other threads:[~2021-05-26 23:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 23:42 Radon Rosborough [this message]
2021-05-27  3:25 ` Ihor Radchenko
2021-05-29 21:18   ` Radon Rosborough
2021-05-30  8:04     ` Ihor Radchenko
2021-05-30 16:48       ` Radon Rosborough
2021-09-26  7:12       ` Bastien

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='CADB4rJHMwFLYVkDn9Ve=OSZ2afkPnREbmaT4Mcw=O=iXB-6LHg@mail.gmail.com' \
    --to=radon.neon@gmail.com \
    --cc=Emacs-orgmode@gnu.org \
    /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).