Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save match data in markdown-syntax-propertize-extend-region #105

Merged
merged 1 commit into from
Feb 25, 2016

Conversation

syohex
Copy link
Collaborator

@syohex syohex commented Feb 25, 2016

This function should not overwrite match data.

I suppose this is related to following issues

@jrblevin
Copy link
Owner

Thanks for tracking this down. Were you able to reproduce #104? I wasn't, so I can't check whether this helps.

@syohex
Copy link
Collaborator Author

syohex commented Feb 25, 2016

Were you able to reproduce #104?

No.

However I suppose we can confirm this with simple code.

(defun test-command ()
  (interactive)
  (beginning-of-line)
  (when (re-search-forward "foo" nil t)
    (let ((beg0 (match-beginning 0)))
      (insert "A") ;; <- markdown-syntax-propertize-extend-region is called
      (cl-assert (= beg0 (match-beginning 0))))))

Open following markdown file

abcdefg

foo<- move cursor here and do M-x test-command

With original code, match data is overwritten and assertion is failed, while assertion is not failed with this patch.

@jrblevin jrblevin merged commit a2a1b5f into master Feb 25, 2016
@jrblevin
Copy link
Owner

Thanks for confirming, and for the patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants