From 60d24e1681c5a4bf43c943825dd2b5df42d8419c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 14 Jul 2017 11:33:46 +0300 Subject: [PATCH] Avoid byte-compilation warnings for advised functions * lisp/files.el (insert-directory, create-file-buffer): Add an advertised-calling-convention form to shut up byte-compilation warnings. (Bug#14860) --- lisp/files.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/files.el b/lisp/files.el index 2f3efa33c28..646387f8c86 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1821,6 +1821,10 @@ otherwise a string <2> or <3> or ... is appended to get an unused name. Emacs treats buffers whose names begin with a space as internal buffers. To avoid confusion when visiting a file whose name begins with a space, this function prepends a \"|\" to the final result if necessary." + ;; We need the following 'declare' form to shut up the byte + ;; compiler, which displays a bogus warning for advised functions, + ;; see bug#14860. + (declare (advertised-calling-convention (filename) "18.59")) (let ((lastname (file-name-nondirectory filename))) (if (string= lastname "") (setq lastname filename)) @@ -6590,6 +6594,11 @@ When SWITCHES contains the long `--dired' option, this function treats it specially, for the sake of dired. However, the normally equivalent short `-D' option is just passed on to `insert-directory-program', as any other option." + ;; We need the following 'declare' form to shut up the byte + ;; compiler, which displays a bogus warning for advised functions, + ;; see bug#14860. + (declare (advertised-calling-convention + (file switches &optional wildcard full-directory-p) "19.34")) ;; We need the directory in order to find the right handler. (let ((handler (find-file-name-handler (expand-file-name file) 'insert-directory))) -- 2.39.2