emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rick Frankel <rick@rickster.com>
To: Alan Schmitt <alan.schmitt@polytechnique.org>
Cc: John Kitchin <jkitchin@andrew.cmu.edu>,
	emacs-orgmode@gnu.org,
	Carsten Dominik <carsten.dominik@gmail.com>
Subject: Re: make new links show as figures?
Date: Thu, 31 Oct 2013 11:47:48 -0400	[thread overview]
Message-ID: <a8d0ad9dedcfd77f8b5fc2388e99ceba@mail.rickster.com> (raw)
In-Reply-To: <m2ob65u575.fsf@polytechnique.org>

On 2013-10-31 06:04, Alan Schmitt wrote:
> rick@rickster.com writes:
> 
> So it turns out that this is a REALLY simple patch (two characters):
> 
> +++ b/lisp/org.el
> @@ -18853,7 +18853,7 @@ BEG and END default to the buffer boundaries."
> (widen)
> (setq beg (or beg (point-min)) end (or end (point-max)))
> (goto-char beg)
> -   (let ((re (concat 
> "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
> +   (let ((re (concat
> "\\[.*\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
> (substring (org-image-file-name-regexp) 0 -2)
> "\\)\\]" (if include-linked "" "\\]")))
> (case-fold-search t)
> 
> This seems to work in all cases I can think of (see test file below).
> Let me know if this works for you and i will apply to master when i
> get home and have git push access.
> 
> I tried it on some files with images as links, and it works
> great. Thanks a lot!

So, I've done some testing of the export functions (html and latex
only) and found the following behaviors with this patch:

- HTML
- image in description only displayed if the protocol (file:) is
included.
- LaTeX
- same, required file: protocol in description
- additionally, pdflatex \includgraphics barfs on any path w/ a
=./= path prefix -- this is true for the current implmenation as
well.

Changing the regexp for in-buffer image expansion to mimic the export
behavior is difficult at best. I think the inconsistency is
acceptable, and I will documentment the behavior in the
`org-display-inline-images' docstring.

The latex breakage on paths beginning with =./= should perhaps be
addressed in the latex exporter, but this is orthogonal to the
current issue.

If there is no objection, I will push a fix tonight or tomorrow.

rick

  reply	other threads:[~2013-10-31 15:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-23  1:53 make new links show as figures? John Kitchin
2013-10-23 13:54 ` Rick Frankel
2013-10-24  7:28   ` Alan Schmitt
2013-10-24 10:08     ` Carsten Dominik
2013-10-24 13:45       ` Rick Frankel
2013-10-24 21:48         ` John Kitchin
2013-10-25 16:49           ` Rick Frankel
2013-10-26 12:10             ` John Kitchin
2013-10-30 16:02               ` Rick Frankel
2013-10-31 10:04                 ` Alan Schmitt
2013-10-31 15:47                   ` Rick Frankel [this message]
2013-10-31 16:20                     ` Cook, Malcolm
2013-10-31 16:55                       ` Rick Frankel
2013-10-31 17:06                     ` Alan Schmitt
2013-10-24 23:41       ` Rick Frankel
2013-10-25  1:18       ` Rick Frankel

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=a8d0ad9dedcfd77f8b5fc2388e99ceba@mail.rickster.com \
    --to=rick@rickster.com \
    --cc=alan.schmitt@polytechnique.org \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jkitchin@andrew.cmu.edu \
    /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).