From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: Re: Drag images from Firefox to org-mode Date: Wed, 23 Oct 2013 22:01:29 +0200 Message-ID: References: <87eh7irjvi.fsf@yahoo.fr> <52610C29.3000505@yahoo.fr> <526114B4.6060303@yahoo.fr> <2d5635af9ad6d51badb40e1e19c85572@mail.rickster.com> <87y55qpp44.fsf@yahoo.fr> <857b1a922e24dda4404df4d19fabd7e2@mail.rickster.com> <20131018204553.GA87254@BigDog.local> <87k3h7ptcc.fsf@yahoo.fr> <23f3f3530f88fa5571d80b8c38adf4c6@mail.rickster.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZ4cX-0006LU-CT for emacs-orgmode@gnu.org; Wed, 23 Oct 2013 16:01:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZ4cV-000727-79 for emacs-orgmode@gnu.org; Wed, 23 Oct 2013 16:01:33 -0400 Received: from mail-ea0-x22c.google.com ([2a00:1450:4013:c01::22c]:65149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZ4cU-00071l-Tn for emacs-orgmode@gnu.org; Wed, 23 Oct 2013 16:01:31 -0400 Received: by mail-ea0-f172.google.com with SMTP id r16so708919ead.3 for ; Wed, 23 Oct 2013 13:01:30 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Oleh Cc: Nicolas Richard , Rick Frankel , org mode Hi, I have to correct myself, I could use the link created by thunderbird drag and drop. I simply missed to put the link into quotes. This works, thunderbird will open the message in a new view. thunderbird -mails "imap://user.name%2Borganisation.com@mailsystem.organisation.com:993/fetch>UID>/INBOX>1274" However, the drawback with this, the url is rather fragile. It relies on the folder and a simple number. I am not sure how much one could rely that this number is always the same. Maybe imap or thunderbird compress the list of emails by time effectively renumbering each email in a folder. Furthermore, if I move the mail to another folder my org-mode link would be broken too. Thunderlink (a thunderbird plugin), instead is able to fetch the message-id, which is unique and independent on the mail position. If there is an interest to extend the drag and drop to emails, I could ask the developer of thunderlink if there is a way to change the drag and drop url to the message-id e.g. with the help of his plugin. Thunderlink itself works already quite well with org-mode. The newest version on git-hub allows to create direct org-mode links which one could simply copy and paste from the clipboard. Guess only a small amount of work would be needed to make it drag and drop ready too. One could also think of saving the email as plain text in the org-mode folder and create a link to that. However, I frighten this would require more work. One idea would be to fetch the email by the message id from the imap server from within emacs. But I guess this would create a large amount of dependencies to make this working. Greetings Torsten On 23 October 2013 20:59, Torsten Wagner wrote: > Hi, > > just wonder if we can drag-and-drop images into org-mode could we > drag-and drop emails from e.g. thunderbird too. There is a plugin for > thunderbird call thunderlink which allows to generate org-mode > readable links. > However, drag and drop an email in a browser gives a address which looks like: > > imap://user.name%2Borganisation.com@mailsystem.organisation.com:993/fetch>UID>/INBOX>1274 > > I tried to use this address to call it with thunderbird > via > thunderbird -mail but it failed. > with > permission denied: /INBOX > > I guess it would be very attractive for many users if they could > create links to there email program by drag-and drop. > > Just an idea > > Torsten > > > On 23 October 2013 20:26, Oleh wrote: >> On Wed, Oct 23, 2013 at 7:13 PM, Rick Frankel wrote: >>> On 2013-10-20 16:42, Nicolas Richard wrote: >>>> >>>> Oleh writes: >>>> This can be fixed with a platform-aware function that checks both the >>>> clipboard and the cut-buffer. >>>> >>>> I suggest to ask for a string with (read-string "URL: " nil nil default), >>>> offering the content of the clipboard/kill ring/selections as the DEFAULT. >>>> I think it's better to be explicit when downloading content, and there >>>> isn't much overhead in asking for a confirmation. >>> >>> >>> Agreed. Downloading stuff to your local machine should require a >>> confirmation step. >> >> This is already in place. >> >>> >>>> This can be fixed by adding `org-download-max-filename-length`. When >>>> it >>>> overflows, just resort to `default-directory' and provide a >>>> message/option to fix. >>>> >>>> I suggest that the right place for those files is as attachment, and >>>> that's where customization should happen. The function choosing the >>>> right place (i.e. org-download--dir) could be turned into a defvar or >>>> defcustom which could then be set either to #'org-download--dir or >>>> #'org-attach-dir. >>> >>> >>> Agreed. Also, the current "fix" (two variable and three functions!) is >>> overly complex. >> Two variables can change independently in a meaningful way, giving >> 4 combinations with the possibility to alter just part of the setup on a file >> local basis. Three functions specify the intent more clearly. >> >>> I propose that their be three options in the >>> defcustom: >>> - 'org-attach-directory (the default) >>> - user entered string >> I don't get this one. >> >>> - a function (which could be set to `org-download-dir') >> This can be an option for `org-download-method' >> >>> >>> >>>> By the way, which system doesn't allow for spaces in directory names? >>>> >>>> ISTR that MSDOS (except the latest versions) didn't allow spaces in >>>> filenames :) Anyway, I tend to avoid spaces as much as I can in >>>> filenames (including dirs) >>> >>> >>> Also, sending files to external command/shell script for processing >>> often breaks if you have spaces in paths due to quoting issue. >>> >>> >>>> 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. >>>> This isn't an option for users with no elisp skills. >>>> >>>> It is an option if there are enough examples/built-ins that can be used. >>>> e.g. message-send-mail-function can be customized in this way, its >>>> docstring gives a list of meaningful values. >>> >>> >>> Agreed. >> >> There's still two functionality bits that I want to add: >> local files and forwarding to default dnd handlers in the case it's >> not an image. >> But that can be added in later. >> Please make the changes that you think are necessary and commit to org. >> >> regards, >> Oleh >>