Use thing-at-point for citar-markdown-key-at-point #395
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit aims to fix a problem with the current version of
citar-markdown-key-at-point, which is that it returns the closing bracket with the last citekey of a given markdown citation, such that[@Smith2012]returnsSmith2012]in the Embark indicator.Before resorting to
thing-at-point, I tried editing thesplit-stringregex in final line of the current code, to include a closing bracket, like so:(cadr (split-string str "[]@;]"))))). This nicely trimmed the closing bracket from the returned string.But for reasons I don't understand, that change wreaked some strange havoc, leading Embark to recognize anything between brackets as a markdown citation. Not a great outcome.
I had some tinker experience with
thing-at-point, so voila, an attempt at a bugfix. Interested to know what you think. Surely there's a simpler solution.In any case, thanks for a great package. Using it daily and enjoying tracking its development, learning a lot from the conversations here between you and others.