]> code.delx.au - gnu-emacs/commitdiff
Pacify byte-compiler for byte-compile-macroexpand-declare-function
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 18 May 2016 07:14:18 +0000 (00:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 18 May 2016 07:49:30 +0000 (00:49 -0700)
* lisp/emacs-lisp/bytecomp.el: Change signature of
byte-compile-macroexpand-declare-function to match that of
declare-function.

lisp/emacs-lisp/bytecomp.el

index 11eb44cea31be7cbf4286cd6e7a5d529113fdfd3..aa13210b633d669800b784c0fc780373f4d2492d 100644 (file)
@@ -2958,23 +2958,24 @@ for symbols generated by the byte compiler itself."
         (list body))))
 
 ;; Special macro-expander used during byte-compilation.
-(defun byte-compile-macroexpand-declare-function (fn file &rest args)
-  (let ((gotargs (and (consp args) (listp (car args))))
+(defun byte-compile-macroexpand-declare-function (fn file &optional arglist
+                                                     fileonly)
+  (let ((gotargs (listp arglist))
        (unresolved (assq fn byte-compile-unresolved-functions)))
     (when unresolved         ; function was called before declaration
       (if (and gotargs (byte-compile-warning-enabled-p 'callargs))
-         (byte-compile-arglist-warn fn (car args) nil)
+         (byte-compile-arglist-warn fn arglist nil)
        (setq byte-compile-unresolved-functions
              (delq unresolved byte-compile-unresolved-functions))))
     (push (cons fn (if gotargs
-                      (list 'declared (car args))
+                      (list 'declared arglist)
                     t))                     ; Arglist not specified.
          byte-compile-function-environment))
   ;; We are stating that it _will_ be defined at runtime.
   (setq byte-compile-noruntime-functions
         (delq fn byte-compile-noruntime-functions))
   ;; Delegate the rest to the normal macro definition.
-  (macroexpand `(declare-function ,fn ,file ,@args)))
+  (macroexpand `(declare-function ,fn ,file ,arglist ,fileonly)))
 
 \f
 ;; This is the recursive entry point for compiling each subform of an