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

Error enabling org-bib-mode #8

Open
artelse opened this issue Sep 29, 2022 · 27 comments
Open

Error enabling org-bib-mode #8

artelse opened this issue Sep 29, 2022 · 27 comments

Comments

@artelse
Copy link

artelse commented Sep 29, 2022

Great progress on this package! However when I enable org-bib-mode on the bibliography.org file, I get this error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  menu-bar-update-yank-menu(nil nil)
  kill-new(nil)
  org-bibtex-export-to-kill-ring()
  org-bib--preview(t t)
  org-bib-view-preview()
  org-bib-view()
  org-bib-activate()
  org-bib-mode(toggle)
  funcall-interactively(org-bib-mode toggle)

BTW, I have been learning some elisp and have been doing some work on adding ISBN support in pdf-drop-mode because I mostly work with book references. Progress is slow due to getting to know the elisp environment.

@rougier
Copy link
Owner

rougier commented Oct 10, 2022

Thanks for the report. I'm not quite sure to understand why org-bibtex-export-to-kill-ring is called when entering org-bib-mode. Do you have any idea? Something you did just before?

ISBN support would be great and I can try to help. Where do you get the information from for ISBN?

@artelse
Copy link
Author

artelse commented Oct 10, 2022

Will check. I pushed an ISBN branch on pdf-drop-mode. This is very WIP, first elisp code I've written, so I might do things in a not very lispy way ;) It mainly checks the validity of the ISBN code that is pulled from the first pages of the file like the existing DOI code.
ISBN meta-data can be pulled from various online sources with varying results. org-ref uses a German ebook site that directly outputs bibtex for example.

@rougier
Copy link
Owner

rougier commented Oct 17, 2022

Did you made a pull request or is it only in your repo ?

@artelse
Copy link
Author

artelse commented Oct 18, 2022

Only in my repo, am unsure of the quality so far because it has lots of debugging info still in and so on. But I would appreciate some feedback.

@rougier
Copy link
Owner

rougier commented Nov 28, 2022

Sorry for late answer. Can you point me to the relevant code in your repo?

@artelse
Copy link
Author

artelse commented Nov 28, 2022

Haven't had time to work on it any further, but changes here:
artelse/pdf-drop-mode@rougier:pdf-drop-mode:master...isbn

@rougier
Copy link
Owner

rougier commented Dec 5, 2022

Thanks. I don't have much time right now to integrate it. Will try early next year.

@artelse
Copy link
Author

artelse commented Dec 5, 2022

Ok, academic end of year craze here as well, see you next year.

@rougier
Copy link
Owner

rougier commented Jan 5, 2023

I've code a dedicated library for manipulating identifiers: https://github.com/rougier/emacs-persid

@artelse
Copy link
Author

artelse commented Jan 6, 2023

Great to abstract this out into its own package!
Finding a good ISBN db with consistent data is quite hard and in a way also perplexing. I mostly deal with books, so will need to find a good source. Will investigate allowing time.

@rougier
Copy link
Owner

rougier commented Jan 6, 2023

That would be great. So far I've found this resource: Free and Paid APIs to access books information via ISBN

@artelse
Copy link
Author

artelse commented Jan 6, 2023

Have you looked at Kitchin's ISBN sources here:
https://github.com/jkitchin/org-ref/blob/f2ebc18c36c106e94810d5a1b15b108811a87283/org-ref-isbn.el
Especially www.ebook.de looked promising.

@rougier
Copy link
Owner

rougier commented Jan 6, 2023

No, I need to try. But it seems each ISBN database is relatively small and I'm surprised there's no definitve database that collect everything.

@artelse
Copy link
Author

artelse commented Jan 6, 2023

Indeed and also surprising data for the author(s) for example is never consistent. I like to file books on surname, first name for example, but those are mostly not stored separately. Wikipedia, archive.org or some other non-profit org should be involved in such an endeavor as a public service.

@artelse
Copy link
Author

artelse commented Jan 6, 2023

Lars Ingebrigtsen ran into the same problem with incomplete ISBN dbs writing about it here.
Here is some code he wrote to query three different sources.

@orgtre
Copy link

orgtre commented Feb 12, 2023

Thanks for the report. I'm not quite sure to understand why org-bibtex-export-to-kill-ring is called when entering org-bib-mode. Do you have any idea? Something you did just before?

ISBN support would be great and I can try to help. Where do you get the information from for ISBN?

Hi, I also ran into this error when trying out this interesting package (was working on something similar, but given that this exists I don't know if that's still necessary...). When you start out with the minimal document as described in the README, and enable org-bib-mode it tries to create a preview of the "Unsorted" entry and fails with this error. As soon as you have at least one entry with a BTYPE property the error disappears.

@rougier
Copy link
Owner

rougier commented Feb 14, 2023

@orgtre Can you open an issue for that ?
@artelse I've started to collect various packages for retrieving bibtex from identifiers here

@orgtre
Copy link

orgtre commented Feb 14, 2023

