* 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
* bug#12857: rcirc.el: make default PART and QUIT reasons customizable 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> 0 siblings, 1 reply; 5+ messages in thread From: Deniz Dogan @ 2012-11-23 17:25 UTC (permalink / raw) To: 12857 Hi, Daniel This is a good patch! In my opinion it would be nicer if we use a composite customization type for rcirc-default-part-reason and rcirc-default-quit-reason, letting the user choose between the default (rcirc-id-string) and a custom message. What do you think about this idea? Would you be willing to write a new patch implementing this instead? Cheers, Deniz ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <50BE7E86.9020601@dogan.se>]
* bug#12857: Re: rcirc.el: make default PART and QUIT reasons customizable [not found] ` <50BE7E86.9020601@dogan.se> @ 2012-12-13 15:05 ` Daniel Ralston 2016-02-24 6:02 ` Lars Ingebrigtsen 2019-06-02 0:11 ` Noam Postavsky 0 siblings, 2 replies; 5+ messages in thread From: Daniel Ralston @ 2012-12-13 15:05 UTC (permalink / raw) To: 12857; +Cc: deniz [-- Attachment #1.1: Type: text/plain, Size: 1207 bytes --] Hi Deniz, Sorry for my glacially tardy response. That's a much cleaner way of doing it. I hadn't really looked into composite types before, so thanks for the suggestion! I have attached the new patch file to this message. Let me know what you think, and if you'd like me to tweak it any further. I'll try to respond more promptly next time. Daniel 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. Subject: Re: rcirc.el: make default PART and QUIT reasons customizable > Date: Fri, 23 Nov 2012 18:25:30 +0100 > From: Deniz Dogan <deniz@dogan.se> > To: 12857@debbugs.gnu.org > > Hi, Daniel > > This is a good patch! In my opinion it would be nicer if we use a > composite customization type for rcirc-default-part-reason and > rcirc-default-quit-reason, letting the user choose between the default > (rcirc-id-string) and a custom message. > > What do you think about this idea? Would you be willing to write a new > patch implementing this instead? > > Cheers, > Deniz > > > > [-- Attachment #1.2: Type: text/html, Size: 1665 bytes --] [-- Attachment #2: rcirc-default-part-quit-reasons.patch --] [-- Type: application/octet-stream, Size: 2811 bytes --] === modified file 'lisp/net/rcirc.el' *** lisp/net/rcirc.el 2012-10-23 15:06:07 +0000 --- lisp/net/rcirc.el 2012-12-13 14:42:24 +0000 *************** *** 47,52 **** --- 47,54 ---- (require 'time-date) (eval-when-compile (require 'cl)) + (defconst rcirc-id-string (concat "rcirc on GNU Emacs " emacs-version)) + (defgroup rcirc nil "Simple IRC client." :version "22.1" *************** for connections using SSL/TLS." *** 138,143 **** --- 140,159 ---- :type 'string :group 'rcirc) + (defcustom rcirc-default-part-reason rcirc-id-string + "The default reason to send when parting from a channel, when + no reason is explicitly given." + :type `(choice (const :tag "Value of `rcirc-id-string'" ,rcirc-id-string) + (string :tag "Custom string")) + :group 'rcirc) + + (defcustom rcirc-default-quit-reason rcirc-id-string + "The default reason to send when quitting a server, when no + reason is explicitly given." + :type `(choice (const :tag "Value of `rcirc-id-string'" ,rcirc-id-string) + (string :tag "Custom string")) + :group 'rcirc) + (defcustom rcirc-fill-flag t "Non-nil means line-wrap messages printed in channel buffers." :type 'boolean *************** will be killed." *** 412,419 **** (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)) - \f (defvar rcirc-startup-channels nil) (defvar rcirc-server-name-history nil --- 428,433 ---- *************** 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." --- 2213,2220 ---- "Part CHANNEL." (interactive "sPart channel: ") (let ((channel (if (> (length channel) 0) channel target))) ! (rcirc-send-string process (concat "PART " channel " :" ! rcirc-default-part-reason)))) (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." --- 2222,2228 ---- (rcirc-send-string process (concat "QUIT :" (if (not (zerop (length reason))) reason ! rcirc-default-quit-reason)))) (defun-rcirc-command nick (nick) "Change nick to NICK." ^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#12857: Re: rcirc.el: make default PART and QUIT reasons customizable 2012-12-13 15:05 ` bug#12857: " Daniel Ralston @ 2016-02-24 6:02 ` Lars Ingebrigtsen 2019-06-02 0:11 ` Noam Postavsky 1 sibling, 0 replies; 5+ messages in thread From: Lars Ingebrigtsen @ 2016-02-24 6:02 UTC (permalink / raw) To: Daniel Ralston; +Cc: 12857, deniz Daniel Ralston <wubbulous@gmail.com> writes: > Sorry for my glacially tardy response. > That's a much cleaner way of doing it. I hadn't really looked into composite types before, so thanks for the suggestion! I have attached > the new patch file to this message. Let me know what you think, and if you'd like me to tweak it any further. I'll try to respond more > promptly next time. > > Daniel > > 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. > > Subject: Re: rcirc.el: make default PART and QUIT reasons customizable > Date: Fri, 23 Nov 2012 18:25:30 +0100 > From: Deniz Dogan <deniz@dogan.se> > To: 12857@debbug=, 12857@debbugs.gnu.org s.gnu.org That was three years ago. :-) Deniz, did you have a look at the respun patch, and does it look OK? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no ^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#12857: Re: rcirc.el: make default PART and QUIT reasons customizable 2012-12-13 15:05 ` bug#12857: " Daniel Ralston 2016-02-24 6:02 ` Lars Ingebrigtsen @ 2019-06-02 0:11 ` Noam Postavsky 1 sibling, 0 replies; 5+ messages in thread From: Noam Postavsky @ 2019-06-02 0:11 UTC (permalink / raw) To: Daniel Ralston; +Cc: 12857, deniz tags 12857 fixed close 12857 27.1 quit Daniel Ralston <wubbulous@gmail.com> writes: > That's a much cleaner way of doing it. I hadn't really looked into > composite types before, so thanks for the suggestion! >> This is a good patch! In my opinion it would be nicer if we use a >> composite customization type for rcirc-default-part-reason and >> rcirc-default-quit-reason, letting the user choose between the default >> (rcirc-id-string) and a custom message. I removed the part that puts the default into the customization type, since the customization machinery already handles default values just fine. Pushed to master, with followup NEWS entry. aa9d57eed1 2019-06-01T20:01:43-04:00 "; Add NEWS entry for previous change" https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=aa9d57eed17ee6a8006c9cdd4f8636100482cd71 d3f14ffae4 2019-06-01T20:01:43-04:00 "Make rcirc PART and QUIT reasons customizable (Bug#12857)" https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d3f14ffae4078688a57acdff30fdd91747386f17 ^ 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 external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.