Address Emacs 27 warnings

* lisp/org-entities.el (seq): Require seq.el - it is not preloaded in
Emacs <28.
* lisp/org.el (org--image-yank-media-handler): Suppress warning and
throw an error about `file-name-with-extension'.  This function is not
supposed to be called in older Emacs.
This commit is contained in:
Ihor Radchenko 2024-02-27 13:33:26 +03:00
parent 25a51bad2c
commit 8651c83991
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
2 changed files with 4 additions and 1 deletions

View File

@ -29,6 +29,7 @@
(require 'org-macs)
(org-assert-version)
(require 'seq) ; Emacs 27 does not preload seq.el; for `seq-every-p'.
(declare-function org-mode "org" ())
(declare-function org-toggle-pretty-entities "org" ())

View File

@ -20580,11 +20580,13 @@ It is saved as per `org-yank-image-save-method'. The name for the
image is prompted and the extension is automatically added to the
end."
(cl-assert (fboundp 'mailcap-mime-type-to-extension)) ; Emacs >=29
(cl-assert (fboundp 'file-name-with-extension)) ; Emacs >=28
(let* ((ext (symbol-name
(with-no-warnings ; Suppress warning in Emacs <29
(mailcap-mime-type-to-extension mimetype))))
(iname (funcall org-yank-image-file-name-function))
(filename (file-name-with-extension iname ext))
(filename (with-no-warnings ; Suppress warning in Emacs <28
(file-name-with-extension iname ext)))
(absname (expand-file-name
filename
(if (eq org-yank-image-save-method 'attach)