Commits

Anonymous committed 5cef41e Merge

fixup commit for tag 'xwem-1_10'

Comments (0)

Files changed (33)

-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.
-
-2004-07-14  Steve Youngs  <steve@youngs.au.com>
-
-	* lisp/xwem-weather.el: New file.
-
-2004-07-13  Jerry James  <james@xemacs.org>
-
-	* lisp/xwem-clients.el:
-	* lisp/xwem-compat.el:
-	* lisp/xwem-frame.el:
-	* lisp/xwem-framei.el:
-	* lisp/xwem-holer.el:
-	* lisp/xwem-interactive.el:
-	* lisp/xwem-keyboard.el:
-	* lisp/xwem-keydefs.el:
-	* lisp/xwem-keymacro.el:
-	* lisp/xwem-launcher.el:
-	* lisp/xwem-main.el:
-	* lisp/xwem-minibuffer.el:
-	* lisp/xwem-misc.el:
-	* lisp/xwem-root.el:
-	* lisp/xwem-rooter.el:
-	* lisp/xwem-smartmods.el:
-	* lisp/xwem-strokes.el:
-	* lisp/xwem-tabbing.el:
-	* lisp/xwem-tray.el:
-	* lisp/xwem-win.el:
-	* lisp/xwem-worklog.el: Remove many autoloads, replacing them with
-	require forms.  Fix a few typos.
-
-2004-05-19  Norbert Koch  <viteno@xemacs.org>
-
-	* Makefile (VERSION): XEmacs package 1.13 released.
-
-2004-05-15  Steve Youngs  <steve@youngs.au.com>
-
-	* lisp/xwem-keyboard.el (xwem-kbd-quote-command): Removed
-	temporarily because it is broken and if used will cause xwem to
-	hang. 
-
-	* lisp/xwem-keydefs.el: Comment out binding for `H-q' which is
-	currently broken.
-
-	* lisp/xwem-worklog.el (xwem-worklog-auto-continue): Typo fix.
-	(xwem-worklog-end-task): Ditto.
-	(xwem-worklog-pause-task): Ditto.
-	(xwem-worklog-auto-worklog-file): Slightly massage the docstring.
-	Add a `:link' for worklog package's URL.
-
-	* Makefile (DONTCOMPILE): Add auto-autoloads.el and custom-load.el
-	so that they don't appear twice in the package tarball.
-
-2004-05-14  Norbert Koch  <viteno@xemacs.org>
-
-	* Makefile (VERSION): XEmacs package 1.12 released.
-
-2004-05-14  Steve Youngs  <steve@youngs.au.com>
-
-	* lisp/xwem-minibuffer.el (xwem-minibuffer-init): Turn off the
-	gutter in xwem-minibuffer.
-
-2004-05-14  Norbert Koch  <viteno@xemacs.org>
-
-	* Makefile (VERSION): XEmacs package 1.11 released.
-
-2004-05-14  Zajcev Evgeny  <zevlg@yandex.ru>
-
-	* lisp/xwem-worklog.el (xwem-worklog-auto-worklog-file): [fix]
-	Comment fix.
-
-	* lisp/xwem-main.el (xwem-init): [addon] Common configuration
-	added for joe public.
-
-	* lisp/xwem-keyboard.el (xwem-kbd-quote-command): [hmm] marked as
-	non-workable.
-
-2004-05-12  Zajcev Evgeny  <zevlg@yandex.ru>
-
-	* lisp/xwem-frame.el (xwem-frame-config-dump): [fix] Use
-	expand-file-name.
-	* lisp/xwem-frame.el (xwem-frame-config-restore): [fix] Ditto.
-
-	* lisp/xwem-worklog.el (misc): [fix] Ditto.
-
-2004-05-12  Zajcev Evgeny  <zevlg@yandex.ru>
-
-	* lisp/xwem-tray.el (xwem-tray-delimiter): [new] Delimiter stuff
-	added.
-
-	* lisp/xwem-sound.el (xwem-sound-do-visible-bell): [fix] Don't use
-	`X-Dpy-events-excursion'.
-
-	* lisp/xwem-misc.el (xwem-misc-make-screenshot): [fix] Use
-	absolute pathname to import screenshot to.
-
-	* lisp/xwem-launcher.el (xwem-launch-dock): [new] Dockapp to
-	launch clients.
-
-	* lisp/xwem-keydefs.el (xwem-global-map): [addon]
-	`xwem-frame-imove' at Sh-C-button1, `xwem-frame-iresize' on
-	Sh-C-button3.
-
 2004-05-11  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.10 released.
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
-VERSION = 1.18
+VERSION = 1.10
 AUTHOR_VERSION = 0.2
 MAINTAINER = Zajcev Evgeny <zevlg@yandex.ru>
 PACKAGE = xwem
 REQUIRES = xwem xemacs-base xlib strokes edit-utils text-modes time slider
 CATEGORY = standard
 
