Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functionality to copy wine #40

Open
d12frosted opened this issue Jan 15, 2021 · 1 comment
Open

Functionality to copy wine #40

d12frosted opened this issue Jan 15, 2021 · 1 comment

Comments

@d12frosted
Copy link
Owner

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))))
@d12frosted d12frosted added this to the v0.1 milestone Jan 15, 2021
@d12frosted
Copy link
Owner Author

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.

@d12frosted d12frosted removed this from the v0.1 milestone Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant