From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo de Moraes Serpa Subject: Re: Extending paste to auto-archive a copied image Date: Fri, 11 Feb 2011 13:57:34 -0600 Message-ID: References: <87sjvuvlhx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=52052 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pnz7Z-00068L-05 for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 14:57:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pnz7X-0000Jx-Pb for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 14:57:36 -0500 Received: from mail-iy0-f169.google.com ([209.85.210.169]:46662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pnz7X-0000Jm-Cx for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 14:57:35 -0500 Received: by iyi20 with SMTP id 20so3014074iyi.0 for ; Fri, 11 Feb 2011 11:57:34 -0800 (PST) In-Reply-To: <87sjvuvlhx.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: Org Mode Hi Bastien, Let's say I copy a file from my desktop. If I copy it (C-c) and then yank into emacs, the filename is pasted. Now, if I drag and drop it into an emacs buffer, emacs inserts the contents of the file. These two scenarios sum up something I think would be an awesome addition to org, if only we could handle them differently. For example, when taking notes in org, I often have different reference sources open (web pages, word documents, pdfs etc), and would like to insert images. I can already do that manually, and emacs will even render them. But it takes too much time, and gets me out of my productive zone. What I am suggesting is, somehow hook into the moment the file is pasted/dragged and run some code. This code would get a reference to the file/contents of the file, save it in a org data directory and return a URL to it, which would then be pasted in the document like a regular link, and then iimage-mode would come into action and render it. Thanks, Marcelo. On Fri, Feb 11, 2011 at 5:50 AM, Bastien wrot= e: > Hi Marcelo, > > Marcelo de Moraes Serpa writes: > >> So, I'm usign an emacs extension that renders links to image as the >> image itself, it's a minor mode called iimage.el. It works great, but >> the fact that I need to copy the image somewhere first is a time and >> flow - killer. Is it possible to hook up to the paste command and, if >> it's a image in the clipboard, auto-archive somewhere in the >> filesystem it and then return its URL? > > Sorry I don't understand. =A0Can you give an example? =A0When you say > "paste", is it pasting from X or from Emacs? > > Thanks, > > -- > =A0Bastien >