emacs-citar / citar

Emacs package to quickly find and act on bibliographic references, and edit org, markdown, and latex academic documents.
GNU General Public License v3.0
501 stars 54 forks source link

Modify if statements in citar-markdown-insert-citation #787

Closed benthamite closed 1 year ago

benthamite commented 1 year ago

Closes #786

roshanshariff commented 1 year ago

I think a better way to write this is (and prenote (not (string-empty-p prenote))), explicitly checking for prenote being non-nil and non-empty. Using length only works because (length nil) => 0, but it's a little non-obvious.

bdarcus commented 1 year ago

I think a better way to write this ...

I agree. Does it work on your end?

If yes, can you just make that change here?

benthamite commented 1 year ago

@roshanshariff, thanks. I think it should be (or (not prenote) (string-empty-p prenote)), i.e. the negation of your condition.

I made the changes. (I tried to squash the new commit, which I believe is the recommendation, but had an issue with Forge/Magit, so I ended up force-pushing it. I'm not a programmer; apologies if this wasn't the correct process.)

bdarcus commented 1 year ago

I tried to squash the new commit, which I believe is the recommendation, but had an issue with Forge/Magit, so I ended up force-pushing it ...

No worries; I can just squash merge it.

Thanks!