• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Japanese translation of message catalog for Sawfish Window-Manager


Commit MetaInfo

修订版6dbc3f26ca215ade3246108bec5f00d973eabe60 (tree)
时间1999-08-16 00:05:09
作者john <john>
Commiterjohn

Log Message

keymaps are now customizable

更改概述

差异

--- a/lisp/keymaps.jl
+++ b/lisp/keymaps.jl
@@ -21,34 +21,59 @@
2121
2222 (provide 'keymaps)
2323
24-(defvar global-keymap (make-sparse-keymap)
25- "Keymap containing bindings active anywhere.")
24+(put 'keymap 'custom-set 'custom-set-keymap)
25+(put 'keymap 'custom-get 'custom-get-keymap)
26+(put 'keymap 'custom-widget 'custom-keymap-widget)
2627
27-(defvar root-window-keymap (make-sparse-keymap)
28- "Keymap containing bindings active when the pointer is in the root window.")
28+(defgroup bindings "Bindings"
29+ :widget custom-keymap-group-widget)
2930
30-(defvar title-keymap (make-sparse-keymap)
31- "Keymap containing bindings active when the pointer is in the title of
32-a window.")
33-
34-(defvar iconify-button-keymap (make-sparse-keymap)
35- "Keymap containing bindings active when the pointer is in the iconify
36-button of a window.")
31+(defcustom global-keymap (make-sparse-keymap)
32+ "Keymap containing bindings active anywhere."
33+ :group bindings
34+ :type keymap
35+ :before-set (lambda ()
36+ (ungrab-keymap global-keymap))
37+ :after-set (lambda ()
38+ (grab-keymap global-keymap)))
39+
40+(defcustom window-keymap (make-sparse-keymap)
41+ "Keymap containing bindings active when a client window is focused."
42+ :group bindings
43+ :type keymap
44+ :before-set (lambda ()
45+ (ungrab-keymap window-keymap))
46+ :after-set (lambda ()
47+ (grab-keymap window-keymap)))
48+
49+(defcustom root-window-keymap (make-sparse-keymap)
50+ "Keymap containing bindings active when the pointer is in the root window."
51+ :group bindings
52+ :type keymap)
3753
38-(defvar maximize-button-keymap (make-sparse-keymap)
39- "Keymap containing bindings active when the pointer is in the maximize
40-button of a window.")
54+(defcustom title-keymap (make-sparse-keymap)
55+ "Keymap containing bindings active when the pointer is in the title of
56+a window."
57+ :group bindings
58+ :type keymap)
4159
42-(defvar close-button-keymap (make-sparse-keymap)
60+(defcustom close-button-keymap (make-sparse-keymap)
4361 "Keymap containing bindings active when the pointer is in the close button
44-of a window.")
62+of a window."
63+ :group bindings
64+ :type keymap)
4565
46-(defvar menu-button-keymap (make-sparse-keymap)
47- "Keymap containing bindings active when the pointer is in the menu button
48-of a window.")
66+(defcustom iconify-button-keymap (make-sparse-keymap)
67+ "Keymap containing bindings active when the pointer is in the iconify
68+button of a window."
69+ :group bindings
70+ :type keymap)
4971
50-(defvar window-keymap (make-sparse-keymap)
51- "Keymap containing bindings active when a client window is focused.")
72+(defcustom menu-button-keymap (make-sparse-keymap)
73+ "Keymap containing bindings active when the pointer is in the menu button
74+of a window."
75+ :group bindings
76+ :type keymap)
5277
5378
5479 ;; Arrange for window-keymap to be set in each window
@@ -79,8 +104,7 @@ of a window.")
79104
80105 (bind-keys global-keymap
81106 "C-Left" 'previous-workspace
82- "C-Right" 'next-workspace
83- "C-M-ESC" 'quit)
107+ "C-Right" 'next-workspace)
84108
85109 (bind-keys root-window-keymap
86110 "Button2-Click1" 'popup-root-menu
@@ -99,10 +123,36 @@ of a window.")
99123 "Button3-Off" 'delete-window)
100124
101125
102-;; placeholder for customize
103-
104-(defcustom keymap-dummy nil
105- ""
106- :type none
107- :group bindings
108- :widget (lambda () '(label "Keybinding customization is unimplemented.")))
126+;; customize support
127+
128+(defun custom-get-keymap (symbol)
129+ (cons 'keymap (mapcar #'(lambda (cell)
130+ (cons (car cell) (event-name (cdr cell))))
131+ (cdr (symbol-value symbol)))))
132+
133+(defun custom-set-keymap (symbol value &rest args)
134+ (when (eq (car value) 'keymap)
135+ (apply 'custom-set-variable symbol
136+ (cons 'keymap
137+ (delq nil (mapcar #'(lambda (cell)
138+ (let
139+ ((ev (lookup-event (cdr cell))))
140+ (and ev (cons (car cell) ev))))
141+ (cdr value)))) args)))
142+
143+(defun custom-keymap-widget (symbol value doc)
144+ `(keymap :variable ,symbol
145+ :value ,value
146+ :doc ,doc))
147+
148+(defun custom-keymap-group-widget (group spec)
149+ (let
150+ ((names (mapcar 'symbol-name (cdr (assq 'bindings custom-groups)))))
151+ `(keymap-shell ,(mapcar #'(lambda (elt)
152+ (list (car (prog1 names
153+ (setq names (cdr names))))
154+ elt)) spec)
155+ :commands ,(sort (apropos "" 'commandp)
156+ #'(lambda (x y)
157+ (< (symbol-name x)
158+ (symbol-name y)))))))
--- a/lisp/sawfish/wm/keymaps.jl
+++ b/lisp/sawfish/wm/keymaps.jl
@@ -21,34 +21,59 @@
2121
2222 (provide 'keymaps)
2323
24-(defvar global-keymap (make-sparse-keymap)
25- "Keymap containing bindings active anywhere.")
24+(put 'keymap 'custom-set 'custom-set-keymap)
25+(put 'keymap 'custom-get 'custom-get-keymap)
26+(put 'keymap 'custom-widget 'custom-keymap-widget)
2627
27-(defvar root-window-keymap (make-sparse-keymap)
28- "Keymap containing bindings active when the pointer is in the root window.")
28+(defgroup bindings "Bindings"
29+ :widget custom-keymap-group-widget)
2930
30-(defvar title-keymap (make-sparse-keymap)
31- "Keymap containing bindings active when the pointer is in the title of
32-a window.")
33-
34-(defvar iconify-button-keymap (make-sparse-keymap)
35- "Keymap containing bindings active when the pointer is in the iconify
36-button of a window.")
31+(defcustom global-keymap (make-sparse-keymap)
32+ "Keymap containing bindings active anywhere."
33+ :group bindings
34+ :type keymap
35+ :before-set (lambda ()
36+ (ungrab-keymap global-keymap))
37+ :after-set (lambda ()
38+ (grab-keymap global-keymap)))
39+
40+(defcustom window-keymap (make-sparse-keymap)
41+ "Keymap containing bindings active when a client window is focused."
42+ :group bindings
43+ :type keymap
44+ :before-set (lambda ()
45+ (ungrab-keymap window-keymap))
46+ :after-set (lambda ()
47+ (grab-keymap window-keymap)))
48+
49+(defcustom root-window-keymap (make-sparse-keymap)
50+ "Keymap containing bindings active when the pointer is in the root window."
51+ :group bindings
52+ :type keymap)
3753
38-(defvar maximize-button-keymap (make-sparse-keymap)
39- "Keymap containing bindings active when the pointer is in the maximize
40-button of a window.")
54+(defcustom title-keymap (make-sparse-keymap)
55+ "Keymap containing bindings active when the pointer is in the title of
56+a window."
57+ :group bindings
58+ :type keymap)
4159
42-(defvar close-button-keymap (make-sparse-keymap)
60+(defcustom close-button-keymap (make-sparse-keymap)
4361 "Keymap containing bindings active when the pointer is in the close button
44-of a window.")
62+of a window."
63+ :group bindings
64+ :type keymap)
4565
46-(defvar menu-button-keymap (make-sparse-keymap)
47- "Keymap containing bindings active when the pointer is in the menu button
48-of a window.")
66+(defcustom iconify-button-keymap (make-sparse-keymap)
67+ "Keymap containing bindings active when the pointer is in the iconify
68+button of a window."
69+ :group bindings
70+ :type keymap)
4971
50-(defvar window-keymap (make-sparse-keymap)
51- "Keymap containing bindings active when a client window is focused.")
72+(defcustom menu-button-keymap (make-sparse-keymap)
73+ "Keymap containing bindings active when the pointer is in the menu button
74+of a window."
75+ :group bindings
76+ :type keymap)
5277
5378
5479 ;; Arrange for window-keymap to be set in each window
@@ -79,8 +104,7 @@ of a window.")
79104
80105 (bind-keys global-keymap
81106 "C-Left" 'previous-workspace
82- "C-Right" 'next-workspace
83- "C-M-ESC" 'quit)
107+ "C-Right" 'next-workspace)
84108
85109 (bind-keys root-window-keymap
86110 "Button2-Click1" 'popup-root-menu
@@ -99,10 +123,36 @@ of a window.")
99123 "Button3-Off" 'delete-window)
100124
101125
102-;; placeholder for customize
103-
104-(defcustom keymap-dummy nil
105- ""
106- :type none
107- :group bindings
108- :widget (lambda () '(label "Keybinding customization is unimplemented.")))
126+;; customize support
127+
128+(defun custom-get-keymap (symbol)
129+ (cons 'keymap (mapcar #'(lambda (cell)
130+ (cons (car cell) (event-name (cdr cell))))
131+ (cdr (symbol-value symbol)))))
132+
133+(defun custom-set-keymap (symbol value &rest args)
134+ (when (eq (car value) 'keymap)
135+ (apply 'custom-set-variable symbol
136+ (cons 'keymap
137+ (delq nil (mapcar #'(lambda (cell)
138+ (let
139+ ((ev (lookup-event (cdr cell))))
140+ (and ev (cons (car cell) ev))))
141+ (cdr value)))) args)))
142+
143+(defun custom-keymap-widget (symbol value doc)
144+ `(keymap :variable ,symbol
145+ :value ,value
146+ :doc ,doc))
147+
148+(defun custom-keymap-group-widget (group spec)
149+ (let
150+ ((names (mapcar 'symbol-name (cdr (assq 'bindings custom-groups)))))
151+ `(keymap-shell ,(mapcar #'(lambda (elt)
152+ (list (car (prog1 names
153+ (setq names (cdr names))))
154+ elt)) spec)
155+ :commands ,(sort (apropos "" 'commandp)
156+ #'(lambda (x y)
157+ (< (symbol-name x)
158+ (symbol-name y)))))))