emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Joe Corneli <holtzermann17@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] problem with size of inline images
Date: Wed, 06 Aug 2014 15:22:21 +0200	[thread overview]
Message-ID: <87oavxzraq.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAN+qof=oahLhOryG8weONXERTE7z+FH-8piJiGw+yrX9ZdWcjQ@mail.gmail.com> (Joe Corneli's message of "Sun, 3 Aug 2014 22:54:23 +0100")

Hello,

Joe Corneli <holtzermann17@gmail.com> writes:

> I've noticed a problem around line 19171 of org.el.  The size of
> images is supposed to be controlled by attributes and by
> `org-image-actual-width'.  But it seems like the use of `when',
> `save-match-data' and `string-to-number' are in the wrong order in
> this region, so that `(match-string 1)' is not defined properly when
> it's evaluated.  The following instructions should allow you to
> reproduce the issue:
>
> Run this:
> #+BEGIN_SRC shell
> wget http://www.lisperati.com/lisplogo_warning_256.png -O lisp_warning.png
> #+END_SRC
>
> Then:
> [[elisp:(setq org-image-actual-width '(1200))]]
> [[elisp:(org-toggle-inline-images)]]
>
> #+ATTR_ORG: :width 256
> [[file:./lisp_warning.png]]
>
> ... and the attached patch fixed the problem for me.

Thanks for your patch.  Would you mind providing a commit message and
send it again with "git format-patch"?  Don't forget to add "TINYCHANGE"
at its end if you haven't signed FSF papers.

> +				 (save-match-data
> +				   (when 
> +				       (re-search-forward
> +					"^[ \t]*#\\+attr_.*?: +.*?:width +\\(\\S-+\\)"
> +					(org-element-property
> +					 :post-affiliated paragraph)
> +					t)
> +				     (string-to-number (match-string 1)))))))

It seems that `save-match-data' is useless anyway and can be removed
altogether. WDYT?


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2014-08-06 13:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-03 21:54 [PATCH] problem with size of inline images Joe Corneli
2014-08-06 13:22 ` Nicolas Goaziou [this message]
2014-08-07 12:49   ` Joe Corneli
2014-08-07 13:05     ` Nicolas Goaziou

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=87oavxzraq.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=holtzermann17@gmail.com \
    /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).