[Ebib-users] Multiline fields in Index Entry
Brought to you by:
joostkremers
From: Massimo L. <lau...@gm...> - 2010-04-07 14:33:39
|
Hi guy, I have an issue with ebib. I set up the Index Display Fields to show Year; Author; Title. Sometimes these fields are multiline (notice that i've no full control of all .bib files). This results in some entries to span several lines in the index buffer. This produces two bugs: - (minor) only one line of the entry is highlighted - (major) when I move up/down or using whatever keys trigger ebib-prev/next-entry, the prev/next entry is correctly shown in the Entry buffer, but the cursor only moves one line up/down. Since there are entries spanning more than one line, this completely disconnect position in the database with the cursor position in the index buffer. The following is a dirty hack workaround which print only the first line of a multiline field in the index entries. (defun ebib-display-entry (entry-key) "Displays ENTRY-KEY in the index buffer at POINT." (set-buffer ebib-index-buffer) (insert (format "%-30s %s\n" entry-key (if ebib-index-display-fields (let ((cur-entry-hash (ebib-retrieve-entry entry-key ebib-cur-db))) (mapconcat #'(lambda (field) (or (to-raw (let ( (str (gethash field cur-entry-hash)) ) (if (multiline-p str) (first-line str) str )) ) "")) ebib-index-display-fields "; ")) "")))) The correct solution maybe using something different that (forward-line -1/+1) in ebib-prev/next-entry: something like searching backward/forward for the first line beginning with the new displayed entry. Another less robust solution is to search backward/forward for a line beginning with a character, because all lines of fields displayed in the index buffer are indented. Thank you -- Massimo Lauria |