bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#17024: 24.3.50; eieio-compiled-function-arglist is broken


From: Stefan Monnier
Subject: bug#17024: 24.3.50; eieio-compiled-function-arglist is broken
Date: Tue, 18 Mar 2014 16:21:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> The library `emacs-lisp/eieio-core.el' defines the function
> `eieio-compiled-function-arglist' for compatibility but
> its implementation is broken.

> In *scratch* buffer:
> (eieio-compiled-function-arglist (symbol-function 'make-temp-file))
> => 769

> The function `help-function-arglist' does the right thing.

> (help-function-arglist (symbol-function 'make-temp-file))
> => (arg1 &optional arg2 arg3)

Does the patch below work for you?
And could you explain in which circumstance you've bumped into
this problem?


        Stefan


=== modified file 'lisp/emacs-lisp/eieio-core.el'
--- lisp/emacs-lisp/eieio-core.el       2014-01-01 07:43:34 +0000
+++ lisp/emacs-lisp/eieio-core.el       2014-03-18 20:19:52 +0000
@@ -34,18 +34,11 @@
 (eval-when-compile (require 'cl))       ;FIXME: Use cl-lib!
 
 ;; Compatibility
-(if (fboundp 'compiled-function-arglist)
-
+(defalias 'eieio-compiled-function-arglist
+  (if (featurep 'xemacs)
     ;; 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))
-
-  )
+      #'compiled-function-arglist
+    #'help-function-arglist))
 
 (put 'eieio--defalias 'byte-hunk-handler
      #'byte-compile-file-form-defalias) ;;(get 'defalias 'byte-hunk-handler)






reply via email to

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