joostkremers / ebib

A BibTeX database manager for Emacs.
https://joostkremers.github.io/ebib/
BSD 3-Clause "New" or "Revised" License
275 stars 37 forks source link

Missplaced field in detail view #176

Closed oatmealm closed 3 years ago

oatmealm commented 4 years ago

Look like there's an additional "journal" and "month" field showing up in detail view for a "incollection" item with a crossref field. The fields are not in the corresponding bibtex records in the bib file itself. Also, the field "journal" actually had content "Taylor & Francis" which I've manually deleted. What's worrying though is that ebib is showing content that's not physically in the correponding .bib file.

Note: I've tried switching between Book/InCollection and Book/InBook etc... it stays the same.

@book{Simon2019,
    year = {2019},
    publisher = {Routledge},
    url = {https://archives.jdc.org/new-book-the-jews-of-the-middle-east-and-north-africa-the-impact-of-world-war-ii/},
    timestamp = {Mon Aug 31 19:36:24 2020},
    author = {Simon, Reeva Spector},
    title = {The Jews of the Middle East and North Africa: The Impact of World War II},
    language = {en-US},
    keywords = {10311, צפון אפריקה, מלה"ע ה-2},
    abstract = {How the war affected the Jews in the Middle East and North Africa, from Morocco to Turkey}
}

gnome-shell-screenshot-EJRVP0

@incollection{Simon2019-14,
    file = {Simon2019-14.pdf},
    crossref = {Simon2019},
    timestamp = {Mon Aug 31 19:42:25 2020},
    author = {Simon, Reeva Spector},
    title = {Labor camps and refugees in Morocco},
    booktitle = {The Jews of the Middle East and North Africa},
    pages = {200--218},
    year = {2019},
    publisher = {Routledge},
    language = {en-US},
    doi = {10.4324/9780429276248-15},
    abstract = {Although Morocco did not see heavy fighting, Jews in those areas under Vichy control experienced unemployment, student quotas, rationing,}
}

gnome-shell-screenshot-GYGBQ0

joostkremers commented 4 years ago

Have you tried saving and then reloading the file? When you delete the contents of a field, Ebib doesn't actually remove the field from the entry in memory, it just deletes the field contents. When you save the .bib file, empty fields aren't saved, so when you reopen the file, the fields are gone.

Normally, you won't notice this, because all predefined fields are displayed anyway, regardless of whether they have a value or not. But with fields that are not predefined for a particular entry type, they are still shown at the bottom of the entry buffer.

It doesn't hurt, but it's bad UI design, I agree. Don't ask me why I implemented it that way, because I don't remember and it doesn't seem to make much sense now. :-) I'll try to fix it when I find some time.

joostkremers commented 3 years ago

I just pushed a commit that should fix this issue. Let me know if you still run into problems.