[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

org-capture: Capture template ‘g’: Match data clobbered by buffer modifi

From: Alex Bennée
Subject: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks
Date: Fri, 15 Jul 2016 17:39:48 +0100
User-agent: mu4e 0.9.17; emacs


This seems to have been introduced by commit:

    Author:     Eli Zaretskii <address@hidden>

    Avoid crashes when buffer modification hooks clobber match data

    * src/search.c (Freplace_match): Error out if buffer modification
    hooks triggered by buffer changes in replace_range, upcase-region,
    and upcase-initials-region clobber the match data needed to be
    adjusted for the replacement.  (Bug#23869)

    1 file changed, 13 insertions(+)
    src/search.c | 13 +++++++++++++

I have a org-capture template set up that's triggered by a helper

    (defun my-capture-review-tags ()
      "Return a list of DCO style tags for current buffer."
      (let ((tags))
          (goto-char (point-min))
          (while (re-search-forward my-dco-tag-re (point-max) t)
            (add-to-list 'tags (match-string-no-properties 0))))

    (defun my-org-maybe-capture-review-tag ()
      "Check buffer for DCO tags and if found queue a review comment."
      (let ((tags (my-capture-review-tags)))
        (when tags
          (kill-new (mapconcat 'identity tags "\n"))
          (org-capture nil "g"))))

And the following template:

    ("g" "Save reference to review tag"
         (file+headline "review.org" "Review Tags")
         "** %a\n%c" :immediate-finish t)

But I'm not sure what's going on. Obviously there is match data setup as
I snarf the tags but I don't care about them by the time I run the
template insert. It's hard to tell what hooks are running that might be
doing something like this.

I tried setting debug-on-message to:

    (setq debug-on-message "\\(?:Match data clobbered by\\)")

But it wouldn't trigger at all so I'm a little stumped by what is going
on? Have I done something wrong in my code or triggered a bug somewhere else?

Alex Bennée

reply via email to

[Prev in Thread] Current Thread [Next in Thread]