* riece-options.el (riece-part-message): New user option.
authorDaiki Ueno <ueno@unixuser.org>
Fri, 4 Feb 2005 23:28:07 +0000 (23:28 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Fri, 4 Feb 2005 23:28:07 +0000 (23:28 +0000)
* riece-commands.el (riece-command-part): Use riece-part-message.

lisp/ChangeLog
lisp/riece-commands.el
lisp/riece-options.el

index a912203..2a31286 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-04  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-options.el (riece-part-message): New user option.
+       * riece-commands.el (riece-command-part): Use riece-part-message.
+
 2005-02-04  OHASHI Akira  <bg66@koka-in.org>
 
        * riece-eval.el (riece-eval-form): New function.
index 2175264..38a2edb 100644 (file)
@@ -466,7 +466,7 @@ the layout to the selected layout-name."
                                 (format "PART %s\r\n"
                                         (riece-identity-prefix target))))))
 
-(defun riece-command-part (target &optional message)
+(defun riece-command-part (target)
   (interactive
    (progn
      (riece-check-channel-commands-are-usable)
@@ -477,10 +477,10 @@ the layout to the selected layout-name."
                      (riece-format-identity riece-current-channel))
              riece-current-channels nil nil nil nil
              (riece-format-identity riece-current-channel)))
-           message)
-       (if (and current-prefix-arg
-               (riece-channel-p (riece-identity-prefix target)))
-          (setq message (read-string "Message: ")))
+           (message
+            (if current-prefix-arg
+                (read-string "Message: ")
+              riece-part-message)))
        (list target message))))
   (if (riece-identity-member target riece-current-channels)
       (if (riece-channel-p (riece-identity-prefix target))
@@ -609,7 +609,7 @@ If prefix argument ARG is non-nil, toggle frozen status."
        (let ((message
               (if arg
                   (read-string "Message: ")
-              riece-quit-message))
+                riece-quit-message))
              (alist riece-server-process-alist))
          (while alist
            (riece-quit-server-process (cdr (car alist)) message)
index 730cd9b..2c253b3 100644 (file)
@@ -270,6 +270,12 @@ way is to put Riece variables on .emacs or file loaded from there."
   :type '(string :tag "Quit message")
   :group 'riece-options)
 
+(defcustom riece-part-message nil
+  "Default part message."
+  :type '(choice (const :tag "No message" nil)
+                (string :tag "Part message"))
+  :group 'riece-options)
+
 (defcustom riece-away-message "Gone"
   "Default away message."
   :type '(string :tag "Away message")