branch: externals/org
commit 25a51bad2c285dcb4437c4f15ab587505f4c8eff
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    Address Emacs 28 warnings
    
    * lisp/oc-basic.el (org-cite-basic--shorten-names): Provide third
    argument for `mapconcat'.  It is mandatory in Emacs <29.
    * lisp/org.el (org--image-yank-media-handler): Suppress warning and
    throw and error in Emacs <29.
    (org--dnd-rmc): Do not try to call `use-dialog-box-p' in Emacs <29.
---
 lisp/oc-basic.el |  2 +-
 lisp/org.el      | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el
index f896fdf404..d795b09124 100644
--- a/lisp/oc-basic.el
+++ b/lisp/oc-basic.el
@@ -367,7 +367,7 @@ personal names of the form \"family, given\"."
     (cond
      ((stringp names) (setq names-string names))
      ((org-element-type-p names 'raw)
-      (setq names-string (mapconcat #'identity (org-element-contents names))
+      (setq names-string (mapconcat #'identity (org-element-contents names) "")
             raw-p t)))
     (when names-string
       (setq names-string
diff --git a/lisp/org.el b/lisp/org.el
index 898f725760..31f3fa3e07 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20579,7 +20579,10 @@ any extension which is used as the filename."
 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."
-  (let* ((ext (symbol-name (mailcap-mime-type-to-extension mimetype)))
+  (cl-assert (fboundp 'mailcap-mime-type-to-extension)) ; Emacs >=29
+  (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))
          (absname (expand-file-name
@@ -20652,7 +20655,10 @@ When nil, use `org-attach-method'."
 (defvar org-attach-method)
 
 (defun org--dnd-rmc (prompt choices)
-  (if (null (use-dialog-box-p))
+  (if (null (and
+             ;; Emacs <=28 does not have `use-dialog-box-p'.
+             (fboundp 'use-dialog-box-p)
+             (use-dialog-box-p)))
       (caddr (read-multiple-choice prompt choices))
     (setq choices
           (mapcar

Reply via email to