X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fliece-commands.el;h=bbcba829e8881255ff468ebe90d1643be861527a;hb=046934349fbbe535deac0d0406c5978ef0ed8796;hp=de437ded4d98b43ffa6f0c9ac9d8f8a766788baa;hpb=4474bbe3792887d46fe9acbaf0415c325e09c905;p=elisp%2Fliece.git diff --git a/lisp/liece-commands.el b/lisp/liece-commands.el index de437de..bbcba82 100644 --- a/lisp/liece-commands.el +++ b/lisp/liece-commands.el @@ -39,7 +39,6 @@ (require 'liece-minibuf) (autoload 'liece-dcc-chat-send "liece-dcc") -(autoload 'liece-window-configuration-pop "liece-window") (autoload 'liece-command-ctcp-version "liece-ctcp" nil t) (autoload 'liece-command-ctcp-userinfo "liece-ctcp" nil t) @@ -176,13 +175,6 @@ Optional argument NO-CONS specifies timestamp format is cons cell." (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) @@ -448,11 +440,6 @@ With - as argument, list all channels." (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 ." @@ -482,107 +469,63 @@ 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) + (when (= (length run) liece-compress-mode-length) + (liece-command-qualify-nicks ?o run (not arg)) + (setq run nil))) + (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) + (when (= (length run) liece-compress-mode-length) + (liece-command-qualify-nicks ?v run (not arg)) + (setq run nil))) + (when run + (liece-command-qualify-nicks ?v run (not arg)))))) (defun liece-command-message (address message) "Send ADDRESS a private MESSAGE." @@ -818,13 +761,9 @@ If prefix argument ARG is non-nil, leave signoff message." (if arg (read-string (_ "Signoff message: ")) (or liece-signoff-message (product-name (product-find 'liece-version)))))) - (liece-close-server quit-string)) - (liece-clear-system) - (if liece-save-variables-are-dirty - (liece-command-save-vars)) - (if (interactive-p) - (liece-window-configuration-pop)) - (run-hooks 'liece-exit-hook))) + (if quit-string + (liece-send "QUIT :%s" quit-string) + (liece-send "QUIT"))))) (defun liece-command-generic (message) "Enter a generic IRC MESSAGE, which is sent to the server. @@ -852,16 +791,6 @@ NAMES lists users per channel (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." @@ -1175,16 +1104,6 @@ Argument ARG is prefix argument of toggle status." (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)