From 8ce845ba6c51bf5e0bc35d309a04484fbf3504e8 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 4 Jan 2015 21:13:27 +0100 Subject: [PATCH] ox: Tiny refactoring * lisp/ox.el (org-export-inline-image-p): Tiny refactoring. --- lisp/ox.el | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index f47baef8f..5a62cee4d 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -3912,18 +3912,13 @@ the provided rules is non-nil. The default rule is This only applies to links without a description." (and (not (org-element-contents link)) - (let ((case-fold-search t) - (rules (or rules org-export-default-inline-image-rule))) + (let ((case-fold-search t)) (catch 'exit - (mapc - (lambda (rule) - (and (string= (org-element-property :type link) (car rule)) - (string-match (cdr rule) - (org-element-property :path link)) - (throw 'exit t))) - rules) - ;; Return nil if no rule matched. - nil)))) + (dolist (rule (or rules org-export-default-inline-image-rule)) + (and (string= (org-element-property :type link) (car rule)) + (org-string-match-p (cdr rule) + (org-element-property :path link)) + (throw 'exit t))))))) (defun org-export-resolve-coderef (ref info) "Resolve a code reference REF.