:coding-system-alist keyword.
(riece-send-string): Take the target identity as the 2nd argument.
* riece-identity.el (riece-channel-coding-system-alist): Renamed
from riece-coding-system-alist.
* riece-globals.el (riece-coding-system-alist): Abolished.
* riece-commands.el (riece-command-topic): Pass the target
identity to as the 2nd argument of riece-send-string.
(riece-command-kick): Ditto.
(riece-command-send-message): Ditto.
(riece-command-enter-message-to-user): Ditto.
(riece-command-join-channel): Ditto.
(riece-command-part-channel): Ditto.
2005-08-29 Daiki Ueno <ueno@unixuser.org>
+ * riece-server.el (riece-server-keyword-map): Abolished
+ :coding-system-alist keyword.
+ (riece-send-string): Take the target identity as the 2nd argument.
+
+ * riece-identity.el (riece-channel-coding-system-alist): Renamed
+ from riece-coding-system-alist.
+
+ * riece-globals.el (riece-coding-system-alist): Abolished.
+
+ * riece-commands.el (riece-command-topic): Pass the target
+ identity to as the 2nd argument of riece-send-string.
+ (riece-command-kick): Ditto.
+ (riece-command-send-message): Ditto.
+ (riece-command-enter-message-to-user): Ditto.
+ (riece-command-join-channel): Ditto.
+ (riece-command-part-channel): Ditto.
+
+2005-08-29 Daiki Ueno <ueno@unixuser.org>
+
* riece-identity.el (riece-coding-system-for-identity): Moved from
riece-coding.el.
(riece-decoded-string-for-identity): Ditto.
(const nil :tag "No conversion"))
:group 'riece-coding)
-(defcustom riece-coding-system-alist nil
- "An alist mapping from identities to coding-systems."
- :type '(repeat (cons (string :tag "Identity")
- (symbol :tag "Coding system")))
- :group 'riece-coding)
-
(defun riece-encode-coding-string (string)
(if (and (local-variable-p 'riece-coding-system (current-buffer))
riece-coding-system) ;should be nil on non-Mule environment
0)))))
(riece-send-string (format "TOPIC %s :%s\r\n"
(riece-identity-prefix riece-current-channel)
- topic)))
+ topic)
+ riece-current-channel))
(defun riece-command-invite (user)
(interactive
user message)
(format "KICK %s %s\r\n"
(riece-identity-prefix riece-current-channel)
- user))))
+ user))
+ riece-current-channel))
(defun riece-command-names (pattern)
(interactive
(format "NOTICE %s :%s\r\n"
(riece-identity-prefix riece-current-channel)
message)
- (riece-identity-prefix riece-current-channel))
+ riece-current-channel)
(riece-display-message
(riece-make-message (riece-current-nickname) riece-current-channel
message 'notice t)))
(format "PRIVMSG %s :%s\r\n"
(riece-identity-prefix riece-current-channel)
message)
- (riece-identity-prefix riece-current-channel))
+ riece-current-channel)
(riece-display-message
(riece-make-message (riece-current-nickname) riece-current-channel
message nil t))))
(riece-line-beginning-position)
(riece-line-end-position))))
(riece-send-string
- (format "PRIVMSG %s :%s\r\n" (riece-identity-prefix user) text))
+ (format "PRIVMSG %s :%s\r\n" (riece-identity-prefix user) text)
+ user)
(riece-display-message
(riece-make-message (riece-current-nickname) user text nil t)))
(let ((next-line-add-newlines t))
(unless process
(error "%s" (substitute-command-keys
"Type \\[riece-command-open-server] to open server.")))
- (riece-process-send-string process
- (if key
- (format "JOIN %s :%s\r\n"
- (riece-identity-prefix target)
- key)
- (format "JOIN %s\r\n"
- (riece-identity-prefix target))))))
+ (riece-send-string (if key
+ (format "JOIN %s :%s\r\n"
+ (riece-identity-prefix target)
+ key)
+ (format "JOIN %s\r\n"
+ (riece-identity-prefix target)))
+ target)))
(defun riece-command-join-partner (target)
(let ((pointer (riece-identity-member target riece-current-channels)))
(defun riece-command-part-channel (target message)
(let ((process (riece-server-process (riece-identity-server target))))
- (riece-process-send-string process
- (if message
- (format "PART %s :%s\r\n"
- (riece-identity-prefix target)
- message)
- (format "PART %s\r\n"
- (riece-identity-prefix target))))))
+ (riece-send-string (if message
+ (format "PART %s :%s\r\n"
+ (riece-identity-prefix target)
+ message)
+ (format "PART %s\r\n"
+ (riece-identity-prefix target)))
+ target)))
(defun riece-command-part (target &optional message)
(interactive
(defvar riece-coding-system nil
"Coding system for process I/O.
Local to the server buffers.")
-(defvar riece-coding-system-alist nil
- "An alist mapping prefixes to coding-systems.
-Local to the server buffers.")
;;; Variables local to the channel buffers:
(defvar riece-freeze nil
(require 'riece-globals)
(require 'riece-coding)
+(defcustom riece-channel-coding-system-alist nil
+ "An alist mapping from channels to coding-systems."
+ :type '(repeat (cons (string :tag "Channel")
+ (symbol :tag "Coding system")))
+ :group 'riece-coding)
+
(defvar riece-abbrev-identity-string-function nil)
(defvar riece-expand-identity-string-function nil)
identity))
(defun riece-coding-system-for-identity (identity)
- (let ((alist riece-coding-system-alist)
+ (let ((alist riece-channel-coding-system-alist)
matcher)
(catch 'found
(while alist
(let ((coding-system (riece-coding-system-for-identity identity)))
(if (and coding-system
(not (eq (riece-decoded-coding-system decoded)
- coding-system)))
+ (if (consp coding-system)
+ (car coding-system)
+ coding-system))))
(riece-decode-coding-string-1 (riece-decoded-encoded-string decoded)
coding-system)
decoded)))
+(defun riece-encode-coding-string-for-identity (string identity)
+ (let ((coding-system (riece-coding-system-for-identity identity)))
+ (if coding-system
+ (encode-coding-string string
+ (if (consp coding-system)
+ (cdr coding-system)
+ coding-system))
+ (riece-encode-coding-string string))))
+
(provide 'riece-identity)
;;; riece-identity.el ends here
(with-current-buffer (process-buffer process)
(setq riece-last-nickname riece-real-nickname
riece-nick-accepted 'sent
- riece-coding-system coding
- riece-coding-system-alist coding-system-alist))
+ riece-coding-system coding))
process))))
(defun riece-irc-quit-server-process (process &optional message)
(:username riece-username)
(:password)
(:function riece-default-open-connection-function)
- (:coding riece-default-coding-system)
- (:coding-system-alist))
+ (:coding riece-default-coding-system))
"Mapping from keywords to default values.
All keywords that can be used must be listed here."))
(if (riece-server-opened "")
"")))))
-(defun riece-send-string (string &optional prefix)
- (let* ((server-name (riece-current-server-name))
+(defun riece-send-string (string &optional identity)
+ (let* ((server-name (if identity
+ (riece-identity-server identity)
+ (riece-current-server-name)))
(process (riece-server-process server-name))
coding-system)
(unless process
"Type \\[riece-command-open-server] to open server.")))
(riece-process-send-string
process
- (if (and prefix
- (setq coding-system
- (cdr (assoc prefix
- (plist-get (riece-server-properties
- server-name)
- :coding-system-alist)))))
- (encode-coding-string string coding-system)
- (riece-encode-coding-string string)))))
+ (with-current-buffer (process-buffer process)
+ (if identity
+ (riece-encode-coding-string-for-identity string identity)
+ (riece-encode-coding-string string))))))
(defun riece-open-server (server server-name)
(let ((protocol (or (plist-get server :protocol)
(make-local-variable 'riece-channel-obarray)
(setq riece-channel-obarray (make-vector riece-channel-obarray-size 0))
(make-local-variable 'riece-coding-system)
- (make-local-variable 'riece-coding-system-alist)
(buffer-disable-undo)
(erase-buffer)))