joostkremers / ebib

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

How to add hidden fields? #282

Closed fountainer closed 7 months ago

fountainer commented 9 months ago

I want to hide some fields, e.g, volume, number, pages, notes. I tried the following code.

  (push "volume" ebib-hidden-fields)

However, the volume filed is still in the entry buffer. How should I use the ebib-hidden-fields?

joostkremers commented 9 months ago

The code should work, but I suspect you don't see its effect because it's executed too early. Wrapping it inside a with-eval-after-load should do the trick:

(with-eval-after-load 'ebib
  (push "volume" ebib-hidden-fields))
fountainer commented 9 months ago

I put the (push "volume" ebib-hidden-fields) in the :config section in use-package. It does not work. I also try the code

(with-eval-after-load 'ebib
  (push "volume" ebib-hidden-fields))

The issue still exists. I checked the value of ebib-hidden-fields

("volume" "addendum" "afterword" "annotator" "archiveprefix" "bookauthor" "booksubtitle" "booktitleaddon" "chapter" "commentator" "edition" "editora" "editorb" "editorc" "eid" "eprint" "eprintclass" "eprinttype" "eventdate" "eventtitle" "foreword" "holder" "howpublished" "introduction" "isbn" "isrn" "issn" "issue" "issuesubtitle" "issuetitle" "issuetitleaddon" "journaltitleadddon" "journalsubtitle" "language" "location" "mainsubtitle" "maintitle" "maintitleaddon" "month" "origlanguage" "pagetotal" "part" "primaryclass" "remark" "subtitle" "timestamp" "titleaddon" "translator" "urldate" "venue" "version" "volumes")
joostkremers commented 9 months ago

Note that hidden fields are still shown when they have a value. There is currently no mechanism to hide fields when they have a value.