Hello,

Joe Corneli <holtzerman...@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 via email to