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

Upgrade citar-org-update-pre-suffix to iterate through all references in citation #788

Merged
merged 7 commits into from
Jul 15, 2023

Conversation

krisbalintona
Copy link
Contributor

To resolve #607 and #606. The following pull request does the following:

  1. Renames citar-org-update-pre-suffix to citar-org-update-prefix-suffix. I found the initial naming potentially misleading. This rename may increase the discoverability of the command.
  2. Adds a helper function, citar-org--update-prefix-suffix.
  3. (Unchanged) When on a reference, will prompt for a new prefix and suffix, with default values being their current values.
  4. (New) When on a citation (but not a reference), will prompt for a new prefix and suffix for every reference in the citation at point from left to right.
  5. (New) When on a reference and called with prefix arg, does the same as (4).
  6. (New) There will always be only one space between citekey and citation suffix, unless there is no non-whitespace character in the suffix, in which case the suffix will be empty.

This new functionality uses purely the org-element API, meaning this should be a robust solution.

Additionally, I have manually tested the pull request through several edge cases, and have detected no bugs.

Finally, if this pull request goes through, I think it would be a good idea to (i) have citar-org-update-prefix-suffix be run after inserting a citation and (ii) have a customizable option to have toggle this behavior, potentially having it enabled by default.

@bdarcus
Copy link
Contributor

bdarcus commented Jul 15, 2023

Finally, if this pull request goes through, I think it would be a good idea to (i) have citar-org-update-prefix-suffix be run after inserting a citation and (ii) have a customizable option to have toggle this behavior, potentially having it enabled by default.

Yeah; I was wondering about that after testing it. ;-)

Perhaps on that you could also update the documentation?

https://github.com/emacs-citar/citar#org-cite-1

Thanks!

@bdarcus bdarcus merged commit 648ef55 into emacs-citar:main Jul 15, 2023
@krisbalintona krisbalintona deleted the citation-prefix-suffix branch July 15, 2023 21:21
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.

Query affixes after adding key
2 participants