Skip to content

Commit

Permalink
emacs:vino: function to set price
Browse files Browse the repository at this point in the history
  • Loading branch information
d12frosted committed Dec 26, 2024
1 parent ffad734 commit e66269e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions emacs/lisp/lib-vino.el
Original file line number Diff line number Diff line change
Expand Up @@ -967,5 +967,21 @@ Assumptions:
;; done
result))

;;;###autoload;
(defun vino-set-price ()
"Interactively set price for a wine at point."
(interactive)
(let* ((note (vino-entry-note-get-dwim))
(price-new (read-string "Price: "))
(price-old (vulpea-note-meta-get note "price")))
(unless (string-equal price-new price-old)
(when price-old
(vulpea-buffer-meta-set
"price private"
(-uniq (cons price-old (vulpea-note-meta-get-list note "price private")))))
(vulpea-buffer-meta-set "price" price-new)
(vulpea-buffer-meta-set "price date" (format-time-string "%F"))
(vulpea-buffer-meta-sort vino-entry-meta-props-order))))

(provide 'lib-vino)
;;; lib-vino.el ends here

0 comments on commit e66269e

Please sign in to comment.