Skip to content

Commit

Permalink
Fix description toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceWarne committed Aug 16, 2024
1 parent 9a7bc33 commit 06727cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion finito-buffer.el
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ BOOK-ALIST is an alist of the format returned by `finito--create-book-alist'"
(finito-insert-started-reading writer .started-reading)))
((eq it 'last-read) (when .last-read
(finito-insert-last-read writer .last-read)))
((eq it 'description) (finito-insert-description writer .description))))))
((eq it 'description) (finito-insert-description writer .description))
((eq it 'review) (finito-insert-description writer .review))))))

(cl-defmethod finito-insert-title ((_ finito-book-writer) title)
"Insert TITLE into the current buffer."
Expand Down
8 changes: 5 additions & 3 deletions finito.el
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,11 @@ request is successful"
((_ _ from-year) (calendar-current-date -30)))
(cons (format "%s-01-01" from-year) (format "%s-%02d-%02d" year month day))))

(defun finito--set-show-attribute-for-collection (alist collection flag)
"Set show the attribute implied by ALIST to FLAG for COLLECTION."
(defun finito--set-show-attribute-for-collection (alist-sym alist collection flag)
"Set show the attribute implied by ALIST and ALIST-SYM to FLAG for COLLECTION."
(if (member collection (mapcar #'car alist))
(setf (cdr (assoc finito--collection alist)) flag)
(setq alist `((,collection . ,flag) . ,alist))))
(set alist-sym `((,collection . ,flag) . ,alist))))

(defun finito--init-summary-buffer (summary-alist)
"Create a summary buffer using data from SUMMARY-ALIST."
Expand Down Expand Up @@ -1038,6 +1038,7 @@ Example:
'equal))))
(cond ((bound-and-true-p finito--collection)
(finito--set-show-attribute-for-collection
'finito-show-description-alist
finito-show-description-alist
finito--collection
(not alist-val)))
Expand All @@ -1062,6 +1063,7 @@ Example:
'equal))))
(cond ((bound-and-true-p finito--collection)
(finito--set-show-attribute-for-collection
'finito-show-review-alist
finito-show-review-alist
finito--collection
(not alist-val)))
Expand Down

0 comments on commit 06727cb

Please sign in to comment.