Location: lg@xxxxxxxxxxxxxx http://arch.xwem.org/2005/
Revision: xwem--main--2.2--patch-18
Archive: lg@xxxxxxxxxxxxxx
Creator: Zajcev Evgeny <lg@xxxxxxxx>
Date: Wed May 25 21:44:11 MSD 2005
Standard-date: 2005-05-25 17:44:11 GMT
Modified-files: lisp/xwem-clients.el
lisp/xwem-interactive.el lisp/xwem-keydefs.el
New-patches: lg@xxxxxxxxxxxxxx/xwem--main--2.2--patch-18
Summary: Client reading fix
Keywords: client, reading, interactive
* lisp/xwem-clients.el (xwem-client-query-kill): Sort clients by recency.
* lisp/xwem-interactive.el (xwem-read-client): [addon and fix]
INITIAL-CLIENT parameter added. Selected client moved to the end of
list.
* lisp/xwem-keydefs.el (rebinding): `H-x 4 C-o' rebound to `H-x 4 H-o'.
`H-x 7 C-o' rebound to `H-x 7 H-o'.
* added files
{arch}/xwem/xwem--main/xwem--main--2.2/lg@xxxxxxxxxxxxxx/patch-log/patch-18
* modified files
--- orig/lisp/xwem-clients.el
+++ mod/lisp/xwem-clients.el
@@ -988,8 +988,8 @@
;;;###autoload(autoload 'xwem-cl-switch-other-win "xwem-clients" "" t)
(define-xwem-command xwem-cl-switch-other-win (cl &optional arg)
- "Switch to CL in other window.
-When used with prefix ARG, then focus to that other window."
+ "Display client CL in other window.
+If prefix ARG is given - select CL as well."
(xwem-interactive "cXWEM-CL Other: \nP")
(let (nwin)
@@ -1475,9 +1475,8 @@
(xwem-interactive (list
;; Sort clients, so selected client will be first
(xwem-read-client "XWEM Kill client: "
- (sort xwem-clients
- #'(lambda (cl1 cl2)
- (eq cl1 (xwem-cl-selected)))))
+ (xwem-cl-list-sort-by-recency
xwem-clients)
+ (xwem-cl-selected))
xwem-prefix-arg))
(xwem-client-kill cl arg))
--- orig/lisp/xwem-interactive.el
+++ mod/lisp/xwem-interactive.el
@@ -184,12 +184,27 @@
"Read for external command using PROMPT."
(xwem-launcher-query prompt))
-(defun xwem-read-client (prompt &optional clients)
+(defun xwem-read-client (prompt &optional clients initial-client)
"Read for client name prompting PROMPT and return xwem client.
-CLIENTS specifies list of clients to select from, default is `xwem-clients'.
-NOTE: Uses"
+CLIENTS specifies list of clients to select from, default is list
+returned by `xwem-clients-list'. Selected client is put to the end of
+the list.
+If INITIAL-CLIENT is given, it is put to the beginning of the clients
+list."
(unless clients
- (setq clients xwem-clients))
+ (setq clients (xwem-clients-list)))
+
+ ;; Put selected client to the end of list
+ (when (memq (xwem-cl-selected) clients)
+ (setq clients (append (remove* (xwem-cl-selected) clients :test 'eq)
+ (list (xwem-cl-selected)))))
+
+ ;; Put INITIAL-CLIENT to the beginning of the list
+ (when (and initial-client
+ (memq initial-client clients))
+ (setq clients
+ (cons initial-client
+ (remove* initial-client clients :test 'eq))))
(with-xwem-read-from-minibuffer
(let* ((clns (mapcar #'(lambda (cl)
@@ -269,7 +284,6 @@
((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))
--- orig/lisp/xwem-keydefs.el
+++ mod/lisp/xwem-keydefs.el
@@ -269,7 +269,7 @@
;; Window commands
(define-key xwem-global-map (xwem-kbd "H-x 4 0") 'xwem-kill-cl-and-window)
(define-key xwem-global-map (xwem-kbd "H-x 4 b") 'xwem-cl-switch-other-win)
-(define-key xwem-global-map (xwem-kbd "H-x 4 C-o") 'xwem-cl-switch-other-win)
+(define-key xwem-global-map (xwem-kbd "H-x 4 H-o") 'xwem-cl-switch-other-win)
(define-key xwem-global-map (xwem-kbd "H-x 4 r")
'xwem-launch-program-other-win)
(define-key xwem-global-map (xwem-kbd "H-x 4 H-M-l")
'xwem-cl-switch-to-other-in-other-win)
(define-key xwem-global-map (xwem-kbd "H-x 4 H-a x")
'xwem-launch-xterm-other-win)
@@ -287,7 +287,7 @@
(define-key xwem-global-map (xwem-kbd "H-x 7 4")
'xwem-client-run-copy-other-win)
(define-key xwem-global-map (xwem-kbd "H-x 7 5")
'xwem-client-run-copy-other-frame)
(define-key xwem-global-map (xwem-kbd "H-x 7 i") 'xwem-client-info)
-(define-key xwem-global-map (xwem-kbd "H-x 7 C-o") 'xwem-cl-switch-to-other)
+(define-key xwem-global-map (xwem-kbd "H-x 7 H-o") 'xwem-cl-switch-to-other)
(define-key xwem-global-map (xwem-kbd "H-x 7 p") 'xwem-cl-pop-to-client)
(define-key xwem-global-map (xwem-kbd "H-x 7 t") 'xwem-client-set-title)
(define-key xwem-global-map (xwem-kbd "H-x 7 H-t") 'xwem-cl-transpose)
|