summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelvin White <kwhite@gnu.org>2014-09-25 10:07:30 -0400
committerKelvin White <kwhite@gnu.org>2014-09-25 10:07:30 -0400
commit685460246c7474d2654c50df89e8c882dd19c383 (patch)
treea038c766ca5e62ca1f4921aaa2cd9793bf00711c
parent80067ccf79e05e3be3e259033e3bb054163c2551 (diff)
downloademacs-685460246c7474d2654c50df89e8c882dd19c383.tar.gz
Follow Emacs versioning
-rw-r--r--lisp/erc/ChangeLog10
-rw-r--r--lisp/erc/erc.el42
2 files changed, 30 insertions, 22 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index dcde62af9c2..837203f305c 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,13 @@
+2014-09-25 Kelvin White <kwhite@gnu.org>
+
+ * erc.el: Follow Emacs version instead of tracking it seperately.
+ (erc-quit/part-reason-default) : Clean up quit/part message
+ functions by abstracting repetitive code, change version string.
+ (erc-quit-reason-various, erc-quit-reason-normal, erc-quit-reason-zippy)
+ (erc-part-reason-normal, erc-part-reason-zippy, erc-part-reason-various)
+ (erc-cmd-SV, erc-ctcp-query-VERSION, erc-version, erc-version-string):
+ Change version string.
+
2014-08-13 Kelvin White <kwhite@gnu.org>
* erc.el (erc-send-input): Disable display commands in current buffer
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index cedc4f6b517..f4d9dd3c652 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -12,7 +12,7 @@
;; Kelvin White (kwhite@gnu.org)
;; Maintainer: emacs-devel@gnu.org
;; Keywords: IRC, chat, client, Internet
-;; Version: 5.3
+
;; This file is part of GNU Emacs.
@@ -63,11 +63,11 @@
;;; History:
;;
-;;; Code:
-
-(defconst erc-version-string "Version 5.3"
+(defconst erc-version-string (format "\C-bERC\C-b (IRC client for Emacs %s)" emacs-version)
"ERC version. This is used by function `erc-version'.")
+;;; Code:
+
(eval-when-compile (require 'cl-lib))
(require 'font-lock)
(require 'pp)
@@ -3380,14 +3380,16 @@ If USER is omitted, close the current query buffer if one exists
(signal 'wrong-number-of-arguments ""))))
(defalias 'erc-cmd-Q 'erc-cmd-QUERY)
+(defun erc-quit/part-reason-default ()
+ "Default quit/part message."
+ (format "\C-bERC\C-b (IRC client for Emacs %s)" emacs-version))
+
+
(defun erc-quit-reason-normal (&optional s)
"Normal quit message.
If S is non-nil, it will be used as the quit reason."
- (or s
- (format "\C-bERC\C-b %s (IRC client for Emacs)"; - \C-b%s\C-b"
- erc-version-string) ; erc-official-location)
- ))
+ (or s (erc-quit/part-reason-default)))
(defun erc-quit-reason-zippy (&optional s)
"Zippy quit message.
@@ -3396,7 +3398,7 @@ If S is non-nil, it will be used as the quit reason."
(or s
(if (fboundp 'yow)
(erc-replace-regexp-in-string "\n" "" (yow))
- (erc-quit-reason-normal))))
+ (erc-quit/part-reason-default))))
(make-obsolete 'erc-quit-reason-zippy "it will be removed." "24.4")
@@ -3409,16 +3411,13 @@ If S is non-nil, it will be used as the quit reason."
((functionp res) (funcall res))
((stringp res) res)
(s s)
- (t (erc-quit-reason-normal)))))
+ (t (erc-quit/part-reason-default)))))
(defun erc-part-reason-normal (&optional s)
"Normal part message.
-If S is non-nil, it will be used as the quit reason."
- (or s
- (format "\C-bERC\C-b %s (IRC client for Emacs)"; - \C-b%s\C-b"
- erc-version-string) ; erc-official-location)
- ))
+If S is non-nil, it will be used as the part reason."
+ (or s (erc-quit/part-reason-default)))
(defun erc-part-reason-zippy (&optional s)
"Zippy part message.
@@ -3427,7 +3426,7 @@ If S is non-nil, it will be used as the quit reason."
(or s
(if (fboundp 'yow)
(erc-replace-regexp-in-string "\n" "" (yow))
- (erc-part-reason-normal))))
+ (erc-quit/part-reason-default))))
(make-obsolete 'erc-part-reason-zippy "it will be removed." "24.4")
@@ -3440,7 +3439,7 @@ If S is non-nil, it will be used as the quit reason."
((functionp res) (funcall res))
((stringp res) res)
(s s)
- (t (erc-part-reason-normal)))))
+ (t (erc-quit/part-reason-default)))))
(defun erc-cmd-QUIT (reason)
"Disconnect from the current server.
@@ -3534,8 +3533,7 @@ the message given by REASON."
(defun erc-cmd-SV ()
"Say the current ERC and Emacs version into channel."
- (erc-send-message (format "I'm using ERC %s with %s %s (%s%s) of %s."
- erc-version-string
+ (erc-send-message (format "I'm using ERC with %s %s (%s%s) of %s."
(if (featurep 'xemacs) "XEmacs" "GNU Emacs")
emacs-version
system-configuration
@@ -4594,8 +4592,8 @@ See also `erc-display-message'."
(unless erc-disable-ctcp-replies
(erc-send-ctcp-notice
nick (format
- "VERSION \C-bERC\C-b %s - an IRC client for emacs (\C-b%s\C-b)"
- erc-version-string
+ "VERSION \C-bERC\C-b - an IRC client for Emacs %s (\C-b%s\C-b)"
+ emacs-version
erc-official-location)))
nil)
@@ -6373,7 +6371,7 @@ P may be an integer or a service name."
If optional argument HERE is non-nil, insert version number at point."
(interactive "P")
(let ((version-string
- (format "ERC %s (GNU Emacs %s)" erc-version-string emacs-version)))
+ (format "ERC (IRC client for Emacs %s)" emacs-version)))
(if here
(insert version-string)
(if (called-interactively-p 'interactive)