Can you open an issue for that ?

I'm getting the same error as in artelse's initial post, and the cause seems to be the same too (preview generation fails when no entry with BTYPE property). Do you still want a separate issue?

@rougier
Copy link
Owner

rougier commented Feb 27, 2023

@orgtre do you have a minimal org-file that show the problem such that I can experiment on my side?

@orgtre
Copy link

orgtre commented Feb 27, 2023

Sure, I just created a minimal document exactly as in the block of the configuration section but with paths adjusted to my system and then the error happens when enabling org-bib-mode.

@rougier
Copy link
Owner

rougier commented Mar 17, 2023

Sorry for delay. Which version are you using?

@orgtre
Copy link

orgtre commented Mar 17, 2023

Do you mean you cannot reproduce this? I'm using org-bib-mode version 0.4.0 (latest commit).

@rougier
Copy link
Owner

rougier commented Mar 27, 2023

I think I got it. I've change the internal format of the org file to take advantage of org-bibtex. For example, here is an example of the new format, can you check if this is working?

#+STARTUP: hideblocks
#+LIBRARY-PATH: ~/Documents/Papers/
#+LIBRARY-FILE: ~/Documents/Papers/papers.bib

*Literate & Annotated bibliography* — Nicolas P. Rougier

* Unsorted :UNSORTED:

** Prefrontal feature representations drive memory recall (2022)
:PROPERTIES:
:TITLE:    Prefrontal feature representations drive memory recall
:BTYPE:    article
:CUSTOM_ID: Yadav:2022
:ISSN:     1476-4687
:URL:      http://dx.doi.org/10.1038/s41586-022-04936-2
:DOI:      10.1038/s41586-022-04936-2
:JOURNAL:  Nature
:PUBLISHER: Springer Science and Business Media LLC
:AUTHOR:   Yadav, Nakul and Noble, Chelsea and Niemeyer, James E. and Terceros, Andrea and Victor, Jonathan and Liston, Conor and Rajasethupathy, Priyamvada
:YEAR:     2022
:MONTH:    Jul
:FILENAME: ~/Documents/Papers/2022 - Prefrontal feature representations drive memory recall.pdf
:STATUS:   READ
:ENTERED:  2022-07-16T20:08:55+0200
:END:

*** Abstract
:PROPERTIES:
:CUSTOM_ID: Yadav:2022:abstract
:END:

Memory formation involves binding of contextual features into a unitary representation, whereas memory recall can occur using partial combinations of these contextual features. The neural basis underlying the relationship between a contextual memory and its constituent features is not well understood; in particular, where features are represented in the brain and how they drive recall. Here, to gain insight into this question, we developed a behavioural task in which mice use features to recall an associated contextual memory. We performed longitudinal imaging in hippocampus as mice performed this task and identified robust representations of global context but not of individual features. To identify putative brain regions that provide feature inputs to hippocampus, we inhibited cortical afferents while imaging hippocampus during behaviour. We found that whereas inhibition of entorhinal cortex led to broad silencing of hippocampus, inhibition of prefrontal anterior cingulate led to a highly specific silencing of context neurons and deficits in feature-based recall. We next developed a preparation for simultaneous imaging of anterior cingulate and hippocampus during behaviour, which revealed robust population-level representation of features in anterior cingulate, that lag hippocampus context representations during training but dynamically reorganize to lead and target recruitment of context ensembles in hippocampus during recall. Together, we provide the first mechanistic insights into where contextual features are represented in the brain, how they emerge, and how they access long-range episodic representations to drive memory recall.

*** Notes
:PROPERTIES:
:CUSTOM_ID: Yadav:2022:notes
:END:

@artelse
Copy link
Author

artelse commented Mar 28, 2023

Reinstalled org-bib, dependencies and above example. It now accepts a dropped pdf article and adds it to the list to be viewed in the side menu. Further, the keys also work fine for quick viewing of the note, abstract, pdf, url, etc. As you state in the code, the file format could be made a configurable option. Now as my main interest is books with ISBN numbers (..), it would be great if we could make that work as well as a dropper. I love the annotated format that can be exported to a regular .bib file. Have you played with transients yet, could be a cool addition.

@rougier
Copy link
Owner

rougier commented Apr 3, 2023

Problem with ISBN is that we do not have a reliable solution to find them. What is transient doing exactly?

@artelse
Copy link
Author

artelse commented Apr 3, 2023

A transient is a temporary minibuffer popup displaying relevant commands with keybindings which is very helpful from a UI/UX pov imo. Tarsius developed it for Magit, but has become a separate package Docs seem a bit confusing, but here are a few good examples on its simple usage.
To make ISBN metadata retrieval useful, I'm afraid we need a heuristic probing different sources.

@rougier
Copy link
Owner

rougier commented Apr 3, 2023

Good starting point would be https://github.com/rougier/emacs-persid. I'm not talking about my code but the various similar initiative I've collected in the README. A good test would be to choose arbitrarily a few ISBNs and check where can get the bib info.

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

3 participants