From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Emacs 23.3 released Date: Thu, 10 Mar 2011 23:20:42 -0500 Message-ID: References: <87sjuulr20.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1299817261 8120 80.91.229.12 (11 Mar 2011 04:21:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 11 Mar 2011 04:21:01 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 11 05:20:57 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PxtqR-0002cF-9G for ged-emacs-devel@m.gmane.org; Fri, 11 Mar 2011 05:20:56 +0100 Original-Received: from localhost ([127.0.0.1]:33876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxtqO-0005Qd-Md for ged-emacs-devel@m.gmane.org; Thu, 10 Mar 2011 23:20:52 -0500 Original-Received: from [140.186.70.92] (port=53318 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxtqH-0005P1-PC for emacs-devel@gnu.org; Thu, 10 Mar 2011 23:20:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxtqG-0003jR-9S for emacs-devel@gnu.org; Thu, 10 Mar 2011 23:20:45 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:35823 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxtqG-0003jE-6b for emacs-devel@gnu.org; Thu, 10 Mar 2011 23:20:44 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEADYyeU3O+IG+/2dsb2JhbACmNXjBEYViBIUpkBI X-IronPort-AV: E=Sophos;i="4.62,301,1297054800"; d="scan'208";a="95623989" Original-Received: from 206-248-129-190.dsl.teksavvy.com (HELO ceviche.home) ([206.248.129.190]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 10 Mar 2011 23:20:43 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 0119E66135; Thu, 10 Mar 2011 23:20:42 -0500 (EST) In-Reply-To: <87sjuulr20.fsf@gmail.com> (Thierry Volpiatto's message of "Thu, 10 Mar 2011 20:21:43 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:137076 Archived-At: > A quick try to lexbind give me this error on startup: > --8<---------------cut here---------------start------------->8--- > Debugger entered--Lisp error: (wrong-type-argument listp 0) > ad-parse-arglist(0) Does the patch below fix it for you? Stefan === modified file 'lisp/emacs-lisp/advice.el' --- lisp/emacs-lisp/advice.el 2011-01-28 21:42:11 +0000 +++ lisp/emacs-lisp/advice.el 2011-03-11 04:16:59 +0000 @@ -2535,17 +2535,11 @@ "Return the argument list of DEFINITION. If DEFINITION could be from a subr then its NAME should be supplied to make subr arglist lookup more efficient." - (cond ((ad-compiled-p definition) - (aref (ad-compiled-code definition) 0)) - ((consp definition) - (car (cdr (ad-lambda-expression definition)))) - ((ad-subr-p definition) - (if name - (ad-subr-arglist name) - ;; otherwise get it from its printed representation: - (setq name (format "%s" definition)) - (string-match "^#]+\\)>$" name) - (ad-subr-arglist (intern (match-string 1 name))))))) + (require 'help-fns) + (cond + ((or (ad-macro-p definition) (ad-advice-p)) + (help-function-arglist (cdr definition))) + (t (help-function-arglist definition)))) ;; Store subr-args as `((arg1 arg2 ...))' so I can distinguish ;; a defined empty arglist `(nil)' from an undefined arglist: === modified file 'lisp/help-fns.el' --- lisp/help-fns.el 2011-03-06 21:22:16 +0000 +++ lisp/help-fns.el 2011-03-11 04:15:05 +0000 @@ -124,6 +124,21 @@ (nreverse arglist))) ((byte-code-function-p def) (aref def 0)) ((eq (car-safe def) 'lambda) (nth 1 def)) + ((subrp def) + (let ((arity (subr-arity def)) + (arglist ())) + (dotimes (i (car arity)) + (push (intern (concat "arg" (number-to-string (1+ i)))) arglist)) + (if (not (numberp (cdr arglist))) + (progn + (push '&rest arglist) + (push 'rest arglist)) + (push '&optional arglist) + (dotimes (i (- (cdr arity) (car arity))) + (push (intern (concat "arg" (number-to-string + (1+ i (car arity))))) + arglist))) + (nreverse arglist))) ((and (eq (car-safe def) 'autoload) (not (eq (nth 4 def) 'keymap))) "[Arg list not available until function definition is loaded.]") (t t)))