emacs-devel
[Top][All Lists]
Advanced

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

Re: New GNOME icons


From: Katsumi Yamaoka
Subject: Re: New GNOME icons
Date: Mon, 13 Mar 2006 20:52:56 +0900
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/23.0.0 (gnu/linux)

>>>>> In <address@hidden>
>>>>>   Reiner Steib wrote:

> [1]   * gmm-utils.el (gmm-image-load-path-for-library): Return single
>       directory if path is t.  Add no-error.

Because of the `no-error' argument[1], I needed to modify the
`gmm-defun-compat' macro as follows since I'm using Emacs 23.
It will become unnecessary soon (when the `emacs-unicode-2'
branch is synch'd with the trunk), though.

--8<---------------cut here---------------start------------->8---
--- gmm-utils.el~       2006-03-07 22:01:08 +0000
+++ gmm-utils.el        2006-03-13 11:51:18 +0000
@@ -285,8 +285,19 @@
   "Create function NAME.
 If FUNCTION exists, then NAME becomes an alias for FUNCTION.
 Otherwise, create function NAME with ARG-LIST and BODY."
-  (let ((defined-p (fboundp function)))
-    (if defined-p
+  (let ((definition (and (fboundp function)
+                        (symbol-function function))))
+    ;; FIXME: If a function which is not a byte compiled one might be
+    ;; given as FUNCTION, we'll have to use `ad-arglist' or equivalent.
+    (if (and definition
+            (or (not (byte-code-function-p definition))
+                (eq (length arg-list)
+                    (ignore-errors
+                      (length (if (fboundp 'compiled-function-arglist)
+                                  ;; XEmacs
+                                  (eval (list 'compiled-function-arglist
+                                              definition))
+                                (aref definition 0)))))))
         `(defalias ',name ',function)
       `(defun ,name ,arg-list ,@body))))
 
--8<---------------cut here---------------end--------------->8---

[1] image-load-path-for-library is a compiled Lisp function in `image.el'.
(image-load-path-for-library LIBRARY IMAGE &optional PATH)




reply via email to

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