aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Ralston2012-12-13 07:05:08 -0800
committerNoam Postavsky2019-06-01 20:01:43 -0400
commitd3f14ffae4078688a57acdff30fdd91747386f17 (patch)
treea4a41d7984d39551987475d68213ecb6cba24511
parent4541e31d9c522df3cef6e7ab939655f6f92e7fb4 (diff)
downloademacs-d3f14ffae4078688a57acdff30fdd91747386f17.tar.gz
emacs-d3f14ffae4078688a57acdff30fdd91747386f17.zip
Make rcirc PART and QUIT reasons customizable (Bug#12857)
* rcirc.el: (rcirc-default-part-reason, rcirc-default-quit-reason): New customizable vars. (rcirc-cmd-quit, rcirc-cmd-part): Consult them. Copyright-paperwork-exempt: yes
-rw-r--r--lisp/net/rcirc.el19
1 files changed, 15 insertions, 4 deletions
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index b317f002ee9..9c3828caf56 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -45,6 +45,8 @@
45(require 'ring) 45(require 'ring)
46(require 'time-date) 46(require 'time-date)
47 47
48(defconst rcirc-id-string (concat "rcirc on GNU Emacs " emacs-version))
49
48(defgroup rcirc nil 50(defgroup rcirc nil
49 "Simple IRC client." 51 "Simple IRC client."
50 :version "22.1" 52 :version "22.1"
@@ -137,6 +139,16 @@ display purposes. If absent, the real server name will be displayed instead."
137 :version "24.1" ; changed default 139 :version "24.1" ; changed default
138 :type 'string) 140 :type 'string)
139 141
142(defcustom rcirc-default-part-reason rcirc-id-string
143 "The default reason to send when parting from a channel.
144Used when no reason is explicitly given."
145 :type 'string)
146
147(defcustom rcirc-default-quit-reason rcirc-id-string
148 "The default reason to send when quitting a server.
149Used when no reason is explicitly given."
150 :type 'string)
151
140(defcustom rcirc-fill-flag t 152(defcustom rcirc-fill-flag t
141 "Non-nil means line-wrap messages printed in channel buffers." 153 "Non-nil means line-wrap messages printed in channel buffers."
142 :type 'boolean) 154 :type 'boolean)
@@ -413,7 +425,6 @@ will be killed."
413(defvar rcirc-timeout-seconds 600 425(defvar rcirc-timeout-seconds 600
414 "Kill connection after this many seconds if there is no activity.") 426 "Kill connection after this many seconds if there is no activity.")
415 427
416(defconst rcirc-id-string (concat "rcirc on GNU Emacs " emacs-version))
417 428
418(defvar rcirc-startup-channels nil) 429(defvar rcirc-startup-channels nil)
419 430
@@ -2189,10 +2200,10 @@ CHANNELS is a comma- or space-separated string of channel names."
2189 "Part CHANNEL. 2200 "Part CHANNEL.
2190CHANNEL should be a string of the form \"#CHANNEL-NAME REASON\". 2201CHANNEL should be a string of the form \"#CHANNEL-NAME REASON\".
2191If omitted, CHANNEL-NAME defaults to TARGET, and REASON defaults 2202If omitted, CHANNEL-NAME defaults to TARGET, and REASON defaults
2192to `rcirc-id-string'." 2203to `rcirc-default-part-reason'."
2193 (interactive "sPart channel: ") 2204 (interactive "sPart channel: ")
2194 (let ((channel (if (> (length channel) 0) channel target)) 2205 (let ((channel (if (> (length channel) 0) channel target))
2195 (msg rcirc-id-string)) 2206 (msg rcirc-default-part-reason))
2196 (when (string-match "\\`\\([&#+!]\\S-+\\)?\\s-*\\(.+\\)?\\'" channel) 2207 (when (string-match "\\`\\([&#+!]\\S-+\\)?\\s-*\\(.+\\)?\\'" channel)
2197 (when (match-beginning 2) 2208 (when (match-beginning 2)
2198 (setq msg (match-string 2 channel))) 2209 (setq msg (match-string 2 channel)))
@@ -2207,7 +2218,7 @@ to `rcirc-id-string'."
2207 (rcirc-send-string process (concat "QUIT :" 2218 (rcirc-send-string process (concat "QUIT :"
2208 (if (not (zerop (length reason))) 2219 (if (not (zerop (length reason)))
2209 reason 2220 reason
2210 rcirc-id-string)))) 2221 rcirc-default-quit-reason))))
2211 2222
2212(defun-rcirc-command reconnect (_) 2223(defun-rcirc-command reconnect (_)
2213 "Reconnect to current server." 2224 "Reconnect to current server."