+2000-09-19 Daiki Ueno <ueno@unixuser.org>
+
+ * liece-menu.el (liece-menu-callback-set-operators): Rename from
+ `liece-menu-callback-mode+o'.
+ (liece-menu-callback-set-voices): Rename from
+ `liece-menu-callback-mode+v'.
+ (liece-menu-callback-unset-operators): Rename from
+ `liece-menu-callback-mode-o'.
+ (liece-menu-callback-unset-voices): Rename from
+ `liece-menu-callback-mode-v'.
+
+ * liece-nick.el (liece-nick-region-opers): Abolish.
+ (liece-nick-region-voices): Abolish.
+ (liece-nick-update-region): Don't set them.
+
+ * liece.el (liece-dialogue-mode-map): Don't bind `liece-command-exec',
+ `liece-command-lusers' and `liece-command-userhost'.
+
+ * liece-commands.el (liece-command-exec): Abolish.
+ (liece-command-inline): Abolish.
+ (liece-command-set-operators): Rename from `liece-command-mode+o'.
+ (liece-command-set-voices): Rename from `liece-command-mode+v'.
+ (liece-command-qualify-nicks): New function.
+ (liece-command-mode-o): Abolish.
+ (liece-command-mode-v): Abolish.
+ (liece-command-userhost): Abolish.
+ (liece-command-lusers): Abolish.
+
2000-09-18 Daiki Ueno <ueno@unixuser.org>
* liece-vars.el (liece-channel-buffer-mode): Set default to t.
(liece-menu-channel-menu): Move `liece-command-own-freeze'
from 'liece-menu-IRC-menu'.
(liece-menu-channel-menu): New menu item `liece-dialogue-beep'.
+ (liece-menu-channel-menu): New menu item
+ `liece-command-unread-channel'.
2000-09-17 Akira Ohashi <bg66@luck.gr.jp>
(while (not (string-equal (setq message (read-string "> ")) ""))
(liece-command-send-message message))))
-(defun liece-command-inline ()
- "Send current line as a message to the IRC server."
- (interactive)
- (beginning-of-line)
- (liece-send (buffer-substring (point)(progn (end-of-line) (point))))
- (liece-next-line 1))
-
(defun liece-command-join-channel (join-channel-var key)
"Join a JOIN-CHANNEL-VAR with KEY."
(let ((nicks liece-nick-alist) nick)
(liece-send "LIST %s" (liece-channel-real channel))
)))
-(defun liece-command-lusers ()
- "List the number of users and servers."
- (interactive)
- (liece-send "LUSERS"))
-
(defun liece-command-modec (chnl change)
"Send a MODE command to this CHNL.
Argument CHANGE ."
(list chnl (read-from-minibuffer prompt nil liece-minibuffer-map))))
(liece-send "MODE %s %s" (liece-channel-real chnl) change))
-(defun liece-command-mode+o (opers)
- "Send a MODE +o OPERS command."
- (interactive
- (let ((opers (liece-channel-get-operators)) oper
- (nicks (liece-channel-get-nicks))
- (completion-ignore-case t))
- (setq nicks (filter-elements
- nick nicks
- (not (liece-nick-member nick opers)))
- opers (liece-minibuffer-completing-read-multiple
- (_ "Assign operational privilege to: ") (list-to-alist nicks)))
- (list opers)))
- (let (ops)
- (dolist (oper opers)
- (push oper ops)
- (when (= (length ops) liece-compress-mode-length)
- (liece-send "MODE %s +%s %s"
- (liece-channel-real liece-current-channel)
- (string-times "o" liece-compress-mode-length)
- (string-join ops " "))
- (setq ops nil)))
- (if ops
- (liece-send "MODE %s +%s %s"
- (liece-channel-real liece-current-channel)
- (string-times "o" (length ops))
- (string-join ops " ")))))
-
-(defun liece-command-mode-o (opers)
- "Send a MODE -o OPERS command."
- (interactive
- (let ((completion-ignore-case t)
- (opers (liece-channel-get-operators)) oper nicks)
- (setq nicks (liece-minibuffer-completing-read-multiple
- (_ "Divest operational privilege from: ") (list-to-alist opers)))
- (list nicks)))
- (let (ops)
- (dolist (oper opers)
- (push oper ops)
- (when (= (length ops) liece-compress-mode-length)
- (liece-send "MODE %s -%s %s"
- (liece-channel-real liece-current-channel)
- (string-times "o" liece-compress-mode-length)
- (string-join ops " "))
- (setq ops nil)))
- (if ops
- (liece-send "MODE %s -%s %s"
- (liece-channel-real liece-current-channel)
- (string-times "o" (length ops))
- (string-join ops " ")))))
-
-(defun liece-command-mode+v (voices)
- "Send a MODE +v VOICES command."
+(defun liece-command-qualify-nicks (mode nicks val)
+ (liece-send
+ "MODE %s %c%s %s"
+ (liece-channel-real liece-current-channel)
+ (if val ?+ ?-) (make-string (length nicks) ?o)
+ (string-join nicks " ")))
+
+(defun liece-command-set-operators (nicks &optional arg)
(interactive
- (let ((voices (append (liece-channel-get-voices)
- (liece-channel-get-operators)))
- voice
- (nicks (liece-channel-get-nicks))
+ (let ((opers (liece-channel-get-operators))
(completion-ignore-case t)
- (count 0))
- (setq nicks (filter-elements nick nicks
- (not (string-assoc-ignore-case nick voices)))
- voices (liece-minibuffer-completing-read-multiple
- (_ "Allow to speak: ") (list-to-alist nicks)))
- (list voices)))
- (let (vcs)
- (dolist (voice voices)
- (push voice vcs)
- (when (= (length vcs) liece-compress-mode-length)
- (liece-send "MODE %s +%s %s"
- (liece-channel-real liece-current-channel)
- (string-times "v" liece-compress-mode-length)
- (string-join vcs " "))
- (setq vcs nil)))
- (if vcs
- (liece-send "MODE %s +%s %s"
- (liece-channel-real liece-current-channel)
- (string-times "v" (length vcs))
- (string-join vcs " ")))))
-
-(defun liece-command-mode-v (voices)
- "Send a MODE -v VOICES command."
+ nicks)
+ (if current-prefix-arg
+ (setq nicks (liece-minibuffer-completing-read-multiple
+ (_ "Divest operational privilege from: ")
+ (list-to-alist opers)))
+ (setq nicks (liece-channel-get-nicks)
+ nicks (filter-elements nick nicks
+ (not (liece-nick-member nick opers)))
+ nicks (liece-minibuffer-completing-read-multiple
+ (_ "Assign operational privilege to: ")
+ (list-to-alist nicks))))
+ (list nicks current-prefix-arg)))
+ (let (run)
+ (unwind-protect
+ (dolist (nick nicks)
+ (push nick run)
+ (if (= (length run) liece-compress-mode-length)
+ (liece-command-qualify-nicks ?o run (not arg))))
+ (when run
+ (liece-command-qualify-nicks ?o run (not arg))))))
+
+(defun liece-command-set-voices (nicks &optional arg)
(interactive
- (let ((completion-ignore-case t)
- (voices (liece-channel-get-voices)) voice nicks)
- (setq nicks (liece-minibuffer-completing-read-multiple
- (_ "Forbid to speak: ") (list-to-alist voices)))
- (list nicks)))
- (let (vcs)
- (dolist (voice voices)
- (push voice vcs)
- (when (= (length vcs) liece-compress-mode-length)
- (liece-send "MODE %s -%s %s"
- (liece-channel-real liece-current-channel)
- (string-times "v" liece-compress-mode-length)
- (string-join vcs " "))
- (setq vcs nil)))
- (if vcs
- (liece-send "MODE %s -%s %s"
- (liece-channel-real liece-current-channel)
- (string-times "v" (length vcs))
- (string-join vcs " ")))))
+ (let ((voices (liece-channel-get-voices))
+ (completion-ignore-case t)
+ nicks)
+ (if current-prefix-arg
+ (setq nicks (liece-minibuffer-completing-read-multiple
+ (_ "Forbid to speak: ") (list-to-alist voices)))
+ (setq voices (append voices (liece-channel-get-operators))
+ nicks (liece-channel-get-nicks)
+ nicks (filter-elements nick nicks
+ (not (liece-nick-member nick voices)))
+ nicks (liece-minibuffer-completing-read-multiple
+ (_ "Allow to speak: ") (list-to-alist nicks))))
+ (list nicks current-prefix-arg)))
+ (let (run)
+ (unwind-protect
+ (dolist (nick nicks)
+ (push nick run)
+ (if (= (length run) liece-compress-mode-length)
+ (liece-command-qualify-nicks ?v run (not arg))))
+ (when run
+ (liece-command-qualify-nicks ?v run (not arg))))))
(defun liece-command-message (address message)
"Send ADDRESS a private MESSAGE."
(call-interactively (function liece-command-generic))
(self-insert-command 1)))
-(defun liece-command-exec (command)
- "Execute COMMAND, stdout to dialogue."
- (interactive "sShell command: ")
- (shell-command command t)
- (let ((opoint (point)))
- (while (< (point) (mark))
- (liece-command-enter-message)
- (set-buffer liece-command-buffer))
- (push-mark opoint t)))
-
(defun liece-command-yank-send (&optional arg)
"Send message from yank buffer.
Prefix argument ARG is regarded as distance from yank pointer."
(insert "+ " friend "\n")
(insert "- " friend "\n")))))
-(defun liece-command-userhost (nicks)
- "Ask for the hostnames of NICKS."
- (interactive
- (let (nicks (completion-ignore-case t))
- (setq nicks (liece-minibuffer-completing-read-multiple
- (_ "Userhost nick")
- (list-to-alist liece-nick-alist)))
- (list nicks)))
- (liece-send "USERHOST :%s" (mapconcat 'identity nicks ",")))
-
(defun liece-command-show-last-kill ()
"Dig last kill from KILL and show it."
(interactive)
["CTCP PING" liece-menu-callback-ctcp-ping
liece-nick-region-nicks]
"----"
- ["Set Channel Operator(s)" liece-menu-callback-mode+o
+ ["Set Channel Operator(s)" liece-menu-callback-set-operators
liece-nick-region-nicks]
- ["Set Channel Voice(s)" liece-menu-callback-mode+v
+ ["Set Channel Voice(s)" liece-menu-callback-set-voices
liece-nick-region-nicks]
- ["Unset Channel Operator(s)" liece-menu-callback-mode-o
+ ["Unset Channel Operator(s)" liece-menu-callback-unset-operators
liece-nick-region-nicks]
- ["Unset Channel Voice(s)" liece-menu-callback-mode-v
+ ["Unset Channel Voice(s)" liece-menu-callback-unset-voices
liece-nick-region-nicks]
"----"
["Kick" liece-menu-callback-kick
(or liece-current-channels liece-current-chat-partners)]
["Go to previous channel" liece-command-previous-channel
(or liece-current-channels liece-current-chat-partners)]
+ ["Go to unread channel" liece-command-unread-channel
+ (or liece-current-channels liece-current-chat-partners)]
["Rotate left channels" liece-command-pop
(or liece-current-channels liece-current-chat-partners)]
["Rotate right channels" liece-command-push
(dolist (nick liece-nick-region-nicks)
(liece-command-kick nick)))
-(defun liece-menu-callback-mode+o ()
+(defun liece-menu-callback-set-operators ()
(interactive)
- (dolist (oper liece-nick-region-opers)
+ (let ((opers (liece-channel-get-operators)))
(setq liece-nick-region-nicks
- (string-list-remove-ignore-case oper liece-nick-region-nicks)))
- (liece-command-mode+o liece-nick-region-nicks))
+ (filter-elements nick liece-nick-region-nicks
+ (not (liece-nick-member nick opers)))))
+ (liece-command-set-operators liece-nick-region-nicks))
-(defun liece-menu-callback-mode+v ()
+(defun liece-menu-callback-set-voices ()
(interactive)
- (dolist (voice liece-nick-region-voices)
+ (let ((voices (liece-channel-get-voices)))
(setq liece-nick-region-nicks
- (string-list-remove-ignore-case voice liece-nick-region-nicks)))
- (liece-command-mode+v liece-nick-region-nicks))
+ (filter-elements nick liece-nick-region-nicks
+ (not (liece-nick-member nick voices)))))
+ (liece-command-set-voices liece-nick-region-nicks))
-(defun liece-menu-callback-mode-o ()
+(defun liece-menu-callback-unset-operators ()
(interactive)
- (liece-command-mode-o liece-nick-region-opers))
+ (let ((opers (liece-channel-get-operators)))
+ (setq liece-nick-region-nicks
+ (filter-elements nick liece-nick-region-nicks
+ (liece-nick-member nick opers))))
+ (liece-command-set-operators liece-nick-region-nicks t))
-(defun liece-menu-callback-mode-v ()
+(defun liece-menu-callback-unset-voices ()
(interactive)
- (liece-command-mode-v liece-nick-region-voices))
+ (let ((voices (liece-channel-get-voices)))
+ (setq liece-nick-region-nicks
+ (filter-elements nick liece-nick-region-nicks
+ (liece-nick-member nick voices))))
+ (liece-command-set-voices liece-nick-region-nicks t))
(provide 'liece-menu)
(liece-nick-join user chnl)))))
(defvar liece-nick-region-nicks nil)
-(defvar liece-nick-region-opers nil)
-(defvar liece-nick-region-voices nil)
;;;###liece-autoload
(defun liece-nick-update-region ()
- (setq liece-nick-region-nicks nil
- liece-nick-region-opers nil
- liece-nick-region-voices nil)
+ (setq liece-nick-region-nicks nil)
(save-excursion
(let (region nick)
(if (not (region-active-p))
(while (not (eobp))
(setq nick (widget-value (widget-at (1+ (point)))))
(push nick liece-nick-region-nicks)
- (if (memq (char-after) '(?@ ?+))
- (push nick liece-nick-region-voices))
- (if (eq ?@ (char-after))
- (push nick liece-nick-region-opers))
(beginning-of-line 2))))))
(defun liece-nick-add-buttons (start end)
(provide 'liece-version)
(product-provide 'liece-version
- (product-define "Liece" nil '(1 4 4)))
+ (product-define "Liece" nil '(1 4 5)))
(defconst liece-environment-version
(concat
"/" liece-command-generic
">" end-of-buffer
"<" beginning-of-buffer
- "!" liece-command-exec
"|" liece-command-show-last-kill
"a" liece-command-away
"b" liece-command-submit-bug-report
"t" liece-command-topic
"T" liece-command-timestamp
"\C-t" liece-command-find-timestamp
- "u" liece-command-lusers
- "U" liece-command-userhost
"v" liece-command-browse-url
"w" liece-command-who)
"\r" liece-command-enter-message
[tab] liece-command-complete
[(meta control c) >] liece-command-push
- [(meta control c) <] liece-command-pop
- [(meta control c) o] liece-command-mode+o
- [(meta control c) O] liece-command-mode-o
- [(meta control c) v] liece-command-mode+v
- [(meta control c) V] liece-command-mode-v)
+ [(meta control c) <] liece-command-pop)
(liece-define-keys (liece-command-map "\C-c" liece-command-mode-map)
"\177" liece-command-scroll-down
">" liece-command-next-channel
"<" liece-command-previous-channel
"a" liece-command-away
- "c" liece-command-inline
- "\C-a" liece-command-previous-channel
"\C-f" liece-command-freeze
"\C-j" liece-command-next-channel
"\C-n" liece-command-names
"L" liece-command-load-vars
"M" liece-command-own-freeze
"\C-m" liece-command-modec
- "o" liece-command-mode+o
+ "o" liece-command-set-operators
"O" liece-command-toggle-nick-buffer-mode
"\C-o" liece-command-toggle-channel-buffer-mode
"\C-p" liece-command-part
"\C-r" mule-caesar-region
"s" liece-command-set-window-style
"S" liece-command-save-vars
- "v" liece-command-mode+v
+ "v" liece-command-set-voices
"\C-v" liece-command-browse-url
"\C-y" liece-command-yank-send)
(set-keymap-parent liece-command-map liece-dialogue-mode-map)
(liece-define-keys liece-nick-mode-map
- "o" liece-command-mode+o
- "O" liece-command-mode-o
- "v" liece-command-mode+v
- "V" liece-command-mode-v
+ "o" liece-command-set-operators
+ "v" liece-command-set-voices
"f" liece-command-finger
" " liece-command-nick-scroll-up
"\177" liece-command-nick-scroll-down