diff options
author | Daniel Ralston <wubbulous@gmail.com> | 2012-12-13 07:05:08 -0800 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2019-06-01 20:01:43 -0400 |
commit | d3f14ffae4078688a57acdff30fdd91747386f17 (patch) | |
tree | a4a41d7984d39551987475d68213ecb6cba24511 /lisp/net | |
parent | 4541e31d9c522df3cef6e7ab939655f6f92e7fb4 (diff) | |
download | emacs-d3f14ffae4078688a57acdff30fdd91747386f17.tar.gz |
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
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/rcirc.el | 19 |
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 @@ (require 'ring) (require 'time-date) +(defconst rcirc-id-string (concat "rcirc on GNU Emacs " emacs-version)) + (defgroup rcirc nil "Simple IRC client." :version "22.1" @@ -137,6 +139,16 @@ display purposes. If absent, the real server name will be displayed instead." :version "24.1" ; changed default :type 'string) +(defcustom rcirc-default-part-reason rcirc-id-string + "The default reason to send when parting from a channel. +Used when no reason is explicitly given." + :type 'string) + +(defcustom rcirc-default-quit-reason rcirc-id-string + "The default reason to send when quitting a server. +Used when no reason is explicitly given." + :type 'string) + (defcustom rcirc-fill-flag t "Non-nil means line-wrap messages printed in channel buffers." :type 'boolean) @@ -413,7 +425,6 @@ will be killed." (defvar rcirc-timeout-seconds 600 "Kill connection after this many seconds if there is no activity.") -(defconst rcirc-id-string (concat "rcirc on GNU Emacs " emacs-version)) (defvar rcirc-startup-channels nil) @@ -2189,10 +2200,10 @@ CHANNELS is a comma- or space-separated string of channel names." "Part CHANNEL. CHANNEL should be a string of the form \"#CHANNEL-NAME REASON\". If omitted, CHANNEL-NAME defaults to TARGET, and REASON defaults -to `rcirc-id-string'." +to `rcirc-default-part-reason'." (interactive "sPart channel: ") (let ((channel (if (> (length channel) 0) channel target)) - (msg rcirc-id-string)) + (msg rcirc-default-part-reason)) (when (string-match "\\`\\([&#+!]\\S-+\\)?\\s-*\\(.+\\)?\\'" channel) (when (match-beginning 2) (setq msg (match-string 2 channel))) @@ -2207,7 +2218,7 @@ to `rcirc-id-string'." (rcirc-send-string process (concat "QUIT :" (if (not (zerop (length reason))) reason - rcirc-id-string)))) + rcirc-default-quit-reason)))) (defun-rcirc-command reconnect (_) "Reconnect to current server." |