CVS update by aidan packages/xemacs-packages/xwem/lisp ...

[email protected] 2 Oct 2009 12:03:35 -0000
Newsgroups gmane.emacs.xemacs.cvs
Message-ID <[email protected]>
  User: aidan   
  Date: 09/10/02 14:03:35

  Modified:    packages/xemacs-packages/xwem/lisp xwem-battery.el
Log:
Avoid compile-time autoloading by compiler-macroexpand, xwem-battery.el

Revision  Changes    Path
1.84      +12 -1     XEmacs/packages/xemacs-packages/xwem/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xwem/ChangeLog,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -p -r1.83 -r1.84
--- ChangeLog	2009/10/01 18:30:10	1.83
+++ ChangeLog	2009/10/02 12:03:33	1.84
@@ -1,3 +1,14 @@
+2009-10-02  Aidan Kehoe  <[email protected]>
+
+	* lisp/xwem-battery.el (xwem-battery-status): 
+	Turns out that #'compiler-macroexpand attempts the autoload for
+	any autoloaded functions it encounters in a form handed to it, so
+	if we define a compiler macro for #'values-list, compilation of
+	this file fails on 21.4, since #'apm-battery is defined at compile
+	time as an autoload.
+	So, use #'destructuring-bind instead of #'multiple-value-bind,
+	being careful to always return a three-element list in EXPR.
+
 2009-08-13  Aidan Kehoe  <[email protected]>
 
 	* lisp/xwem-battery.el:
@@ -621,4 +632,4 @@
 
 	* ChangeLog (Revision): ChangeLog in new XWEM layout created.
 	
-;; $Id: ChangeLog,v 1.83 2009/10/01 18:30:10 aidan Exp $
+;; $Id: ChangeLog,v 1.84 2009/10/02 12:03:33 aidan Exp $



1.4       +7 -11     XEmacs/packages/xemacs-packages/xwem/lisp/xwem-battery.el

Index: xwem-battery.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xwem/lisp/xwem-battery.el,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- xwem-battery.el	2009/10/01 18:30:13	1.3
+++ xwem-battery.el	2009/10/02 12:03:35	1.4
@@ -6,7 +6,7 @@
 ;;         Steve Youngs  <[email protected]>
 ;; Created: Thu Sep  2 01:14:36 GMT 2004
 ;; Keywords: xwem
-;; X-CVS: $Id: xwem-battery.el,v 1.3 2009/10/01 18:30:13 aidan Exp $
+;; X-CVS: $Id: xwem-battery.el,v 1.4 2009/10/02 12:03:35 aidan Exp $
 
 ;; This file is part of XWEM.
 
@@ -64,11 +64,6 @@
 
 (require 'xwem-load)
 
-;; Have compiled 21.4 code also work on XEmacs binaries with real support
-;; for multiple values, by avoiding runtime calls to #'values-list: 
-(eval-when-compile (when (eq 'identity (symbol-function 'values-list))
-                     (define-compiler-macro values-list (arg) arg)))
-
 ;;; Customisation
 (defgroup xwem-batt nil
   "Group to customise APM battery monitor."
@@ -326,11 +321,12 @@
 (define-xwem-command xwem-battery-status ()
   "Show battery status in xwem minibuffer."
   (xwem-interactive)
-     (multiple-value-bind (ac-line status perc)
-         (values-list (apm-battery))
-       (xwem-message
-        'info "APM Battery: AC-line: %s, Status: %S, Percentage: %d%%"
-        (if ac-line "on" "off") status perc)))
+  (destructuring-bind
+      (ac-line status perc)
+      (or (apm-battery) '(nil nil nil))
+    (xwem-message
+     'info "APM Battery: AC-line: %s, Status: %S, Percentage: %d%%"
+     (if ac-line "on" "off") status perc)))
 
 ;;;###autoload(autoload 'xwem-battery-popup-menu "xwem-battery" nil t)
 (define-xwem-command xwem-battery-popup-menu (ev)