diff options
author | Aaron Ecay <aaronecay@gmail.com> | 2015-11-06 12:27:28 +0000 |
---|---|---|
committer | Aaron Ecay <aaronecay@gmail.com> | 2015-11-06 12:50:42 +0000 |
commit | 861b6b1bd07b6ceeef0aa3b5185d77f09ba955eb (patch) | |
tree | 8f95a4bd2680e4c8dbb819e4642ff712c17494f9 | |
parent | d29d9a029cd1feef6db247c89500e29346befd7f (diff) | |
download | org-mode-861b6b1bd07b6ceeef0aa3b5185d77f09ba955eb.tar.gz |
org.el: Obsolete ‘org-image-file-name-regexp’
* lisp/org.el (org-image-file-name-regexp): Make obsolete. Change
callers.
-rw-r--r-- | contrib/lisp/org-screenshot.el | 10 | ||||
-rwxr-xr-x | lisp/org.el | 27 |
2 files changed, 13 insertions, 24 deletions
diff --git a/contrib/lisp/org-screenshot.el b/contrib/lisp/org-screenshot.el index 6d10783..3c59df9 100644 --- a/contrib/lisp/org-screenshot.el +++ b/contrib/lisp/org-screenshot.el @@ -339,8 +339,8 @@ by most recent first" org-screenshot-rotation-index -1 org-screenshot-file-list (let ((files (directory-files org-screenshot-image-directory - t (org-image-file-name-regexp) t))) - (mapcar 'file-name-nondirectory + t (image-file-name-regexp) t))) + (mapcar 'file-name-nondirectory (sort files (lambda (file1 file2) (let ((mtime1 (nth 5 (file-attributes file1))) @@ -365,7 +365,7 @@ other direction" (link-re ;; taken from `org-display-inline-images' (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" - (substring (org-image-file-name-regexp) 0 -2) + (substring (image-file-name-regexp) 0 -2) "\\)\\]")) newfile oldfile) (save-excursion @@ -497,7 +497,7 @@ entered, at which point event will be unread" (let ((files-in-buffer) dired-buffer had-any - (image-re (org-image-file-name-regexp)) + (image-re (image-file-name-regexp)) beg end) (save-excursion (save-restriction @@ -505,7 +505,7 @@ entered, at which point event will be unread" (setq beg (or beg (point-min)) end (or end (point-max))) (goto-char beg) (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" - (substring (org-image-file-name-regexp) 0 -2) + (substring (image-file-name-regexp) 0 -2) "\\)\\]")) (case-fold-search t) old file ov img type attrwidth width) diff --git a/lisp/org.el b/lisp/org.el index a70fe01..1184484 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -19625,7 +19625,7 @@ boundaries." (org-with-wide-buffer (goto-char (or beg (point-min))) (let ((case-fold-search t) - (file-extension-re (org-image-file-name-regexp))) + (file-extension-re (image-file-name-regexp))) (while (re-search-forward "[][]\\[\\(?:file\\|[./~]\\)" end t) (let ((link (save-match-data (org-element-context)))) ;; Check if we're at an inline image. @@ -22773,26 +22773,15 @@ not an indirect buffer." (or (buffer-base-buffer buf) buf) nil))) -(defun org-image-file-name-regexp (&optional extensions) - "Return regexp matching the file names of images. -If EXTENSIONS is given, only match these." - (if (and (not extensions) (fboundp 'image-file-name-regexp)) - (image-file-name-regexp) - (let ((image-file-name-extensions - (or extensions - '("png" "jpeg" "jpg" "gif" "tiff" "tif" - "xbm" "xpm" "pbm" "pgm" "ppm")))) - (concat "\\." - (regexp-opt (nconc (mapcar 'upcase - image-file-name-extensions) - image-file-name-extensions) - t) - "\\'")))) - -(defun org-file-image-p (file &optional extensions) +(define-obsolete-function-alias 'org-image-file-name-regexp 'image-file-name-regexp + "Org 9.0") + +;;; TODO: Only called once, from ox-odt which should probably use +;;; org-export-inline-image-p or something. +(defun org-file-image-p (file) "Return non-nil if FILE is an image." (save-match-data - (string-match (org-image-file-name-regexp extensions) file))) + (string-match (image-file-name-regexp) file))) (defun org-get-cursor-date (&optional with-time) "Return the date at cursor in as a time. |