emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "gregory mitchell" <radiochickenwax@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Re: inline images
Date: Mon, 6 Oct 2008 19:50:43 -0700	[thread overview]
Message-ID: <170f0450810061950k6bbb5773nd1d1fcb024fd35a1@mail.gmail.com> (raw)
In-Reply-To: <loom.20081003T164148-861@post.gmane.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.

  reply	other threads:[~2008-10-07  2:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-01 15:33 inline images Richard Riley
2008-10-02  0:47 ` Lindsay Todd
2008-10-02 19:56   ` Felipe Csaszar
2008-10-03  3:34     ` Sebastian Rose
2008-10-03 16:51       ` Felipe Csaszar
2008-10-07  2:50         ` gregory mitchell [this message]
2011-01-07  8:06           ` Vladimir Alexiev
2011-01-07 16:31             ` [PATCH] org-display-inline-images to reduce image size Vladimir Alexiev
2011-01-10  8:31               ` Vladimir Alexiev
2011-02-07  8:33                 ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=170f0450810061950k6bbb5773nd1d1fcb024fd35a1@mail.gmail.com \
    --to=radiochickenwax@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).