-DONTCOMPILE = lisp/_pkg.el lisp/auto-autoloads.el lisp/custom-load.el
-
+DONTCOMPILE = lisp/_pkg.el
+ 
 ELCS = $(patsubst %.el,%.elc,$(filter-out $(DONTCOMPILE),$(wildcard lisp/*.el)))
 
 DATA_FILES = $(wildcard icons/*.x[bp]m) logo.xpm

lisp/xwem-clients.el

 
 (eval-when-compile
   ;; Shutup compiler
-  (require 'xlib-xwin)
   (require 'xwem-macros)
-  (require 'iswitchb)
+  (defvar iswitchb-buflist nil)
+  (autoload 'subtract-time "time-date")
+  (autoload 'iswitchb-read-buffer "iswitchb")
   )
-(require 'xwem-frame)
 
 ;;; Variables
 (defgroup xwem-cl nil
   :type 'number
   :group 'xwem-cl)
 
+;;;###autoload
 (defcustom xwem-cl-create-hook nil
   "Hook to call when creating new client."
   :type 'hook
   :group 'xwem-cl)
 
+;;;###autoload
 (defcustom xwem-cl-destroy-hook nil
   "Hooks called with one argument - cl, when cl destroyed.
 NOT USED YET."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-manage-hook nil
   "*Hooks to be called with just setuped CL as argument."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-demanage-hook nil
   "*Hooks to be called with just desetuped CL as argument."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-refit-hook nil
   "Hooks called when CL just refited."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-iconify-hook nil
   "Hooks called when CL just iconified."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-change-hook nil
   "Hooks called when something changed in CL."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-state-change-hook nil
   "*Hooks to run when state of client changes.
 Every hook called with three args - CL OLD-STATE NEW-STATE."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-mark-hook nil
   "*Hooks to run when marking client.
 Hooks called with two args - CL STATE.
   :group 'xwem-hooks)
 
 ;;; CL property change hooks
+;;;###autoload
 (defcustom xwem-cl-wmnh-change-hooks nil
   "Hooks to be called when WM_NORMAL_HINTS changes."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-wmname-change-hooks nil
   "Hooks to be called when WM_NAME changes."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-wmcommand-chage-hooks nil
   "Hooks to be called when WM_COMMAND changes."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-wmclass-change-hooks nil
   "Hooks to be called when WM_CLASS changes."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-wmh-change-hooks nil
   "Hooks to be called when WM_HINTS changes."
   :type 'hook
   wm-transient-for
   wm-protocols)
 
+;;;###autoload
 (defconst xwem-client-ev-mask (Xmask-or XM-ColormapChange XM-PropertyChange
 					XM-FocusChange XM-EnterWindow XM-LeaveWindow
 					XM-StructureNotify XM-ResizeRedirect)
   "Return non-nil if CL has already destroyed xwin."
   (eq (xwem-cl-state cl) 'destroyed))
 
+;;;###autoload
 (defsubst xwem-cl-put-prop (cl prop val)
   "In CL's property list put property PROP with value VAL."
   (setf (xwem-cl-plist cl) (plist-put (xwem-cl-plist cl) prop val)))
 (put 'xwem-cl-put-prop 'lisp-indent-function 2)
 
+;;;###autoload
 (defsubst xwem-cl-get-prop (cl prop)
   "From CL's property list get property PROP."
   (plist-get (xwem-cl-plist cl) prop))
 
+;;;###autoload
 (defsubst xwem-cl-rem-prop (cl prop)
   "From CL's property list remove property PROP."
   (setf (xwem-cl-plist cl) (plist-remprop (xwem-cl-plist cl) prop)))
     (run-hook-with-args 'xwem-cl-state-change-hook cl old-state state)
     ))
 
+;;;###autoload
 (defsubst xwem-cl-managed-p (cl &optional win)
   "Return non-nil if client CL is managed, i.e. has 'managed or 'normal state."
   (and (or (not win) (eq (xwem-cl-win cl) win))
   (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-compat.el

       (define-prefix-command name)
     (define-prefix-command name t)))
 
+;;;###autoload
 (unless (fboundp 'set-keymap-default-binding)
   (fset 'set-keymap-default-binding
 	(lambda (keym cmd) (define-key keym [t] cmd))))
 
+;;;###autoload
 (unless (fboundp 'events-to-keys)
   (defalias 'events-to-keys 'identity))
 

lisp/xwem-events.el

 ;;
 ;;; Code
 
-(eval-when-compile
-  (require 'xlib-xwin))
 
 (defun xwem-ev-defhnd (xdpy win xev)
   "Default X-Events handler."

lisp/xwem-faces.el

 
 ;;; Code:
 (require 'cus-face)			; for `custom-face-get-spec'
-(eval-when-compile
-  (require 'xlib-xlib)
-  (require 'xwem-misc))
 
 
 (defgroup xwem-faces nil

lisp/xwem-focus.el

 
 ;;; Code:
 
-(eval-when-compile
-  (require 'xlib-xwin)
-  (require 'xwem-clients))
 
 ;;;###autoload
 (defvar xwem-focus-stack nil

lisp/xwem-frame.el

 ;;; Code
 
 
-(eval-when-compile
-  (require 'xlib-xlib)
-  (require 'xwem-misc))
-(require 'xlib-xinerama)
+(autoload 'X-XIneramaQueryScreens "xlib-xinerama")
 
 ;;; Variables
 (defgroup xwem-frame nil
   :group 'xwem-hooks)
   
 ;; Variables
+;;;###autoload
 (defconst xwem-frame-ev-mask (Xmask-or XM-Exposure
 				       XM-StructureNotify
 				       XM-SubstructureRedirect
     (error "Not an xwem frame configuration" config))
 
   (unless file
-    (setq file (expand-file-name "xwem-configs.el" xwem-dir)))
+    (setq file (concat xwem-dir "/" "xwem-configs.el")))
 
   (let* ((ccf (copy-sequence config))
          (find-file-hooks nil)          ; omit autoinsert and others
   (declare (special xwem-frame-dumped-config))
 
   (unless file
-    (setq file (expand-file-name "xwem-configs.el" xwem-dir)))
+    (setq file (concat xwem-dir "/" "xwem-configs.el")))
 
   (setq xwem-frame-dumped-config nil)
   (load-file file)
   "Fit FRAME to screen sizes."
   (xwem-interactive (list (xwem-frame-selected)))
 
-  ;; Take into account XInerama layout
+  ;; Take into acount XInerama layout
   (let ((frect (X-Geom-to-X-Rect (xwem-frame-xgeom frame)))
 	(xin (X-XIneramaQueryScreens (xwem-dpy))))
     (if (car xin)

lisp/xwem-framei.el

 
 ;;; Code:
 
-(require 'xwem-compat)
 (require 'xwem-osd)
 
 (defgroup xwem-framei nil
   "Face used to draw in framei dockapp."
   :group 'xwem-faces)
 
+;;;###autoload
 (defcustom xwem-framei-dockapp-format-function 'xwem-framei-dockapp-default-format
   "Function passed with one arg - frame, should return string to display."
   :type 'funtion

lisp/xwem-holer.el

 
 ;;; Code:
 (require 'xlib-xshape)
-(eval-when-compile
-  (require 'xlib-xlib)
-  (require 'xwem-misc))
 
 
 (defgroup xwem-holer nil
 
 
 ;;; Define holer prefix map
+;;;###autoload
 (xwem-define-prefix-command 'xwem-holer-prefix t)
 (defvar xwem-holer-map (symbol-function 'xwem-holer-prefix)
   "Keymap for holer (\\<xwem-global-map>\\[xwem-holer-prefix]) commands.

lisp/xwem-icons.el

 
 ;;; Code:
 
-(eval-when-compile
-  (require 'xlib-xlib))
 (require 'xlib-xpm)
 
 (defvar xwem-icons-dir (locate-data-directory "xwem")
     (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

 ;;;###autoload
 (defvar xwem-interactively nil
   "Non-nil when xwem in interactive mode.
-Internal variable, do not modify.")
+Internal variabel, do not modify.")
 
-(defalias 'read-from-minibuffer-for-xwem (symbol-function 'read-from-minibuffer))
+;;;###autoload
+(fset 'read-from-minibuffer-for-xwem (symbol-function 'read-from-minibuffer))
 
 
 ;;;###autoload

lisp/xwem-keyboard.el

 ;;; Code:
 
 
-(eval-when-compile
-  (require 'xwem-clients))
-(require 'xlib-xtest)
-(require 'xwem-compat)
+(eval-and-compile
+  (require 'xlib-xtest))
 
 ;;{{{ [-] Custamizable xwem-keyboard group
 
   :group 'xwem-keyboard
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-keyboard-echo-keystrokes t
   "*If non-nil than echo unfinished commands in echo area."
   :type 'boolean
   "List of evil masks.
 Internal variable, DO NOT MODIFY.")
 
+;;;###autoload
 (defcustom xwem-quit-key [(hyper ?g)]
   "Quit command key."
   :type 'sexp
   :group 'xwem-keyboard)
 
+;;;###autoload
 (defcustom xwem-quit-command 'xwem-keyboard-quit
   "Default command to be called when `xwem-quit-key' pressed."
   :type 'function
   :type 'sexp
   :group 'xwem-keyboard)
 
+;;;###autoload
 (defcustom xwem-prefix-help-command 'xwem-describe-prefix-bindings
   "Default command to be called when `xwem-help-key' pressed."
   :type 'function
   :group 'xwem-keys)
 
+;;;###autoload
 (defcustom xwem-universal-key [(hyper ?u)]
   "Key for universal argument commands."
   :type 'sexp
 
     (setq xwem-kbd-now-grabbing nil)))
 
-;;; FIXME: this does bad, naughty things.
-;; ;;;###autoload(autoload 'xwem-kbd-quote-command "xwem-keyboard" "" t)
-;; (define-xwem-command xwem-kbd-quote-command ()
-;;   "Pass event EV to currently active window.
-;; DOES NOT WORK."
-;;   (xwem-interactive "_")
+;;;###autoload(autoload 'xwem-kbd-quote-command "xwem-keyboard" "" t)
+(define-xwem-command xwem-kbd-quote-command ()
+  "Pass event EV to currently active window."
+  (xwem-interactive "_")
 
-;;   (let ((xwin (xwem-focus-xcurrent)))
-;;     (when (X-Win-p xwin)
-;;       (XGrabKeyboard (xwem-dpy) xwin nil X-GrabModeAsync X-GrabModeSync)
-;;       (XGrabPointer (xwem-dpy) xwin (Xmask-or XM-ButtonPress XM-ButtonRelease)
-;; 		    xwem-cursor-quote nil X-GrabModeSync)
-;;       (XAllowEvents (xwem-dpy) X-SyncBoth)
+  (let ((xwin (xwem-focus-xcurrent)))
+    (when (X-Win-p xwin)
+      (XGrabKeyboard (xwem-dpy) xwin nil X-GrabModeAsync X-GrabModeSync)
+      (XGrabPointer (xwem-dpy) xwin (Xmask-or XM-ButtonPress XM-ButtonRelease)
+		    xwem-cursor-quote nil X-GrabModeSync)
+      (XAllowEvents (xwem-dpy) X-SyncBoth)
 
-;;       (xwem-message 'info "[Quote key]")
-;;       (unwind-protect
-;; 	  (let ((done nil)
-;; 		xev)
-;; 	    (while (not done)
-;; 	      (setq xev (xwem-next-event 1))
-;;               (cond ((X-Event-p xev)
-;;                      (if (and (member (X-Event-type xev)
-;;                                       (list X-KeyPress X-ButtonPress X-ButtonRelease))
-;;                               (xwem-kbd-xevents->emacs-events (list xev) t))
-;;                          (progn
-;;                            (xwem-message 'info "here")
-;;                            (XAllowEvents (xwem-dpy) X-ReplayKeyboard)
-;;                            (XAllowEvents (xwem-dpy) X-ReplayPointer)
-;;                            (xwem-clear-message)
-;;                            (setq done t))
+      (xwem-message 'info "[Quote key]")
+      (unwind-protect
+	  (let ((done nil)
+		xev)
+	    (while (not done)
+	      (setq xev (XNextEvent (xwem-dpy)))
+	      (if (and (member (X-Event-type xev)
+			       (list X-KeyPress X-ButtonPress X-ButtonRelease))
+		       (xwem-kbd-xevents->emacs-events (list xev) t))
+		  (progn
+		    (XAllowEvents (xwem-dpy) X-ReplayKeyboard)
+		    (XAllowEvents (xwem-dpy) X-ReplayPointer)
+		    (xwem-clear-message)
+		    (setq done t))
 
-;;                        (XAllowEvents (X-Event-dpy xev) X-SyncBoth)))
-;;                     (t (setq done t)))))
+		(XAllowEvents (X-Event-dpy xev) X-SyncBoth))))
 
-;; 	(XUngrabKeyboard (xwem-dpy))
-;; 	(XUngrabPointer (xwem-dpy))
-;; 	))))
+	(XUngrabKeyboard (xwem-dpy))
+	(XUngrabPointer (xwem-dpy))
+	))))
 
 ;;}}}
 

lisp/xwem-keydefs.el

 ;; 
 
 ;;; Code:
-(require 'xwem-compat)
-(require 'xwem-keyboard)
 
 (defmacro xwem-keymap-put-prop (keymap prop value)
   "In on of xwem KEYMAP put property PROP with VALUE."
 (define-key xwem-global-map (xwem-kbd "H-x") 'xwem-Hyper-X-prefix)
 
 ;; Help
+;;;###autoload
 (defvar xwem-help-map (symbol-function (xwem-define-prefix-command 'xwem-help-prefix t))
   "Keymap for help (\\<xwem-global-map>\\[xwem-help-prefix]) commands.
 
 (define-key xwem-hyp-x-5-map (xwem-kbd "H-a") 'xwem-launcher-other-frame-prefix)
 
 ;; Keyboard macros keymap
+;;;###autoload
 (defvar xwem-user-macros-map (symbol-function (xwem-define-prefix-command 'xwem-user-macros-prefix t))
   "Keymap of user defined keyboard macros (\\<xwem-global-map>\\[xwem-user-macros-prefix]) commands.
 
 (define-key xwem-global-map (xwem-kbd "H-g") xwem-quit-command)
 (define-key xwem-global-map (xwem-kbd "H-G") 'xwem-kbd-quit)
 
-;; Quoting keyboard  currently doesn't work --SY.
-;(define-key xwem-global-map (xwem-kbd "H-q") 'xwem-kbd-quote-command)
+;; Quoting keyboard
+(define-key xwem-global-map (xwem-kbd "H-q") 'xwem-kbd-quote-command)
 
 ;; help keys
 (define-key xwem-global-map (xwem-kbd "H-h H-h") 'xwem-help-for-help)
       (define-key xwem-global-map [s-mouse-1] 'xwem-strokes-begin)
       (define-key xwem-global-map [h-mouse-1] 'xwem-strokes-cmplx-begin))
   (progn
-    (define-key xwem-global-map (xwem-kbd "Sh-C-button1") 'xwem-frame-imove)
-    (define-key xwem-global-map (xwem-kbd "Sh-C-button3") 'xwem-frame-iresize)
-
     (define-key xwem-global-map (xwem-kbd "M-button1") 'xwem-strokes-begin)
     (define-key xwem-global-map (xwem-kbd "H-button1") 'xwem-strokes-cmplx-begin)))
 

lisp/xwem-keymacro.el

 
 ;;; Code:
 
-(require 'xwem-compat)
 (eval-and-compile
   (require 'xlib-xtest)
   (require 'xlib-xrecord))

lisp/xwem-launcher.el

 
 ;;; Code:
 
-;(require 'completer)
-(require 'comint)
-(eval-when-compile
-  (require 'xlib-xlib))
+(eval-and-compile
+;  (require 'completer)
+  (require 'comint))
 
 (autoload 'executable-find "executable")
 
   :type 'boolean
   :group 'xwem-launcher)
 
+;;;###autoload
 (defcustom xwem-launcher-function 'xwem-execute-program
   "Function to be used to execute external program."
   :type 'function
     (xwem-frame-select oframe))
   )
 
+;;;###autoload
 (defsubst xwem-launch (cmd)
   "Execute CMD using `xwem-launcher'."
   (funcall xwem-launcher-function cmd))
   (xwem-interactive)
 
   (xwem-launch-generic-program xwem-xlock-program xwem-xlock-arguments))
-
-
-;;; Launcher dockapp button
-(defcustom xwem-launch-dock-width 24
-  "*Launcher dockapp width."
-  :type 'number
-  :group 'xwem-launch)
-
-(defcustom xwem-launch-dock-height 24
-  "*Launcher dockapp height."
-  :type 'number
-  :group 'xwem-launch)
-
-(defcustom xwem-launch-dock-thick 2
-  "*Launcher dockapp border thickness."
-  :type 'number
-  :group 'xwem-launch)
-
-(defface xwem-launch-dock-face
-  `((t (:foreground "gray70" :background "black")))
-  "Default background face for launcher docks."
-  :group 'xwem-launch)
-
-(defvar xwem-launch-dock-keymap
-  (let ((map (make-sparse-keymap)))
-    (define-key map [button1] 'xwem-launch-dock-down)
-    (define-key map [button1up] 'xwem-launch-dock-launch)
-    (define-key map [button3] 'xwem-launch-dock-menu)
-    map)
-  "Keymap for launch docks.")
-
-(define-xwem-command xwem-launch-dock-down ()
-  "Default command when button is down."
-  (xwem-interactive)
-
-  (xwem-ladock-push (X-Event-win xwem-last-xevent))
-  )
-
-(define-xwem-command xwem-launch-dock-launch ()
-  "Launch command for launch dock."
-  (xwem-interactive)
-
-  (let* ((xwin (X-Event-win xwem-last-xevent))
-         (action (X-Win-get-prop xwin 'ladock-action))
-         (atype (car action))
-         (acmd (cdr action)))
-    (xwem-ladock-pop xwin)
-    (cond ((eq atype 'elisp)
-           (eval (read acmd)))
-
-          ((eq atype 'cmd)
-           (xwem-execute-program acmd))
-
-          (t (xwem-message 'warn "Unknown action type=`%s'" atype)))
-  ))
-
-(define-xwem-command xwem-launch-dock-menu (action)
-  "Popup menu."
-  (xwem-interactive (list (X-Win-get-prop (X-Event-win xwem-last-xevent) 'ladock-action)))
-
-  (let (cls menu)
-    (mapc (lambda (cl)
-            (when (string-match (cdr action) (xwem-hints-wm-command (xwem-cl-hints cl)))
-              (setq cls (cons cl cls))))
-          xwem-clients)
-
-    ;; Sort clients
-    (setq cls (sort cls (lambda (cl1 cl2)
-                          (and (xwem-frame-p (xwem-cl-frame cl1))
-                               (xwem-frame-p (xwem-cl-frame cl2))
-                               (> (xwem-frame-num (xwem-cl-frame cl1))
-                                  (xwem-frame-num (xwem-cl-frame cl2)))))))
-    
-    (setq menu (list "Clients" :filter
-                     (lambda (not-used)
-                       (mapcar (lambda (cl)
-                                 (let ((frame (xwem-cl-frame cl))
-                                      (name (xwem-hints-wm-name (xwem-cl-hints cl))))
-                                  (vector (if (xwem-frame-p frame)
-                                              (format "[%d](%s): %s" (xwem-frame-num (xwem-cl-frame cl))
-                                                      (xwem-frame-name (xwem-cl-frame cl))
-                                                      name)
-                                            name)
-                                          `(xwem-cl-pop-to-client ,cl)
-                                          :active (if (xwem-cl-exclude-p cl) nil t))))
-                               cls))))
-    (xwem-popup-menu menu))
-  )
-
-(defun xwem-ladock-push (xwin)
-  "Emulate pushing button."
-  (X-Win-put-prop xwin 'ladock-state 'down)
-  (xwem-ladock-redraw xwin))
-
-(defun xwem-ladock-pop (xwin)
-  "Emulate poping button."
-  (X-Win-put-prop xwin 'ladock-state 'up)
-  (xwem-ladock-redraw xwin))
- 
-(defun xwem-ladock-puticon (xwin)
-  "Draw icon on launcher dock XWIN."
-  (let* ((xdpy (X-Win-dpy xwin))
-         (xpix (X-Win-get-prop xwin 'ladock-xpix))
-         (ximg (X-Pixmap-get-prop xpix 'ximg))
-         (xgc (X-Win-get-prop xwin 'ladock-xgc)))
-    (XCopyArea xdpy xpix xwin xgc 0 0
-               (X-Image-width ximg) (X-Image-height ximg)
-               (/ (- xwem-launch-dock-width (X-Image-width ximg)) 2)
-               (/ (- xwem-launch-dock-height (X-Image-height ximg)) 2))
-    ))
-    
-(defun xwem-ladock-redraw (xwin)
-  "Redraw launcher button dock XWIN."
-  (let ((state (X-Win-get-prop xwin 'ladock-state))
-        (xdpy (X-Win-dpy xwin)))
-    (X-Dpy-send-excursion xdpy
-      (cond ((eq state 'down)
-             (xwem-misc-draw-bar xdpy xwin
-                                 (xwem-face-get-gc 'xwem-launch-dock-face)
-                                 (xwem-face-get-gc 'xwem-face-black)
-                                 (xwem-face-get-gc 'xwem-face-white)
-                                 0 0 xwem-launch-dock-width xwem-launch-dock-height xwem-launch-dock-thick))
-
-            ((eq state 'up)
-             (xwem-misc-draw-bar xdpy xwin
-                                 (xwem-face-get-gc 'xwem-launch-dock-face)
-                                 (xwem-face-get-gc 'xwem-face-white)
-                                 (xwem-face-get-gc 'xwem-face-black)
-                                 0 0 xwem-launch-dock-width xwem-launch-dock-height xwem-launch-dock-thick))
-            )
-      (xwem-ladock-puticon xwin))
-    ))
-
-(defun xwem-ladock-evhandler (xdpy xwin xev)
-  "On XDPY and launcher dock XWIN handle event XEV."
-  (X-Event-CASE xev
-    (:X-Expose
-     (xwem-ladock-redraw xwin))
-
-    ((:X-ButtonPress :X-ButtonRelease)
-     (let ((xwem-override-global-map xwem-launch-dock-keymap))
-       (xwem-kbd-handle-keybutton xev)))
-
-    (:X-DestroyNotify
-     (xwem-launch-button-stop xwin))
-    ))
-
-(defun xwem-launch-button-stop (xwin &optional force)
-  "Destoy launch dockapp button XWIN.
-If FORCE is non-nil also destroy XWIN."
-  (let ((xdpy (X-Win-dpy xwin))
-        (xpix (X-Win-get-prop xwin 'ladock-xpix))
-        (xpix-mask (X-Win-get-prop xwin 'ladock-xpix-mask))
-        (xgc (X-Win-get-prop xwin 'ladock-xgc)))
-    (XFreeGC xdpy xgc)
-    (XFreePixmap xdpy xpix)
-    (XFreePixmap xdpy xpix-mask)
-
-    (when force
-      (XDestroyWindow xdpy xwin))))
-
-;;;###autoload
-(defun xwem-launch-button-start (xpm-file action &optional xdpy)
-  "Create new dockapp button with XPM-FILE image and doing ACTION on click.
-ACTION is cons cell wher car is one of 'elisp or 'cmd and cdr is string.
-For 'elisp car, cdr is real elisp expression, to evaluate on click.
-For 'cmd  car, cdr is cmd to run on click."
-  (unless xdpy
-    (setq xdpy (xwem-dpy)))
-
-  (let (xwin xpix xpix-mask ximg xgc)
-    (setq xwin (XCreateWindow xdpy nil 0 0 xwem-launch-dock-width xwem-launch-dock-height 0 nil nil nil
-                              (make-X-Attr :override-redirect t
-                                           :backing-store X-WhenMapped
-                                           :background-pixel (XAllocNamedColor xdpy (XDefaultColormap xdpy) "gray50")
-                                           :border-pixel (XAllocNamedColor xdpy (XDefaultColormap xdpy) "gray80"))
-                              ))
-    ;; Create pixmap
-    (setq xpix (X:xpm-pixmap-from-file xdpy xwin xpm-file))
-    (setq ximg (X-Pixmap-get-prop xpix 'ximg))
-    (setq xpix-mask (X:xpm-pixmap-from-file xdpy xwin xpm-file t))
-
-    (setq xgc (XCreateGC xdpy xpix
-                         (make-X-Gc :dpy xdpy :id (X-Dpy-get-id xdpy)
-                                    :clip-x-origin (/ (- xwem-launch-dock-width (X-Image-width ximg)) 2)
-                                    :clip-y-origin (/ (- xwem-launch-dock-height (X-Image-height ximg)) 2)
-                                    :clip-mask xpix-mask)))
-    ;; Put some properties
-    (X-Win-put-prop xwin 'ladock-state 'up)
-    (X-Win-put-prop xwin 'ladock-action action)
-
-    (X-Win-put-prop xwin 'ladock-xgc xgc)
-    (X-Win-put-prop xwin 'ladock-xpix xpix)
-    (X-Win-put-prop xwin 'ladock-xpix-mask xpix-mask)
-
-    (XSelectInput xdpy xwin (Xmask-or XM-Exposure XM-StructureNotify XM-ButtonPress XM-ButtonRelease))
-    (X-Win-EventHandler-add xwin 'xwem-ladock-evhandler nil
-			    (list X-Expose X-ButtonPress X-ButtonRelease X-DestroyNotify))
-
-    (XTrayInit xdpy xwin)
-
-    xwin))
   
 
 (provide 'xwem-launcher)

lisp/xwem-main.el

 
 
 (eval-when-compile
-  (require 'cl)				;last, intersection etc
-  (require 'xlib-xwin))
+  (require 'cl))			;last, intersection etc
+
 (eval-when 'load
   (load "xwem-keydefs")
   (run-hooks 'xwem-load-hook))
-(require 'xwem-root)
 
 ;;;###autoload
 (defconst xwem-version "xwem(xemacs-package):  $Revision$")
   :type '(restricted-sexp :match-alternatives (stringp null))
   :group 'xwem)
 
+;;;###autoload
 (defcustom xwem-load-hook nil
   "*Hooks to call after xwem was load."
   :type 'hook
 			      " succesfully started. Start with `M-x xwem-help RET'."))
   )
 
-(defcustom xwem-use-presetup t
-  "*When non-nil, us things that normally should be in xwemrc."
-  :type 'boolean
-  :group 'xwem)
-
 ;;;###autoload
 (defun xwem-init ()
   "Initialization of xwem subsystems."
   (require 'xwem-keydefs)               ; load keyboard difinitions
 
-  (setq inhibit-startup-message t)      ; DO NOT REMOVE
-
-  (when xwem-use-presetup
-    ;; default presetup
-    (setf allow-deletion-of-last-visible-frame t)
-    (defadvice kill-buffer (before delete-dedicated-frame activate)
-      "Work around dedicated frame problem."
-      (let ((frame (buffer-dedicated-frame
-                    (get-buffer (or (ad-get-arg 0) (current-buffer))))))
-        (when (framep frame)
-          (delete-frame frame))))
-    (xwem-init-tabber))
+  (setq inhibit-startup-message t)
 
   ;; read configuration
   (let ((cfg (expand-file-name "xwemrc.el" xwem-dir)))

lisp/xwem-manage.el

 ;;
 
 ;;; Code
-(eval-when-compile
-  (require 'xlib-xlib)
-  (require 'xwem-misc))
 
 
 ;; Variables

lisp/xwem-minibuffer.el

 ;; such as messages displaying, system tray, etc.
 
 ;;; Code:
-(eval-when-compile
-  (require 'xlib-xwin)
-  (require 'xwem-misc))
 
 ;;;###autoload
 (defstruct xwem-minib
   :type '(restricted-sexp :match-alternatives ('nil try-font-name))
   :group 'xwem-minibuffer)
 
+;;;###autoload
 (defcustom xwem-minibuffer-height 1
   "Height of `xwem-minibuffer'."
   :type 'number
   :group 'xwem-minibuffer)
 
+;;;###autoload
 (defcustom xwem-minibuffer-width 80
   "*Usable width of `xwem-minibuffer' frame."
   :type 'number
   :group 'xwem-minibuffer)
 
+;;;###autoload
 (defcustom xwem-minibuffer-border-width 3
   "Border width for `xwem-minibuffer'."
   :type 'number
   (setq minibuffer-frame-plist
 	(list 'menubar-visible-p nil
 	      'default-toolbar-visible-p nil
-	      'default-gutter-visible-p nil
 	      'name xwem-minibuffer-name
 	      'height xwem-minibuffer-height
 	      'border-width xwem-minibuffer-border-width

lisp/xwem-misc.el

 ;;; Code:
 ;;
 
-(require 'xlib-xwin)
 
 (eval-and-compile
   (defvar elp-function-list nil)        ; shut up compiler
 (defvar xwem-cursor-help nil "Cursor when in help mode.")
 
 ;;; Functions
+;;;###autoload
 (defsubst xwem-misc-colorspec->rgb-vector (colspec)
   "Conver color specification COLSPEC to internal representation.
 COLSPEC maybe in form: #RRGGBB or name like 'green4'."
   (vconcat (color-instance-rgb-components (make-color-instance colspec))))
 
+;;;###autoload
 (defsubst xwem-misc-colorspec->rgb-vector-safe (colspec &optional defret)
   "Validate COLSPEC to be color specification in safe manner.
 Return DEFRET or [0 0 0] if there was error."
       (xwem-misc-colorspec->rgb-vector colspec)
     (t (or defret [0 0 0]))))
 
+;;;###autoload
 (defsubst xwem-misc-colorspec-valid-p (colspec)
   "Return non-nil if COLSPEC is valid color specification.
 Valid colorspecification is spec in form: #RRGGBB or name like 'green4'."
      ;; shut up messaging
      (xwem-message 'msg
                    (format "Importing screenshot to %s." file-name))
-     (xwem-execute-program (format "import -window root %s" (expand-file-name file-name)))))
+     (xwem-execute-program (format "import -window root %s" file-name))))
 
 ;;;###autoload(autoload 'xwem-misc-pause "xwem-misc")
 (define-xwem-command xwem-misc-pause (arg)
 ;;; Code:
 
 (eval-when-compile
-  (require 'cl)
-  (require 'xlib-xlib))
+  (require 'cl))
+
 (require 'xlib-xshape)
 
 (defconst xwem-osd-instance-types '(text line dots arc rect)

lisp/xwem-root.el

 ;; window. Also has macros to work with geometry.
 ;;
 ;;; Code
-(require 'xlib-xlib)
-
 
 ;;; Variables
 
+;;;###autoload
 (defconst xwem-root-ev-mask (Xmask-or XM-SubstructureNotify XM-SubstructureRedirect
                                       XM-KeyPress XM-ButtonPress XM-ButtonRelease
 				      XM-PropertyChange

lisp/xwem-rooter.el

 ;; 
 
 ;;; Code:
-(require 'xlib-xwin)
 
 (defgroup xwem-rooter nil
   "Group to customize rooter apps."

lisp/xwem-smartmods.el

 ;;; Code:
 
 
-(eval-when-compile
-  (require 'xlib-xwin))
-(require 'xlib-xtest)
-(require 'xwem-keyboard)
-
 ;; Smart modifiers:
 ;;  smart modifiers is modifiers which can work as normal modifier and
 ;;  as key if it is not used with some other key(when you just

lisp/xwem-sound.el

   :group 'xwem-sound)
 
 (defcustom xwem-visible-bell nil
-  "*If non-nil mean try to flash selected frame to represent a bell."
+  "If non-nil mean try to flash selected frame to represent a bell."
   :type 'boolean
   :group 'xwem-sound)
 
 			(make-X-Gc :dpy xdpy :id (X-Dpy-get-id xdpy)
 				   :function X-GXInvert
 				   :subwindow-mode X-IncludeInferiors))))
+    (X-Dpy-events-excursion xdpy
+      (XGrabServer xdpy)
+      (unwind-protect
+	  (progn
+	    (XFillRectangle xdpy (xwem-frame-xwin frame)
+			    gc 0 0 (xwem-frame-width frame)
+			    (xwem-frame-height frame))
 
-    (XGrabServer xdpy)
-    (unwind-protect
-        (progn
-          (XFillRectangle xdpy (xwem-frame-xwin frame)
-                          gc 0 0 (xwem-frame-width frame)
-                          (xwem-frame-height frame))
+	    ;; XXX we need sleeping, so flashing will be visible
+	    (sleep-for 0.1)
 
-          ;; XXX we need sleeping, so flashing will be visible
-          (sleep-for 0.1)
-
-          (XFillRectangle xdpy (xwem-frame-xwin frame)
-                          gc 0 0 (xwem-frame-width frame)
-                          (xwem-frame-height frame)))
-      (XUngrabServer xdpy)
-      (XFreeGC xdpy gc))
-
-    (XSyncEvents (xwem-dpy))
-    ))
+	    (XFillRectangle xdpy (xwem-frame-xwin frame)
+			    gc 0 0 (xwem-frame-width frame)
+			    (xwem-frame-height frame)))
+	(XUngrabServer xdpy)
+	(XFreeGC xdpy gc))
+      )))
 
 ;;;###autoload
 (defun xwem-play-sound (sound &optional volume)

lisp/xwem-special.el

 ;;    - Models
 
 ;;; Code:
-(eval-when-compile
-  (require 'xlib-xwin)
-  (require 'xwem-misc))
 
 (defgroup xwem-special nil
   "Group to customize special emacs frames handling."

lisp/xwem-strokes.el

 ;; 
 
 ;;; Code:
-(eval-when-compile
-  (require 'xwem-misc))
-(require 'strokes)
-(require 'xwem-compat)
-(require 'xwem-keyboard)
+
+(eval-and-compile
+  (require 'strokes))
 
 (defgroup xwem-strokes nil
   "Group to customize XWEM strokes."
   :group 'xwem-faces)
 
 ;; Stroke variables
+;;;###autoload
 (defvar xwem-strokes-keymap 
   (let ((map (make-sparse-keymap)))
     (set-keymap-default-binding map 'xwem-strokes-nocmd)

lisp/xwem-tabbing.el

 
 ;;; Code:
 
-(eval-when-compile
-  (require 'xlib-xlib)
-  (require 'xwem-clients))
-(require 'xwem-keyboard)
 
 (defconst xwem-tab-states
   '(xwem-face-tab-selected-active
   :prefix "xwem-face-"
   :group 'xwem)
 
+;;;###autoload
 (defcustom xwem-tab-default-format " %i %*%# %n"
   "*Default format for tab item."
   :type 'string
       (xwem-tabber-draw tabber))
     ))
 
+;;;###autoload
 (defsubst xwem-tabber-safe-regeom (tabber &optional draw-p)
   "Saf variant of `xwem-tabber-regeom'."
   (and (xwem-tabber-p tabber)
       )
     ))
 
+;;;###autoload
 (defsubst xwem-client-get-tab-item (cl)
   "Get tab item associated with CL."
   (xwem-cl-get-prop cl 'tab-item))
 
+;;;###autoload
 (defsubst xwem-client-set-tab-item (tabi cl)
   "Associate tab item TABI with client CL."
   (xwem-cl-put-prop cl 'tab-item tabi))

lisp/xwem-time.el

 ;;; Code:
 
 (eval-when-compile
-  (require 'xwem-misc)
-  (require 'xlib-xlib))
+  (require 'itimer))
 
 (require 'time)
 

lisp/xwem-tray.el

 ;;
 ;;; Code:
 
-(eval-when-compile
-  (require 'xlib-xlib)
-  (require 'xwem-misc))
-
 ;;; xwem tray constants
 (defconst xwem-tc-dock-req 0 "Dock place request.")
 (defconst xwem-tc-message 1 "Message from dock app.")
   :type '(restricted-sexp :match-alternatives (xwem-misc-colorspec-valid-p))
   :group 'xwem-tray)
 
-(defcustom xwem-tray-cursor-background-color nil;"#000039"
+(defcustom xwem-tray-cursor-background-color "#000039"
   "*Cursor's background color used when poniter is on dock app."
-  :type '(restricted-sexp :match-alternatives (nil xwem-misc-colorspec-valid-p))
+  :type '(restricted-sexp :match-alternatives (xwem-misc-colorspec-valid-p))
   :group 'xwem-tray)
 
 ;;; Internal variables
   (setq xwem-tray-dockapps 0)
   )
 
-;;; Delimiter stuff
-(defcustom xwem-tray-delimiter-width 4
-  "*Delimiter width."
-  :type 'number
-  :group 'xwem-tray)
-
-(defcustom xwem-tray-delimiter-height 28
-  "*Delimiter height."
-  :type 'number
-  :group 'xwem-tray)
-
-(defcustom xwem-tray-delimiter-background "gray40"
-  "Background face for tray delimiter."
-  :type '(restricted-sexp :match-alternatives (nil xwem-misc-colorspec-valid-p))
-  :group 'xwem-tray)
-
-;;;###autoload
-(defun xwem-tray-delimeter (&optional w h bgcol)
-  "Add delimiter to dockapp.
-W and H specifies delimiter width and height.
-BGCOL - background color."
-  (unless w
-    (setq w xwem-tray-delimiter-width))
-  (unless h
-    (setq h xwem-tray-delimiter-height))
-  (unless bgcol
-    (setq bgcol xwem-tray-delimiter-background))
-
-  (let ((xwin (XCreateWindow (xwem-dpy) nil 0 0 w h
-                             0 nil nil nil
-                             (make-X-Attr :override-redirect t
-                                          :background-pixel (XAllocNamedColor (xwem-dpy) (XDefaultColormap (xwem-dpy))
-                                                                              bgcol)))))
-    (XTrayInit (xwem-dpy) xwin)
-    xwin))
-
 (provide 'xwem-tray)
 
 ;;; xwem-tray.el ends here

lisp/xwem-weather.el

-;;; xwem-weather.el --- Display weather information in XWEM dock.
-
-;; Copyright (C) 2004 by Free Software Foundation, Inc.
-
-;; Author: Steve Youngs <steve@youngs.au.com>
-;; Created: 2004-06-22
-;; Keywords: xwem
-;; X-CVS: $Id$
-
-;; This file is part of XWEM.
-
-;; XWEM is free software; you can redistribute it and/or modify it
-;; under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; XWEM is distributed in the hope that it will be useful, but WITHOUT
-;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
-;; License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with XEmacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-;; 02111-1307, USA.
-
-;;; Synched up with: Not in FSF
-
-;;; Commentary:
-
-;; Display weather information (current local temp) in the dock area.
-;; Optionally display a frame with more detailed weather information.
-
-;; Set this up by adding the following code to your ~/.xwem/xwemrc.el
-
-;; (require 'xwem-weather)
-;; (customize-set-variable 'xwem-weather-update-frequency 3600)
-;; (add-hook 'xwem-after-init-hook 'xwem-weather-init)
-
-
-;;; Code:
-
-
-(require 'xwem-osd)
-(require 'itimer)
-
-(defgroup xwem-weather nil
-  "XWEM Weather options."
-  :prefix "xwem-weather-"
-  :group 'xwem)
-
-(defcustom xwem-weather-station-id "ybbn"
-  "*The four letter weather station ID.
-
-The default setting is the author's local station, Brisbane,
-Australia.  So you can all be jealous of the wonderful weather we
-have in Australia. :-P"
-  :type 'string
-  :group 'xwem-weather)
-
-(defvar xwem-weather-osd nil)
-
-(defvar xwem-weather-frequency)
-
-(defun xwem-weather-alter-update-frequency (value)
-  "Alters the update frequency of the weather updates.
-
-DO NOT CALL THIS FUNCTION DIRECTLY.  Change the update frequency
-by customising `xwem-weather-update-frequency'.  You MUST use
-`customize-set-variable' to do so.
-
-Argument SYM is the symbol name of what is changing the frequency.  It
-will always be `xwem-weather-update-frequency'.
-
-Argument VALUE is an integer determining how often, in seconds, to
-update the weather data."
-  (let ((itimer (get-itimer "xwem-weather-itimer")))
-    (cond ((and (xwem-osd-p xwem-weather-osd)
-		value
-		itimer)
-	   (set-itimer-value itimer value)
-	   (set-itimer-restart itimer value))
-	  ((and (xwem-osd-p xwem-weather-osd)
-		(eq value 0)
-		itimer)
-	   (delete-itimer itimer))
-	  ((and (xwem-osd-p xwem-weather-osd)
-		(> value 0)
-		(not itimer))
-	   (start-itimer "xwem-weather-itimer"
-			 'xwem-weather-update
-			 value value))
-	  (t nil))
-    (setq xwem-weather-frequency value)
-    (message (format "Weather update frequency set to: %d seconds" value))))
-
-(defcustom xwem-weather-update-frequency 0
-  "*The number of seconds between updates of the weather info.
-
-Most weather stations only update once/hour so it might not be very
-beneficial to set this to lower than an hour.
-
-If this is set to 0 updates will not happen.
-
-If you want to set this outside of the custom interface, you MUST use
-`customize-set-variable'."
-  :type '(choice
-	  (integer :tag "Do not update" 0)
-	  (integer :tag "Every 10 minutes" 600)
-	  (integer :tag "Every 15 minutes" 900)
-	  (integer :tag "Every 30 minutes" 1800)
-	  (integer :tag "Every 60 minutes" 3600)
-	  (integer :tag "Every 2 hours" 7200)
-	  (integer :tag "Every 4 hours" 14400)
-	  (integer :tag "Every 12 hours" 43200)
-	  (integer :tag "Every 24 hours" 86400)
-	  (integer :tag "Other"))
-  :set '(lambda (sym value)
-	  (xwem-weather-alter-update-frequency value))
-  :initialize 'custom-initialize-default
-  :group 'xwem-weather)
-
-(defcustom xwem-weather-data-directory xwem-dir
-  "*The directory to story weather data files."
-  :type '(directory :must-match t)
-  :group 'xwem-weather)
-
-(defcustom xwem-weather-data-file
-  (expand-file-name xwem-weather-station-id xwem-weather-data-directory)
-  "*File to hold the weather data."
-  :type 'file
-  :group 'xwem-weather)
-
-(defcustom xwem-weather-temperature-format 'celsius
-  "*Display temperature in Celsius or Fahrenheit."
-  :type '(choice
-	  (const :tag "Celsius" celsius)
-	  (const :tag "Fahrenheit" fahrenheit))
-  :group 'xwem-weather)
-
-(defface xwem-weather-osd-face
-  '((((class color))
-     (:foreground "cyan" :family "fixed" :size "12pt"))
-    (t
-     (:family "fixed" :size "12pt")))
-  "*Face for the weather OSD."
-  :group 'xwem-weather)
-
-(defconst xwem-weather-url-fqdn "weather.noaa.gov"
-  "FQDN part of the weather URL.")
-
-(defconst xwem-weather-url-dir "pub/data/observations/metar/decoded"
-  "Directory part of the weather URL.")
-
-(defun xwem-weather-retrieve-update ()
-  "Retrieve weather info."
-  (let* ((host xwem-weather-url-fqdn)
-	 (dir xwem-weather-url-dir)
-	 (file (upcase (concat xwem-weather-station-id ".txt")))
-	 (path (concat dir "/" file))
-	 (user-agent (concat "XEmacs " emacs-program-version))
-	 (http (open-network-stream "xwem-weather-update"
-				    " *xwem-weather-update-buf*"
-				    host 80))
-	 (pbuf (process-buffer http)))
-    (process-send-string
-     http
-     (concat "GET /" path " HTTP/1.1\r\n"
-	     "MIME-Version: 1.0\r\n"
-	     "Connection: close\r\n"
-	     "Extension: Security/Digest Security/SSL\r\n"
-	     "Host: " host "\r\n"
-	     "Accept: */*\r\n"
-	     "User-Agent: " user-agent "\r\n\r\n"))
-    (while (eq (process-status http) 'open)
-      (sleep-for 0.05))
-    (with-temp-buffer
-      (erase-buffer)
-      (insert-buffer pbuf)
-      (goto-char (point-min))
-      (re-search-forward "^Content-Length: \\([0-9]+.*$\\)" nil t)
-      (let* ((file-length (string-to-int (match-string 1)))
-	     (file-begin (progn
-			   (goto-char (point-min))
-			   (re-search-forward "^Content-Type:" nil t)
-			   (forward-line 2)
-			   (point-at-bol))))
-	(goto-char file-begin)
-	(forward-char file-length)
-	(narrow-to-region file-begin (point))
-	(write-region (point-min) (point-max) xwem-weather-data-file)))
-    (kill-buffer pbuf)))
-
-(defun xwem-weather-get-temp ()
-  "Return the temperature as a string from the weather data file."
-  (with-temp-buffer
-    (erase-buffer)
-    (insert-file-contents-literally xwem-weather-data-file)
-    (goto-char (point-min))
-    (re-search-forward "^Temperature: \\(-?[0-9]+ F\\) (\\(-?[0-9]+ C\\))" nil t)
-    (let ((temp-f (match-string 1))
-	  (temp-c (match-string 2)))
-      (if (eq xwem-weather-temperature-format 'celsius)
-	  temp-c
-	temp-f))))
-
-(define-xwem-command xwem-weather-show-details ()
-  "doc string"
-  (interactive)
-  (xwem-help-display
-   (insert-file-contents xwem-weather-data-file)))
-
-(define-xwem-command xwem-weather-update ()
-  "*Update the weather OSD."
-  (interactive)
-  (xwem-weather-retrieve-update)
-  (when (xwem-osd-p xwem-weather-osd)
-    (let* ((text (xwem-weather-get-temp))
-	   (face `xwem-weather-osd-face)
-	   (width (+ 3 (X-Text-width
-			(xwem-dpy)
-			(X-Font-get (xwem-dpy)
-				    (face-font-name face))
-			text)))
-	   (height (+ 3 (X-Text-height
-			 (xwem-dpy)
-			 (X-Font-get (xwem-dpy)
-				     (face-font-name face))
-			 text))))
-      (xwem-osd-text xwem-weather-osd text)
-      (xwem-osd-set-width xwem-weather-osd width)
-      (xwem-osd-set-height xwem-weather-osd height))))
-
-(define-key xwem-global-map (xwem-kbd "H-c W d") 'xwem-weather-show-details)
-(define-key xwem-global-map (xwem-kbd "H-c W u") 'xwem-weather-update)
-
-(defvar xwem-weather-osd-keymap
-  (let ((map (make-sparse-keymap 'xwem-weather-osd-keymap)))
-    (define-key map [button1] 'xwem-weather-show-details)
-    (define-key map [button2] 'xwem-weather-update)
-    map)
-  "Keymap for weather OSD.")
-
-(define-xwem-command xwem-weather-display-temp (&optional force)
-  "*Display the current temperature using OSD."
-  (xwem-interactive "P")
-  (when force
-    (xwem-weather-retrieve-update))
-  (let* ((face `xwem-weather-osd-face)
-	 (text (xwem-weather-get-temp))
-	 (width (+ 3 (X-Text-width
-		      (xwem-dpy)
-		      (X-Font-get (xwem-dpy)
-				  (face-font-name face))
-		      text)))
-	 (height (+ 3 (X-Text-height
-		       (xwem-dpy)
-		       (X-Font-get (xwem-dpy)
-				   (face-font-name face))
-		       text))))
-    (if (xwem-osd-p xwem-weather-osd)
-	(progn
-	  (xwem-osd-text xwem-weather-osd text)
-	  (xwem-osd-set-width xwem-weather-osd width)
-	  (xwem-osd-set-height xwem-weather-osd height))      
-      (setq xwem-weather-osd (xwem-osd-create-dock
-			      (xwem-dpy)
-			      width
-			      height
-			      (list 'keymap xwem-weather-osd-keymap)))
-      (xwem-osd-set-color xwem-weather-osd (face-foreground-name face))
-      (xwem-osd-set-font xwem-weather-osd (face-font-name face))
-      (xwem-osd-text xwem-weather-osd text)
-      (xwem-osd-show xwem-weather-osd))))
-
-(defun xwem-weather-init ()			    
-  "Initialise the weather dock."
-  (when (xwem-osd-p xwem-weather-osd)
-    (xwem-osd-destroy xwem-weather-osd))
-  (when (itimerp (get-itimer "xwem-weather-itimer"))
-    (delete-itimer (get-itimer "xwem-weather-itimer")))
-  (xwem-weather-display-temp 'force)
-  (unless (eq xwem-weather-frequency 0)
-    (start-itimer "xwem-weather-itimer"
-		  'xwem-weather-update
-		  xwem-weather-frequency
-		  xwem-weather-frequency)))
-
-
-(provide 'xwem-weather)
-
-;;; xwem-weather.el ends here
 
 ;;; Code
 
-(eval-when-compile
-  (require 'xwem-clients))
 
 ;;; Customization
 (defgroup xwem-win nil
   :prefix "xwem-win-"
   :group 'xwem)
 
+;;;###autoload
 (defcustom xwem-win-min-width 80
   "*Minimal width for window"
   :type 'number
   :group 'xwem-win)
 
+;;;###autoload
 (defcustom xwem-win-min-height 80
   "*Minimal height for window"
   :type 'number

lisp/xwem-worklog.el

 
 ;;; Code:
 
-(require 'xwem-compat)
+(eval-when-compile
+  (require 'cl))
+
 (require 'xwem-diagram)
-(require 'xwem-keyboard)
-(eval-when-compile
-  (require 'xlib-xlib)
-  (require 'xwem-misc))
 
 (defstruct xwem-worklog-pause
   (type 'pause)                         ; type of pause, can be 'pause or 'list
   :group 'xwem-worklog)
 
 (defcustom xwem-worklog-auto-continue nil
-  "*Non-nil means auto continue when a task is started/stopped while in pause."
+  "*Non-nil mean auto continue, when task started/stoped while in pause."
   :type 'boolean
   :group 'xwem-worklog)
 
 (defcustom xwem-worklog-auto-worklog-file nil
   "*Non-nil mean save changes all the time to `xwem-worklog-file'.
 Note that `xwem-worklog-task-time-decrease' and
-`xwem-worklog-task-time-increase' wont change file entries.  If you
-set this to non-nil you will need the worklog package, which you can
-get from: http://www.emacswiki.org/elisp/worklog.el"
+`xwem-worklog-task-time-increase' wont change file entries."
   :type 'boolean
-  :link '(url-link "http://www.emacswiki.org/elisp/worklog.el")
   :group 'xwem-worklog)
 
 (defcustom xwem-worklog-save-worklog-file-on-logout t
   :type 'alist
   :group 'xwem-worklog)
 
+;;;###autoload
 (xwem-define-prefix-command 'xwem-worklog-prefix t)
 (defvar xwem-worklog-map (symbol-function 'xwem-worklog-prefix)
   "Keymap for xwem worklog (\\<xwem-global-map>\\[xwem-worklog-prefix]) commands.
     (xwem-worklog-task-update-total-time task)
     (xwem-worklog-task-update-today-time task)
 
-    (xwem-message 'info "WORKLOG: task '%s' stopped." (xwem-worklog-task-name xwem-worklog-current-task))
+    (xwem-message 'info "WORKLOG: task '%s' stoped." (xwem-worklog-task-name xwem-worklog-current-task))
     (setq xwem-worklog-current-task nil))
   )
 
   (xwem-worklog-task-change-time '+ arg))
 
 (defun xwem-worklog-pause-task (task)
-  "Pause TASK."
+  "Pause task named by NAME."
   (unless (cdr (car (xwem-worklog-task-times task)))
     (setcdr (car (xwem-worklog-task-times task))
             (current-time))
 
     (when xwem-worklog-auto-worklog-file
       ;; XXX logout/login is special tasks that does not need to be
-      ;; stopped
+      ;; stoped
       (unless (or (string= (xwem-worklog-task-name task) "logout")
                   (string= (xwem-worklog-task-name task) "login"))
         (xwem-worklog-add-entry "stop")))
   "Add entry to `xwem-worklog-file'."
   (require 'worklog)
 
-  (let ((buf (find-file-noselect (expand-file-name xwem-worklog-file xwem-dir))))
+  (let ((buf (find-file-noselect (concat xwem-dir "/" xwem-worklog-file))))
     (save-excursion
       (unwind-protect
           (with-current-buffer buf
   (interactive)
   
   (require 'worklog)
-  (find-file (expand-file-name xwem-worklog-file xwem-dir))
+  (find-file (concat xwem-dir "/" xwem-worklog-file))
   (worklog-mode))
 
 (defun xwem-worklog-summarize ()
   (interactive)
   (require 'worklog)
 
-  (let ((worklog-file (expand-file-name xwem-worklog-file xwem-dir)))
+  (let ((worklog-file (concat xwem-dir "/" xwem-worklog-file)))
     (worklog-summarize-tasks)))
 
 (defun xwem-worklog-write-file (&optional file)
 If FILE is not given, `xwem-worklog-file' from `xwem-dir' will be used."
   (require 'worklog)
 
-  (let ((buf (find-file-noselect (or file (expand-file-name xwem-worklog-file xwem-dir)))))
+  (let ((buf (find-file-noselect (or file (concat xwem-dir "/" xwem-worklog-file)))))
     (unwind-protect
         (with-current-buffer buf
           (goto-char (point-max))       ; append to the end of buffer
 If FILE is not given, `xwem-worklog-file' from `xwem-dir' will be used."
   (require 'worklog)
 
-  (let ((buf (find-file-noselect (expand-file-name xwem-worklog-file xwem-dir))))
+  (let ((buf (find-file-noselect (concat xwem-dir "/" xwem-worklog-file))))
     (unwind-protect
         (with-current-buffer buf
           (goto-char (point-min))