emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Drag images from Firefox to org-mode


From: Rick Frankel
Subject: Re: [O] Drag images from Firefox to org-mode
Date: Fri, 18 Oct 2013 16:45:53 -0400
User-agent: Mutt/1.5.21+155 (d3096e8796e7) (2012-12-30)

On Fri, Oct 18, 2013 at 09:22:17PM +0200, Oleh wrote:
>    Thanks, Rick and Nico, I've merged the code.
>    All except the last bit from Rick: I can't think of any sensible
>    way to enter an image URL except pasting it.
>    And since link will be in the clipboard at some point, why not use
>    it straight away without prompting.
>    Maybe URL can be prompted for when called with a prefix arg,
>    but I don't know how to do that yet.

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.

rick







reply via email to

[Prev in Thread] Current Thread [Next in Thread]