Procházet zdrojové kódy

Modification to the type signature of `org-export-inline-image-p'

EXPERIMENTAL/org-e-latex.el (org-e-latex-link): Apply changes.
contrib/lisp/org-export.el (org-export-inline-image-p): Remove
description of the link as a required argument, since this function is
called with link contents anyway.
Nicolas Goaziou před 13 roky
rodič
revize
c3972265bb
2 změnil soubory, kde provedl 3 přidání a 5 odebrání
  1. 1 1
      EXPERIMENTAL/org-e-latex.el
  2. 2 4
      contrib/lisp/org-export.el

+ 1 - 1
EXPERIMENTAL/org-e-latex.el

@@ -1251,7 +1251,7 @@ INFO is a plist holding contextual information. See
 	 ;; Ensure DESC really exists, or set it to nil.
 	 (desc (and (not (string= desc "")) desc))
 	 (imagep (org-export-inline-image-p
-		  link desc org-e-latex-inline-image-extensions))
+		  link org-e-latex-inline-image-extensions))
 	 (path (cond
 		((member type '("http" "https" "ftp" "mailto"))
 		 (concat type ":" raw-path))

+ 2 - 4
contrib/lisp/org-export.el

@@ -2277,15 +2277,13 @@ PATH is the link path.  DESC is its description."
 	  ((string= desc "") "%s")
 	  (t desc))))
 
-(defun org-export-inline-image-p (link contents &optional extensions)
+(defun org-export-inline-image-p (link &optional extensions)
   "Non-nil if LINK object points to an inline image.
 
-CONTENTS is the link description part, as a string, or nil.
-
 When non-nil, optional argument EXTENSIONS is a list of valid
 extensions for image files, as strings.  Otherwise, a default
 list is provided \(cf. `org-image-file-name-regexp'\)."
-  (and (or (not contents) (string= contents ""))
+  (and (not (org-element-get-contents link))
        (string= (org-element-get-property :type link) "file")
        (org-file-image-p
 	(expand-file-name (org-element-get-property :path link))