From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo de Moraes Serpa Subject: Re: [Orgmode] Automatic screenshot insertion Date: Sun, 15 Jan 2012 13:31:02 -0600 Message-ID: References: <87ehveyck1.fsf@iro.umontreal.ca> <87fwfoohn6.fsf@ucl.ac.uk> <87obucaanw.fsf@iro.umontreal.ca> <87wr90c4u0.fsf@ucl.ac.uk> <87y5tf622q.fsf@iro.umontreal.ca> <87lipfzgiz.fsf@ucl.ac.uk> <87ty43fjdw.fsf@iro.umontreal.ca> <871ur23r32.fsf@iro.umontreal.ca> <20120115121048.GH3129@x201> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0015173fed70680aec04b6962308 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmVnH-0002eD-Lc for emacs-orgmode@gnu.org; Sun, 15 Jan 2012 14:31:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmVnE-0003lP-L6 for emacs-orgmode@gnu.org; Sun, 15 Jan 2012 14:31:07 -0500 Received: from mail-bk0-f41.google.com ([209.85.214.41]:59237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmVnE-0003lE-6r for emacs-orgmode@gnu.org; Sun, 15 Jan 2012 14:31:04 -0500 Received: by bkuw5 with SMTP id w5so4288191bku.0 for ; Sun, 15 Jan 2012 11:31:02 -0800 (PST) In-Reply-To: <20120115121048.GH3129@x201> 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: emacs-orgmode@gnu.org --0015173fed70680aec04b6962308 Content-Type: text/plain; charset=ISO-8859-1 Awesome! I will try that out. What about hooking into the pasting event and check when it's an image (or whatever file you want) ? Thanks, - Marcelo. On Sun, Jan 15, 2012 at 6:10 AM, Russell Adams wrote: > On Sun, Jan 15, 2012 at 12:37:16AM -0600, Marcelo de Moraes Serpa wrote: > > A bit OT, but related. > > > > --- > > It would be *awesome* if we could somehow hook into the emacs > > paste/(drag-and)drop events and automatically "paste" or "drop" the image > > in an org buffer. I don't know if it's possible, but I imagine that if > > hooking into those events was somehow possible, then we could get the > > "event handle" with information regarding the file, and automatically > > insert a link to it, and if iimage is activated, it would then render the > > image. It would be freaking awesome, this is the only thing I miss from > > Evernote. > > --- > > > > - Marcelo. > > Emacs has drag'n'drop support. In fact, I've been able to drag and > drop image files from KDE's file manager (dolphin?) into emacs and make > them custom links. > > .emacs: > (defun dnd-from-kde (url action) > (insert url) > (select-frame-set-input-focus (selected-frame))) > > (custom-set-variables > '(dnd-protocol-alist (quote (("file:///" . dnd-from-kde))))) > > This ought to give you a place to start. The URL format may need to > change to make it an Org link, I was using file:// for another text > format. > > > > ------------------------------------------------------------------ > Russell Adams RLAdams@AdamsInfoServ.com > > PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ > > Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 > > --0015173fed70680aec04b6962308 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Awesome! I will try that out.=A0

What about hooking into= the pasting event and check when it's an image (or whatever file you w= ant) ?

Thanks,

- Marcelo.=

On Sun, Jan 15, 2012 at 6:10 AM, Russell Ada= ms <RLAda= ms@adamsinfoserv.com> wrote:
On Sun, Jan 15, 2012 at 12:37:16AM -0600, Marcelo de Mora= es Serpa wrote:
> A bit OT, but related.
>
> ---
> It would be *awesome* if we could somehow hook into the emacs
> paste/(drag-and)drop events and automatically "paste" or &qu= ot;drop" the image
> in an org buffer. I don't know if it's possible, but I imagine= that if
> hooking into those events was somehow possible, then we could get the<= br> > "event handle" with information regarding the file, and auto= matically
> insert a link to it, and if iimage is activated, it would then render = the
> image. It would be freaking awesome, this is the only thing I miss fro= m
> Evernote.
> ---
>
> - Marcelo.

Emacs has drag'n'drop support. In fact, I've been able to= drag and
drop image files from KDE's file manager (dolphin?) into emacs and make=
them custom links.

.emacs:
(defun dnd-from-kde (url action)
=A0(insert url)
=A0(select-frame-set-input-focus (selected-frame)))

(custom-set-variables
=A0 '(dnd-protocol-alist (quote (("file:///" . dnd-from-kde)= ))))

This ought to give you a place to start. The URL format may need to
change to make it an Org link, I was using file:// for another text
format.



------------------------------------------------------------------
Russell Adams =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0RLAdam= s@AdamsInfoServ.com

PGP Key ID: =A0 =A0 0x1160DCB3 =A0 =A0 =A0 =A0 =A0 http://www.adamsinfoserv.com/

Fingerprint: =A0 =A01723 D8CA 4280 1EC9 557F =A066E8 1154 E018 1160 DCB3

--0015173fed70680aec04b6962308--