emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Joe Corneli <holtzermann17@gmail.com>
To: Joe Corneli <holtzermann17@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: [PATCH] problem with size of inline images
Date: Thu, 7 Aug 2014 13:49:39 +0100	[thread overview]
Message-ID: <CAN+qof=8gFz-_Vz6OBy3PwySiFHv4VHV9HDNi5Wif+=K-A-=Mg@mail.gmail.com> (raw)
In-Reply-To: <87oavxzraq.fsf@nicolasgoaziou.fr>

[-- Attachment #1: Type: text/plain, Size: 592 bytes --]

On Wed, Aug 6, 2014 at 2:22 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> 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.

Sure.  I did sign them quite some time ago (2003 or 2004) though I
haven't contributed much if any code since then.  Git seems to make
that  quite easy!

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

You're right.  I removed it at another point in the function as well.

[-- Attachment #2: 0001-Fix-bug-associated-with-setting-image-size-via-ATTR.patch --]
[-- Type: application/octet-stream, Size: 1726 bytes --]

From c0f60b932c11936e2c1ed7e84c9385500d3e6e7e Mon Sep 17 00:00:00 2001
From: Joe Corneli <holtzermann17@gmail.com>
Date: Thu, 7 Aug 2014 13:42:54 +0100
Subject: [PATCH] Fix bug associated with setting image size via ATTR.

This change is necessary to make ATTR work.
Removed unnecessary save-match-data forms.
---
 lisp/org.el | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 0f7a4ef..2584dc4 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -19168,13 +19168,13 @@ boundaries."
 			     (when paragraph
 			       (save-excursion
 				 (goto-char (org-element-property :begin paragraph))
-				 (when (save-match-data
-					 (re-search-forward
-					  "^[ \t]*#\\+attr_.*?: +.*?:width +\\(\\S-+\\)"
-					  (org-element-property
-					   :post-affiliated paragraph)
-					  t))
-				   (string-to-number (match-string 1))))))
+				   (when
+				       (re-search-forward
+					"^[ \t]*#\\+attr_.*?: +.*?:width +\\(\\S-+\\)"
+					(org-element-property
+					 :post-affiliated paragraph)
+					t)
+				     (string-to-number (match-string 1))))))
 			   ;; Otherwise, fall-back to provided number.
 			   (car org-image-actual-width)))
 			 ((numberp org-image-actual-width)
@@ -19184,11 +19184,10 @@ boundaries."
 			     'org-image-overlay)))
 		   (if (and (car-safe old) refresh)
 		       (image-refresh (overlay-get (cdr old) 'display))
-		     (let ((image (save-match-data
-				    (create-image file
+		     (let ((image (create-image file
 						  (and width 'imagemagick)
 						  nil
-						  :width width))))
+						  :width width)))
 		       (when image
 			 (let* ((link
 				 ;; If inline image is the description
-- 
1.8.5.2 (Apple Git-48)


  reply	other threads:[~2014-08-07 12:49 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
2014-08-07 12:49   ` Joe Corneli [this message]
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='CAN+qof=8gFz-_Vz6OBy3PwySiFHv4VHV9HDNi5Wif+=K-A-=Mg@mail.gmail.com' \
    --to=holtzermann17@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).