-
Notifications
You must be signed in to change notification settings - Fork 55
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
citar-open-entry
receives wrong citekey
#822
Comments
Hi @pgoelz - I can't reproduce that. On my end, it works as expected. |
Thanks for trying, Bruce! Do you have any advice for how to narrow it down on my side? I’m stuck because I’m not familiar with embark and so don’t understand where embark calls |
I’ve been able to reproduce the error when starting from a fresh spacemacs configuration file and a minimal bibliography. Bibliography, to be placed in @techreport{AAA+18,
title = {Market Failure in Kidney Exchange},
author = {Agarwal, Nikhil and Ashlagi, Itai and Azevedo, Eduardo and Featherstone, Clayton R. and Karaduman, {\"O}mer},
year = {2018},
institution = {{National Bureau of Economic Research}}
}
@book{NW06,
title = {Numerical Optimization},
author = {Nocedal, Jorge and Wright, Stephen J.},
year = {2006},
series = {Springer Series in Operations Research},
edition = {2nd ed},
publisher = {{Springer}},
address = {{New York}}
} Org-file in which the problem occurs:
The (defun dotspacemacs/user-config ()
"Configuration for user code:
This function is called at the very end of Spacemacs startup, after layer
configuration.
Put your configuration code here, except for variables that should be set
before packages are loaded."
;; install the straight package manager
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name
"straight/repos/straight.el/bootstrap.el"
(or (bound-and-true-p straight-base-dir)
user-emacs-directory)))
(bootstrap-version 7))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'org)
(setq org-cite-global-bibliography '("/tmp/bib.bib"))
(straight-use-package 'embark)
(straight-use-package 'citar)
(straight-use-package 'citar-embark)
(setq citar-bibliography '("/tmp/bib.bib"))
(defun debugging-log (citekey)
(switch-to-buffer-other-window "*log*")
(erase-buffer)
(insert citekey)
(other-window 1)
)
(setq citar-open-entry-function 'debugging-log)
(citar-embark-mode)
) I’m also attaching the full With this, I can reproduce the problem: calling @bdarcus, does anything in the above look problematic to you? |
I think the + in that first key may be invalid? ❯ bibcop /tmp/test.bib
It is impossible to parse the .bib file, because I do not know what to do with '+' at line no.0 (s=tag) What happens if you change it? As a general rule, it's often the case when something unexpected like this, there's an issue with the input file. |
Thanks, Bruce! The issue persists when I delete the @book{A,
title = {A},
author = {Anderson, Anthony},
year = {2000}
}
@book{B,
title = {B},
author = {Baker, Bessie},
year = {2001}
} |
Seems pretty likely there's something wrong on your local system. I note that you don't really configure Embark, but I doubt that would matter in this case. Maybe try rebuilding your packages?? PS - there's a little test script in the repo |
Describe the bug
I set up citar with embark. All actions work, but
citar-open-entry
is called with a spurious citekey.To Reproduce
Steps to reproduce the behavior:
[cite:@NW06]
and citar knows about it: hovering over it gives me the full citation. My cursor is on the “N”, but the result is the same if it is on thecite:
part.)embark-act
, either explicitly or through C-c C-o.e
to callcitar-open-entry
.Expected behavior
I would expect
citar-open-entry
to be called with the argument"NW06"
. Instead, it gets called with the first reference in my bib file,"AAA+18"
.Screenshots
Note that embark is aware of the correct citar-key,
NW06
.Emacs version: 29.1. I installed citar and embark using straight, so I’m up to date with their respective
main
/master
branches.Additional context
To better understand this issue, I set
citar-open-entry-function
to a function that prints its argument, which indeed gets called with the argumentAAAI+18
. I also verified that running(citar-open-entry "NW06")
would indeed open the entry for NW06. What I am most confused by is that the other options inembark-act
(say,r
forcitar-copy-reference
) receive the correct reference when selected.The text was updated successfully, but these errors were encountered: