From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: change in call-next-method Date: Sun, 03 Jan 2016 07:43:08 -0600 Message-ID: <86d1tibwyb.fsf@stephe-leake.org> References: <86poxiki76.fsf@stephe-leake.org> <874meudg0c.fsf@igel.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1451828656 13565 80.91.229.3 (3 Jan 2016 13:44:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jan 2016 13:44:16 +0000 (UTC) Cc: emacs-devel To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 03 14:43:58 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 1aFiwv-0001Qj-J7 for ged-emacs-devel@m.gmane.org; Sun, 03 Jan 2016 14:43:57 +0100 Original-Received: from localhost ([::1]:41682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFiwu-0002Y0-E5 for ged-emacs-devel@m.gmane.org; Sun, 03 Jan 2016 08:43:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFiwh-0002Xr-K1 for emacs-devel@gnu.org; Sun, 03 Jan 2016 08:43:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFiwb-0005ua-AZ for emacs-devel@gnu.org; Sun, 03 Jan 2016 08:43:43 -0500 Original-Received: from gproxy5-pub.mail.unifiedlayer.com ([67.222.38.55]:57518) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1aFiwb-0005uS-3Y for emacs-devel@gnu.org; Sun, 03 Jan 2016 08:43:37 -0500 Original-Received: (qmail 23550 invoked by uid 0); 3 Jan 2016 13:43:24 -0000 Original-Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy5.mail.unifiedlayer.com with SMTP; 3 Jan 2016 13:43:24 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmgw3 with id 1YjG1s00F2UdiVW01YjKc0; Sun, 03 Jan 2016 13:43:22 -0700 X-Authority-Analysis: v=2.1 cv=bej4Do/B c=1 sm=1 tr=0 a=CQdxDb2CKd3SRg4I0/XZPQ==:117 a=CQdxDb2CKd3SRg4I0/XZPQ==:17 a=DsvgjBjRAAAA:8 a=f5113yIGAAAA:8 a=9i_RQKNPAAAA:8 a=hEr_IkYJT6EA:10 a=x_XPkuGwIRMA:10 a=7aQ_Q-yQQ-AA:10 a=tBb2bbeoAAAA:8 a=wN9w4xoAkOseR4DPucwA:9 Original-Received: from [76.218.37.33] (port=64383 helo=TAKVER2) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1aFiwI-0006W4-JU; Sun, 03 Jan 2016 06:43:18 -0700 In-Reply-To: <874meudg0c.fsf@igel.home> (Andreas Schwab's message of "Sun, 03 Jan 2016 13:06:11 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) X-Identified-User: {2442:host114.hostmonster.com:stephele:stephe-leake.org} {sentby:smtp auth 76.218.37.33 authed with stephen_leake@stephe-leake.org} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 67.222.38.55 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:197440 Archived-At: Andreas Schwab writes: > Stephen Leake writes: > >> I'm updating JDEE to Emacs 25. It has several functions like this: >> >> (cl-defmethod initialize-instance ((this jdee-jddocset) &rest rest) >> (apply 'call-next-method rest) >> (unless (oref this description) >> (oset this :description >> (if (oref this jdkp) >> (format "JDK %s Javadoc" (oref this version)) >> (let ((file (jdee-url-file (oref this url)))) >> (if (string-match ".*\\/\\(.*?\\)\\/doc\\/api" file) >> (match-string 1 file) >> (jdee-url-name (oref this url)))))))) >> >> This breaks if I just change call-next-method to cl-call-next-method. > > How do you change it? I tried: (apply 'cl-call-next-method rest) (cl-call-next-method rest) They both give the error: cl-call-next-method: cl-call-next-method only allowed inside primary and around methods > I think you are supposed to call it as > (cl-call-next-method). That gives the same error. Note that I don't actually need to call the superclass init; I just need to process the args in `rest', storing them in the slots. I can write code that does it: (let ((description (plist-get rest :description)) (url (plist-get rest :url)) (jdkp (plist-get rest :jdkp)) (version (plist-get rest :version))) (when description (oset this :description description)) (when url (oset this :url url)) (when jdkp (oset this :jdkp jdkp)) (when version (oset this :version version))) but that's tedious and error-prone. -- -- Stephe