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

void function dnd-unescape-uri #812

Closed
gdindi opened this issue Nov 13, 2020 · 7 comments
Closed

void function dnd-unescape-uri #812

gdindi opened this issue Nov 13, 2020 · 7 comments

Comments

@gdindi
Copy link

gdindi commented Nov 13, 2020

Version: 20201013.1427
Commit: 2a91b6f

org-ref-pdf-to-bibtex calls which seems to be void.

I need to do this to make the function work:
(defalias 'dnd-unescape-uri 'dnd--unescape-uri)

@jkitchin
Copy link
Owner

I do not understand this issue. Are you saying dnd-unescape-uri is not a function for you, and dnd--unescape-uri is? Is that why the alias solves your problem? For me the first one is defined in dnd.el, and the second is non-existant.

@gdindi
Copy link
Author

gdindi commented Nov 24, 2020

I am sorry. My sentence was incomplete. dnd-unescape-uri is void for me (I am on emacs master). The fuction seems to have been renamed with a double dash.

jkitchin added a commit that referenced this issue Nov 25, 2020
I think this should be backward compatible, and work with future emacs versions.
Apparently in emacs master dnd-unescape-uri is renamed to dnd--unescape-uri.
Here I use an alias approach to keep the original code working with the same
function name.
@jkitchin
Copy link
Owner

Ok. Thanks for the report. I have added a conditional defalias that I think will solve this.

@yangsheng6810
Copy link
Contributor

It may not be a good idea to warn if neither dnd-unescape-uri nor dnd--unescape-uri exists. They are not autoload functions. So unless dnd is loaded, you will always produce a warning, which can be both annoying and unhelpful.

jkitchin added a commit that referenced this issue Nov 26, 2020
I added this in issue #812 , but it appears these functions are not autoloaded
and so this creates a warning that is not helpful. For now I am commenting this
out to avoid that. Later we will have to figure out a solution.
@jkitchin
Copy link
Owner

Indeed, I have already gotten an email about that. I have just pushed something that comments those out for now.

@paulapatience
Copy link

@yangsheng6810: What I don't understand is that none of the other dnd functions called by org-ref are autoloaded. Only dnd-protocol-alist is, and dnd-unescape-uri is called before that anyway.

Probably the reason @jkitchin received an email about the warning is because the current defalias would never take effect because dnd--unescape-uri is misspelled as dnd--escape-uri in org-ref-pdf.el and org-ref-url-utils.el. Correcting the typo should fix everything. In particular, I don't encounter the problem mentioned by @yangsheng6810 after correcting it.

@paulapatience
Copy link

Ah, and in fact, the defalias in org-ref-url-utils is unnecessary (and unconditionally skipped, resulting in the warning being displayed), since that file requires doi-utils, which requires org-ref-utils, which requires org-ref-pdf, so dnd-unescape-uri is already defaliased and thus fboundp'd.

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

No branches or pull requests

4 participants