Location: lg@xxxxxxxxxxxxxx http://arch.xwem.org/2005/
Revision: xwem--main--2.1--patch-8
Archive: lg@xxxxxxxxxxxxxx
Creator: Zajcev Evgeny <lg@xxxxxxxx>
Date: Fri Jan 28 00:46:41 MSK 2005
Standard-date: 2005-01-27 21:46:41 GMT
Modified-files: extra/xwem-rooticon.el lisp/xwem-clgen.el
lisp/xwem-clients.el lisp/xwem-desktop.el
lisp/xwem-edmacro.el lisp/xwem-events.el
lisp/xwem-faces.el lisp/xwem-focus.el lisp/xwem-frame.el
lisp/xwem-help.el lisp/xwem-icons.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-manage.el lisp/xwem-minibuffer.el
lisp/xwem-misc.el lisp/xwem-mouse.el lisp/xwem-netwm.el
lisp/xwem-register.el lisp/xwem-report.el
lisp/xwem-root.el lisp/xwem-selections.el
lisp/xwem-sound.el lisp/xwem-special.el
lisp/xwem-strokes.el lisp/xwem-struct.el
lisp/xwem-tabbing.el lisp/xwem-theme.el
lisp/xwem-tray.el lisp/xwem-win.el
New-patches: dev@xxxxxxxxxxxxxxxx/xwem--dev--2.1--patch-3
lg@xxxxxxxxxxxxxx/xwem--main--2.1--patch-8
Summary: Merge with ckent, 80th column fixes, tab-space fixes
Keywords:
Patches applied:
* dev@xxxxxxxxxxxxxxxx/xwem--dev--2.1--patch-3
80th column rule fixes
* added files
{arch}/xwem/xwem--dev/xwem--dev--2.1/dev@xxxxxxxxxxxxxxxx/patch-log/patch-3
{arch}/xwem/xwem--main/xwem--main--2.1/lg@xxxxxxxxxxxxxx/patch-log/patch-8
* modified files
--- orig/extra/xwem-rooticon.el
+++ mod/extra/xwem-rooticon.el
@@ -238,7 +238,8 @@
;;; Hooking into clients handling
(define-xwem-deffered xwem-rooticon-apply-state (ri)
"Show/hide rooticon RI according to RI's client state."
- (when (xwem-rooticon-p ri)
+ (when (and (xwem-rooticon-p ri)
+ (xwem-cl-p (xwem-rooticon-cl ri)))
(case (xwem-cl-state (xwem-rooticon-cl ri))
(iconified
(XLowerWindow (xwem-dpy) (xwem-rooticon-xriwin ri))
--- orig/lisp/xwem-clgen.el
+++ mod/lisp/xwem-clgen.el
@@ -88,7 +88,7 @@
:group 'xwem-clgen)
(defcustom xwem-clgen-allow-make-frame t
- "*Non-nil mean, clgen permited to make frame if there no frame where client
can be managed."
+ "*Non-nil mean, clgen permited to create new frames."
:type 'boolean
:group 'xwem-clgen)
@@ -125,9 +125,12 @@
(let (rcl notgoodcl)
(while clients-list
(when (and (not (eq (car clients-list) cl)) ; skip ourself
- (not (eq (xwem-cl-state (car clients-list)) 'iconified))) ;
skip iconfied
- (if (and (not (xwem-dummy-client-p (car clients-list))) ; exclude
dummy clients
- (or visible (not (xwem-win-cl-current-p (car
clients-list)))))
+ ;; skip iconified
+ (not (eq (xwem-cl-state (car clients-list)) 'iconified)))
+ ;; exclude dummy clients
+ (if (and (not (xwem-dummy-client-p (car clients-list)))
+ (or visible
+ (not (xwem-win-cl-current-p (car clients-list)))))
(progn
(setq rcl (car clients-list))
(setq clients-list nil))
@@ -199,8 +202,8 @@
(if (numberp arg)
(if (> arg 0)
- (setq xwem-clgen-other-on-split nil)
- (setq xwem-clgen-other-on-split t)))
+ (setq xwem-clgen-other-on-split nil)
+ (setq xwem-clgen-other-on-split t)))
(if xwem-clgen-other-on-split
(xwem-clgen-turn-off-other-on-split)
@@ -253,7 +256,8 @@
(unless (xwem-cl-xparent cl)
(setf (xwem-cl-xparent cl)
(XCreateWindow (xwem-dpy) nil 0 0 1 1 0 nil nil nil
- (make-X-Attr :override-redirect t :event-mask
0.0))))
+ (make-X-Attr :override-redirect t
+ :event-mask 0.0))))
;; Set CL's window
(xwem-cl-set-win cl dwin)
@@ -318,12 +322,14 @@
(XMapWindow (xwem-dpy) (xwem-cl-xwin cl)))
((eq (xwem-cl-state cl) 'inactive)
- (XReparentWindow (xwem-dpy) (xwem-cl-xwin cl) (xwem-cl-xparent cl)
0 0)
+ (XReparentWindow (xwem-dpy) (xwem-cl-xwin cl)
+ (xwem-cl-xparent cl) 0 0)
(XLowerWindow (xwem-dpy) (xwem-cl-xwin cl))
(XUnmapWindow (xwem-dpy) (xwem-cl-xwin cl)))
((eq (xwem-cl-state cl) 'iconified)
- (XReparentWindow (xwem-dpy) (xwem-cl-xwin cl) (xwem-cl-xparent cl)
0 0)
+ (XReparentWindow (xwem-dpy) (xwem-cl-xwin cl)
+ (xwem-cl-xparent cl) 0 0)
(XLowerWindow (xwem-dpy) (xwem-cl-xwin cl))
(XUnmapWindow (xwem-dpy) (xwem-cl-xwin cl))))
))
--- orig/lisp/xwem-clients.el
+++ mod/lisp/xwem-clients.el
@@ -134,8 +134,8 @@
One of 'any 'samewin 'sameframe.
TODO: add more strategies."
:type '(choice (const :tag "Same Window" samewin)
- (const :tag "Same Frame" sameframe)
- (const :tag "Any" any))
+ (const :tag "Same Frame" sameframe)
+ (const :tag "Any" any))
:group 'xwem-cl)
(defcustom xwem-frame-iresize-mode 'normal
@@ -234,6 +234,12 @@
:group 'xwem-hooks)
;;;###autoload
+(defcustom xwem-cl-manage-hook nil
+ "*Hooks to be called with just managed CL as argument."
+ :type 'hook
+ :group 'xwem-hooks)
+
+;;;###autoload
(defcustom xwem-cl-activate-hook nil
"*Hooks to be called with just setuped CL as argument."
:type 'hook
@@ -494,9 +500,9 @@
"Apply CL's x border color to life."
(when (xwem-cl-managed-p cl)
(XSetWindowBorder (xwem-dpy) (xwem-cl-xwin cl)
- (X-Gc-foreground (xwem-face-get-gc 'x-border-face
- (and (xwem-cl-selected-p cl)
'(selected))
- cl)))))
+ (X-Gc-foreground
+ (xwem-face-get-gc 'x-border-face
+ (and (xwem-cl-selected-p cl) '(selected)) cl)))))
(defun xwem-client-default-select-hook ()
"Default hook to be added to `xwem-client-select-hook'."
@@ -562,32 +568,32 @@
(if (stringp cl)
cl
(let ((cll (or clist xwem-clients))
- (cln (xwem-hints-wm-name (xwem-cl-hints cl)))
- (cnt 0))
+ (cln (xwem-hints-wm-name (xwem-cl-hints cl)))
+ (cnt 0))
(while cll
- (cond ((string= (xwem-hints-wm-name (xwem-cl-hints (car cll))) cln)
- (if (eq cl (car cll))
- (setq cll nil)
- (setq cnt (1+ cnt))))
- (t nil))
- (setq cll (cdr cll)))
+ (cond ((string= (xwem-hints-wm-name (xwem-cl-hints (car cll))) cln)
+ (if (eq cl (car cll))
+ (setq cll nil)
+ (setq cnt (1+ cnt))))
+ (t nil))
+ (setq cll (cdr cll)))
(if (> cnt 0)
- (format "%s<%d>" cln cnt)
- cln))))
+ (format "%s<%d>" cln cnt)
+ cln))))
;;;###xwem-autoload
(defun xwem-find-client (win-or-id)
"Find WIN-OR-ID in client windows list.
WIN-OR-ID can be X-Win or id of window."
(let ((winid (if (X-Win-p win-or-id) (X-Win-id win-or-id) win-or-id))
- (cl xwem-clients)
- (rc nil))
+ (cl xwem-clients)
+ (rc nil))
(while cl
(if (= (X-Win-id (xwem-cl-xwin (car cl))) winid)
- (progn
- (setq rc (car cl))
- (setq cl nil))
- (setq cl (cdr cl))))
+ (progn
+ (setq rc (car cl))
+ (setq cl nil))
+ (setq cl (cdr cl))))
rc))
(defun xwem-remove-client (cl)
@@ -603,23 +609,23 @@
(define-xwem-deffered xwem-cl-send-config (cl)
"Send config info to window."
(let ((clgeom (xwem-cl-xgeom cl))
- (win (xwem-cl-xwin cl)))
+ (win (xwem-cl-xwin cl)))
(XSendEvent (xwem-dpy) win nil XM-StructureNotify
- (X-Create-message
- (list [1 X-ConfigureNotify] ;type
- [1 nil] ;detail
- [2 2806] ;seq
- [4 (X-Win-id win)] ;event
- [4 (X-Win-id win)] ;window
- [4 X-None] ;above sibling
- (vector 2 (X-Geom-x clgeom)) ; shutup compiler
- [2 (X-Geom-y clgeom)]
- [2 (X-Geom-width clgeom)]
- [2 (X-Geom-height clgeom)]
- [2 (X-Geom-border-width clgeom)] ;XXX
- [1 nil] ;pad override
- [1 nil] ;pad
- )))
+ (X-Create-message
+ (list [1 X-ConfigureNotify] ;type
+ [1 nil] ;detail
+ [2 2806] ;seq
+ [4 (X-Win-id win)] ;event
+ [4 (X-Win-id win)] ;window
+ [4 X-None] ;above sibling
+ (vector 2 (X-Geom-x clgeom)) ; shutup compiler
+ [2 (X-Geom-y clgeom)]
+ [2 (X-Geom-width clgeom)]
+ [2 (X-Geom-height clgeom)]
+ [2 (X-Geom-border-width clgeom)] ;XXX
+ [1 nil] ;pad override
+ [1 nil] ;pad
+ )))
))
@@ -654,7 +660,7 @@
(if (or (not rc1) (not rc2))
(not (null rc1))
-
+
(cond ((> (nth 0 rc1) (nth 0 rc2))
t)
((< (nth 0 rc1) (nth 0 rc2))
@@ -688,13 +694,15 @@
(xwem-cl-list-sort-by-recency clients-list)))
(let ((rcl nil)
- (notgoodcl nil)) ;not so good candidate as rcl
+ (notgoodcl nil)) ;not so good candidate as rcl
(while clients-list
(when (and (xwem-cl-p (car clients-list)) ; skip non-clients
(not (eq (car clients-list) cl)) ; skip ourself
- (not (eq (xwem-cl-state (car clients-list)) 'iconified))) ;
skip iconified
- (if (or also-active (not (eq (xwem-cl-state (car clients-list))
'active)))
+ ;; skip iconified
+ (not (eq (xwem-cl-state (car clients-list)) 'iconified)))
+ (if (or also-active
+ (not (eq (xwem-cl-state (car clients-list)) 'active)))
;; Found pretty good candidate
(setq rcl (car clients-list)
clients-list nil)
@@ -739,31 +747,31 @@
(let* ((hthi (or (X-Geom-border-width new-geom) 0))
(he (X-Geom-height new-geom))
(wi (X-Geom-width new-geom))
- (clgmt (xwem-cl-xgeom cl))
+ (clgmt (xwem-cl-xgeom cl))
(wmnh (xwem-hints-wm-normal-hints (xwem-cl-hints cl)))
- (wi-rmd 0)
- (he-rmd 0)
- bw bh wi-st he-st)
+ (wi-rmd 0)
+ (he-rmd 0)
+ bw bh wi-st he-st)
(when wmnh
(setq bw (X-WMSize-base-width wmnh))
(setq bh (X-WMSize-base-height wmnh))
(when (X-WMSize-presizeinc-p wmnh)
- (setq wi-st (X-WMSize-width-inc wmnh)) ; width step
- (setq he-st (X-WMSize-height-inc wmnh))) ; height step
+ (setq wi-st (X-WMSize-width-inc wmnh)) ; width step
+ (setq he-st (X-WMSize-height-inc wmnh))) ; height step
;; - Calculate size reminders
;; - Adjust wi-rmd and he-rmd if needed
(when wi-st
- (setq wi-rmd (% (abs (- wi bw (* 2 hthi))) wi-st))
- (when (> bw wi)
- (setq wi-rmd (- wi-st wi-rmd))))
+ (setq wi-rmd (% (abs (- wi bw (* 2 hthi))) wi-st))
+ (when (> bw wi)
+ (setq wi-rmd (- wi-st wi-rmd))))
(when he-st
- (setq he-rmd (% (abs (- he bh (* 2 hthi))) he-st))
- (when (> bh he)
- (setq he-rmd (- he-st he-rmd)))))
+ (setq he-rmd (% (abs (- he bh (* 2 hthi))) he-st))
+ (when (> bh he)
+ (setq he-rmd (- he-st he-rmd)))))
(unless (X-Geom-p clgmt)
(setf (xwem-cl-xgeom cl) (make-X-Geom))
@@ -771,17 +779,17 @@
;; Now adjust geometry according to X-TYPE and Y-TYPE layout
(cond ((eq x-type 'left)
- (setf (X-Geom-x clgmt) (X-Geom-x new-geom)))
- ((eq x-type 'right)
- (setf (X-Geom-x clgmt) (+ (X-Geom-x new-geom) wi-rmd)))
- (t ; 'center or any other
- (setf (X-Geom-x clgmt) (+ (X-Geom-x new-geom) (/ wi-rmd 2)))))
+ (setf (X-Geom-x clgmt) (X-Geom-x new-geom)))
+ ((eq x-type 'right)
+ (setf (X-Geom-x clgmt) (+ (X-Geom-x new-geom) wi-rmd)))
+ (t ; 'center or any other
+ (setf (X-Geom-x clgmt) (+ (X-Geom-x new-geom) (/ wi-rmd 2)))))
(cond ((eq y-type 'top)
- (setf (X-Geom-y clgmt) (X-Geom-y new-geom)))
- ((eq y-type 'bottom)
- (setf (X-Geom-y clgmt) (+ (X-Geom-y new-geom) he-rmd)))
- (t
- (setf (X-Geom-y clgmt) (+ (X-Geom-y new-geom) (/ he-rmd 2)))))
+ (setf (X-Geom-y clgmt) (X-Geom-y new-geom)))
+ ((eq y-type 'bottom)
+ (setf (X-Geom-y clgmt) (+ (X-Geom-y new-geom) he-rmd)))
+ (t
+ (setf (X-Geom-y clgmt) (+ (X-Geom-y new-geom) (/ he-rmd 2)))))
(setf (X-Geom-width clgmt) (- wi (* 2 hthi) wi-rmd))
(setf (X-Geom-height clgmt) (- he (* 2 hthi) he-rmd))))
@@ -810,10 +818,11 @@
(eq (xwem-cl-manage-type cl) (quote ,mt))))))
(clients (xwem-cl-list-sort-by-recency
(xwem-clients-list pred arg)))
- (cl (xwem-read-client (if arg (format "XWEM-CL (%S): "
- (and (xwem-cl-p
(xwem-cl-selected))
- (xwem-cl-manage-type
(xwem-cl-selected))))
- "XWEM-CL: ") clients)))
+ (cl (xwem-read-client
+ (if arg (format "XWEM-CL (%S): "
+ (and (xwem-cl-p (xwem-cl-selected))
+ (xwem-cl-manage-type (xwem-cl-selected))))
+ "XWEM-CL: ") clients)))
(unless (xwem-cl-alive-p cl)
(error 'xwem-error "Invalid client"))
@@ -848,7 +857,8 @@
(xwem-interactive "P")
(let* ((pred (lambda (cl)
- (and (xwem-manage-property (xwem-cl-manage-type cl)
'win-support)
+ (and (xwem-manage-property
+ (xwem-cl-manage-type cl) 'win-support)
(or arg
(eq (xwem-cl-win cl) (xwem-win-selected))))))
(cl (xwem-read-client (if arg "XWEM-CL any: " "XWEM-CL: ")
@@ -891,7 +901,7 @@
xwem-prefix-arg))
(let ((ofr (or (xwem-frame-other (xwem-frame-selected))
- (xwem-make-frame-1 (or (and arg 'embedded) 'desktop)
+ (xwem-make-frame-1 (or (and arg 'embedded) 'desktop)
:noselect t))))
(xwem-cl-change-window cl (xwem-frame-selwin ofr))
@@ -932,7 +942,7 @@
(error 'xwem-error "Invalid client"))
(xwem-activate cl)))
-
+
;;;###autoload(autoload 'xwem-kill-cl-and-window "xwem-clients" "" t)
(define-xwem-command xwem-kill-cl-and-window (window &optional arg)
"Kill WINDOW an client currently activated in it.
@@ -942,7 +952,7 @@
xwem-prefix-arg))
(let* ((win (if arg (xwem-window-other 1 window) window))
- (cl (xwem-win-cl win)))
+ (cl (xwem-win-cl win)))
;; kill client
(when (xwem-cl-p cl)
@@ -1056,19 +1066,20 @@
;; Fetch some window properties
(setf (xwem-cl-hints cl)
- (make-xwem-hints :wm-normal-hints (or (XGetWMNormalHints (xwem-dpy)
xwin)
- (make-X-WMSize :flags 0))
- :wm-hints (or (XGetWMHints (xwem-dpy) xwin)
- (make-X-WMHints :flags 0))
- :wm-class (multiple-value-bind (ci cn)
- (values-list (XGetWMClass (xwem-dpy)
xwin))
- (cons ci cn))
- :wm-command (XGetWMCommand (xwem-dpy) xwin)
- :wm-name (XGetWMName (xwem-dpy) xwin)
- :wm-icon-name (XGetPropertyString (xwem-dpy)
- xwin XA-wm-icon-name)
- :wm-transient-for (XGetWMTransientFor (xwem-dpy)
xwin)
- :wm-protocols (XGetWMProtocols (xwem-dpy) xwin)))
+ (make-xwem-hints
+ :wm-normal-hints (or (XGetWMNormalHints (xwem-dpy) xwin)
+ (make-X-WMSize :flags 0))
+ :wm-hints (or (XGetWMHints (xwem-dpy) xwin)
+ (make-X-WMHints :flags 0))
+ :wm-class (multiple-value-bind (ci cn)
+ (values-list (XGetWMClass (xwem-dpy) xwin))
+ (cons ci cn))
+ :wm-command (XGetWMCommand (xwem-dpy) xwin)
+ :wm-name (XGetWMName (xwem-dpy) xwin)
+ :wm-icon-name (XGetPropertyString (xwem-dpy)
+ xwin XA-wm-icon-name)
+ :wm-transient-for (XGetWMTransientFor (xwem-dpy) xwin)
+ :wm-protocols (XGetWMProtocols (xwem-dpy) xwin)))
(when (zerop (length (xwem-hints-wm-name (xwem-cl-hints cl))))
;; WMNAME is empty
@@ -1076,7 +1087,7 @@
;; In case CL is transient for window
(setf (xwem-cl-transient-for cl)
- (xwem-hints-wm-transient-for (xwem-cl-hints cl)))
+ (xwem-hints-wm-transient-for (xwem-cl-hints cl)))
;; Install keyboard grabs, (ARGUSED)
(xwem-kbd-install-grab xwem-global-map xwin)))
@@ -1145,7 +1156,8 @@
(setf (xwem-cl-manage-spec cl) mspec)
(xwem-cl-apply-plist cl (cadr mspec))
- (xwem-debug 'xwem-cl "Managing model: %S selected" '(xwem-cl-manage-type
cl))
+ (xwem-debug 'xwem-cl "Managing model: %S selected"
+ '(xwem-cl-manage-type cl))
;; Setup focus mode if not already setuped
(unless (xwem-client-property cl 'xwem-focus-mode)
@@ -1197,7 +1209,8 @@
(setq nplist (cdr (cdr nplist)))))
;;;###xwem-autoload
-(defun xwem-cl-apply-new-xgeom (cl &optional correct-including-border
hold-size)
+(defun xwem-cl-apply-new-xgeom (cl &optional correct-including-border
+ hold-size)
"Apply entries in `xwem-cl-new-xgeom' to CL's x geometry.
When CORRECT-INCLUDING-BORDER is non-nil, then
`xwem-cl-correct-size-for-size' will correct size reguarding new
@@ -1234,15 +1247,18 @@
"Apply CL's geometry to CL's X window."
(let ((clxg (xwem-cl-xgeom cl)))
(XConfigureWindow (xwem-dpy) (xwem-cl-xwin cl)
- (make-X-Conf :x (X-Geom-x clxg) :y (X-Geom-y clxg)
- :width (X-Geom-width clxg) :height
(X-Geom-height clxg)
+ (make-X-Conf :x (X-Geom-x clxg)
+ :y (X-Geom-y clxg)
+ :width (X-Geom-width clxg)
+ :height (X-Geom-height clxg)
:border-width (X-Geom-border-width clxg)))
(xwem-cl-send-config-1 cl)))
;;;###xwem-autoload
(defun xwem-client-move (cl new-x new-y)
"Move client CL to NEW-X, NEW-Y."
- (setf (xwem-cl-new-xgeom cl) (make-X-Geom :x new-x :y new-y :border-width
nil))
+ (setf (xwem-cl-new-xgeom cl)
+ (make-X-Geom :x new-x :y new-y :border-width nil))
(xwem-refit cl))
;;;###xwem-autoload
@@ -1256,7 +1272,9 @@
(defun xwem-client-move-resize (cl new-x new-y new-width new-height)
"Move CL to NEW-X, NEW-Y and resize to NEW-WIDTH, NEW-HEIGHT."
(setf (xwem-cl-new-xgeom cl)
- (make-X-Geom :x new-x :y new-y :width new-width :height new-height
:border-width nil))
+ (make-X-Geom :x new-x :y new-y
+ :width new-width :height new-height
+ :border-width nil))
(xwem-refit cl))
@@ -1367,10 +1385,10 @@
(when cmd
;; Check is there split needed
(when (eq own (xwem-win-selected))
- (if arg
- (xwem-window-split-horizontally 0)
- (xwem-window-split-vertically 0))
- (setq own (xwem-win-next (xwem-win-selected))))
+ (if arg
+ (xwem-window-split-horizontally 0)
+ (xwem-window-split-vertically 0))
+ (setq own (xwem-win-next (xwem-win-selected))))
;; Install expectance in hope it will be managed by generic
;; manage type, or some other type that suppors expectances.
@@ -1423,8 +1441,8 @@
"Return base width and height for CL."
(let ((wmnh (xwem-hints-wm-normal-hints (xwem-cl-hints cl))))
(cond ((and wmnh (X-WMSize-pbasesize-p wmnh))
- (cons (X-WMSize-base-width wmnh) ;base width
- (X-WMSize-base-height wmnh))) ;base height
+ (cons (X-WMSize-base-width wmnh) ;base width
+ (X-WMSize-base-height wmnh))) ;base height
((and wmnh (X-WMSize-pminsize-p wmnh))
(cons (X-WMSize-min-width wmnh)
(X-WMSize-min-height wmnh))))))
@@ -1457,28 +1475,28 @@
(defun xwem-cl-get-usize (cl)
"Returns cons cell (uwi . uhe) - CL's size in steps."
(let* ((clgmt (xwem-cl-xgeom cl))
- (wmnh (xwem-hints-wm-normal-hints (xwem-cl-hints cl)))
- (steps (xwem-cl-step-geom cl))
- (base (xwem-cl-base-geom cl))
- (minsize (xwem-cl-min-geom cl))
- (uwi (X-Geom-width clgmt))
- (uhe (X-Geom-height clgmt)))
-
+ (wmnh (xwem-hints-wm-normal-hints (xwem-cl-hints cl)))
+ (steps (xwem-cl-step-geom cl))
+ (base (xwem-cl-base-geom cl))
+ (minsize (xwem-cl-min-geom cl))
+ (uwi (X-Geom-width clgmt))
+ (uhe (X-Geom-height clgmt)))
+
(if (and steps
- (not (= (car steps) 0))
- (not (= (cdr steps) 0)))
- (when (or base minsize)
- (progn
- (setq uwi (- uwi (if (X-WMSize-pbasesize-p wmnh)
- (car base)
- (car minsize))))
- (setq uhe (- uhe (if (X-WMSize-pbasesize-p wmnh)
- (cdr base)
- (cdr minsize))))))
+ (not (= (car steps) 0))
+ (not (= (cdr steps) 0)))
+ (when (or base minsize)
+ (progn
+ (setq uwi (- uwi (if (X-WMSize-pbasesize-p wmnh)
+ (car base)
+ (car minsize))))
+ (setq uhe (- uhe (if (X-WMSize-pbasesize-p wmnh)
+ (cdr base)
+ (cdr minsize))))))
(setq steps '(1 . 1)))
(cons (/ uwi (car steps))
- (/ uhe (cdr steps)))))
+ (/ uhe (cdr steps)))))
;;;###xwem-autoload
(defun xwem-cl-get-psize (cl)
@@ -1503,40 +1521,40 @@
%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 ""))
+ (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 ((flst (string-to-list fmt))
- chr)
+ chr)
(while flst
- (setq chr (car flst))
- (cond ((= chr ?%)
- (setq flst (cdr flst))
- (setq chr (car flst))
- (cond ((= chr ?d)
- (setq rup (concat rup (format "%d" days))))
- ((= chr ?h)
- (setq rup (concat rup (format "%d" hours))))
- ((= chr ?m)
- (setq rup (concat rup (format "%d" minutes))))
- ((= chr ?s)
- (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))
- ((> minutes 0) (format "%dm %ds" minutes
seconds))
- ((> seconds 0) (format "%d seconds"
seconds))
- (t "")))))
- (t (error "Invalid format"))))
-
- (t (setq rup (concat rup (char-to-string chr)))))
- (setq flst (cdr flst))))
+ (setq chr (car flst))
+ (cond ((= chr ?%)
+ (setq flst (cdr flst))
+ (setq chr (car flst))
+ (cond ((= chr ?d)
+ (setq rup (concat rup (format "%d" days))))
+ ((= chr ?h)
+ (setq rup (concat rup (format "%d" hours))))
+ ((= chr ?m)
+ (setq rup (concat rup (format "%d" minutes))))
+ ((= chr ?s)
+ (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))
+ ((> minutes 0) (format "%dm %ds"
minutes seconds))
+ ((> seconds 0) (format "%d seconds"
seconds))
+ (t "")))))
+ (t (error "Invalid format"))))
+
+ (t (setq rup (concat rup (char-to-string chr)))))
+ (setq flst (cdr flst))))
rup))
;;;###autoload(autoload 'xwem-client-info "xwem-clients" "" t)
@@ -1584,7 +1602,8 @@
(define-xwem-command xwem-client-set-title (title &optional cl)
"Set new TITLE for client CL."
(xwem-interactive
- (list (xwem-read-from-minibuffer "XWEM Set title: " (xwem-client-name
(xwem-cl-selected)))
+ (list (xwem-read-from-minibuffer
+ "XWEM Set title: " (xwem-client-name (xwem-cl-selected)))
(xwem-cl-selected)))
(unless (xwem-cl-p cl)
@@ -1611,11 +1630,13 @@
With no prefix ARG push selected client to `xwem-cl-mark-ring'.
With positive prefix ARG, jump to ARG's client in `xwem-cl-mark-ring'.
With negative prefix ARG, unset mark from CL."
- (xwem-interactive (list (if (and (not (null xwem-prefix-arg))
- (> (prefix-numeric-value xwem-prefix-arg)
0))
- (nth (1- (prefix-numeric-value xwem-prefix-arg))
xwem-cl-mark-ring)
- (xwem-cl-selected))
- xwem-prefix-arg))
+ (xwem-interactive
+ (list (if (and (not (null xwem-prefix-arg))
+ (> (prefix-numeric-value xwem-prefix-arg) 0))
+ (nth (1- (prefix-numeric-value xwem-prefix-arg))
+ xwem-cl-mark-ring)
+ (xwem-cl-selected))
+ xwem-prefix-arg))
(unless (xwem-cl-p cl)
(error 'xwem-error "Invalid client"))
@@ -1733,8 +1754,7 @@
(= (car (nth 0 (X-Event-xclient-msg xev))) X-IconicState))
;; Iconify request from client
(xwem-iconify cl))
- )
- ))
+ )))
(defun xwem-cl-events-handler (xdpy xwin xev)
"Events handler for root window."
@@ -1835,7 +1855,8 @@
(when xwem-iresize-visible
(let ((psize (xwem-cl-get-psize cl))
(usize (xwem-cl-get-usize cl)))
- (xwem-message 'nolog "New size %dx%d/%dx%d" (car psize) (cdr
psize) (car usize) (cdr usize))))
+ (xwem-message 'nolog "New size %dx%d/%dx%d"
+ (car psize) (cdr psize) (car usize) (cdr usize))))
(while (not done)
(X-Event-CASE (setq xev (xwem-next-event))
(:X-ButtonRelease (setq done t))
@@ -1847,7 +1868,9 @@
(when xwem-iresize-visible
(let ((psize (xwem-cl-get-psize cl))
(usize (xwem-cl-get-usize cl)))
- (xwem-message 'nolog "New size %dx%d/%dx%d" (car psize)
(cdr psize) (car usize) (cdr usize))))
+ (xwem-message 'nolog "New size %dx%d/%dx%d"
+ (car psize) (cdr psize)
+ (car usize) (cdr usize))))
))))))
(XUngrabPointer (xwem-dpy)))))
@@ -2015,7 +2038,8 @@
ARGS - arguments."
;; Reguard border width change
(when (and (xwem-cl-new-xgeom cl)
- (xwem-manage-property (xwem-cl-manage-type cl)
'reguard-x-border-width)
+ (xwem-manage-property (xwem-cl-manage-type cl)
+ 'reguard-x-border-width)
(X-Geom-border-width (xwem-cl-new-xgeom cl)))
(setf (X-Geom-border-width (xwem-cl-xgeom cl))
(X-Geom-border-width (xwem-cl-new-xgeom cl))))
@@ -2105,9 +2129,10 @@
"Create dummy client"
(unless xwem-dummy-client
(setq xwem-dummy-client
- (xwem-make-client (XCreateWindow (xwem-dpy) nil 0 0 1 1 0 nil nil nil
- (make-X-Attr :override-redirect t))
- '(dummy-client-p t ignore-has-input-p t)))
+ (xwem-make-client
+ (XCreateWindow (xwem-dpy) nil 0 0 1 1 0 nil nil nil
+ (make-X-Attr :override-redirect t))
+ '(dummy-client-p t ignore-has-input-p t)))
(XSelectInput (xwem-dpy) (xwem-cl-xwin xwem-dummy-client)
(Xmask-or XM-KeyPress XM-KeyRelease
@@ -2163,22 +2188,29 @@
(cond ((xwem-cl-new-xgeom cl)
(xwem-cl-apply-new-xgeom cl nil t)
(xwem-cl-apply-xgeom cl)
- (xwem-window-set-size (xwem-cl-win cl)
- (X-Geom-width-with-borders (xwem-cl-xgeom cl))
- (X-Geom-height-with-borders (xwem-cl-xgeom
cl))))
+ (xwem-window-set-size
+ (xwem-cl-win cl)
+ (X-Geom-width-with-borders (xwem-cl-xgeom cl))
+ (X-Geom-height-with-borders (xwem-cl-xgeom cl))))
(t
(let ((win (xwem-cl-win cl))
(clg (xwem-cl-xgeom cl)))
- (when (or (not (= (X-Geom-width-with-borders clg) (xwem-win-width
win)))
- (not (= (X-Geom-height-with-borders clg) (xwem-win-height
win))))
+ (when (or (not (= (X-Geom-width-with-borders clg)
+ (xwem-win-width win)))
+ (not (= (X-Geom-height-with-borders clg)
+ (xwem-win-height win))))
(xwem-cl-correct-size-for-size cl
- (make-X-Geom :x (xwem-win-x win) :y (xwem-win-y win)
- :width (xwem-win-width win) :height
(xwem-win-height win)
- :border-width (X-Geom-border-width clg)) 'left 'top)
- (xwem-window-set-size (xwem-cl-win cl)
- (X-Geom-width-with-borders (xwem-cl-xgeom
cl))
- (X-Geom-height-with-borders (xwem-cl-xgeom
cl)))
+ (make-X-Geom :x (xwem-win-x win)
+ :y (xwem-win-y win)
+ :width (xwem-win-width win)
+ :height (xwem-win-height win)
+ :border-width (X-Geom-border-width clg))
+ 'left 'top)
+ (xwem-window-set-size
+ (xwem-cl-win cl)
+ (X-Geom-width-with-borders (xwem-cl-xgeom cl))
+ (X-Geom-height-with-borders (xwem-cl-xgeom cl)))
(xwem-cl-apply-xgeom cl))))))
(define-xwem-deffered xwem-cldedic-apply-state (cl)
@@ -2192,8 +2224,7 @@
(xwem-select-window (xwem-cl-win cl)))
((eq type 'activate)
- (xwem-cldedic-apply-state cl)))
- )
+ (xwem-cldedic-apply-state cl))))
(defun xwem-deactivate-dedicated (cl &optional type)
"Deactivate method for dedicated CL."
@@ -2322,7 +2353,7 @@
(define-xwem-manage-model dummy
"Managing model for dummy clients.
Dummy client is client which can't do anything."
- :match-spec '(function (lambda (cl) (xwem-client-property cl
'dummy-client-p))))
+ :match-spec '(function xwem-dummy-client-p))
(if xwem-started
(xwem-clients-init)
--- orig/lisp/xwem-desktop.el
+++ mod/lisp/xwem-desktop.el
@@ -59,15 +59,18 @@
"*List of variables to save.
Each element is eather symbol or cons cell in form.
\(symbol . maxsize\)."
- :type '(repeat (choice (const :tag "Frames configuration" frames-config)
- (cons :tag "Keymap goal"
- (const :tag "Keymap" keymap)
- (symbol :tag "Keymap prefix"))
- (cons :tag "History"
- (choice (const :tag "Launcher history"
xwem-launcher-history)
- (const :tag "Expression history"
xwem-read-expression-history)
- (symbol :tag "Custom history"))
- (number :tag "Max Size"))))
+ :type '(repeat
+ (choice (const :tag "Frames configuration" frames-config)
+ (cons :tag "Keymap goal"
+ (const :tag "Keymap" keymap)
+ (symbol :tag "Keymap prefix"))
+ (cons :tag "History"
+ (choice (const :tag "Launcher history"
+ xwem-launcher-history)
+ (const :tag "Expression history"
+ xwem-read-expression-history)
+ (symbol :tag "Custom history"))
+ (number :tag "Max Size"))))
:group 'xwem-desktop)
;;; Internal variables
@@ -85,7 +88,8 @@
(princ "\n;; Symbol value\n" buffer)
(princ (concat "(setq " (symbol-name el) " "
(if (listp (symbol-value el))
- (concat "(quote " (prin1-to-string (symbol-value
el)) ")")
+ (concat "(quote "
+ (prin1-to-string (symbol-value el)) ")")
(prin1-to-string (symbol-value el)))
")\n")
buffer))
@@ -111,7 +115,8 @@
(kmap-name (keymap-name kmap)))
(princ (format "\n;; Keymap (%s)\n" kmap-name) buffer)
(map-keymap (lambda (kseq fbind)
- (princ (concat "(define-key (quote " (prin1-to-string
kmap-name) ") "
+ (princ (concat "(define-key (quote "
+ (prin1-to-string kmap-name) ") "
"(quote " (prin1-to-string kseq) ") "
"(quote " (prin1-to-string fbind) ")"
")\n")
@@ -132,7 +137,7 @@
(erase-buffer)
(insert
(format ";;; %s --- Desktop configuration for XWEM.\n"
- (file-name-nondirectory file))
+ (file-name-nondirectory file))
"\n;; NOTE: This file is automatically generated by xwem-desktop\n\n")
;; Set print-XX to nil to make full printing of objects
--- orig/lisp/xwem-edmacro.el
+++ mod/lisp/xwem-edmacro.el
@@ -78,12 +78,13 @@
"Store new keyboard macro MAC."
(setq mac (key-sequence-list-description mac))
(cond ((eq xwem-edmacro-store-place 'xwem-keymacro-last-kbd-macro)
- (setq xwem-keymacro-last-kbd-macro mac)
- (xwem-message 'info "New keymacro stored to `%S'"
xwem-edmacro-store-place))
-
- (t
- ;; redefine key in user macros map
- (define-key xwem-global-map xwem-edmacro-store-place mac)))
+ (setq xwem-keymacro-last-kbd-macro mac)
+ (xwem-message 'info "New keymacro stored to `%S'"
+ xwem-edmacro-store-place))
+
+ (t
+ ;; redefine key in user macros map
+ (define-key xwem-global-map xwem-edmacro-store-place mac)))
(setq xwem-edmacro-store-place nil))
@@ -106,61 +107,67 @@
(xwem-read-key-sequence
(substitute-command-keys
(concat "Enter `\\<xwem-global-map>\\[xwem-keymacro-play-last]' "
- "or one of `\\<xwem-global-map>\\[xwem-user-macros-prefix] XXX':
")))
+ "or one of `\\<xwem-global-map>\\[xwem-user-macros-prefix] XXX':
")))
(prefix-numeric-value xwem-prefix-arg)))
(xwem-kbd-stop-grabbing)
(let ((xwem-cmd (xwem-kbd-get-binding xwem-keys))
- xwem-evs frame)
+ xwem-evs frame)
(setq xwem-evs (cond ((eq xwem-cmd 'xwem-keymacro-play-last)
- (setq xwem-edmacro-store-place
'xwem-keymacro-last-kbd-macro)
- (or xwem-keymacro-last-kbd-macro []))
-
- ((vectorp xwem-cmd)
- (setq xwem-edmacro-store-place xwem-keys)
- xwem-cmd)
-
- ((and xwem-edmacro-can-edit-unbinded (null xwem-cmd))
- (setq xwem-edmacro-store-place xwem-keys)
- [])
-
- (xwem-edmacro-can-edit-nonmacro
- (setq xwem-edmacro-store-place xwem-keys)
- [])
+ (setq xwem-edmacro-store-place
+ 'xwem-keymacro-last-kbd-macro)
+ (or xwem-keymacro-last-kbd-macro []))
+
+ ((vectorp xwem-cmd)
+ (setq xwem-edmacro-store-place xwem-keys)
+ xwem-cmd)
+
+ ((and xwem-edmacro-can-edit-unbinded (null xwem-cmd))
+ (setq xwem-edmacro-store-place xwem-keys)
+ [])
+
+ (xwem-edmacro-can-edit-nonmacro
+ (setq xwem-edmacro-store-place xwem-keys)
+ [])
- (t nil)))
+ (t nil)))
(if (null xwem-evs)
- (cond ((and (not xwem-edmacro-can-edit-unbinded) (null xwem-cmd))
- (xwem-message 'warning (concat "Dissalowed to edit unbinded key "
- (key-description xwem-keys)
- " by
`xwem-edmacro-can-edit-unbinded'")))
- ((not xwem-edmacro-can-edit-nonmacro)
- (xwem-message 'warning (concat "Dissalowed to edit non-macro key
"
- (key-description xwem-keys)
- " by
`xwem-edmacro-can-edit-nonmacro'.")))
- (t (xwem-message 'warning "Invalid keyboard macro given.")))
+ (cond ((and (not xwem-edmacro-can-edit-unbinded) (null xwem-cmd))
+ (xwem-message 'warning
+ (concat "Dissalowed to edit unbinded key "
+ (key-description xwem-keys)
+ " by `xwem-edmacro-can-edit-unbinded'")))
+ ((not xwem-edmacro-can-edit-nonmacro)
+ (xwem-message 'warning
+ (concat "Dissalowed to edit non-macro key "
+ (key-description xwem-keys)
+ " by `xwem-edmacro-can-edit-nonmacro'.")))
+ (t (xwem-message 'warning "Invalid keyboard macro given.")))
;; XXX
(when xwem-edmacro-store-place
- (setq frame (xwem-special-popup-frame (get-buffer-create "*Edit
Macro*") t))
+ (setq frame (xwem-special-popup-frame
+ (get-buffer-create "*Edit Macro*") t))
- ;; Add some info in *Edit Macro* buffer
- (let ((edmacro-format-hook
- (lambda ()
- (save-excursion
- (re-search-backward "Macro:")
- (previous-line 1)
- (insert (format "\n;; Key: %s\n" (key-description
xwem-keys)))
- (insert (format ";; Type: %s\n" (if xwem-cmd
- (if (vectorp xwem-cmd)
- "binded macro"
- "binded command")
- "unbinded")))
- (when (not (vectorp xwem-cmd))
- (insert (format ";; Cmd: %S\n" xwem-cmd)))))))
+ ;; Add some info in *Edit Macro* buffer
+ (let ((edmacro-format-hook
+ (lambda ()
+ (save-excursion
+ (re-search-backward "Macro:")
+ (previous-line 1)
+ (insert (format "\n;; Key: %s\n"
+ (key-description xwem-keys)))
+ (insert (format ";; Type: %s\n"
+ (if xwem-cmd
+ (if (vectorp xwem-cmd)
+ "binded macro"
+ "binded command")
+ "unbinded")))
+ (when (not (vectorp xwem-cmd))
+ (insert (format ";; Cmd: %S\n" xwem-cmd)))))))
;; edmacro.el has a bug, it dos not understand self-insert
;; in list form, i.e. does not recognize space in [(?a)
@@ -169,11 +176,15 @@
;;
;; We adjust xwem-evs to avoid such things.
(setq xwem-evs
- (mapvector (lambda (k) (if (and (listp k) (= (length k) 1))
(car k) k))
+ (mapvector (lambda (k)
+ (if (and (listp k)
+ (= (length k) 1))
+ (car k)
+ k))
xwem-evs))
;; Start edmacro
- (edit-kbd-macro xwem-evs arg
+ (edit-kbd-macro xwem-evs arg
`(lambda () (xwem-edmacro-finish ,frame))
'xwem-edmacro-store)))
)))
--- orig/lisp/xwem-events.el
+++ mod/lisp/xwem-events.el
@@ -40,8 +40,8 @@
(defun xwem-ev-reconfig (xdpy win xev)
"Common ConfigureRequest handler."
(let* ((win (X-Event-xconfigurerequest-window xev))
- (cl (xwem-xwin-cl win))
- (vmask (X-Event-xconfigurerequest-value-mask xev)))
+ (cl (xwem-xwin-cl win))
+ (vmask (X-Event-xconfigurerequest-value-mask xev)))
(xwem-debug 'xwem-event
"XWEM-EVENTS: ConfigureRequest event for win=%s vmask=%s,
x=%S, y=%S, width=%S, height=%S"
@@ -189,9 +189,9 @@
(setq xwem-last-xevent x-ev
xwem-event-client (xwem-event-client x-ev)
xwem-last-event e-ev
- xwem-this-command-keys (vconcat (and (not
(xwem-kbd-global-map-current-p))
- xwem-this-command-keys)
- (vector e-ev))))
+ xwem-this-command-keys (vconcat (and (not
(xwem-kbd-global-map-current-p))
+ xwem-this-command-keys)
+ (vector e-ev))))
;;;###xwem-autoload
--- orig/lisp/xwem-faces.el
+++ mod/lisp/xwem-faces.el
@@ -34,7 +34,7 @@
;;; Code:
-(require 'cus-face) ; for `custom-face-get-spec'
+(require 'cus-face) ; for `custom-face-get-spec'
(require 'xlib-xlib)
(require 'xwem-struct)
--- orig/lisp/xwem-focus.el
+++ mod/lisp/xwem-focus.el
@@ -39,8 +39,8 @@
(defcustom xwem-default-focus-mode 'generic
"*Default CL's focus mode."
:type '(choice (const :tag "Generic mode" generic)
- (const :tag "Click to focus" click-focus)
- (const :tag "Follow mouse" follow-mouse))
+ (const :tag "Click to focus" click-focus)
+ (const :tag "Follow mouse" follow-mouse))
:group 'xwem)
;;; Internal variables
@@ -93,18 +93,20 @@
; (xwem-focus-set (xwem-dummy-client))))
)
- ;; xwem client
- ((xwem-cl-p thing)
+ ;; xwem client
+ ((xwem-cl-p thing)
;; For Passive/Locally Active focus models
(when (or (xwem-client-property thing 'ignore-has-input-p)
(eq xwem-client-focusing 'advanced)
- (X-WMHints-input-p (xwem-hints-wm-hints (xwem-cl-hints
thing))))
+ (X-WMHints-input-p
+ (xwem-hints-wm-hints (xwem-cl-hints thing))))
(xwem-focus-set (xwem-cl-xwin thing) push revert))
;; For Locally Active/Globally Active focus models
- (when (XWMProtocol-set-p (xwem-dpy)
- (xwem-hints-wm-protocols (xwem-cl-hints thing))
"WM_TAKE_FOCUS")
- (xwem-client-sendmsg-atom thing
+ (when (XWMProtocol-set-p (xwem-dpy)
+ (xwem-hints-wm-protocols (xwem-cl-hints thing))
+ "WM_TAKE_FOCUS")
+ (xwem-client-sendmsg-atom thing
(X-Atom-find-by-name (xwem-dpy) "WM_TAKE_FOCUS")
(and (X-Event-p xwem-last-xevent)
(or (and (member (X-Event-type xwem-last-xevent)
@@ -114,27 +116,28 @@
(list X-KeyPress X-KeyRelease))
(X-Event-xkey-time xwem-last-xevent)))))))
- ;; xwem window
- ((xwem-win-p thing)
- (xwem-focus-set (xwem-win-frame thing) push revert))
-
- ;; xwem-frame
- ((xwem-frame-p thing)
- (let* ((cl (xwem-win-cl (xwem-frame-selwin thing)))
- (embf (and (xwem-cl-p cl)
- (X-Win-get-prop (xwem-cl-xwin cl) 'xwem-frame)))) ;
maybe cl is embedded frame
-
- (if (xwem-frame-p embf)
- ;; embedded frame
- (xwem-focus-set embf push revert)
-
- (if (xwem-cl-p cl)
- ;; Current client active
- (xwem-focus-set cl push revert)
- (xwem-focus-set (xwem-frame-xwin thing) push revert)))))
+ ;; xwem window
+ ((xwem-win-p thing)
+ (xwem-focus-set (xwem-win-frame thing) push revert))
+
+ ;; xwem-frame
+ ((xwem-frame-p thing)
+ (let* ((cl (xwem-win-cl (xwem-frame-selwin thing)))
+ ;; maybe cl is embedded frame?
+ (embf (and (xwem-cl-p cl)
+ (X-Win-get-prop (xwem-cl-xwin cl) 'xwem-frame))))
+
+ (if (xwem-frame-p embf)
+ ;; embedded frame
+ (xwem-focus-set embf push revert)
+
+ (if (xwem-cl-p cl)
+ ;; Current client active
+ (xwem-focus-set cl push revert)
+ (xwem-focus-set (xwem-frame-xwin thing) push revert)))))
- ;; Normally should not happen
- (t (xwem-focus-set (xwem-dummy-client)))))
+ ;; Normally should not happen
+ (t (xwem-focus-set (xwem-dummy-client)))))
;;; Focus modes support
@@ -162,7 +165,8 @@
`(progn
(put (quote ,name) 'xwem-focus-mode ,fun)
(add-to-list 'xwem-focus-mode-names
- (cons (list 'const :tag ,docstring (quote ,name)) (quote
,fun))))))
+ (cons (list 'const :tag ,docstring (quote ,name))
+ (quote ,fun))))))
(put 'define-xwem-focus-mode 'lisp-indent-function 'defun)
;;;###xwem-autoload
@@ -182,9 +186,9 @@
"
(when (xwem-cl-p cl)
(let* ((mode (xwem-client-property cl 'xwem-focus-mode))
- (fun (get mode 'xwem-focus-mode)))
+ (fun (get mode 'xwem-focus-mode)))
(when fun
- (apply fun cl args)))))
+ (apply fun cl args)))))
;;;###xwem-autoload
(defun xwem-focus-mode-set (cl &optional mode)
@@ -218,7 +222,8 @@
(defun xwem-turn-on-focus-click-mode (cl)
"On CL, turn on click to focus minor mode."
(unless (xwem-client-local-variable-value cl 'xwem-focus-click-minor-mode)
- (xwem-kbd-install-grab xwem-focus-click-to-focus-map (xwem-cl-xwin cl)
X-GrabModeSync)
+ (xwem-kbd-install-grab xwem-focus-click-to-focus-map
+ (xwem-cl-xwin cl) X-GrabModeSync)
(xwem-client-local-variable-set cl 'xwem-focus-click-minor-mode t)))
(defun xwem-turn-off-focus-click-mode (cl)
--- orig/lisp/xwem-frame.el
+++ mod/lisp/xwem-frame.el
@@ -80,11 +80,11 @@
;;;###autoload
(defcustom xwem-frame-default-properties
- (list 'inner-border-width 3 ; Internal border of xwem's frame
+ (list 'inner-border-width 3 ; Internal border of xwem's frame
'inner-border-thickness 1 ; Internal border thickness
- 'outer-border-width 0 ; X border
+ 'outer-border-width 0 ; X border
'background "gray60" ; background color
- 'title-height 18)
+ 'title-height 18)
"*Default properties list for xwem frames."
:type '(restricted-sexp :match-alternatives (valid-plist-p))
:group 'xwem-frame)
@@ -103,8 +103,8 @@
;;;###autoload
(defcustom xwem-dedicated-frame-defalut-properties
(list 'inner-border-width 2
- 'inner-border-thickness 1
- 'outer-border-width 0)
+ 'inner-border-thickness 1
+ 'outer-border-width 0)
"*Default properties for dedicated xwem frames.
Values in `xwem-dedicated-frame-defalut-properties' overrides values in
`xwem-frame-default-properties'."
@@ -144,7 +144,8 @@
'xwem-frame-imoveresize-mode-function-default
"Function to call in way to select move or resize mode.
It is passed with two arguments - FRAME and WHAT.
-Where FRAME is frame which is about to move/resize and WHAT is one of 'resize
or 'move.
+Where FRAME is frame which is about to move/resize and WHAT is one of
+'resize or 'move.
It should return one of:
'normal - Normal resize/move mode, just outline frame rectangle.
'contiguous - Butified 'normal mode.
@@ -292,7 +293,7 @@
(defmacro xwem-frame-link-remove (frame)
"Remove FRAME from linkage."
`(let ((nfr (xwem-frame-link-next ,frame))
- (pfr (xwem-frame-link-prev ,frame)))
+ (pfr (xwem-frame-link-prev ,frame)))
(when (xwem-frame-p pfr)
(setf (xwem-frame-link-next pfr) nfr))
(when (xwem-frame-p nfr)
@@ -365,17 +366,18 @@
"Return XWEM frame for which FRAME is embedded."
(let* ((cl (and (xwem-frame-p frame)
(xwem-frame-get-prop frame 'xwem-embedded-cl)))
- (rv (and (xwem-cl-p cl)
- (xwem-cl-frame cl))))
+ (rv (and (xwem-cl-p cl)
+ (xwem-cl-frame cl))))
rv))
(defun xwem-frame-unembedd (frame &optional new-type)
"Unembedd FRAME."
(when (xwem-frame-embedded-p frame)
(let* ((cl (xwem-frame-get-prop frame 'xwem-embedded-cl))
- (tpnt (car (XTranslateCoordinates (xwem-dpy) (xwem-frame-xwin frame)
- (xwem-rootwin) (xwem-frame-x
frame)
- (xwem-frame-y frame)))))
+ (tpnt (car (XTranslateCoordinates
+ (xwem-dpy) (xwem-frame-xwin frame)
+ (xwem-rootwin) (xwem-frame-x frame)
+ (xwem-frame-y frame)))))
;; Remove clients stuff
(xwem-cl-destroy cl)
@@ -409,12 +411,15 @@
(defun xwem-frame-autoiconify-on-select ()
"Maybe iconify some frames when selecting FRAME."
(when (eq xwem-frame-autoiconify-mode 'intersect)
- (let ((nfr-rect (X-Geom-to-X-Rect (xwem-frame-xgeom
(xwem-frame-selected))))
+ (let ((nfr-rect (X-Geom-to-X-Rect
+ (xwem-frame-xgeom (xwem-frame-selected))))
(frames (xwem-frames-list)))
(while frames
(when (and (not (eq (xwem-frame-selected) (car frames)))
(xwem-frame-mapped-p (car frames))
- (X-Rect-intersect-p nfr-rect (X-Geom-to-X-Rect
(xwem-frame-xgeom (car frames)))))
+ (X-Rect-intersect-p
+ nfr-rect (X-Geom-to-X-Rect
+ (xwem-frame-xgeom (car frames)))))
;; NOTE: double deffering
(xwem-deffered-funcall 'xwem-frame-unmap (car frames)))
(setq frames (cdr frames))))))
@@ -426,7 +431,7 @@
If NOSELECT is non-nil then do not select newly created frame to be
current."
(let* ((fplist (copy-list xwem-frame-default-properties))
- (frame (apply 'make-xwem-frame params))
+ (frame (apply 'make-xwem-frame params))
fwin parwin)
(setf (xwem-frame-type frame) type)
@@ -444,10 +449,10 @@
(setf (xwem-frame-width frame) (X-Geom-width (xwem-rootgeom))))
(unless (xwem-frame-height frame)
(setf (xwem-frame-height frame)
- (- (X-Geom-height (xwem-rootgeom))
- (if (X-Geom-p (xwem-minib-xgeom xwem-minibuffer))
- (X-Geom-height (xwem-minib-xgeom xwem-minibuffer))
- 0))))
+ (- (X-Geom-height (xwem-rootgeom))
+ (if (X-Geom-p (xwem-minib-xgeom xwem-minibuffer))
+ (X-Geom-height (xwem-minib-xgeom xwem-minibuffer))
+ 0))))
;;; Initialize FRAME's X window
(setq fwin (XCreateWindow
@@ -460,16 +465,19 @@
nil ;DefaultDepth
nil ;CopyFromParent
nil ;CopyFromParent
- (make-X-Attr :override-redirect (not (xwem-frame-embedded-p
frame))
- :backing-store X-Always
+ (make-X-Attr :override-redirect
+ (not (xwem-frame-embedded-p frame))
+ :backing-store nil
:cursor xwem-frame-cursor
:event-mask xwem-frame-ev-mask)))
(X-Win-put-prop fwin 'xwem-frame frame)
(setf (xwem-frame-xwin frame) fwin)
;; Install events handlers
- (X-Win-EventHandler-add-new fwin 'xwem-frame-events-handler 150)
- (X-Win-EventHandler-add-new fwin 'xwem-ev-reconfig 40 (list
X-ConfigureRequest))
+ (X-Win-EventHandler-add-new
+ fwin 'xwem-frame-events-handler 150)
+ (X-Win-EventHandler-add-new
+ fwin 'xwem-ev-reconfig 40 (list X-ConfigureRequest))
;; XXX Setup WM_XXX stuff
(XSetWMProtocols (xwem-dpy) fwin
@@ -487,11 +495,11 @@
;; Adjust frame properties in case FRAME is embedded or dedicated
;; frame.
(setq fplist (xwem-misc-merge-plists
- fplist
- (cond ((xwem-frame-embedded-p frame)
- xwem-embedded-frame-default-properties)
- ((xwem-frame-dedicated-p frame)
- xwem-dedicated-frame-defalut-properties))))
+ fplist
+ (cond ((xwem-frame-embedded-p frame)
+ xwem-embedded-frame-default-properties)
+ ((xwem-frame-dedicated-p frame)
+ xwem-dedicated-frame-defalut-properties))))
;;; Initialize FRAME's root window
(setq parwin (xwem-win-new (list :frame frame) nil))
@@ -528,19 +536,21 @@
(defun xwem-init-frame-at-rect (xrect)
"Create frame to fit in XRECT rectangle."
- (let ((xmrect (make-X-Rect :x 0 :y 0 :width (X-Geom-width (xwem-rootgeom))
- :height (if (xwem-minib-xgeom xwem-minibuffer)
- (X-Geom-height (xwem-minib-xgeom
xwem-minibuffer))
- (+ (* 2 xwem-minibuffer-border-width)
- (frame-pixel-height
(xwem-minib-frame xwem-minibuffer))
- xwem-minibuffer-outer-border-width
-
xwem-minibuffer-outer-border-width)))))
+ (let ((xmrect (make-X-Rect
+ :x 0 :y 0 :width (X-Geom-width (xwem-rootgeom))
+ :height (if (xwem-minib-xgeom xwem-minibuffer)
+ (X-Geom-height (xwem-minib-xgeom xwem-minibuffer))
+ (+ (* 2 xwem-minibuffer-border-width)
+ (frame-pixel-height
+ (xwem-minib-frame xwem-minibuffer))
+ xwem-minibuffer-outer-border-width
+ xwem-minibuffer-outer-border-width)))))
(when (X-Rect-intersect-p xmrect xrect)
;; Take into account this intersection
(setf (X-Rect-height xrect)
- (- (X-Rect-height xrect)
- (X-Rect-height xmrect))))
+ (- (X-Rect-height xrect)
+ (X-Rect-height xmrect))))
(xwem-make-frame-1 'desktop
:params (list :xgeom (X-Rect-to-X-Geom xrect))
@@ -549,21 +559,21 @@
(defun xwem-frame-adjust-geom (frame new-rect)
"Adjust FRAME geom according to NEW-RECT and xwem-minibuffer geom."
(let ((mrect (X-Geom-to-X-Rect (xwem-minib-xgeom xwem-minibuffer)))
- (brd (X-Geom-border-width (xwem-minib-xgeom xwem-minibuffer)))
- ngeom)
+ (brd (X-Geom-border-width (xwem-minib-xgeom xwem-minibuffer)))
+ ngeom)
(when (eq (xwem-cl-state (xwem-minib-cl xwem-minibuffer)) 'active)
(when brd
- (incf (X-Rect-width mrect) (+ brd brd))
- (incf (X-Rect-height mrect) (+ brd brd)))
+ (incf (X-Rect-width mrect) (+ brd brd))
+ (incf (X-Rect-height mrect) (+ brd brd)))
(when (X-Rect-intersect-p new-rect mrect)
- (setf (X-Rect-height new-rect)
- (- (X-Rect-height new-rect)
- (X-Rect-height mrect)))))
+ (setf (X-Rect-height new-rect)
+ (- (X-Rect-height new-rect)
+ (X-Rect-height mrect)))))
(setq ngeom (X-Rect-to-X-Geom new-rect))
(setf (X-Geom-border-width ngeom)
- (X-Geom-border-width (xwem-frame-xgeom frame)))
+ (X-Geom-border-width (xwem-frame-xgeom frame)))
(decf (X-Geom-width ngeom) (* 2 (X-Geom-border-width ngeom)))
(decf (X-Geom-height ngeom) (* 2 (X-Geom-border-width ngeom)))
@@ -639,7 +649,8 @@
(xwem-interactive (list (or (and xwem-prefix-arg 'desktop)
(xwem-completing-read
"XWEM Frame type [desktop]: "
- (mapcar (lambda (cc) (list (symbol-name cc)))
xwem-frame-types)))
+ (mapcar (lambda (cc) (list (symbol-name cc)))
+ xwem-frame-types)))
xwem-prefix-arg))
(when (stringp type)
(if (string= type "")
@@ -651,32 +662,33 @@
(defun xwem-frame-find (how arg)
"Find frame by ARG. HOW is search type, one of 'xwin 'win 'cl or 'name."
(let ((flist xwem-frames-list)
- (rf nil))
+ (rf nil))
(while flist
(if (cond ((and (eq how 'xwin)
- (X-Win-p arg)
- (= (X-Win-id arg) (X-Win-id (xwem-frame-xwin (car
flist)))))
- t)
-
- ((and (eq how 'win)
- (eq (xwem-win-frame arg) (car flist)))
- t)
-
- ((and (eq how 'cl)
- (eq (xwem-cl-frame arg) (car flist)))
- t)
+ (X-Win-p arg)
+ (= (X-Win-id arg)
+ (X-Win-id (xwem-frame-xwin (car flist)))))
+ t)
+
+ ((and (eq how 'win)
+ (eq (xwem-win-frame arg) (car flist)))
+ t)
+
+ ((and (eq how 'cl)
+ (eq (xwem-cl-frame arg) (car flist)))
+ t)
((and (eq how 'name)
(string= arg (xwem-frame-name (car flist))))
t)
- (t nil))
- (progn
- (setq rf (car flist))
- (setq flist nil))
+ (t nil))
+ (progn
+ (setq rf (car flist))
+ (setq flist nil))
- (setq flist (cdr flist))))
+ (setq flist (cdr flist))))
rf))
(defun xwem-frame-other-frame (frame)
@@ -688,9 +700,12 @@
(unless (xwem-frame-p oframe)
(setq oframe (xwem-frame-link-prev frame))
(unless (xwem-frame-p oframe)
- (setq oframe (cadr (memq frame (xwem-frames-list (xwem-frame-type
frame)))))
+ (setq oframe (cadr (memq frame (xwem-frames-list
+ (xwem-frame-type frame)))))
(unless (xwem-frame-p oframe)
- (setq oframe (cadr (memq frame (nreverse (xwem-frames-list
(xwem-frame-type frame))))))
+ (setq oframe (cadr (memq frame (nreverse
+ (xwem-frames-list
+ (xwem-frame-type frame))))))
(unless (xwem-frame-p oframe)
(setq oframe (car (xwem-frames-list)))))))
oframe))
@@ -704,26 +719,26 @@
;; First try linkaged frames
(let ((allframes xwem-frames-list)
- (oframe (xwem-frame-link-next frame)))
+ (oframe (xwem-frame-link-next frame)))
(unless (xwem-frame-mapped-p oframe)
(setq oframe (xwem-frame-link-prev frame)))
;; Now try parent in case when FRAME is embedded frame.
(unless (xwem-frame-mapped-p oframe)
(when (xwem-frame-embedded-p frame)
- (let ((cl (xwem-frame-get-prop frame 'xwem-embedded-cl)))
- (when (xwem-cl-p cl)
- (setq oframe (xwem-cl-frame cl))))))
+ (let ((cl (xwem-frame-get-prop frame 'xwem-embedded-cl)))
+ (when (xwem-cl-p cl)
+ (setq oframe (xwem-cl-frame cl))))))
(when (and (not (xwem-frame-mapped-p oframe))
- (eq type 'any))
+ (eq type 'any))
;; Scan frames list only for 'any TYPE
(while (and allframes (not (xwem-frame-mapped-p oframe)))
- (when (and (xwem-frame-mapped-p (car allframes))
- (not (eq frame (car allframes))))
- (setq oframe (car allframes))
- (setq allframes nil))
- (setq allframes (cdr allframes))))
+ (when (and (xwem-frame-mapped-p (car allframes))
+ (not (eq frame (car allframes))))
+ (setq oframe (car allframes))
+ (setq allframes nil))
+ (setq allframes (cdr allframes))))
oframe))
;;;###xwem-autoload
@@ -733,12 +748,12 @@
(error 'xwem-error "Invalid frame" frame))
(let ((fl (xwem-frames-list))
- (num 0))
+ (num 0))
(while fl
(if (eq frame (car fl))
- (setq fl nil)
- (setq num (+ 1 num))
- (setq fl (cdr fl))))
+ (setq fl nil)
+ (setq num (+ 1 num))
+ (setq fl (cdr fl))))
num))
(defun xwem-frame-xy-in-p (x y frame)
@@ -760,11 +775,12 @@
(define-xwem-deffered xwem-frame-apply-xgeom (frame)
"Apply FRAME's geometry to life."
(XConfigureWindow (xwem-dpy) (xwem-frame-xwin frame)
- (make-X-Conf :x (xwem-frame-x frame)
- :y (xwem-frame-y frame)
- :width (xwem-frame-width frame)
- :height (xwem-frame-height frame)
- :border-width (xwem-frame-border-width
frame)))
+ (make-X-Conf
+ :x (xwem-frame-x frame)
+ :y (xwem-frame-y frame)
+ :width (xwem-frame-width frame)
+ :height (xwem-frame-height frame)
+ :border-width (xwem-frame-border-width frame)))
(xwem-frame-setup-root-win frame)
(run-hook-with-args 'xwem-frame-resize-hook frame))
@@ -772,7 +788,8 @@
(define-xwem-deffered xwem-frame-apply-position (frame)
"Apply FRAME's position to life."
(when (xwem-frame-p frame)
- (XMoveWindow (xwem-dpy) (xwem-frame-xwin frame) (xwem-frame-x frame)
(xwem-frame-y frame))
+ (XMoveWindow (xwem-dpy) (xwem-frame-xwin frame)
+ (xwem-frame-x frame) (xwem-frame-y frame))
(run-hook-with-args 'xwem-frame-move-hook frame)))
;;;###xwem-autoload
@@ -849,7 +866,8 @@
(when (and (xwem-cl-p cl)
(eq (xwem-cl-win cl) win))
(XReparentWindow (xwem-dpy) (xwem-cl-xwin cl) (xwem-rootwin)
- (X-Geom-width (xwem-rootgeom))
(X-Geom-height (xwem-rootgeom)))
+ (X-Geom-width (xwem-rootgeom))
+ (X-Geom-height (xwem-rootgeom)))
(setf (xwem-cl-win cl) nil)
(xwem-client-change-state cl 'iconified)))
xwem-clients))
@@ -876,9 +894,9 @@
(defun xwem-frame-hconfigure (frame xev)
"FRAME just received ConfigureNotify event XEV."
(let ((owid (xwem-frame-width frame))
- (ohei (xwem-frame-height frame))
- (nwid (X-Event-xconfigure-width xev)) ;new width
- (nhei (X-Event-xconfigure-height xev))) ;new height
+ (ohei (xwem-frame-height frame))
+ (nwid (X-Event-xconfigure-width xev)) ;new width
+ (nhei (X-Event-xconfigure-height xev))) ;new height
(unless (and (= owid nwid) (= ohei nhei))
(xwem-frame-set-size frame nwid nhei)
@@ -898,7 +916,8 @@
(xwem-debug 'xwem-frame "Killing frame, because of
WM_DELETE_WINDOW client message")
(xwem-frame-total-remove frame))
((string= (X-Atom-name wmda) "WM_TAKE_FOCUS")
- (xwem-debug 'xwem-frame "Frame(%s): Taking focus .."
'(xwem-frame-name frame))
+ (xwem-debug 'xwem-frame "Frame(%s): Taking focus .."
+ '(xwem-frame-name frame))
(xwem-focus-set (xwem-frame-cl frame)))))
))))
@@ -916,24 +935,26 @@
(let ((frame (X-Win-get-prop win 'xwem-frame)))
(when (xwem-frame-p frame)
(X-Event-CASE xev
- (:X-Expose
- (xwem-frame-hexpose frame xev))
+ (:X-Expose
+ (xwem-frame-hexpose frame xev))
- ((:X-KeyPress :X-ButtonPress :X-ButtonRelease)
- (xwem-frame-hkeybutton frame xev))
+ ((:X-KeyPress :X-ButtonPress :X-ButtonRelease)
+ (xwem-frame-hkeybutton frame xev))
- (:X-DestroyNotify
- ;; Somebody kill us, or one of clients die
- (setq frame (X-Win-get-prop (X-Event-xdestroywindow-window xev)
'xwem-frame))
- (when (xwem-frame-p frame)
+ (:X-DestroyNotify
+ ;; Somebody kill us, or one of clients die
+ (setq frame (X-Win-get-prop (X-Event-xdestroywindow-window xev)
+ 'xwem-frame))
+ (when (xwem-frame-p frame)
(setf (xwem-frame-state frame) 'destroed)
(xwem-frame-total-remove frame)))
- (:X-ConfigureNotify
- ;; Seems that we are embedded frame
- (setq frame (X-Win-get-prop (X-Event-xconfigure-window xev)
'xwem-frame))
- (when (xwem-frame-p frame)
- (xwem-frame-hconfigure frame xev)))
+ (:X-ConfigureNotify
+ ;; Seems that we are embedded frame
+ (setq frame (X-Win-get-prop (X-Event-xconfigure-window xev)
+ 'xwem-frame))
+ (when (xwem-frame-p frame)
+ (xwem-frame-hconfigure frame xev)))
(:X-ClientMessage
(xwem-frame-hclient frame xev))
@@ -973,16 +994,17 @@
;; TODO: save domain faces
(cons 'xwem-frame-configuration
(mapcar (lambda (frame)
- (make-xwem-frame-saved :frame frame
- :selected-p (xwem-frame-selected-p
frame)
- :type (xwem-frame-type frame)
- :name (xwem-frame-name frame)
- :xgeom (copy-X-Geom (xwem-frame-xgeom
frame))
- :state (xwem-frame-state frame)
- :plist (nconc (unless
(xwem-frame-mapped-p frame)
- '(initially-unmapped
t))
- (xwem-frame-properties
frame))
- :winconfig (xwem-window-configuration
frame)))
+ (make-xwem-frame-saved
+ :frame frame
+ :selected-p (xwem-frame-selected-p frame)
+ :type (xwem-frame-type frame)
+ :name (xwem-frame-name frame)
+ :xgeom (copy-X-Geom (xwem-frame-xgeom frame))
+ :state (xwem-frame-state frame)
+ :plist (nconc (unless (xwem-frame-mapped-p frame)
+ '(initially-unmapped t))
+ (xwem-frame-properties frame))
+ :winconfig (xwem-window-configuration frame)))
xwem-frames-list)))
;;;###xwem-autoload
@@ -1000,10 +1022,14 @@
(let ((sframe (xwem-frame-config-find-sframe frame conf)))
(if (xwem-frame-saved-p sframe)
(progn
- (setf (xwem-frame-name frame) (xwem-frame-saved-name
sframe))
- (setf (xwem-frame-state frame) (xwem-frame-saved-state
sframe))
- (xwem-frame-adjust-geom frame (xwem-frame-saved-xgeom
sframe))
- (xwem-set-window-configuration (xwem-frame-saved-winconfig
sframe)))
+ (setf (xwem-frame-name frame)
+ (xwem-frame-saved-name sframe)
+ (xwem-frame-state frame)
+ (xwem-frame-saved-state sframe))
+ (xwem-frame-adjust-geom
+ frame (xwem-frame-saved-xgeom sframe))
+ (xwem-set-window-configuration
+ (xwem-frame-saved-winconfig sframe)))
(setq frames-to-delete (cons frame frames-to-delete)))))
xwem-frames-list)
@@ -1071,17 +1097,18 @@
(mapc (lambda (sfr)
(let ((swin (xwem-frame-saved-winconfig sfr))
nframe)
- (setq nframe (xwem-make-frame-1 (xwem-frame-saved-type sfr)
- :params (list :name
(xwem-frame-saved-name sfr)
- :xgeom
(xwem-frame-saved-xgeom sfr))
- :props (xwem-frame-saved-plist
sfr)
- :noselect t))
+ (setq nframe (xwem-make-frame-1
+ (xwem-frame-saved-type sfr)
+ :params (list :name (xwem-frame-saved-name sfr)
+ :xgeom (xwem-frame-saved-xgeom sfr))
+ :props (xwem-frame-saved-plist sfr)
+ :noselect t))
(when (xwem-frame-p nframe)
(setf (xwem-win-config-frame swin) nframe)
(xwem-set-window-configuration swin)
- (when (and (xwem-frame-saved-selected-p sfr)
- (not frame-to-select))
+ (when (and (xwem-frame-saved-selected-p sfr)
+ (not frame-to-select))
(setq frame-to-select nframe)))
))
(cdr xwem-frame-dumped-config))
@@ -1126,7 +1153,8 @@
"Switch to ARG previous frame."
(xwem-interactive "p")
- (let ((frame (nth arg (memq (xwem-frame-selected) (reverse
xwem-frames-list)))))
+ (let ((frame (nth arg (memq (xwem-frame-selected)
+ (reverse xwem-frames-list)))))
(when (and xwem-frame-rolling-switch
(not (xwem-frame-p frame)))
;; Assume last frame if there no previous
@@ -1141,10 +1169,13 @@
;;;###autoload(autoload 'xwem-frame-switch "xwem-frame" "Switch to frame by
name." t)
(define-xwem-command xwem-frame-switch (name)
"Switch to frame by NAME."
- (xwem-interactive (list (xwem-completing-read "XWEM Frame: "
- (mapcar (lambda (fr)
- (list
(xwem-frame-name fr)))
- (xwem-frames-list)))))
+ (xwem-interactive
+ (list (xwem-completing-read
+ "XWEM Frame: "
+ (mapcar (lambda (fr)
+ (list (xwem-frame-name fr)))
+ (xwem-frames-list)))))
+
;; Find frame by name
(let ((frms (xwem-frames-list))
(frame nil))
@@ -1169,9 +1200,9 @@
(setq arg 0))
(if (numberp arg)
(let ((frame (nth (abs arg) xwem-frames-list)))
- (if (xwem-frame-p frame)
- (xwem-select-frame frame)
- (xwem-message 'warning "No such %S frame." (abs arg))))
+ (if (xwem-frame-p frame)
+ (xwem-select-frame frame)
+ (xwem-message 'warning "No such %S frame." (abs arg))))
;; UNEMBED selected frame
(let ((frame (xwem-frame-selected)))
@@ -1188,15 +1219,15 @@
(when (null arg) (setq arg 0))
(if (numberp arg)
(let ((frame (nth (abs arg) xwem-frames-list)))
- (if (not (xwem-frame-p frame))
- (xwem-message 'warning "No such %S frame." (abs arg))
+ (if (not (xwem-frame-p frame))
+ (xwem-message 'warning "No such %S frame." (abs arg))
- ;; Select linkage
- (xwem-frame-linkage-map
- frame
- (lambda (fr)
- (xwem-frame-raise fr)))
- (xwem-select-frame frame)))
+ ;; Select linkage
+ (xwem-frame-linkage-map
+ frame
+ (lambda (fr)
+ (xwem-frame-raise fr)))
+ (xwem-select-frame frame)))
(xwem-message 'warning "Strange arg value: %S" arg)))
;;;###autoload(autoload 'xwem-frame-destroy "xwem-frame" "" t)
@@ -1212,7 +1243,7 @@
"Goto window at DIRECTION on FRAME N times.
DIRECTION is one of 'next, 'prev, 'next-vert, ..."
(let* ((gframe (or frame (xwem-frame-selected)))
- (cwin (xwem-frame-selwin gframe)))
+ (cwin (xwem-frame-selwin gframe)))
;; Adjust N and DIRECTION if needed
(when (and (eq direction 'next)
@@ -1222,16 +1253,16 @@
(while (> n 0)
(cond ((eq direction 'next)
- (setq cwin (xwem-window-next cwin)))
- ((eq direction 'prev)
- (setq cwin (xwem-window-prev cwin)))
- ((eq direction 'next-vert)
- (setq cwin (xwem-window-next-vertical cwin)))
- (t (error 'xwem-error "Bad DIRECTION in `xwem-frame-goto', should
be one of 'next or 'prev")))
+ (setq cwin (xwem-window-next cwin)))
+ ((eq direction 'prev)
+ (setq cwin (xwem-window-prev cwin)))
+ ((eq direction 'next-vert)
+ (setq cwin (xwem-window-next-vertical cwin)))
+ (t (error
+ 'xwem-error "Bad DIRECTION in `xwem-frame-goto'" direction)))
(setq n (1- n)))
- (xwem-select-window cwin)
- ))
+ (xwem-select-window cwin)))
;;;###autoload(autoload 'xwem-frame-goto-next "xwem-frame" "" t)
(define-xwem-command xwem-frame-goto-next (arg)
@@ -1288,22 +1319,22 @@
(xwem-interactive "p")
(let* ((vertp (eq side 'vertical))
- (frm (or frame (xwem-frame-selected)))
- (wi (xwem-frame-width frm))
- (he (xwem-frame-height frm))
- (nwi wi)
- (nhe he)
- (wost 0)
- (host 0)
- xoff yoff)
+ (frm (or frame (xwem-frame-selected)))
+ (wi (xwem-frame-width frm))
+ (he (xwem-frame-height frm))
+ (nwi wi)
+ (nhe he)
+ (wost 0)
+ (host 0)
+ xoff yoff)
(when (xwem-frame-embedded-p frm)
(error 'xwem-error "Can't split embedded frame"))
(if vertp
- (progn
- (setq nhe (/ he (1+ n)))
- (setq host (% he (1+ n))))
+ (progn
+ (setq nhe (/ he (1+ n)))
+ (setq host (% he (1+ n))))
(setq nwi (/ wi (1+ n)))
(setq wost (% wi (1+ n))))
@@ -1316,26 +1347,31 @@
;; TODO: - inherit same parent in case FRM is embedded
;; - install frames linkage
(let ((oframe frm)
- (nframe nil)
- (samex (xwem-frame-x frm))
- (samey (xwem-frame-y frm)))
+ (nframe nil)
+ (samex (xwem-frame-x frm))
+ (samey (xwem-frame-y frm)))
(while (> n 0)
- (setq nframe
- (xwem-make-frame-1 (xwem-frame-type frm)
- :params (list :xgeom
- (make-X-Geom :x (if vertp samex
(+ samex xoff))
- :y (if vertp (+
samey yoff) samey)
- :width nwi
- :height nhe))
+ (setq nframe
+ (xwem-make-frame-1 (xwem-frame-type frm)
+ :params
+ (list :xgeom
+ (make-X-Geom :x (if vertp
+ samex
+ (+ samex xoff))
+ :y (if vertp
+ (+ samey yoff)
+ samey)
+ :width nwi
+ :height nhe))
:noselect t))
- ;; Now setup linkage
- (xwem-frame-link-insert-after oframe nframe)
- (setq oframe nframe)
-
- (if vertp
- (setq yoff (+ yoff nhe))
- (setq xoff (+ xoff nwi)))
- (setq n (1- n))))
+ ;; Now setup linkage
+ (xwem-frame-link-insert-after oframe nframe)
+ (setq oframe nframe)
+
+ (if vertp
+ (setq yoff (+ yoff nhe))
+ (setq xoff (+ xoff nwi)))
+ (setq n (1- n))))
))
;;;###autoload(autoload 'xwem-frame-sbs-hor-split "xwem-frame" "" t)
@@ -1359,25 +1395,26 @@
;; Take into acount XInerama layout
(let ((frect (X-Geom-to-X-Rect (xwem-frame-xgeom frame)))
- (xin (X-XIneramaQueryScreens (xwem-dpy))))
+ (xin (X-XIneramaQueryScreens (xwem-dpy))))
(if (car xin)
- (progn
- ;; XInerama enabled
- (while (and (setq xin (cdr xin))
- (not (X-Rect-intersect-p (car xin) frect))))
- (setq xin (car xin)))
+ (progn
+ ;; XInerama enabled
+ (while (and (setq xin (cdr xin))
+ (not (X-Rect-intersect-p (car xin) frect))))
+ (setq xin (car xin)))
;; No XInerama, so use root geometry
(setq xin (X-Geom-to-X-Rect (xwem-rootgeom))))
(xwem-frame-adjust-geom frame xin)
- (xwem-frame-set-size frame (xwem-frame-width frame) (xwem-frame-height
frame))
- (xwem-frame-set-pos frame (xwem-frame-x frame) (xwem-frame-y frame))
+ (xwem-frame-set-size
+ frame (xwem-frame-width frame) (xwem-frame-height frame))
+ (xwem-frame-set-pos
+ frame (xwem-frame-x frame) (xwem-frame-y frame))
;; XXX uninstall linkage if any
- (xwem-frame-link-remove frame)
- ))
+ (xwem-frame-link-remove frame)))
(put 'xwem-frame-fit-screen 'xwem-frame-command t)
;;;###autoload(autoload 'xwem-frame-transpose "xwem-frame" "" t)
@@ -1401,7 +1438,7 @@
When called interactively, FRAME is selected frame.
With prefix ARG, do not select new frame."
(xwem-interactive (list (xwem-frame-selected)
- xwem-prefix-arg))
+ xwem-prefix-arg))
(let ((oframe (xwem-frame-other frame)))
(when (xwem-frame-mapped-p frame)
@@ -1418,12 +1455,12 @@
(xwem-interactive "p")
(let* ((sfr (xwem-frame-selected))
- (ofr (xwem-frame-other sfr))
- sg og)
+ (ofr (xwem-frame-other sfr))
+ sg og)
(when (xwem-frame-p ofr)
(setq sg (copy-sequence (xwem-frame-xgeom sfr))
- og (copy-sequence (xwem-frame-xgeom ofr)))
+ og (copy-sequence (xwem-frame-xgeom ofr)))
(xwem-frame-set-pos sfr (X-Geom-x og) (X-Geom-y og))
(xwem-frame-set-pos ofr (X-Geom-x sg) (X-Geom-y sg))
@@ -1459,7 +1496,7 @@
rwin)
(while (xwem-win-p hc)
- ;; For horizontal split
+ ;; For horizontal split
(when (and (> x (+ (xwem-win-x hc) (xwem-win-width hc)))
(< x (+ (xwem-win-x hc) (xwem-win-width hc)
(xwem-win-delim-width hc)))
@@ -1479,7 +1516,7 @@
(throw 'found vc))
(when (setq rwin (xwem-frame-in-delim-p vc x y))
(throw 'found rwin))
- (setq vc (xwem-win-next vc)))
+ (setq vc (xwem-win-next vc)))
nil)))
;;;###autoload(autoload 'xwem-frame-on-delim-resize "xwem-frame" "" t)
@@ -1489,7 +1526,8 @@
(let* ((x (X-Event-xbutton-event-x xwem-last-xevent))
(y (X-Event-xbutton-event-y xwem-last-xevent))
- (frame (or (X-Win-get-prop (X-Event-xbutton-event xwem-last-xevent)
'xwem-frame)
+ (frame (or (X-Win-get-prop
+ (X-Event-xbutton-event xwem-last-xevent) 'xwem-frame)
(xwem-frame-at x y)))
(in-xy (and (xwem-frame-p frame)
(xwem-frame-in-delim-p
@@ -1533,14 +1571,18 @@
(> (X-Event-xmotion-event-y xev)
(+ (X-Rect-y xrect) xwem-win-min-height))
(not (= (X-Event-xmotion-event-y xev)
- (+ (X-Rect-y xrect) (X-Rect-height
xrect)))))
+ (+ (X-Rect-y xrect)
+ (X-Rect-height xrect)))))
(unless (eq xwem-frame-on-delim-resize-mode 'opaque)
- (xwem-misc-outline xrect 'normal (xwem-frame-xwin
frame)))
+ (xwem-misc-outline
+ xrect 'normal (xwem-frame-xwin frame)))
(setf (X-Rect-height xrect)
(- (X-Event-xmotion-event-y xev) (X-Rect-y xrect)))
(if (eq xwem-frame-on-delim-resize-mode 'opaque)
- (xwem-window-enlarge-vertically (- (X-Rect-height
xrect) (xwem-win-height win)) win)
- (xwem-misc-outline xrect 'normal (xwem-frame-xwin
frame))))
+ (xwem-window-enlarge-vertically
+ (- (X-Rect-height xrect) (xwem-win-height win)) win)
+ (xwem-misc-outline
+ xrect 'normal (xwem-frame-xwin frame))))
((and (eq type 'horz)
(> (X-Event-xmotion-event-x xev) 0)
@@ -1549,12 +1591,15 @@
(not (= (X-Event-xmotion-event-x xev)
(+ (X-Rect-x xrect) (X-Rect-width xrect)))))
(unless (eq xwem-frame-on-delim-resize-mode 'opaque)
- (xwem-misc-outline xrect 'normal (xwem-frame-xwin
frame)))
+ (xwem-misc-outline
+ xrect 'normal (xwem-frame-xwin frame)))
(setf (X-Rect-width xrect)
(- (X-Event-xmotion-event-x xev) (X-Rect-x xrect)))
(if (eq xwem-frame-on-delim-resize-mode 'opaque)
- (xwem-window-enlarge-horizontally (- (X-Rect-width
xrect) (xwem-win-width win)) win)
- (xwem-misc-outline xrect 'normal (xwem-frame-xwin
frame))))))))
+ (xwem-window-enlarge-horizontally
+ (- (X-Rect-width xrect) (xwem-win-width win)) win)
+ (xwem-misc-outline
+ xrect 'normal (xwem-frame-xwin frame))))))))
(xwem-mouse-ungrab)
(XFreeCursor (xwem-dpy) cursor)
@@ -1591,7 +1636,8 @@
(error 'xwem-error "Can't interactively move embedded frame"))
(unless imove-mode
- (setq imove-mode (funcall xwem-frame-imoveresize-mode-function frame
'move)))
+ (setq imove-mode
+ (funcall xwem-frame-imoveresize-mode-function frame 'move)))
(let ((step 1)
(done nil)
@@ -1605,7 +1651,7 @@
(Xmask-or XM-ButtonPress XM-ButtonRelease
XM-ButtonMotion XM-PointerMotion))
(if (eq imove-mode 'opaque)
- (xwem-frame-map frame)
+ (xwem-frame-map frame)
(xwem-misc-outline last-xrect imove-mode))
;; Normally we should do this event loop under GrabServer, but
;; grabbing server causes XEmacs to freeze in some
@@ -1622,21 +1668,26 @@
(:X-MotionNotify
;; Update curr-xrect
(setf (X-Rect-x curr-xrect)
- (+ (X-Rect-x curr-xrect) (- (X-Event-xmotion-root-x xev)
sx)))
+ (+ (X-Rect-x curr-xrect)
+ (- (X-Event-xmotion-root-x xev) sx)))
(setq sx (X-Event-xmotion-root-x xev))
(setf (X-Rect-y curr-xrect)
- (+ (X-Rect-y curr-xrect) (- (X-Event-xmotion-root-y xev)
sy)))
+ (+ (X-Rect-y curr-xrect)
+ (- (X-Event-xmotion-root-y xev) sy)))
(setq sy (X-Event-xmotion-root-y xev))
- (when (or (> (abs (- (X-Rect-x curr-xrect) (X-Rect-x
last-xrect))) step)
- (> (abs (- (X-Rect-y curr-xrect) (X-Rect-y
last-xrect))) step))
+ (when (or (> (abs (- (X-Rect-x curr-xrect)
+ (X-Rect-x last-xrect))) step)
+ (> (abs (- (X-Rect-y curr-xrect)
+ (X-Rect-y last-xrect))) step))
(unless (eq imove-mode 'opaque)
(xwem-misc-outline last-xrect imove-mode))
(setf (X-Rect-x last-xrect) (X-Rect-x curr-xrect))
(setf (X-Rect-y last-xrect) (X-Rect-y curr-xrect))
(if (eq imove-mode 'opaque)
- (xwem-frame-set-pos frame (X-Rect-x last-xrect) (X-Rect-y
last-xrect))
+ (xwem-frame-set-pos
+ frame (X-Rect-x last-xrect) (X-Rect-y last-xrect))
(xwem-misc-outline last-xrect imove-mode))))))
(xwem-mouse-ungrab)
@@ -1681,9 +1732,11 @@
(sry (X-Event-xbutton-root-y xwem-last-xevent))
(frame (or (xwem-xwin-frame (X-Event-xbutton-event xwem-last-xevent))
(xwem-frame-at srx sry)))
- (iresize-mode (funcall xwem-frame-imoveresize-mode-function frame
'resize))
+ (iresize-mode
+ (funcall xwem-frame-imoveresize-mode-function frame 'resize))
(last-xrect (and (xwem-frame-p frame)
- (make-X-Rect :x (xwem-frame-x frame) :y
(xwem-frame-y frame)
+ (make-X-Rect :x (xwem-frame-x frame)
+ :y (xwem-frame-y frame)
:width (- srx (xwem-frame-x frame))
:height (- sry (xwem-frame-y frame)))))
(curr-xrect (copy-X-Rect last-xrect))
@@ -1715,7 +1768,9 @@
(xwem-win-map (lambda (w)
(let ((pwin (xwem-win-parent w)))
(when (and (and pwin (xwem-win-hchild pwin)))
- (incf min-width (+ xwem-win-min-width (car
xwem-win-horizontal-delim-width))))))
+ (incf min-width
+ (+ xwem-win-min-width
+ (car xwem-win-horizontal-delim-width))))))
(xwem-frame-selwin frame)))
(unless min-height
(setq min-height
@@ -1725,7 +1780,9 @@
(xwem-win-map (lambda (w)
(let ((pwin (xwem-win-parent w)))
(when (and (and pwin (xwem-win-vchild pwin)))
- (incf min-height (+ xwem-win-min-height (car
xwem-win-vertical-delim-width))))))
+ (incf min-height
+ (+ xwem-win-min-height
+ (car xwem-win-vertical-delim-width))))))
(xwem-frame-selwin frame)))
;; Adjust last-xrect according to calculated min-width/height
@@ -1752,8 +1809,10 @@
(when (and (or (>= (X-Rect-width curr-xrect) min-width)
(>= (X-Rect-height curr-xrect) min-height))
- (or (> (abs (- (X-Rect-width curr-xrect) (X-Rect-width
last-xrect))) step-x)
- (> (abs (- (X-Rect-height curr-xrect)
(X-Rect-height last-xrect))) step-y)))
+ (or (> (abs (- (X-Rect-width curr-xrect)
+ (X-Rect-width last-xrect))) step-x)
+ (> (abs (- (X-Rect-height curr-xrect)
+ (X-Rect-height last-xrect))) step-y)))
(unless (eq iresize-mode 'opaque)
(xwem-misc-outline last-xrect iresize-mode))
(when (>= (X-Rect-width curr-xrect) min-width)
@@ -1761,7 +1820,8 @@
(when (>= (X-Rect-height curr-xrect) min-height)
(setf (X-Rect-height last-xrect) (X-Rect-height curr-xrect)))
(if (eq iresize-mode 'opaque)
- (xwem-frame-set-size frame (X-Rect-width last-xrect)
(X-Rect-height last-xrect))
+ (xwem-frame-set-size
+ frame (X-Rect-width last-xrect) (X-Rect-height last-xrect))
(xwem-misc-outline last-xrect iresize-mode))
))))
(xwem-mouse-ungrab)
@@ -1770,7 +1830,8 @@
;; Apply changes
(xwem-frame-set-pos frame (X-Rect-x last-xrect) (X-Rect-y last-xrect))
- (xwem-frame-set-size frame (X-Rect-width last-xrect) (X-Rect-height
last-xrect)))
+ (xwem-frame-set-size
+ frame (X-Rect-width last-xrect) (X-Rect-height last-xrect)))
))
;;;###xwem-autoload
@@ -1796,26 +1857,33 @@
(let* ((bw (xwem-frame-property frame 'inner-border-width))
(th (or (xwem-frame-property frame 'inner-border-thickness) 1))
(tag1 (if (xwem-frame-selected-p frame) 'selected 'nonselected))
- (wgc (xwem-face-get-gc 'xwem-frame-inner-border-face (list 'light
tag1) frame))
- (bgc (xwem-face-get-gc 'xwem-frame-inner-border-face (list 'dark
tag1) frame))
- (gc (xwem-face-get-gc 'xwem-frame-inner-border-face (list 'medium
tag1) frame))
+ (wgc (xwem-face-get-gc 'xwem-frame-inner-border-face
+ (list 'light tag1) frame))
+ (bgc (xwem-face-get-gc 'xwem-frame-inner-border-face
+ (list 'dark tag1) frame))
+ (gc (xwem-face-get-gc 'xwem-frame-inner-border-face
+ (list 'medium tag1) frame))
(off th))
(when (> bw 0)
- (XDrawRectangles (xwem-dpy) (xwem-frame-xwin frame)
- gc (mapcar (lambda (notused)
- (prog1
- (make-X-Rect :x off :y off
- :width (-
(xwem-frame-width frame) (* 2 off) 1)
- :height (-
(xwem-frame-height frame) (* 2 off) 1))
- (incf off)))
- (make-list (- bw (* 2 th)) nil)))
+ (XDrawRectangles
+ (xwem-dpy) (xwem-frame-xwin frame)
+ gc (mapcar (lambda (notused)
+ (prog1
+ (make-X-Rect :x off :y off
+ :width (- (xwem-frame-width frame)
+ (* 2 off) 1)
+ :height (- (xwem-frame-height frame)
+ (* 2 off) 1))
+ (incf off)))
+ (make-list (- bw (* 2 th)) nil)))
(xwem-misc-draw-shadow (xwem-dpy) (xwem-frame-xwin frame)
- wgc bgc 0 0 (xwem-frame-width frame)
(xwem-frame-height frame)
- th)
+ wgc bgc 0 0 (xwem-frame-width frame)
+ (xwem-frame-height frame) th)
(xwem-misc-draw-shadow (xwem-dpy) (xwem-frame-xwin frame)
- bgc wgc (- bw th) (- bw th) (- (xwem-frame-width
frame) (* 2 (- bw th)))
+ bgc wgc (- bw th) (- bw th)
+ (- (xwem-frame-width frame) (* 2 (- bw th)))
(- (xwem-frame-height frame) (* 2 (- bw th)))
th)
)))
@@ -1881,7 +1949,8 @@
(if notifiers
(setcdr (last notifiers) (cons notifier nil))
(put prop 'xwem-property-definition
- (plist-put (get prop 'xwem-property-definition) :notifiers (list
notifier))))))
+ (plist-put (get prop 'xwem-property-definition)
+ :notifiers (list notifier))))))
;;;###xwem-autoload
(defun xwem-frame-set-property (frame prop val)
@@ -1890,7 +1959,8 @@
(unless frame
(setq frame (xwem-frame-selected)))
(unless (equal (xwem-frame-property frame prop) val)
- (funcall (xwem-frame-get-prop-keyword prop :set 'xwem-frame-put-prop)
frame prop val)
+ (funcall (xwem-frame-get-prop-keyword prop :set 'xwem-frame-put-prop)
+ frame prop val)
;; Call notifiers
(mapc (lambda (notifier) (funcall notifier frame prop val))
(xwem-frame-get-prop-keyword prop :notifiers))))
@@ -1906,7 +1976,8 @@
(defun xwem-frame-property (frame prop)
"Return value for FRAME's property PROP.
If FRAME is nil - selected frame is used."
- (funcall (xwem-frame-get-prop-keyword prop :get 'xwem-frame-get-prop) (or
frame (xwem-frame-selected)) prop))
+ (funcall (xwem-frame-get-prop-keyword prop :get 'xwem-frame-get-prop)
+ (or frame (xwem-frame-selected)) prop))
;;;###xwem-autoload
(defun xwem-frame-properties (&optional frame)
--- orig/lisp/xwem-help.el
+++ mod/lisp/xwem-help.el
@@ -40,8 +40,8 @@
`(let ((temp-buffer-show-function 'xwem-special-popup-frame))
(with-displaying-help-buffer
(lambda ()
- (set-buffer standard-output)
- ,@forms)
+ (set-buffer standard-output)
+ ,@forms)
(format "xwem %s" (or ,title "")))))
(put 'xwem-help-display 'lisp-indent-function 'defun)
@@ -50,9 +50,9 @@
(defun xwem-logo-string ()
"Return textified XWEM's logo string."
(concat (xwem-str-with-faces "X" (list 'bold-italic))
- (xwem-str-with-faces "W" (list 'bold-italic 'red))
- (xwem-str-with-faces "E" (list 'bold-italic 'green))
- (xwem-str-with-faces "M" (list 'bold-italic 'blue))))
+ (xwem-str-with-faces "W" (list 'bold-italic 'red))
+ (xwem-str-with-faces "E" (list 'bold-italic 'green))
+ (xwem-str-with-faces "M" (list 'bold-italic 'blue))))
;;;###autoload(autoload 'xwem-help "xwem-help" "" t)
(define-xwem-command xwem-help ()
@@ -60,61 +60,64 @@
(xwem-interactive)
(xwem-help-display nil
- (insert "Hello, this is help for ")
- (insert (xwem-logo-string))
- (insert "\n\n")
-
- (insert "TODO: here is some description for ")
- (insert (xwem-logo-string))
- (insert " stuff.\n")
- (insert "\n")
-
- ;; Frames config
- (insert "---=== Frames Info ===---\n\n")
- (insert (format "You have %d frames now and [%d] frame is selected.\n"
- (length xwem-frames-list) (xwem-frame-num
(xwem-frame-selected))))
- (insert "\n")
-
- ;; Clients
- ;; Maybe use tree-widget package to display this info?
- (let ((curr-classn "")
- (curr-classi ""))
- (insert "---=== Clients Info ===---\n")
- (mapc
- (lambda (el)
- (let ((clclass (xwem-hints-wm-class (xwem-cl-hints el)))
- (clgeom (xwem-cl-xgeom el)))
- (when (not (string= curr-classn (cdr clclass)))
- (setq curr-classn (cadr clclass))
- (insert (format "\n= Begin for class name: <%s> =\n" curr-classn)))
- (when (not (string= curr-classi (car clclass)))
- (setq curr-classi (car clclass))
- (insert (format "\n- Class instance: <%s> -\n" curr-classi)))
- (insert (format "WM-NAME: <%s>, Geom: %dx%d+%d+%d\n"
- (xwem-hints-wm-name (xwem-cl-hints el))
- (X-Geom-width clgeom)
- (X-Geom-height clgeom)
- (X-Geom-x clgeom)
- (X-Geom-y clgeom)))))
- (sort (copy-list xwem-clients)
- (lambda (el1 el2) (let ((cl1-clas (xwem-hints-wm-class
(xwem-cl-hints el1)))
- (cl1-name (xwem-hints-wm-name
(xwem-cl-hints el1)))
- (cl2-clas (xwem-hints-wm-class
(xwem-cl-hints el2)))
- (cl2-name (xwem-hints-wm-name
(xwem-cl-hints el2))))
- ;; Sort by class name, than by class
- ;; instance, than by wm-name.
- (or (string-lessp (cdr cl1-clas) (cdr
cl2-clas))
- (and (string= (cdr cl1-clas) (cdr
cl2-clas))
- (string-lessp (car cl1-clas) (car
cl2-clas)))
- (and (string= (car cl1-clas) (car
cl2-clas))
- (string-lessp cl1-name cl2-name)))))))
- (insert "\n"))
-
- ;; Bindings
- (insert "---=== Bindings for `")
- (insert (xwem-str-with-faces "xwem-global-map" 'font-lock-keyword-face))
- (insert "' ===---\n")
- (describe-bindings-internal xwem-global-map)))
+ (insert "Hello, this is help for ")
+ (insert (xwem-logo-string))
+ (insert "\n\n")
+
+ (insert "TODO: here is some description for ")
+ (insert (xwem-logo-string))
+ (insert " stuff.\n")
+ (insert "\n")
+
+ ;; Frames config
+ (insert "---=== Frames Info ===---\n\n")
+ (insert (format "You have %d frames now and [%d] frame is selected.\n"
+ (length xwem-frames-list)
+ (xwem-frame-num (xwem-frame-selected))))
+ (insert "\n")
+
+ ;; Clients
+ ;; Maybe use tree-widget package to display this info?
+ (let ((curr-classn "")
+ (curr-classi ""))
+ (insert "---=== Clients Info ===---\n")
+ (mapc
+ (lambda (el)
+ (let ((clclass (xwem-hints-wm-class (xwem-cl-hints el)))
+ (clgeom (xwem-cl-xgeom el)))
+ (when (not (string= curr-classn (cdr clclass)))
+ (setq curr-classn (cadr clclass))
+ (insert (format "\n= Begin for class name: <%s> =\n"
+ curr-classn)))
+ (when (not (string= curr-classi (car clclass)))
+ (setq curr-classi (car clclass))
+ (insert (format "\n- Class instance: <%s> -\n" curr-classi)))
+ (insert (format "WM-NAME: <%s>, Geom: %dx%d+%d+%d\n"
+ (xwem-hints-wm-name (xwem-cl-hints el))
+ (X-Geom-width clgeom)
+ (X-Geom-height clgeom)
+ (X-Geom-x clgeom)
+ (X-Geom-y clgeom)))))
+ (sort (copy-list xwem-clients)
+ (lambda (el1 el2)
+ (let ((cl1-clas (xwem-hints-wm-class (xwem-cl-hints el1)))
+ (cl1-name (xwem-hints-wm-name (xwem-cl-hints el1)))
+ (cl2-clas (xwem-hints-wm-class (xwem-cl-hints el2)))
+ (cl2-name (xwem-hints-wm-name (xwem-cl-hints el2))))
+ ;; Sort by class name, than by class
+ ;; instance, than by wm-name.
+ (or (string-lessp (cdr cl1-clas) (cdr cl2-clas))
+ (and (string= (cdr cl1-clas) (cdr cl2-clas))
+ (string-lessp (car cl1-clas) (car cl2-clas)))
+ (and (string= (car cl1-clas) (car cl2-clas))
+ (string-lessp cl1-name cl2-name)))))))
+ (insert "\n"))
+
+ ;; Bindings
+ (insert "---=== Bindings for `")
+ (insert (xwem-str-with-faces "xwem-global-map" 'font-lock-keyword-face))
+ (insert "' ===---\n")
+ (describe-bindings-internal xwem-global-map)))
;;;###autoload(autoload 'xwem-help-for-help "xwem-help" "" t)
(define-xwem-command xwem-help-for-help ()
@@ -122,11 +125,12 @@
(xwem-interactive)
(xwem-help-display "help-for-help"
- (let ((heading (gettext "key binding\n---
-------\n")))
+ (let ((heading "key binding\n--- -------\n"))
(insert "Here should be Help-for-Help!\n\n")
(insert (format "Help prefix is %s, keys are:\n"
- (substitute-command-keys
"\\<xwem-global-map>\\[xwem-help-prefix]"))
+ (substitute-command-keys
+ "\\<xwem-global-map>\\[xwem-help-prefix]"))
heading)
(describe-bindings-internal 'xwem-help-prefix))
))
@@ -138,7 +142,7 @@
(when (and (keymapp map)
(or (null keys)
(lookup-key map keys t)))
- (let ((heading (gettext "key binding\n---
-------\n")))
+ (let ((heading "key binding\n--- -------\n"))
(insert title "\n" heading)
(describe-bindings-internal map nil nil keys))))
(put 'xwem-describe-prefix-bindings-1 'lisp-indent-function 2)
@@ -154,7 +158,8 @@
(xwem-help-display (format "%s prefix" (key-description prefix))
(when prefix
- (insert (format "Key bindings starting with `%s':\n" (key-description
prefix))))
+ (insert (format "Key bindings starting with `%s':\n"
+ (key-description prefix))))
;; Minor modes bindings
(mapc (lambda (mimap)
@@ -193,34 +198,34 @@
(xwem-interactive (list xwem-this-command-keys))
(let ((dfn (xwem-kbd-get-binding key))
- (keystr (key-description key)))
+ (keystr (key-description key)))
(if (or (null dfn) (integerp dfn))
- (xwem-message 'info "%s is undefined." keystr)
+ (xwem-message 'info "%s is undefined." keystr)
(xwem-help-display (format "key `%s'" keystr)
(insert keystr)
(insert " runs ")
(if (symbolp dfn)
- (insert (format "`%S'" dfn))
- (insert (format "%S" dfn)))
+ (insert (format "`%S'" dfn))
+ (insert (format "%S" dfn)))
(insert "\n\n")
(cond ((or (stringp dfn) (vectorp dfn))
- (let ((cmd (xwem-kbd-get-binding dfn)))
- (if (not cmd)
- (insert "a keyboard macro")
- (insert "a keyboard macro which runs the command\n")
- (insert (format "`%S'" cmd))
- (insert ":\n\n")
- (when (documentation cmd)
- (insert (documentation cmd))))))
- ((and (consp dfn) (not (eq 'lambda (car-safe dfn))))
- (let ((describe-function-show-arglist nil))
- (describe-function-1 (car dfn))))
- ((symbolp dfn)
- (describe-function-1 dfn))
- ((documentation dfn)
- (insert (documentation dfn)))
- (t (insert "not documented"))))
+ (let ((cmd (xwem-kbd-get-binding dfn)))
+ (if (not cmd)
+ (insert "a keyboard macro")
+ (insert "a keyboard macro which runs the command\n")
+ (insert (format "`%S'" cmd))
+ (insert ":\n\n")
+ (when (documentation cmd)
+ (insert (documentation cmd))))))
+ ((and (consp dfn) (not (eq 'lambda (car-safe dfn))))
+ (let ((describe-function-show-arglist nil))
+ (describe-function-1 (car dfn))))
+ ((symbolp dfn)
+ (describe-function-1 dfn))
+ ((documentation dfn)
+ (insert (documentation dfn)))
+ (t (insert "not documented"))))
)))
;;;###autoload(autoload 'xwem-help-describe-key "xwem-help" "" t)
@@ -263,7 +268,8 @@
(xwem-interactive "CXWEM where is command: \nP")
(let* ((keys (where-is-internal dfn (list xwem-global-map)))
- (msg (if keys (format "%s is on %s" dfn (sorted-key-descriptions
keys))
+ (msg (if keys (format "%s is on %s"
+ dfn (sorted-key-descriptions keys))
(format "%s is not on any keys" dfn))))
(if paste
(xwem-key-send-ekeys msg)
--- orig/lisp/xwem-icons.el
+++ mod/lisp/xwem-icons.el
@@ -124,11 +124,11 @@
;; ICQ
("mini-icq.xpm"
(or (buffer-major-mode eicq-buddy-mode)
- (buffer-major-mode eicq-log-mode)
- (and (application "xemacs")
- (name "\\*Status\\*"))
+ (buffer-major-mode eicq-log-mode)
+ (and (application "xemacs")
+ (name "\\*Status\\*"))
(application "licq")
- (name "[LlMmVv][Ii][Cc][Qq]")))
+ (name "[LlMmVv][Ii][Cc][Qq]")))
;; xterm
("mini-term.xpm" (class-inst ".term") (class-name ".[tT]erm"))
@@ -138,19 +138,20 @@
:type '(repeat
(cons :tag "Icon specifier"
(string :tag "Icon name")
- (repeat (cons
- (choice (const :tag "Application" application)
- (const :tag "Class name" class-name)
- (const :tag "Class instance" class-inst)
- (const :tag "Name" name)
- (const :tag "Buffer Major Mode"
buffer-major-mode)
- (const :tag "Buffer Name" buffer-name)
- (const :tag "Buffer Name" buffer-name)
- (const :tag "Sexp for evaluation" eval)
- (const :tag "Function" function)
- (const :tag "Or operation" or)
- (const :tag "And operation" and))
- (repeat sexp)))))
+ (repeat
+ (cons
+ (choice (const :tag "Application" application)
+ (const :tag "Class name" class-name)
+ (const :tag "Class instance" class-inst)
+ (const :tag "Name" name)
+ (const :tag "Buffer Major Mode" buffer-major-mode)
+ (const :tag "Buffer Name" buffer-name)
+ (const :tag "Buffer Name" buffer-name)
+ (const :tag "Sexp for evaluation" eval)
+ (const :tag "Function" function)
+ (const :tag "Or operation" or)
+ (const :tag "And operation" and))
+ (repeat sexp)))))
:group 'xwem)
;;; Internal variables
@@ -225,9 +226,13 @@
(cdar (cdar (specifier-spec-list ximg-spec nil tag-set
t)))))
(unless ximg
;; No image in TAG-SET environ
- (setq fname (expand-file-name iname xwem-icons-dir))
- (setq ximg (X:xpm-pixmap-from-file (xwem-dpy) (XDefaultRootWindow
(xwem-dpy)) fname nil tag-set))
- (setq ximg-mask-pixmap (X:xpm-pixmap-from-file (xwem-dpy)
(XDefaultRootWindow (xwem-dpy)) fname t tag-set))
+ (setq fname (expand-file-name iname xwem-icons-dir))
+ (setq ximg (X:xpm-pixmap-from-file
+ (xwem-dpy) (XDefaultRootWindow (xwem-dpy))
+ fname nil tag-set))
+ (setq ximg-mask-pixmap
+ (X:xpm-pixmap-from-file
+ (xwem-dpy) (XDefaultRootWindow (xwem-dpy)) fname t tag-set))
(setq ximg (cons ximg ximg-mask-pixmap))
(let ((sym (gensym "*xwem-icon-")))
@@ -244,10 +249,13 @@
(cond ((eq kwi 'no-kwm-win-icon) nil)
((null kwi)
;; KWM_WIN_ICON not yet checked
- (let* ((kw (XGetWindowProperty (xwem-dpy) (xwem-cl-xwin cl)
- (XInternAtom (xwem-dpy)
"KWM_WIN_ICON")))
- (pp (and (nth 2 kw) (make-X-Pixmap :dpy (xwem-dpy) :id (nth
2 kw))))
- (pm (and (nth 3 kw) (make-X-Pixmap :dpy (xwem-dpy) :id (nth
3 kw))))
+ (let* ((kw (XGetWindowProperty
+ (xwem-dpy) (xwem-cl-xwin cl)
+ (XInternAtom (xwem-dpy) "KWM_WIN_ICON")))
+ (pp (and (nth 2 kw) (make-X-Pixmap :dpy (xwem-dpy)
+ :id (nth 2 kw))))
+ (pm (and (nth 3 kw) (make-X-Pixmap :dpy (xwem-dpy)
+ :id (nth 3 kw))))
(gg nil))
(if (not (and pp pm))
(xwem-cl-put-sys-prop cl 'kwm-win-icon 'no-kwm-win-icon)
--- orig/lisp/xwem-interactive.el
+++ mod/lisp/xwem-interactive.el
@@ -78,14 +78,14 @@
C -- Command.
e -- External command."
(let ((is (cond ((and (= (length ispec) 1)
- (stringp (car ispec)))
- (setq ispec (car ispec))
- (split-string ispec "\n"))
+ (stringp (car ispec)))
+ (setq ispec (car ispec))
+ (split-string ispec "\n"))
- (t ispec))))
+ (t ispec))))
(if (not (stringp ispec))
- `(interactive (let ((xwem-interactively t))
+ `(interactive (let ((xwem-interactively t))
(prog1 (progn ,@ispec)
(setq xwem-prefix-arg nil))))
@@ -101,20 +101,23 @@
,(macroexpand inter)
;; Maybe run command without GCing at all
(let ((gc-cons-threshold (if xwem-commands-inhibit-gc
- most-positive-fixnum
- gc-cons-threshold)))
+ xwem-commands-gc-cons-threshold
+ gc-cons-threshold)))
,@body)))
(put 'define-xwem-command 'lisp-indent-function 'defun)
(defmacro xwem-under-minibuffer (&rest forms)
"Evaluate FORM under XWEM's minibuffer focus."
`(progn
- (xwem-client-set-property (xwem-minib-cl xwem-minibuffer) 'skip-deselect
t)
+ (xwem-client-set-property
+ (xwem-minib-cl xwem-minibuffer) 'skip-deselect t)
(xwem-select-client (xwem-minib-cl xwem-minibuffer))
(xwem-unwind-protect
(progn ,@forms)
- (xwem-client-set-property (xwem-minib-cl xwem-minibuffer)
'skip-deselect nil)
- (xwem-select-last-or-other-client (xwem-minib-cl xwem-minibuffer) nil
t))))
+ (xwem-client-set-property
+ (xwem-minib-cl xwem-minibuffer) 'skip-deselect nil)
+ (xwem-select-last-or-other-client
+ (xwem-minib-cl xwem-minibuffer) nil t))))
(defun xwem-interactive-p ()
@@ -122,33 +125,39 @@
xwem-interactively)
;; `read-from-minibuffer' variant for use by XWEM.
-(defun xwem-read-from-minibuffer (prompt &optional initial-contents keymap
readp history abbrev-table &rest notused)
+(defun xwem-read-from-minibuffer (prompt &optional initial-contents keymap
+ readp history abbrev-table
+ &rest notused)
"Read data from xwem minibuffer.
Arguments PROMPT, INITIAL-CONTENTS, KEYMAP, READP, HISTORY and
ABBREV-TABLE are same as for `read-from-minibuffer'."
(xwem-kbd-stop-grabbing)
- (let ((gc-cons-threshold most-positive-fixnum)) ; inhibit GCing
- (xwem-under-minibuffer
- (prog1 (let ((special-display-buffer-names
- (and (boundp 'xwem-special-display-buffer-names)
- (symbol-value 'xwem-special-display-buffer-names))))
- (read-from-minibuffer-for-xwem prompt initial-contents keymap
readp history abbrev-table))
- (xwem-clear-message)))))
+ (xwem-under-minibuffer
+ (prog1 (let ((special-display-buffer-names
+ (and (boundp 'xwem-special-display-buffer-names)
+ (symbol-value 'xwem-special-display-buffer-names))))
+ (read-from-minibuffer-for-xwem prompt initial-contents keymap
+ readp history abbrev-table))
+ (xwem-clear-message))))
(defmacro with-xwem-read-from-minibuffer (&rest forms)
"Execute FORMS using xwem `read-from-minibuffer.'"
- `(let ((saved-read-frome-minibuffer (symbol-function 'read-from-minibuffer)))
+ `(let ((saved-read-frome-minibuffer
+ (symbol-function 'read-from-minibuffer)))
(xwem-unwind-protect
(progn
- (fset 'read-from-minibuffer (symbol-function
'xwem-read-from-minibuffer))
+ (fset 'read-from-minibuffer
+ (symbol-function 'xwem-read-from-minibuffer))
,@forms)
(fset 'read-from-minibuffer saved-read-frome-minibuffer))))
-(defun xwem-completing-read (prompt table &optional predicate require-match
initial-contents history)
+(defun xwem-completing-read (prompt table &optional predicate require-match
+ initial-contents history)
"XWEM awared varian of `completing-read'."
(with-xwem-read-from-minibuffer
- (completing-read prompt table predicate require-match initial-contents
history)))
+ (completing-read prompt table predicate require-match
+ initial-contents history)))
(defun xwem-read-command (prompt)
"Just like `read-command', but for XWEM.
@@ -157,7 +166,8 @@
(with-xwem-read-from-minibuffer
(read-command prompt)))
-(defun xwem-read-filename (prompt &optional dir default must-match
initial-contents history)
+(defun xwem-read-filename (prompt &optional dir default must-match
+ initial-contents history)
"Just like `read-file-name', but for XWEM.
PROMPT, DIR, DEFAULT, MUST-MATCH, INITIAL-CONTENTS and HISTORY are
same as for `read-file-name'."
@@ -180,11 +190,13 @@
(let* ((clns (mapcar (lambda (cl)
(cons (xwem-client-name cl clients) cl)) clients))
(name (cond ((eq xwem-completing-read-type 'iswitchb)
- (xwem-misc-completing-read-using-iswitchb prompt
- (mapcar
(lambda (cl) (car cl)) clns)))
+ (xwem-misc-completing-read-using-iswitchb
+ prompt (mapcar 'car clns)))
((eq xwem-completing-read-type 'complete)
(completing-read prompt clns))
- (t (error 'xwem-error "Invalid
`xwem-completing-read-type'" xwem-completing-read-type)))))
+ (t (error 'xwem-error
+ "Invalid `xwem-completing-read-type'"
+ xwem-completing-read-type)))))
;; Find appopriate client
(while (and clns (not (string= (caar clns) name)))
@@ -205,7 +217,9 @@
(mapcar (lambda (frm) (xwem-frame-name frm)) frms)))
((eq xwem-completing-read-type 'complete)
(completing-read prompt frms))
- (t (error 'xwem-error "Invalid
`xwem-completing-read-type'" xwem-completing-read-type)))))
+ (t (error 'xwem-error
+ "Invalid `xwem-completing-read-type'"
+ xwem-completing-read-type)))))
;; Find appopriate frame
(while (and frms (not (string= (caar frms) name)))
@@ -227,8 +241,8 @@
;; Remove ?* from first element in SPEC
(if (= (length (car spec)) 1)
- (setq spec (cdr spec))
- (setq spec (cons (substring (car spec) 1) (cdr spec)))))
+ (setq spec (cdr spec))
+ (setq spec (cons (substring (car spec) 1) (cdr spec)))))
;; XXX if ?_ is first than command need to run with ungrabbed
;; keyboard.
@@ -237,26 +251,26 @@
;; Remove ?_ from first element in SPEC
(if (= (length (car spec)) 1)
- (setq spec (cdr spec))
- (setq spec (cons (substring (car spec) 1) (cdr spec)))))
+ (setq spec (cdr spec))
+ (setq spec (cons (substring (car spec) 1) (cdr spec)))))
(mapcar (lambda (el)
- (let ((code (aref el 0))
- (prompt (substring el 1)))
- (cond ((eq code ?P) xwem-prefix-arg)
- ((eq code ?p) (prefix-numeric-value xwem-prefix-arg))
-
- ((eq code ?k) (xwem-read-key prompt))
- ((eq code ?K) (xwem-read-key-sequence prompt))
- ((eq code ?c) (xwem-read-client prompt))
- ((eq code ?f) (xwem-read-filename prompt nil nil t))
- ((eq code ?F) (xwem-read-filename prompt))
- ((eq code ?s) (xwem-read-from-minibuffer prompt))
- ((eq code ?C) (xwem-read-command prompt))
- ((eq code ?c) (xwem-read-client prompt))
- ((eq code ?e) (xwem-read-external-command prompt))
- )))
- spec)))
+ (let ((code (aref el 0))
+ (prompt (substring el 1)))
+ (cond ((eq code ?P) xwem-prefix-arg)
+ ((eq code ?p) (prefix-numeric-value xwem-prefix-arg))
+
+ ((eq code ?k) (xwem-read-key prompt))
+ ((eq code ?K) (xwem-read-key-sequence prompt))
+ ((eq code ?c) (xwem-read-client prompt))
+ ((eq code ?f) (xwem-read-filename prompt nil nil t))
+ ((eq code ?F) (xwem-read-filename prompt))
+ ((eq code ?s) (xwem-read-from-minibuffer prompt))
+ ((eq code ?C) (xwem-read-command prompt))
+ ((eq code ?c) (xwem-read-client prompt))
+ ((eq code ?e) (xwem-read-external-command prompt))
+ )))
+ spec)))
(provide 'xwem-interactive)
--- orig/lisp/xwem-keyboard.el
+++ mod/lisp/xwem-keyboard.el
@@ -4,7 +4,7 @@
;; Authors: Zajcev Evgeny <zevlg@xxxxxxxxx>
;; Steve Youngs <steve@xxxxxxxxxxxxx>
-;; Alex Ott <ottalex@xxxxxxxx>
+;; Alex Ott <ottalex@xxxxxxxx>
;; Created: 21 Mar 2003
;; Keywords: xwem, xlib
;; X-CVS: $Id: xwem-keyboard.el,v 1.13 2004/12/08 08:30:55 youngs Exp $
@@ -78,27 +78,27 @@
(defcustom xwem-hyper-modifier 'hyper
"*This is a little trick of how ``H'' interpretted in `xwem-kbd'
specification."
:type '(choice (const :tag "Meta" meta)
- (const :tag "Control" control)
- (const :tag "Super" super)
- (const :tag "Hyper" hyper)
+ (const :tag "Control" control)
+ (const :tag "Super" super)
+ (const :tag "Hyper" hyper)
(const :tag "Alt" alt))
:group 'xwem-keyboard)
(defcustom xwem-meta-modifier 'meta
"*This is a little trick of how ``M'' interpretted in `xwem-kbd'
specification."
:type '(choice (const :tag "Meta" meta)
- (const :tag "Control" control)
- (const :tag "Super" super)
- (const :tag "Hyper" hyper)
+ (const :tag "Control" control)
+ (const :tag "Super" super)
+ (const :tag "Hyper" hyper)
(const :tag "Alt" alt))
:group 'xwem-keyboard)
-
+
(defcustom xwem-control-modifier 'control
"*This is a little trick of how ``C'' interpretted in `xwem-kbd'."
:type '(choice (const :tag "Meta" meta)
- (const :tag "Control" control)
- (const :tag "Super" super)
- (const :tag "Hyper" hyper)
+ (const :tag "Control" control)
+ (const :tag "Super" super)
+ (const :tag "Hyper" hyper)
(const :tag "Alt" alt))
:group 'xwem-keyboard)
@@ -245,8 +245,8 @@
If command is `nil' then undefine KEY in `xwem-global-map' and ungrab KEY."
(define-key xwem-global-map key command)
(mapc (lambda (cl)
- (xwem-kbd-graugra-key key (xwem-cl-xwin cl) (if command 'grab
'ungrab)))
- (xwem-clients-list))
+ (xwem-kbd-graugra-key key (xwem-cl-xwin cl) (if command 'grab
'ungrab)))
+ (xwem-clients-list))
nil)
;;}}}
@@ -261,22 +261,22 @@
"Just like `kbd' but take into account values of `xwem-hyper-modifier' and
`xwem-meta-modifier'."
(let ((keys (key-sequence-list-description (kbd spec))))
(mapvector (lambda (key)
- (let ((rkey (last key))
- (rmods (butlast key)))
- (when (member 'meta key)
- (setq rmods (delete 'meta rmods))
- (setq rkey (cons xwem-meta-modifier rkey)))
- (when (member 'hyper key)
- (setq rmods (delete 'hyper rmods))
- (setq rkey (cons xwem-hyper-modifier rkey)))
+ (let ((rkey (last key))
+ (rmods (butlast key)))
+ (when (member 'meta key)
+ (setq rmods (delete 'meta rmods))
+ (setq rkey (cons xwem-meta-modifier rkey)))
+ (when (member 'hyper key)
+ (setq rmods (delete 'hyper rmods))
+ |