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.
This commit is contained in:
parent
44c83b239d
commit
4a8ff671b0
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue