+2014-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/eieio-opt.el (eieio-lambda-arglist): Remove.
+ Use help-function-arglist instead.
+
+ * emacs-lisp/eieio-core.el (eieio-compiled-function-arglist): Remove.
+ (eieio--with-scoped-class): Use `declare'.
+ (eieio-defclass): Remove compatibility code.
+ (no-method-definition, no-next-method, inconsistent-class-hierarchy)
+ (invalid-slot-type, unbound-slot, invalid-slot-name): Use define-error.
+
2014-10-18 Jan Djärv <jan.h.d@swipnet.se>
* cus-start.el (x-gtk-whole-detached-tool-bar): Remove.
2014-10-17 Michal Nazarewicz <mina86@mina86.com>
- * textmodes/tildify.el (tildify--pick-alist-entry): rename from
+ * textmodes/tildify.el (tildify--pick-alist-entry): Rename from
tildify-mode-alist.
2014-10-17 Stefan Monnier <monnier@iro.umontreal.ca>
(require 'cl-lib)
-;; Compatibility
-(if (fboundp 'compiled-function-arglist)
-
- ;; XEmacs can only access a compiled functions arglist like this:
- (defalias 'eieio-compiled-function-arglist 'compiled-function-arglist)
-
- ;; Emacs doesn't have this function, but since FUNC is a vector, we can just
- ;; grab the appropriate element.
- (defun eieio-compiled-function-arglist (func)
- "Return the argument list for the compiled function FUNC."
- (aref func 0))
-
- )
-
(put 'eieio--defalias 'byte-hunk-handler
#'byte-compile-file-form-defalias) ;;(get 'defalias 'byte-hunk-handler)
(defun eieio--defalias (name body)
(defmacro eieio--with-scoped-class (class &rest forms)
"Set CLASS as the currently scoped class while executing FORMS."
+ (declare (indent 1))
`(unwind-protect
(progn
(push ,class eieio--scoped-class-stack)
,@forms)
(pop eieio--scoped-class-stack)))
-(put 'eieio--with-scoped-class 'lisp-indent-function 1)
;;;
;; Field Accessors
;; Else - Some error? nil?
nil)))
- (if (fboundp 'gv-define-setter)
- ;; FIXME: We should move more of eieio-defclass into the
- ;; defclass macro so we don't have to use `eval' and require
- ;; `gv' at run-time.
- (eval `(gv-define-setter ,acces (eieio--store eieio--object)
- (list 'eieio-oset eieio--object '',name
- eieio--store)))
- ;; Provide a setf method. It would be cleaner to use
- ;; defsetf, but that would require CL at runtime.
- (put acces 'setf-method
- `(lambda (widget)
- (let* ((--widget-sym-- (make-symbol "--widget--"))
- (--store-sym-- (make-symbol "--store--")))
- (list
- (list --widget-sym--)
- (list widget)
- (list --store-sym--)
- (list 'eieio-oset --widget-sym-- '',name
- --store-sym--)
- (list 'getfoo --widget-sym--))))))))
+ ;; FIXME: We should move more of eieio-defclass into the
+ ;; defclass macro so we don't have to use `eval' and require
+ ;; `gv' at run-time.
+ (eval `(gv-define-setter ,acces (eieio--store eieio--object)
+ (list 'eieio-oset eieio--object '',name
+ eieio--store)))))
;; If a writer is defined, then create a generic method of that
;; name whose purpose is to set the value of the slot.
\f
;;; Here are some special types of errors
;;
-(intern "no-method-definition")
-(put 'no-method-definition 'error-conditions '(no-method-definition error))
-(put 'no-method-definition 'error-message "No method definition")
-
-(intern "no-next-method")
-(put 'no-next-method 'error-conditions '(no-next-method error))
-(put 'no-next-method 'error-message "No next method")
-
-(intern "invalid-slot-name")
-(put 'invalid-slot-name 'error-conditions '(invalid-slot-name error))
-(put 'invalid-slot-name 'error-message "Invalid slot name")
-
-(intern "invalid-slot-type")
-(put 'invalid-slot-type 'error-conditions '(invalid-slot-type error nil))
-(put 'invalid-slot-type 'error-message "Invalid slot type")
-
-(intern "unbound-slot")
-(put 'unbound-slot 'error-conditions '(unbound-slot error nil))
-(put 'unbound-slot 'error-message "Unbound slot")
-
-(intern "inconsistent-class-hierarchy")
-(put 'inconsistent-class-hierarchy 'error-conditions
- '(inconsistent-class-hierarchy error nil))
-(put 'inconsistent-class-hierarchy 'error-message "Inconsistent class hierarchy")
+(define-error 'no-method-definition "No method definition")
+(define-error 'no-next-method "No next method")
+(define-error 'invalid-slot-name "Invalid slot name")
+(define-error 'invalid-slot-type "Invalid slot type")
+(define-error 'unbound-slot "Unbound slot")
+(define-error 'inconsistent-class-hierarchy "Inconsistent class hierarchy")
;;; Obsolete backward compatibility functions.
;; Needed to run byte-code compiled with the EIEIO of Emacs-23.
(insert "' " (aref prefix i) " ")
;; argument list
(let* ((func (cdr (car gm)))
- (arglst (eieio-lambda-arglist func)))
+ (arglst (help-function-arglist func)))
(prin1 arglst (current-buffer)))
(insert "\n"
(or (documentation (cdr (car gm)))
(insert "\n")))
(setq i (1+ i)))))))
-(defun eieio-lambda-arglist (func)
- "Return the argument list of FUNC, a function body."
- (if (symbolp func) (setq func (symbol-function func)))
- (if (byte-code-function-p func)
- (eieio-compiled-function-arglist func)
- (car (cdr func))))
-
(defun eieio-all-generic-functions (&optional class)
"Return a list of all generic functions.
Optional CLASS argument returns only those functions that contain
(fboundp after)))
nil
(list (if (fboundp before)
- (cons (eieio-lambda-arglist before)
+ (cons (help-function-arglist before)
(documentation before))
nil)
(if (fboundp primary)
- (cons (eieio-lambda-arglist primary)
+ (cons (help-function-arglist primary)
(documentation primary))
nil)
(if (fboundp after)
- (cons (eieio-lambda-arglist after)
+ (cons (help-function-arglist after)
(documentation after))
nil))))))