Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] rcirc.el (rcirc-connect): Make process name configurable.

2 views
Skip to first unread message

Stefan Kangas

unread,
Jan 14, 2011, 1:23:29 PM1/14/11
to emacs...@gnu.org
When using rcirc to connect to a proxy that uses several ports on the
same host, one will get confusing results if joining a channel with the
same name on several servers.

If the proxy is running on localhost, one will get buffers (and log
files) named e.g. #emacs@localhost, #emacs@localhost<1> etc.

The attached patch changes (rcirc-connect) so that one can specify what
name the connecting process will have.

Thanks,
Stefan Kangas

rcirc-configure-process.txt

Deniz Dogan

unread,
Jan 15, 2011, 6:14:39 AM1/15/11
to Stefan Kangas, Ryan Yeske, emacs...@gnu.org
2011/1/14 Stefan Kangas <ska...@skangas.se>:
> # Bazaar merge directive format 2 (Bazaar 0.90)
> # revision_id: ska...@skangas.se-20110114011521-glws2d6ojsa0fyjp
> # target_branch: http://bzr.savannah.gnu.org/r/emacs/trunk
> # testament_sha1: bae2aee2a7aea3671fed35dae50f3a0c64c34f28
> # timestamp: 2011-01-14 02:28:45 +0100
> # base_revision_id: mon...@iro.umontreal.ca-20110113231430-\
> #   chaw2vxixdrrj3g4
> #
> # Begin patch
> === modified file 'lisp/net/rcirc.el'
> --- lisp/net/rcirc.el   2011-01-13 23:14:30 +0000
> +++ lisp/net/rcirc.el   2011-01-14 01:15:21 +0000
> @@ -471,7 +471,7 @@
>
>  ;;;###autoload
>  (defun rcirc-connect (server &optional port nick user-name
> -                             full-name startup-channels password)
> +                             full-name startup-channels password process-name)
>   (save-excursion
>     (message "Connecting to %s..." server)
>     (let* ((inhibit-eol-conversion)
> @@ -484,7 +484,9 @@
>           (user-name (or user-name rcirc-default-user-name))
>           (full-name (or full-name rcirc-default-full-name))
>           (startup-channels startup-channels)
> -           (process (make-network-process :name server :host server :service port-number)))
> +           (process (make-network-process
> +                     :name (if process-name process-name server)
> +                     :host server :service port-number)))
>       ;; set up process
>       (set-process-coding-system process 'raw-text 'raw-text)
>       (switch-to-buffer (rcirc-generate-new-buffer-name process nil))
>
> # Begin bundle
> IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWQ9MrSEAAYj/gACQICBQc//3
> UgoIAL////BQA4170b3ncpddde9hJRBpk1MkeDQVPIymm0QekGIYSkajSeVP1NPUyaaEZoCDE0NG
> hgaaEE0T1MoeoGmhoPUAaeo0AGSk/SjTTGk00epoHqNAAAABJIEMiYmRop6nqehqPUekeoA0PSe/
> MedfTtZJt9H7wT5sNyC/Gqmd8qJs96SaHSO7rj0tYEjP1Tc8zoVRwQVyK7rrNlR7/u3ZLCwrIexi
> 4wYKOIX2W7T+KaxEl3Mfwt2a3df7NsPQKhTkbA22Fm/Egx/6hxXDhGk7AoE0vIM9VraqU0kmGCni
> DnrxYRAIeCgCBIDblmLCw7X9mK4G0DES9QRSrwrhlqiEYKxOAIRrshO3KtCuWQdjSkRZec+kzwxk
> qi3XdCGb8sbS5CgtopSis1EGi6G680iUzji8NmJxFgX7z/Bg/INYSJpWUzjgSvvh/AmUKC2DJzwc
> KpVa6vHY70SgQkyR6rwya+gU9xHYMpuUPdc1KzHjhtrldRIi0lVODB9RQoj1mmFxqD4U0+EEWpjE
> e1wux0C1wZrZILOKpKidFaX3saWjEVYPIYSbLS0Liaus9J840YI0GQ2zXkkFoBZQ+Qjlw2Yqcjz7
> X6wO1EdNkx+XUPK19GCrrA4g8TwuM4YGvvtnmYt131EYG1jg9f7SHncldzd7dBLGO9DvJJNiqA8O
> 52ejVSxv+XBFiNHFN2fQJ8OtXmLKf7InFCazvoiU2a8D5fWEVxFUnPUS5VSHNvO4SwuWh9OfJ4YC
> dA66Fw4v5cffOEeZybGoIcswbl2OXlnWrXMpkaFkOIaRvYz+NKLTmmJg+WVeoZRYm2ikVqsHKai7
> lYGnf4qagoVriv3z5vYn6N7BfYIpLUj4CnkZgyKygZGOe5qT7pnA7/rLAUr2hF1lKyCQnUJBuzeg
> OWsP0T1EerIiW42hoFbwcEAe4N3gxnLzxaVXUWy5RqSzmb17AQAgogrgNdqALwA1ROecnhFERogO
> xA+kvQ4JOUnLjqB6ZLsLSIdHGIETkFCxdB67XegYathhixiY0mpme7synCrBX4MQOeGuAn5SYyFP
> aE0P4XFvt0CsLQxFOLuYRqajk5bB7cWTkt4mJs3gVsbyZmhA5JWgJUTQKAjM8hnhjJbPBJCQ1iZ5
> 82Ns66xwztfgW0RhEeEAFYl9sbUwXDrQpfr3pOpqYdgvDkq7MRXK8OgWKavFOJD1F3JFOFCQD0yt
> IQ==
>
>

Thanks for the patch!

However, I'm a bit reluctant to introducing new parameters such as
process-name to such a central function. Since process-name is
essentially used as an argument to make-network-process, maybe it
would be better if we replace the process-name parameter by a plist
which is passed to make-network-process containing :name.

What do you think?

--
Deniz Dogan


Stefan Kangas

unread,
Jan 15, 2011, 7:20:27 PM1/15/11
to Deniz Dogan, Ryan Yeske, emacs...@gnu.org
Deniz Dogan <deniz.a...@gmail.com> writes:

> Since process-name is
> essentially used as an argument to make-network-process, maybe it
> would be better if we replace the process-name parameter by a plist
> which is passed to make-network-process containing :name.

How about the attached patch?

Regards,
Stefan Kangas

rcirc-configure-process-v2.txt
0 new messages