Skip to content

Commit 5e98b9b

Browse files
committed
Add in simple knob to update ebib index on reading list updates
1 parent f0f65cc commit 5e98b9b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ebib-reading-list.el

+11
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ functions, especially `ebib-get-field-value' and
166166
:group 'ebib-reading-list
167167
:type 'hook)
168168

169+
(defcustom ebib-reading-list-update-index nil
170+
"Whether or not index is updated on reading list changes."
171+
:group 'ebib-reading-list
172+
:type 'boolean)
173+
169174
(defun ebib--reading-list-buffer ()
170175
"Return the buffer containing the reading list.
171176
If the file has not been opened yet, open it, creating it if
@@ -208,6 +213,9 @@ return nil."
208213
(insert (ebib--reading-list-fill-template key db))
209214
(run-hooks 'ebib-reading-list-new-item-hook)
210215
(save-buffer)
216+
(when ebib-reading-list-update-index
217+
(ebib-db-set-current-entry-key (ebib--get-key-at-point) ebib--cur-db)
218+
(ebib--update-index-buffer))
211219
key)))
212220

213221
(defun ebib--reading-list-remove-item (key)
@@ -221,6 +229,9 @@ do nothing and return nil."
221229
(funcall ebib-reading-list-remove-item-function)
222230
(run-hooks 'ebib-reading-list-remove-item-hook)
223231
(save-buffer)
232+
(when ebib-reading-list-update-index
233+
(ebib-db-set-current-entry-key (ebib--get-key-at-point) ebib--cur-db)
234+
(ebib--update-index-buffer))
224235
key))))
225236

226237
(defun ebib--reading-list-fill-template (key db)

0 commit comments

Comments
 (0)