emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r118154: * lisp/emacs-lisp/eieio: A bit more cleanup


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r118154: * lisp/emacs-lisp/eieio: A bit more cleanup, removing compat code.
Date: Sun, 19 Oct 2014 02:15:06 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118154
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sat 2014-10-18 22:14:58 -0400
message:
  * lisp/emacs-lisp/eieio: A bit more cleanup, removing compat code.
  
  * lisp/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.
  * lisp/emacs-lisp/eieio-opt.el (eieio-lambda-arglist): Remove.
  Use help-function-arglist instead.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/emacs-lisp/eieio-core.el  eieiocore.el-20130602114656-85t1ypd76v2yp6fh-1
  lisp/emacs-lisp/eieio-opt.el   
eieioopt.el-20091113204419-o5vbwnq5f7feedwu-10971
  lisp/emacs-lisp/eieio.el       eieio.el-20091113204419-o5vbwnq5f7feedwu-10973
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-10-18 16:26:47 +0000
+++ b/lisp/ChangeLog    2014-10-19 02:14:58 +0000
@@ -1,3 +1,14 @@
+2014-10-19  Stefan Monnier  <address@hidden>
+
+       * 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  <address@hidden>
 
        * cus-start.el (x-gtk-whole-detached-tool-bar): Remove.
@@ -33,7 +44,7 @@
 
 2014-10-17  Michal Nazarewicz  <address@hidden>
 
-       * 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  <address@hidden>

=== modified file 'lisp/emacs-lisp/eieio-core.el'
--- a/lisp/emacs-lisp/eieio-core.el     2014-10-17 05:09:24 +0000
+++ b/lisp/emacs-lisp/eieio-core.el     2014-10-19 02:14:58 +0000
@@ -33,20 +33,6 @@
 
 (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)
@@ -117,12 +103,12 @@
 
 (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
@@ -678,26 +664,12 @@
                            ;; 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.
@@ -2099,30 +2071,12 @@
 
 ;;; 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.

=== modified file 'lisp/emacs-lisp/eieio-opt.el'
--- a/lisp/emacs-lisp/eieio-opt.el      2014-05-14 20:41:53 +0000
+++ b/lisp/emacs-lisp/eieio-opt.el      2014-10-19 02:14:58 +0000
@@ -356,7 +356,7 @@
              (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)))
@@ -374,13 +374,6 @@
              (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
@@ -419,15 +412,15 @@
                   (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))))))
 

=== modified file 'lisp/emacs-lisp/eieio.el'
--- a/lisp/emacs-lisp/eieio.el  2014-10-17 05:09:24 +0000
+++ b/lisp/emacs-lisp/eieio.el  2014-10-19 02:14:58 +0000
@@ -910,7 +910,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "eieio-opt" "eieio-opt.el" 
"99b94c63a73593402e3c825178a44f4f")
+;;;### (autoloads nil "eieio-opt" "eieio-opt.el" 
"889c0a935dddf758dbb65488470ffa06")
 ;;; Generated autoloads from eieio-opt.el
 
 (autoload 'eieio-browse "eieio-opt" "\


reply via email to

[Prev in Thread] Current Thread [Next in Thread]