From fe814f449811f29c7a78eec19f1be3dcd0698173 Mon Sep 17 00:00:00 2001 From: ueno Date: Sun, 19 Oct 2003 04:10:00 +0000 Subject: [PATCH] * riece-options.el (riece-command-prefix): New user option. (riece-tab-stop-list): Abolish. * riece.el (riece-define-keys-1): If keymap is a list, eval the 2nd element of it. (riece-select-keys): Use riece-command-prefix instead of "\C-c". (riece-command-map): Ditto. (riece-dialogue-mode): Don't set tab-stop-list. --- lisp/ChangeLog | 11 +++++++++++ lisp/riece-options.el | 12 ++++++------ lisp/riece.el | 45 +++++++++++++++++++++++++++++---------------- 3 files changed, 46 insertions(+), 22 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 58ab064..48a76fc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2003-10-19 Daiki Ueno + + * riece-options.el (riece-command-prefix): New user option. + (riece-tab-stop-list): Abolish. + + * riece.el (riece-define-keys-1): If keymap is a list, eval the + 2nd element of it. + (riece-select-keys): Use riece-command-prefix instead of "\C-c". + (riece-command-map): Ditto. + (riece-dialogue-mode): Don't set tab-stop-list. + 2003-10-18 Daiki Ueno * riece-keyword.el (riece-keyword-message-filter): Ignore messages diff --git a/lisp/riece-options.el b/lisp/riece-options.el index 0872933..700bfc2 100644 --- a/lisp/riece-options.el +++ b/lisp/riece-options.el @@ -48,6 +48,11 @@ :type 'boolean :group 'riece-options) +(defcustom riece-command-prefix "\C-c" + "Key sequence to be used as prefix for command mode key bindings." + :type 'string + :group 'riece-options) + (defgroup riece-looks nil "Related to look and feel" :prefix "riece-" @@ -63,12 +68,7 @@ :type 'boolean :group 'riece-looks) -(defcustom riece-tab-stop-list '(2 4 6 8 10 12 14 16) - "To override `tab-stop-list'." - :type '(repeat integer) - :group 'riece-looks) - -(defcustom riece-directory "~/.riece" +(defcustom riece-directory (expand-file-name "~/.riece") "Where to look for data files." :type 'directory :group 'riece-options) diff --git a/lisp/riece.el b/lisp/riece.el index 2f3b858..1cf4769 100644 --- a/lisp/riece.el +++ b/lisp/riece.el @@ -58,7 +58,7 @@ (riece-user-list-buffer " *Users*" riece-user-list-mode))) (defvar riece-select-keys - '("1" riece-command-switch-to-channel-by-number-1 + `("1" riece-command-switch-to-channel-by-number-1 "2" riece-command-switch-to-channel-by-number-2 "3" riece-command-switch-to-channel-by-number-3 "4" riece-command-switch-to-channel-by-number-4 @@ -68,16 +68,26 @@ "8" riece-command-switch-to-channel-by-number-8 "9" riece-command-switch-to-channel-by-number-9 "0" riece-command-switch-to-channel-by-number-10 - "\C-c1" riece-command-switch-to-channel-by-number-11 - "\C-c2" riece-command-switch-to-channel-by-number-12 - "\C-c3" riece-command-switch-to-channel-by-number-13 - "\C-c4" riece-command-switch-to-channel-by-number-14 - "\C-c5" riece-command-switch-to-channel-by-number-15 - "\C-c6" riece-command-switch-to-channel-by-number-16 - "\C-c7" riece-command-switch-to-channel-by-number-17 - "\C-c8" riece-command-switch-to-channel-by-number-18 - "\C-c9" riece-command-switch-to-channel-by-number-19 - "\C-c0" riece-command-switch-to-channel-by-number-20)) + ,(concat riece-command-prefix "1") + riece-command-switch-to-channel-by-number-11 + ,(concat riece-command-prefix "2") + riece-command-switch-to-channel-by-number-12 + ,(concat riece-command-prefix "3") + riece-command-switch-to-channel-by-number-13 + ,(concat riece-command-prefix "4") + riece-command-switch-to-channel-by-number-14 + ,(concat riece-command-prefix "5") + riece-command-switch-to-channel-by-number-15 + ,(concat riece-command-prefix "6") + riece-command-switch-to-channel-by-number-16 + ,(concat riece-command-prefix "7") + riece-command-switch-to-channel-by-number-17 + ,(concat riece-command-prefix "8") + riece-command-switch-to-channel-by-number-18 + ,(concat riece-command-prefix "9") + riece-command-switch-to-channel-by-number-19 + ,(concat riece-command-prefix "0") + riece-command-switch-to-channel-by-number-20)) ;;; Keymap macros. -- borrowed from `gnus-util.el'. (defmacro riece-local-set-keys (&rest plist) @@ -108,7 +118,11 @@ If optional argument SAFE is nil, overwrite previous definitions." ((listp keymap) (set (car keymap) nil) (define-prefix-command (car keymap)) - (define-key (symbol-value (nth 2 keymap)) (nth 1 keymap) (car keymap)) + (define-key (symbol-value (nth 2 keymap)) + (if (symbolp (nth 1 keymap)) + (symbol-value (nth 1 keymap)) + (nth 1 keymap)) + (car keymap)) (setq keymap (symbol-value (car keymap))))) (let (key) (while plist @@ -162,7 +176,8 @@ If optional argument SAFE is nil, overwrite previous definitions." "\r" riece-command-enter-message [(control return)] riece-command-enter-message-as-notice) - (riece-define-keys (riece-command-map "\C-c" riece-command-mode-map) + (riece-define-keys (riece-command-map riece-command-prefix + riece-command-mode-map) "\177" riece-command-scroll-down [delete] riece-command-scroll-down [backspace] riece-command-scroll-down @@ -318,7 +333,6 @@ Instead, these commands are available: \\{riece-dialogue-mode-map}" (kill-all-local-variables) (make-local-variable 'riece-freeze) - (make-local-variable 'tab-stop-list) (setq riece-freeze riece-default-freeze riece-away-indicator "-" riece-operator-indicator "-" @@ -332,8 +346,7 @@ Instead, these commands are available: riece-freeze-indicator " " riece-channel-list-indicator " ")) - buffer-read-only t - tab-stop-list riece-tab-stop-list) + buffer-read-only t) (riece-simplify-mode-line-format) (use-local-map riece-dialogue-mode-map) (buffer-disable-undo) -- 1.7.10.4