|
From: | Oleh |
Subject: | Re: [O] Drag images from Firefox to org-mode |
Date: | Sat, 19 Oct 2013 12:34:14 +0200 |
I strongly disagree, for a couple of reasons:
- Esp. on non-unix systems, the contents of the cut-buffer are not
necessarily the same as the contents of the system clipboard. This
is the problem I was having w/ your code on windows, where the
cut-buffer contained the value of the current (or possibly last)
selection, but the clipboard had a url.
- It is certainly possible to type in a url
- You might want to DND a url from another buffer.
- It is ergonomically wrong for an interactive function defined to
take an argument (and called "download-image") to automagically use a
value from somewhere else and not actually take an argument.
It would however, make sense for the function to use the current
clipboard contents if called with a prefix.
In the same vein, I was thinking about the automagically creating a
subdirectory based on a top level heading. This is also wrong for a
couple reasons:
- Creating a potentially =very long directory name with spaces= can
cause multiple problems, both on unix and esp. non-unix systems,
where spaces may not be allowed in directory names, or there may be
limits on filename/directory length.
- The use of the top-level heading is arbitrary and may have nothing
to do with the current context (for instance, i sometimes group
together multiple documents to be output w/ export subtree in the
same master document)
The default should be to save it in the same directory as the document
(which by the way, may not be in emacs's idea of the current
directory). Also, the filename should not be expanded to an absolute
path, which makes the document non-portable and will break publishing.
If you want the ability to create arbitrary output directories based
on document context, the customization can be made to accept a
function (lambda) as a value, which could then return a directory
prefix.
While i realize the current implementation meets your needs, if the
code is to be included in the org-mode distribution it should follow
emacs and org conventions and not contains any suprises.
I would be glad to make the above changes on tuesday when i get back
to the office. Please send me (again) the url of the github repos with
the current set of changes and I will update it so that it will allow
the current functionality but have less magical default behavior.
[Prev in Thread] | Current Thread | [Next in Thread] |