From: ueno Date: Sat, 19 Feb 2005 06:42:55 +0000 (+0000) Subject: 2005-02-18 Steve Youngs X-Git-Tag: riece-1_0_8~33 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=db13d44f1b160cc69c5ca1c31acb5413f52f2980;p=elisp%2Friece.git 2005-02-18 Steve Youngs * riece-ctcp.el (riece-handle-ctcp-time-request): New. (riece-handle-ctcp-time-response): New. (riece-command-ctcp-time): New. (riece-ctcp-enable): Add `riece-command-ctcp-time'. (riece-ctcp-disable): Ditto. * riece-layout.el (riece-layout-alist): Minor doc string fix -- escape a couple of parens. * riece-version.el: defvar sxemacs-codename at compile time. (riece-extended-version): Simplify the XEmacs section, add support for SXEmacs. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7b7738c..dd78f3c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2005-02-18 Steve Youngs + + * riece-ctcp.el (riece-handle-ctcp-time-request): New. + (riece-handle-ctcp-time-response): New. + (riece-command-ctcp-time): New. + (riece-ctcp-enable): Add `riece-command-ctcp-time'. + (riece-ctcp-disable): Ditto. + + * riece-layout.el (riece-layout-alist): Minor doc string fix -- + escape a couple of parens. + + * riece-version.el: defvar sxemacs-codename at compile time. + (riece-extended-version): Simplify the XEmacs section, add support + for SXEmacs. + 2005-02-17 TAKAHASHI Kaoru * riece-addon.el (riece-resolve-addons): Fixed diff --git a/lisp/riece-ctcp.el b/lisp/riece-ctcp.el index 8c45869..d7ffe6b 100644 --- a/lisp/riece-ctcp.el +++ b/lisp/riece-ctcp.el @@ -179,6 +179,28 @@ (concat (riece-concat-server-name (concat riece-ctcp-action-prefix user " " string)) "\n")))) +(defun riece-handle-ctcp-time-request (prefix target string) + (let* ((target-identity (riece-make-identity target riece-server-name)) + (buffer (if (riece-channel-p target) + (riece-channel-buffer target-identity))) + (user (riece-prefix-nickname prefix)) + (time (format-time-string "%c"))) + (riece-send-string + (format "NOTICE %s :\1TIME %s\1\r\n" user time)) + (riece-insert-change buffer (format "CTCP TIME from %s\n" user)) + (riece-insert-change + (if (and riece-channel-buffer-mode + (not (eq buffer riece-channel-buffer))) + (list riece-dialogue-buffer riece-others-buffer) + riece-dialogue-buffer) + (concat + (riece-concat-server-name + (format "CTCP TIME from %s (%s) to %s" + user + (riece-strip-user-at-host (riece-prefix-user-at-host prefix)) + (riece-format-identity target-identity t))) + "\n")))) + (defun riece-handle-ctcp-response (prefix string) (when (and riece-ctcp-enabled prefix string (riece-prefix-nickname prefix)) @@ -243,6 +265,17 @@ string)) "\n"))) +(defun riece-handle-ctcp-time-response (prefix target string) + (riece-insert-change + (list riece-dialogue-buffer riece-others-buffer) + (concat + (riece-concat-server-name + (format "CTCP TIME for %s (%s) = %s" + (riece-prefix-nickname prefix) + (riece-strip-user-at-host (riece-prefix-user-at-host prefix)) + string)) + "\n"))) + (defun riece-command-ctcp-version (target) (interactive (list (riece-completing-read-identity @@ -307,6 +340,14 @@ " (in " (riece-format-identity target t) ")"))) "\n")))) +(defun riece-command-ctcp-time (target) + (interactive + (list (riece-completing-read-identity + "Channel/User: " + (riece-get-identities-on-server (riece-current-server-name))))) + (riece-send-string (format "PRIVMSG %s :\1TIME\1\r\n" + (riece-identity-prefix target)))) + (defun riece-ctcp-requires () (if (memq 'riece-highlight riece-addons) '(riece-highlight))) @@ -327,6 +368,7 @@ (define-key riece-dialogue-mode-map "\C-cp" 'riece-command-ctcp-ping) (define-key riece-dialogue-mode-map "\C-ca" 'riece-command-ctcp-action) (define-key riece-dialogue-mode-map "\C-cc" 'riece-command-ctcp-clientinfo) + (define-key riece-dialogue-mode-map "\C-ct" 'riece-command-ctcp-time) (setq riece-ctcp-enabled t)) (defun riece-ctcp-disable () @@ -334,6 +376,7 @@ (define-key riece-dialogue-mode-map "\C-cp" nil) (define-key riece-dialogue-mode-map "\C-ca" nil) (define-key riece-dialogue-mode-map "\C-cc" nil) + (define-key riece-dialogue-mode-map "\C-ct" nil) (setq riece-ctcp-enabled nil)) (provide 'riece-ctcp) diff --git a/lisp/riece-layout.el b/lisp/riece-layout.el index 08441e3..05bdabd 100644 --- a/lisp/riece-layout.el +++ b/lisp/riece-layout.el @@ -49,8 +49,8 @@ "An alist mapping the names to layout functions. An element of this alist is either in the following forms: -(NAME CONFIGURE-FUNCTION [PARAMETERS]) -(NAME1 . NAME2) +\(NAME CONFIGURE-FUNCTION [PARAMETERS]\) +\(NAME1 . NAME2\) In the first form, NAME is a string which specifies the layout setting, and CONFIGURE-FUNCTION is a function which does window diff --git a/lisp/riece-version.el b/lisp/riece-version.el index 84ff418..1e362c5 100644 --- a/lisp/riece-version.el +++ b/lisp/riece-version.el @@ -55,7 +55,8 @@ string, be sure to use a valid format, see RFC 2616." "Version string for this version of Riece.") (eval-when-compile - (defvar xemacs-codename)) + (defvar xemacs-codename) + (defvar sxemacs-codename)) (defun riece-extended-version () "Stringified Riece version and Emacs version. @@ -79,22 +80,20 @@ See the variable `riece-user-agent'." (if system-v (concat " (" system-v ")") ""))) - ((string-match - "\\([A-Z]*[Mm][Aa][Cc][Ss]\\)[^(]*\\(\\((beta.*)\\|'\\)\\)?" - emacs-version) - (concat - (match-string 1 emacs-version) - (format "/%d.%d" emacs-major-version emacs-minor-version) - (if (match-beginning 3) - (match-string 3 emacs-version) - "") - (if (boundp 'xemacs-codename) - (concat - " (" xemacs-codename - (if system-v - (concat ", " system-v ")") - ")")) - ""))) + ((featurep 'sxemacs) + (concat "SXEmacs/" emacs-program-version + (when system-v + (concat " (" + (when sxemacs-codename + (concat sxemacs-codename ", ")) + system-v ")")))) + ((featurep 'xemacs) + (concat "XEmacs/" emacs-program-version + (when system-v + (concat " (" + (when xemacs-codename + (concat xemacs-codename ", ")) + system-v ")")))) (t emacs-version)))) (if (stringp riece-user-agent) riece-user-agent