summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-12-17 14:09:03 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2022-12-17 14:24:17 -0800
commit4a8ff671b0e93e96f7fca4204cdbc83f99a3387c (patch)
treef020b8a1bb4a60f5a2b29e510f2c3111be4cbbb0 /lisp/files.el
parent44c83b239d3cbb5c7675c8abd595fd3e33811ece (diff)
downloademacs-4a8ff671b0e93e96f7fca4204cdbc83f99a3387c.tar.gz
emacs-4a8ff671b0e93e96f7fca4204cdbc83f99a3387c.tar.bz2
emacs-4a8ff671b0e93e96f7fca4204cdbc83f99a3387c.zip
Don’t assume make-directory handler returns nil
* lisp/files.el (make-directory): Ignore what the make-directory handler returns, as its return value was not documented in Emacs 28.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 3cf7833ae02..cc7d7e2af94 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -6224,7 +6224,12 @@ Signal an error if unsuccessful."
;; make sure we find its make-directory handler.
(setq dir (expand-file-name dir))
(let ((mkdir (if-let ((handler (find-file-name-handler dir 'make-directory)))
- #'(lambda (dir) (funcall handler 'make-directory dir))
+ #'(lambda (dir)
+ ;; Use 'ignore' since the handler might be designed for
+ ;; Emacs 28-, so it might return an (undocumented)
+ ;; non-nil value, whereas the Emacs 29+ convention is
+ ;; to return nil here.
+ (ignore (funcall handler 'make-directory dir)))
#'make-directory-internal)))
(if (not parents)
(funcall mkdir dir)