Anonymous avatar Anonymous committed 65cce39 Merge

fixup commit for tag 'sumo-2004-08-18'

Comments (0)

Files changed (5)

-2004-09-16  Norbert Koch  <viteno@xemacs.org>
-
-	* Makefile (VERSION): XEmacs package 1.18 released.
-
-2004-09-15  Steve Youngs  <steve@youngs.au.com>
-
-	* lisp/xwem-clients.el (xwem-client-info): Typo fix. car -> cdr.
-
-2004-09-15  Norbert Koch  <viteno@xemacs.org>
-
-	* Makefile (VERSION): XEmacs package 1.17 released.
-
-2004-09-15  Steve Youngs  <steve@youngs.au.com>
-
-	* lisp/xwem-icons.el (xwem-icons-cl-icon): Remove redundant `if' in
-	previous patch.
-
-2004-09-15  Norbert Koch  <viteno@xemacs.org>
-
-	* Makefile (VERSION): XEmacs package 1.16 released.
-
-2004-09-15  Steve Youngs  <steve@youngs.au.com>
-
-	* lisp/xwem-icons.el (xwem-icons-cl-icon): Allow for a user set
-	icon path.
-
-2004-09-13  Norbert Koch  <viteno@xemacs.org>
-
-	* Makefile (VERSION): XEmacs package 1.15 released.
-
-	* lisp/xwem-interactive.el (read-from-minibuffer-for-xwem): Fix
-	build, add missing closing paren.
-
-2004-09-13  Steve Youngs  <steve@youngs.au.com>
-
-	* lisp/xwem-interactive.el: Use `symbol-function' in the defalias
-	for `read-from-minibuffer-for-xwem'.
-	This fixes a "exceeds max-specpdl-size" error when doing things
-	like `H-x b', `H-!' etc.
-
-2004-09-13  Steve Youngs  <steve@youngs.au.com>
-
-	* xwem-clients.el: Don't autoload `subtract-time' from time-date
-	at compile time as it isn't needed anymore.
-	(xwem-cl-get-uptime-1): New.
-	(xwem-cl-get-uptime): Use it.
-	This fixes a bug that meant a client's uptime couldn't be measured
-	beyond 65535 seconds.
-
-	The fix was inspired by code
-	From Sebastian Freundt <freundt@math.tu-berlin.de>
-
 2004-07-14  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.14 released.
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
-VERSION = 1.18
+VERSION = 1.14
 AUTHOR_VERSION = 0.2
 MAINTAINER = Zajcev Evgeny <zevlg@yandex.ru>
 PACKAGE = xwem

lisp/xwem-clients.el

   (require 'xlib-xwin)
   (require 'xwem-macros)
   (require 'iswitchb)
+  (autoload 'subtract-time "time-date")
   )
 (require 'xwem-frame)
 
   (let ((gmt (xwem-cl-xgeom cl)))
     (cons (X-Geom-width gmt) (X-Geom-height gmt))))
 
-(defun xwem-cl-get-uptime-1 (cl)
-  (let ((ctime (current-time))
-        (stime (xwem-cl-start-time cl)))
-    (list (- (nth 0 ctime) (nth 0 stime))
-          (- (nth 1 ctime) (nth 1 stime))
-          (- (nth 2 ctime) (nth 2 stime)))))
+(unless (fboundp 'subtract-time)
+  (defun subtract-time (t1 t2)
+    "Subtract two internal times."
+    (let ((borrow (< (cadr t1) (cadr t2))))
+      (list (- (car t1) (car t2) (if borrow 1 0))
+	    (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))))
 
 ;;;###autoload
 (defun xwem-cl-get-uptime (cl &optional format)
 %m is replaced by the minutes
 %s is replaced by the seconds
 %A is replaced by autogenerated format."
-  (let* ((upt (xwem-cl-get-uptime-1 cl))
-	 (upt (+ (* (nth 0 upt) 65536) (mod (nth 1 upt) 65536)))
-	 (days (/ upt 86400))
-	 (hours (/ (mod upt 86400) 3600))
-	 (minutes (/ (mod upt 3600) 60))
-	 (seconds (mod upt 60))
-	 (fmt (or format "%A"))
-	 (rup ""))
+  (let ((upt (nth 1 (subtract-time (current-time) (xwem-cl-start-time cl))))
+	(fmt (or format "%A"))
+	(days 0)
+	(hours 0)
+	(minutes 0)
+	(seconds 0)
+	(rup ""))
     
+    (when (> upt (* 60 60 24))
+      (setq days (/ upt (* 60 60 24))))
+
+    (when (> upt (* 60 60))
+      (setq hours (% (/ upt (* 60 60)) 24)))
+
+    (when (> upt 60)
+      (setq minutes (% (/ upt 60) 60)))
+
+    (setq seconds (% upt 60))
+
     (let ((flst (string-to-list fmt))
 	  chr)
       (while flst
 		      (setq rup (concat rup (format "%d" seconds))))
 		     ((= chr ?A)
 		      (setq rup (concat
-				 (cond ((> days 0) (format "%dd %dh %dm %ds" days hours minutes seconds))
-				       ((> hours 0) (format "%dh %dm %ds" hours minutes seconds))
+				 (cond ((> days 0) (format "%dd %dh" days hours))
+				       ((> hours 0) (format "%dh %dm" hours minutes))
 				       ((> minutes 0) (format "%dm %ds" minutes seconds))
 				       ((> seconds 0) (format "%d seconds" seconds))
 				       (t "")))))
 	  (xwem-message 'info "id: 0x%d, usize: %dx%d, psize: %dx%d, uptime: %s, name: `%s'"
 			(X-Win-id (xwem-cl-xwin client))
 			(car usz) (cdr usz)
-			(car psz) (cdr psz)
+			(car psz) (car psz)
 			(xwem-cl-get-uptime client)
 			(xwem-client-name client)))
       (xwem-message 'warn "No active clients found.")))

lisp/xwem-icons.el

     (when iname
       (setq ximg (plist-get xwem-icons-list iname))
       (unless ximg
-	(setq fname (expand-file-name iname xwem-icons-dir))
+	(setq fname (concat xwem-icons-dir "/" iname))
 	(setq ximg (X:xpm-pixmap-from-file (xwem-dpy) (XDefaultRootWindow (xwem-dpy)) fname))
 	(setq ximg-mask-pixmap (X:xpm-pixmap-from-file (xwem-dpy) (XDefaultRootWindow (xwem-dpy)) fname t))
 

lisp/xwem-interactive.el

   "Non-nil when xwem in interactive mode.
 Internal variable, do not modify.")
 
-(defalias 'read-from-minibuffer-for-xwem (symbol-function 'read-from-minibuffer))
+(defalias 'read-from-minibuffer-for-xwem 'read-from-minibuffer)
 
 
 ;;;###autoload
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.