rexim / org-cliplink

Insert org-mode links from clipboard
323 stars 11 forks source link

Using ~org-cliplink-retrieve-title-synchronously~ on a directory causes the directory to open in dired #105

Closed GuiltyDolphin closed 6 years ago

GuiltyDolphin commented 6 years ago

For example, running (org-cliplink-retrieve-title-synchronously "file:~/org") (where~/org is a directory) causes a Dired buffer to open, as well as a "Response buffer is nil!" message to be printed to the minibuffer.

rexim commented 6 years ago

@GuiltyDolphin thanks for reporting the problem! Could you please provide more details on what you expected from the function in this situation? Thanks!

GuiltyDolphin commented 6 years ago

@rexim org-cliplink-retrieve-title-synchronously isn't an interactive command, so using it in Lisp to retrieve the title I wouldn't expect it to modify the user's current buffers/windows (or use message).

I would expect such a function to return either a string (when a title has been retrieved successfully), or nil (or a richer 'error' type) if the title could not be retrieved. It gets very confusing when dired buffers start popping up all over the place because a file path happened to be passed to the function.

rexim commented 6 years ago

@GuiltyDolphin sounds reasonable. Thanks for such a detailed response! I'll try to find some time this week to fix the issue. If this problem is urgent feel free to submit a PR yourself. I will be happy to review and merge. Thanks!

rexim commented 6 years ago

@GuiltyDolphin should be fixed by ef5e27c31e7acf593eb8e480bd52ea241099e12b. Please close the ticket if the problem is fixed. Thanks!

rexim commented 6 years ago

@GuiltyDolphin it's been a week. So I'm gonna assume that the problem is fixed for you.

GuiltyDolphin commented 6 years ago

@rexim This is fixed on my end, thank you! Apologies for not getting back to you sooner.