d12frosted/vino

Functionality to copy wine

d12frosted opened this issue · 1 comments

Like it is done in +org-wine.el:

(defun wine/copy-wine ()
  "Create a new wine entry based on wine entry at point."
  (interactive)
  (wine-require-wine-entry)
  (let* ((winery (+org-entry-get "WINERY"))
         (name (+org-entry-get "NAME"))
         (region (+org-entry-get "REGION"))
         (appellation (+org-entry-get "APPELLATION"))
         (grapes (+org-entry-get "GRAPES"))
         (volume (+org-entry-get "VOLUME"))
         (colour (+org-entry-get "COLOUR"))
         (carbonation (+org-entry-get "CARBONATION"))
         (id (+brain-new-child wine-parent (cadr winery))))
    (org-with-point-at (org-id-find id t)
      (+org-entry-set "WINERY" winery)
      (+org-entry-set "NAME" name)
      (+org-entry-set "REGION" region)
      (+org-entry-set "APPELLATION" appellation)
      (+org-entry-set "GRAPES" grapes)
      (+org-entry-set "VOLUME" volume)
      (+org-entry-set "COLOUR" colour)
      (+org-entry-set "CARBONATION" carbonation)
      (+org-prompt-property "YEAR")
      (+org-prompt-number-property "SUGAR")
      (+org-prompt-number-property "ALCOHOL")
      (+org-prompt-property "PRICE")
      (while (wine--add-url (read-string "URL: ")))
      (when (y-or-n-p "Acquire? ")
        (call-interactively #'wine/acquire))
      (save-buffer)
      (wine-refresh-entry)
      (save-buffer))))

On the second though, I don't like how it worked in +org-wine.el. I would rather present a list of properties and user may choose what to change. Because the only value that doesn't change with vintage is producer (though maybe I just didn't find such wine yet). Few examples:

  • sweetness level changed from dry to semi-dry in La Stoppa Ageno 2017 (comparing to 2015)
  • appellation changes from Touraine AOC to VdF in Clos du Tue-Boeuf Le Petit Buisson 2019 (comparing to 2018)

So I am leaving this ticket as is, will just lower priority.