unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks
@ 2016-07-15 16:39 Alex Bennée
  2016-07-15 17:39 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Alex Bennée @ 2016-07-15 16:39 UTC (permalink / raw)
  To: emacs-devel; +Cc: Eli Zaretskii

Hi,

This seems to have been introduced by commit:

    3a9d6296b35e5317c497674d5725eb52699bd3b8
    Author:     Eli Zaretskii <eliz@gnu.org>

    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
function:

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

    (defun my-org-maybe-capture-review-tag ()
      "Check buffer for DCO tags and if found queue a review comment."
      (interactive)
      (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"
          entry
         (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



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-07-17 17:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-15 16:39 org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks Alex Bennée
2016-07-15 17:39 ` Eli Zaretskii
2016-07-15 19:12   ` Alex Bennée
2016-07-15 19:37     ` Noam Postavsky
2016-07-15 21:56       ` Alex Bennée
2016-07-16 16:01       ` Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks) N. Jackson
2016-07-16 16:11         ` Eli Zaretskii
2016-07-16 17:09           ` John Wiegley
2016-07-17 17:28             ` Alex Bennée
2016-07-17 17:41               ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).