XEmacs 21.5 compilation fix
authorKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 24 Oct 2012 00:25:44 +0000 (00:25 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 24 Oct 2012 00:25:44 +0000 (00:25 +0000)
* dgnushack.el (define-obsolete-variable-alias): Add a compiler-marco
  and a runtime function for it, of which the XEmacs version takes only
 two arguments.

lisp/ChangeLog
lisp/dgnushack.el

index c636ffa..a617f4f 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-24  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * dgnushack.el (define-obsolete-variable-alias): Add a compiler-marco
+       and a runtime function for it, of which the XEmacs version takes only
+       two arguments.
+
 2012-10-23  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * nndiary.el (nndiary-request-create-group-functions)
index 19f253a..6bbde42 100644 (file)
@@ -565,4 +565,25 @@ but which should be robust in the unexpected case that an error is signaled."
           (progn ,@body)
         (error (message "Error: %S" ,err) nil)))))
 
+;; XEmacs's `define-obsolete-variable-alias' takes only two arguments:
+;; (define-obsolete-variable-alias OLDVAR NEWVAR)
+(condition-case nil
+    (progn
+      (defvar dgnushack-obsolete-name nil)
+      (defvar dgnushack-current-name nil)
+      (unwind-protect
+         (define-obsolete-variable-alias 'obsolete-name 'current-name "0")
+       (makunbound 'dgnushack-obsolete-name)
+       (makunbound 'dgnushack-current-name)))
+  (wrong-number-of-arguments
+   (define-compiler-macro
+     define-obsolete-variable-alias (oldvar newvar &rest args)
+     `(funcall ,(symbol-function 'define-obsolete-variable-alias)
+              ,oldvar ,newvar))
+   (defadvice define-obsolete-variable-alias (around ignore-rest-args
+                                                    (oldvar newvar &rest args)
+                                                    activate)
+     "Ignore arguments other than the 1st and the 2nd ones."
+     (ad-Orig-define-obsolete-variable-alias oldvar newvar))))
+
 ;;; dgnushack.el ends here