all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* change in call-next-method
@ 2016-01-03 11:37 Stephen Leake
  2016-01-03 12:06 ` Andreas Schwab
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Leake @ 2016-01-03 11:37 UTC (permalink / raw)
  To: emacs-devel

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. In
Emacs 24, `call-next-method' is a defun that does the right thing here
(calls the default superclass init). In Emacs 25, cl-call-next-method is
a defun that throws an error; cl-defmethod is supposed to replace plain
calls to cl-call-next-method with an in-line call to the appropriate
method.

As far as I can tell, the only reason for the call to call-next-method
is to process the constructor args in `rest', storing them in the
appropriate slots.

What is the right way to do that in Emacs 25? I don't see anything in
the CL manual about this, and I can't find the relevant code by reading
the implementations of cl-defmethod or cl-generic.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 7+ messages in thread
* change in call-next-method
@ 2016-01-03 11:38 Stephen Leake
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Leake @ 2016-01-03 11:38 UTC (permalink / raw)
  To: emacs-devel

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. In
Emacs 24, `call-next-method' is a defun that does the right thing here
(calls the default superclass init). In Emacs 25, cl-call-next-method is
a defun that throws an error; cl-defmethod is supposed to replace plain
calls to cl-call-next-method with an in-line call to the appropriate
method.

As far as I can tell, the only reason for the call to call-next-method
is to process the constructor args in `rest', storing them in the
appropriate slots.

What is the right way to do that in Emacs 25? I don't see anything in
the CL manual about this, and I can't find the relevant code by reading
the implementations of cl-defmethod or cl-generic.

--
-- Stephe



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-03 21:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-03 11:37 change in call-next-method Stephen Leake
2016-01-03 12:06 ` Andreas Schwab
2016-01-03 13:43   ` Stephen Leake
2016-01-03 14:48     ` Eric Abrahamsen
2016-01-03 18:05       ` Stephen Leake
2016-01-03 21:48     ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2016-01-03 11:38 Stephen Leake

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.