[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: change in call-next-method
From: |
Stephen Leake |
Subject: |
Re: change in call-next-method |
Date: |
Sun, 03 Jan 2016 07:43:08 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) |
Andreas Schwab <address@hidden> writes:
> Stephen Leake <address@hidden> 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