unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#12857: rcirc.el: make default PART and QUIT reasons customizable
@ 2012-11-10 21:43 Daniel Ralston
  2012-11-23 17:25 ` Deniz Dogan
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Ralston @ 2012-11-10 21:43 UTC (permalink / raw)
  To: 12857

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

If no other reason is given for parting or quitting with
rcirc-cmd-part or rcirc-cmd-quit, rcirc will use the value of
rcirc-id-string: "rcirc on GNU Emacs <version>". Kinda stuffy.

This patch adds two customizable variables to rcirc:
rcirc-default-part-reason and rcirc-default-quit-reason. The above
commands will use these variables as the default part/quit reason if
they are set. If they are left nil, rcirc will fallback to its current
behaviour, and use the value of rcirc-id-string.


Changelog entry:

2012-11-10  Daniel Ralston  <Wubbulous@gmail.com>

    * rcirc.el: Make the default PART and QUIT reasons used by
    rcirc-cmd-part and rcirc-cmd-quit customizable.
    (rcirc-default-part-reason,rcirc-default-quit-reason): New
    customizable vars.

[-- Attachment #2: rcirc-default-reasons.patch --]
[-- Type: application/octet-stream, Size: 2138 bytes --]

=== modified file 'lisp/net/rcirc.el'
*** lisp/net/rcirc.el	2012-10-23 15:06:07 +0000
--- lisp/net/rcirc.el	2012-11-10 20:47:21 +0000
*************** for connections using SSL/TLS."
*** 138,143 ****
--- 138,155 ----
    :type 'string
    :group 'rcirc)
  
+ (defcustom rcirc-default-part-reason nil
+   "The default reason to send when parting from a channel. If
+ nil, use the value of rcirc-id-string instead."
+   :type 'string
+   :group 'rcirc)
+ 
+ (defcustom rcirc-default-quit-reason nil
+   "The default reason to send when quitting a server. If nil, use
+ the value of rcirc-id-string instead."
+   :type 'string
+   :group 'rcirc)
+ 
  (defcustom rcirc-fill-flag t
    "Non-nil means line-wrap messages printed in channel buffers."
    :type 'boolean
*************** CHANNELS is a comma- or space-separated
*** 2199,2205 ****
    "Part CHANNEL."
    (interactive "sPart channel: ")
    (let ((channel (if (> (length channel) 0) channel target)))
!     (rcirc-send-string process (concat "PART " channel " :" rcirc-id-string))))
  
  (defun-rcirc-command quit (reason)
    "Send a quit message to server with REASON."
--- 2211,2219 ----
    "Part CHANNEL."
    (interactive "sPart channel: ")
    (let ((channel (if (> (length channel) 0) channel target)))
!     (rcirc-send-string process (concat "PART " channel " :"
!                                        (or rcirc-default-part-reason
!                                            rcirc-id-string)))))
  
  (defun-rcirc-command quit (reason)
    "Send a quit message to server with REASON."
*************** CHANNELS is a comma- or space-separated
*** 2207,2213 ****
    (rcirc-send-string process (concat "QUIT :"
  				     (if (not (zerop (length reason)))
  					 reason
! 				       rcirc-id-string))))
  
  (defun-rcirc-command nick (nick)
    "Change nick to NICK."
--- 2221,2228 ----
    (rcirc-send-string process (concat "QUIT :"
  				     (if (not (zerop (length reason)))
  					 reason
! 				       (or rcirc-default-quit-reason
!                                            rcirc-id-string)))))
  
  (defun-rcirc-command nick (nick)
    "Change nick to NICK."


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-02  0:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-10 21:43 bug#12857: rcirc.el: make default PART and QUIT reasons customizable Daniel Ralston
2012-11-23 17:25 ` Deniz Dogan
     [not found]   ` <50BE7E86.9020601@dogan.se>
2012-12-13 15:05     ` bug#12857: " Daniel Ralston
2016-02-24  6:02       ` Lars Ingebrigtsen
2019-06-02  0:11       ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).