aboutsummaryrefslogtreecommitdiff
path: root/compat-26.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-01-05 09:25:16 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-01-05 09:25:16 +0100
commit3d5d2068d964a77de314463a42418b8a4191c7f0 (patch)
treec6acc85110c1b4b04f1669ae2a25ef259047bced /compat-26.el
parent17f018c0a1a2bc88913dd003a249b6104f2faa31 (diff)
Remove unnecessary declare-functions
Diffstat (limited to 'compat-26.el')
-rw-r--r--compat-26.el33
1 files changed, 15 insertions, 18 deletions
diff --git a/compat-26.el b/compat-26.el
index af1b337..48261b6 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -65,7 +65,6 @@ from the absolute start of the buffer, disregarding the narrowing."
;;;; Defined in subr.el
-(declare-function alist-get nil (key alist &optional default remove))
(compat-defun alist-get (key alist &optional default remove testfn) ;; <OK>
"Handle TESTFN manually."
:explicit t
@@ -325,23 +324,6 @@ are non-nil, then the result is non-nil."
;;;; Defined in files.el
-(declare-function temporary-file-directory nil)
-
-(compat-defun make-nearby-temp-file (prefix &optional dir-flag suffix) ;; <UNTESTED>
- "Create a temporary file as close as possible to `default-directory'.
-If PREFIX is a relative file name, and `default-directory' is a
-remote file name or located on a mounted file systems, the
-temporary file is created in the directory returned by the
-function `temporary-file-directory'. Otherwise, the function
-`make-temp-file' is used. PREFIX, DIR-FLAG and SUFFIX have the
-same meaning as in `make-temp-file'."
- (let ((handler (find-file-name-handler
- default-directory 'make-nearby-temp-file)))
- (if (and handler (not (file-name-absolute-p default-directory)))
- (funcall handler 'make-nearby-temp-file prefix dir-flag suffix)
- (let ((temporary-file-directory (temporary-file-directory)))
- (make-temp-file prefix dir-flag suffix)))))
-
(compat-defvar mounted-file-systems
(eval-when-compile
(if (memq system-type '(windows-nt cygwin))
@@ -394,6 +376,21 @@ the variable `temporary-file-directory' is returned."
default-directory
temporary-file-directory))))
+(compat-defun make-nearby-temp-file (prefix &optional dir-flag suffix) ;; <UNTESTED>
+ "Create a temporary file as close as possible to `default-directory'.
+If PREFIX is a relative file name, and `default-directory' is a
+remote file name or located on a mounted file systems, the
+temporary file is created in the directory returned by the
+function `temporary-file-directory'. Otherwise, the function
+`make-temp-file' is used. PREFIX, DIR-FLAG and SUFFIX have the
+same meaning as in `make-temp-file'."
+ (let ((handler (find-file-name-handler
+ default-directory 'make-nearby-temp-file)))
+ (if (and handler (not (file-name-absolute-p default-directory)))
+ (funcall handler 'make-nearby-temp-file prefix dir-flag suffix)
+ (let ((temporary-file-directory (temporary-file-directory)))
+ (make-temp-file prefix dir-flag suffix)))))
+
(compat-defun file-attribute-type (attributes) ;; <OK>
"The type field in ATTRIBUTES returned by `file-attributes'.
The value is either t for directory, string (name linked to) for