emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 60d24e1: Avoid byte-compilation warnings for advise


From: Eli Zaretskii
Subject: [Emacs-diffs] master 60d24e1: Avoid byte-compilation warnings for advised functions
Date: Fri, 14 Jul 2017 04:34:39 -0400 (EDT)

branch: master
commit 60d24e1681c5a4bf43c943825dd2b5df42d8419c
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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 2f3efa3..646387f 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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]