From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: master e971ce6: Make autoloads populate a new definition-prefixes table Date: Thu, 26 May 2016 19:11:37 -0700 Organization: UCLA Computer Science Department Message-ID: <5747ACD9.3090001@cs.ucla.edu> References: <20160526025822.15529.80475@vcs.savannah.gnu.org> <20160526025822.4D91A220153@vcs.savannah.gnu.org> <83y46w22gw.fsf@gnu.org> <83twhk1tss.fsf@gnu.org> <87r3copla6.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090302070906040608090400" X-Trace: ger.gmane.org 1464315123 2746 80.91.229.3 (27 May 2016 02:12:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 May 2016 02:12:03 +0000 (UTC) Cc: Emacs Development To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 27 04:11:54 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b67Fh-0008Go-Tk for ged-emacs-devel@m.gmane.org; Fri, 27 May 2016 04:11:54 +0200 Original-Received: from localhost ([::1]:41334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b67Fg-0001wY-SP for ged-emacs-devel@m.gmane.org; Thu, 26 May 2016 22:11:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b67Fa-0001wH-7g for Emacs-devel@gnu.org; Thu, 26 May 2016 22:11:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b67FV-0002u8-44 for Emacs-devel@gnu.org; Thu, 26 May 2016 22:11:45 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:41331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b67FU-0002tm-PH for Emacs-devel@gnu.org; Thu, 26 May 2016 22:11:41 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E7D7B16125D; Thu, 26 May 2016 19:11:38 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 0knQAFKRFULu; Thu, 26 May 2016 19:11:37 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id BE525161380; Thu, 26 May 2016 19:11:37 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id m_F0LPJAEVfT; Thu, 26 May 2016 19:11:37 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 96A6416125D; Thu, 26 May 2016 19:11:37 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: <87r3copla6.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:204065 Archived-At: This is a multi-part message in MIME format. --------------090302070906040608090400 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Michael Heerdegen wrote: > AFAIU the patch indeed doesn't distinguish "arglist ()" > and "no arglist specified" - it treats both as "arglist ()". Clearly I missed the distinction between the two. Sorry about that. I ins= talled=20 the attached patch to master, which should fix things. Thanks for reporti= ng it. --------------090302070906040608090400 Content-Type: text/x-diff; name="0001-Fix-byte-compiler-pacification-for-declare-function.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-Fix-byte-compiler-pacification-for-declare-function.pat"; filename*1="ch" =46rom 91e4cad36ab1cc557ab7676cc93c8e05591a53dd Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 26 May 2016 19:10:26 -0700 Subject: [PATCH] Fix byte-compiler pacification for declare-function Problem reported by Michael Heerdegen in: http://lists.gnu.org/archive/html/emacs-devel/2016-05/msg00590.html * lisp/emacs-lisp/bytecomp.el: (byte-compile-macroexpand-declare-function): Revert signature to previous value. * lisp/subr.el (declare-function): Change signature to match the reverted signature used in the byte compiler. --- lisp/emacs-lisp/bytecomp.el | 11 +++++------ lisp/subr.el | 8 +++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index aa13210..11eb44c 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2958,24 +2958,23 @@ byte-compile-top-level-body (list body)))) =20 ;; Special macro-expander used during byte-compilation. -(defun byte-compile-macroexpand-declare-function (fn file &optional argl= ist - fileonly) - (let ((gotargs (listp arglist)) +(defun byte-compile-macroexpand-declare-function (fn file &rest args) + (let ((gotargs (and (consp args) (listp (car args)))) (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 arglist nil) + (byte-compile-arglist-warn fn (car args) nil) (setq byte-compile-unresolved-functions (delq unresolved byte-compile-unresolved-functions)))) (push (cons fn (if gotargs - (list 'declared arglist) + (list 'declared (car args)) 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 ,arglist ,fileonly))) + (macroexpand `(declare-function ,fn ,file ,@args))) =20 =0C ;; This is the recursive entry point for compiling each subform of an diff --git a/lisp/subr.el b/lisp/subr.el index b5d6f6f..7cbf006 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -29,13 +29,13 @@ ;; Beware: while this file has tag `utf-8', before it's compiled, it get= s ;; loaded as "raw-text", so non-ASCII chars won't work right during boot= strap. =20 -(defmacro declare-function (_fn _file &optional _arglist _fileonly) +(defmacro declare-function (_fn _file &rest _args) "Tell the byte-compiler that function FN is defined, in FILE. Optional ARGLIST is the argument list used by the function. The FILE argument is not used by the byte-compiler, but by the `check-declare' package, which checks that FILE contains a -definition for FN. ARGLIST is used by both the byte-compiler -and `check-declare' to check for consistency. +definition for FN. Remaining ARGS are used by both the +byte-compiler and `check-declare' to check for consistency. =20 FILE can be either a Lisp file (in which case the \".el\" extension is optional), or a C file. C files are expanded @@ -46,6 +46,8 @@ declare-function `check-declare' will check such files if they are found, and skip them without error if they are not. =20 +ARGS can contain one or two optional args. First optional arg +ARGLIST specifies the function arguments. Second optional arg FILEONLY non-nil means that `check-declare' will only check that FILE exists, not that it defines FN. This is intended for function-definitions that `check-declare' does not recognize, e.g. --=20 2.5.5 --------------090302070906040608090400--