Chobbes / org-chef

A package for making a cookbook and managing recipes with org-mode.
MIT License
327 stars 33 forks source link

Simplify org-chef-insert-recipe function #7

Closed egh closed 5 years ago

egh commented 6 years ago

By using insert rather than org-chef-recipe-insert-org this avoids interaction with any customizations in the org buffer.

It also fixes a bug where the user would be asked for a URL twice.

Chobbes commented 6 years ago

What do you mean by:

this avoids interaction with any customizations in the org buffer

I suspect you're right about this, but this sounds like something I would like to know about for future reference!

Thanks for the pull request. I'm going to test it now, and merge it shortly if it looks good!

egh commented 6 years ago

@Chobbes I'm not sure exactly why this happens in my setup, but when I run M-x org-chef-insert-recipe it asks me for the url twice, and then I get the error (from the *Messages* buffer)

Contacting host: www.seriouseats.com:443
No completion found [9 times]
org-cycle-list-bullet: Not at an item
Matching input is required

It looks like company is trying to complete something? company

With my patch, there is no error.

Thanks for the project! It works great.

For the record, I wrote some code a long time ago to do some unit conversion for recipes if you ever find a need: https://gitlab.com/egh/org-cook/tree/master

Chobbes commented 6 years ago

Gotcha! You're totally right about this (and also the double asking thing). Another thing is it just completely doesn't work when org-mode isn't enabled.

I've been checking this out (sorry for the delay --- I have been out of town), and the one problem that I have with this fix is that it doesn't respect headings.

I've attempted to modify your change to use org-paste-subtree, instead of insert, but that function seems to be filled with LIES. Supposedly you can provide a subtree as an argument so it doesn't use the kill ring, but that doesn't seem to be working for me. Hmmmm.

egh commented 5 years ago

I honestly can't remember what problem I was trying to solve here. I will close the ticket and re-open if I encounter the issue.