From mboxrd@z Thu Jan 1 00:00:00 1970 From: "gregory mitchell" Subject: Re: Re: inline images Date: Mon, 6 Oct 2008 19:50:43 -0700 Message-ID: <170f0450810061950k6bbb5773nd1d1fcb024fd35a1@mail.gmail.com> References: <48E592E3.5040208@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kn2er-0004No-U9 for emacs-orgmode@gnu.org; Mon, 06 Oct 2008 22:50:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kn2eq-0004Nc-GS for emacs-orgmode@gnu.org; Mon, 06 Oct 2008 22:50:45 -0400 Received: from [199.232.76.173] (port=48001 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kn2eq-0004NZ-Dv for emacs-orgmode@gnu.org; Mon, 06 Oct 2008 22:50:44 -0400 Received: from el-out-1112.google.com ([209.85.162.178]:64576) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kn2eq-0000Te-Gl for emacs-orgmode@gnu.org; Mon, 06 Oct 2008 22:50:44 -0400 Received: by el-out-1112.google.com with SMTP id n30so668080elf.12 for ; Mon, 06 Oct 2008 19:50:43 -0700 (PDT) In-Reply-To: Content-Disposition: inline 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: emacs-orgmode@gnu.org Hey all, my first post to this list. This topic has been bugging me for some time also. The following is a snippet of elisp that can be used to take a file name in a buffer and paste the image file right below it. The image is inserted just as any other character, and can be moved, yanked, copied and/or pasted as such. This only works for png, but it's easy enough to modify for jpeg, etc as well. I often use this method in combination with various other things to generate postscript/pstricks/latex diagrams, etc, and view the results immediately. (global-set-key (kbd "C-S-p") 'insert-png-wrapper) (defun insert-png-wrapper () (interactive) (setq oldmark (mark)) ; save old mark (setq oldpoint (point)) ; and old point (beginning-of-line) (set-mark (point)) (end-of-line) (setq filename (buffer-substring (mark) (point))) ; copy line (newline 1) (clear-image-cache) ; images are cached until cleared (insert-image (create-image filename 'png)) ) If you load "eimp.el" as a minor mode, you can use the functions "eimp-increase-image-size" and "eimp-decrease-image-size" to make the image smaller or larger. There's my 2.5 cents. Cheers.