Add 2007 to copyright years.
[bpt/emacs.git] / man / rcirc.texi
CommitLineData
97ed0ac3
EZ
1\input texinfo
2@c %**start of header
3@setfilename ../info/rcirc
4@settitle rcirc Manual
5@c %**end of header
6
7@copying
4e6835db 8Copyright @copyright{} 2006, 2007 Free Software Foundation, Inc.
97ed0ac3
EZ
9
10@quotation
11Permission is granted to copy, distribute and/or modify this document
12under the terms of the GNU Free Documentation License, Version 1.2 or
13any later version published by the Free Software Foundation; with no
14Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
15and with the Back-Cover Texts as in (a) below. A copy of the license is
16included in the section entitled ``GNU Free Documentation License'' in
17the Emacs manual.
18
19(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
20this GNU Manual, like GNU software. Copies published by the Free
21Software Foundation raise funds for GNU development.''
22
23This document is part of a collection distributed under the GNU Free
24Documentation License. If you want to distribute this document
25separately from the collection, you can do so by adding a copy of the
26license to the document, as described in section 6 of the license.
27@end quotation
28@end copying
29
30@dircategory Emacs
31@direntry
62e77f3d 32* Rcirc: (rcirc). Internet Relay Chat (IRC) client.
97ed0ac3
EZ
33@end direntry
34
35@titlepage
36@title rcirc Manual
37@page
38@vskip 0pt plus 1filll
39@insertcopying
40@end titlepage
41
42@ifnottex
43@node Top, Basics, (dir), (dir)
44@top rcirc Manual
45@end ifnottex
46
47@code{rcirc} is an Emacs IRC client.
48
49IRC (Internet Relay Chat) is a multi-user chat protocol. Users
50communicate with each other in real-time. Communication occurs both in
51topic channels which are collections of many users, or privately, with
52just one other user.
53
54@menu
62e77f3d
LT
55* Basics::
56* Reference::
57* Hacking and Tweaking::
58* Key Index::
59* Variable Index::
60* Index::
97ed0ac3
EZ
61
62@detailmenu
63 --- The Detailed Node Listing ---
64
65Basics
66
67* Internet Relay Chat::
68* Getting started with rcirc::
69
70Reference
71
72* rcirc commands::
73* Useful IRC commands::
74* Configuration::
75
76Hacking and Tweaking
77
78* Skipping /away messages using handlers::
79* Using fly spell mode::
80* Scrolling conservatively::
81* Changing the time stamp format::
82* Defining a new command::
83* Reconnecting after you have lost the connection::
84
85@end detailmenu
86@end menu
87
88@node Basics, Reference, Top, Top
89@chapter Basics
97ed0ac3
EZ
90
91This chapter contains a brief introduction to IRC (Internet Relay Chat),
92and a quick tutorial on @code{rcirc}.
93
94@menu
62e77f3d
LT
95* Internet Relay Chat::
96* Getting started with rcirc::
97ed0ac3
EZ
97@end menu
98
99@node Internet Relay Chat, Getting started with rcirc, Basics, Basics
100@section Internet Relay Chat
101@cindex internet relay chat
102@cindex irc
103
104@cindex channel
105@dfn{Internet Relay Chat} (IRC) is a form of instant communication over the
106Internet. It is mainly designed for group (many-to-many) communication
107in discussion forums called channels, but also allows one-to-one
108communication.
109
110@cindex instant messaging, comparison
111@cindex server
112@cindex network
113Contrary to most Instant Messenger (IM) systems, users usually don't
114connect to a central server. Instead, users connect to a random server
115in a network, and the servers share information between them.
116
117Here's a typical example:
118
119@cindex redirection to random servers
120When you connect to the Freenode network
b4a349d1 121(@code{http://freenode.net/}), you point your IRC client at the
97ed0ac3
EZ
122server @code{irc.freenode.net}. That server will redirect your client
123to a random server on the network, such as @code{zelazny.freenode.net}.
124
d177d64e 125@cindex channel name
97ed0ac3
EZ
126@cindex # starts a channel name
127Once you're connected, you can send messages to all other users
128connected to the same network, and you can join all channels on the same
129network. You might join the @code{#emacs} and the @code{#rcirc}
130channels, for example. (Typically, channel names begin with a hash
131character.)
132
133Once you have joined a channel, anything you type will be broadcast to
134all the other users on the same channel.
135
136@cindex addressing other people
137@cindex other people, addressing them
138@cindex talk to other people
fe5a02b3
AS
139If you want to address someone specifically, for example as an answer to
140a question, it is customary to prefix the message with the nick followed
141by a colon, like this:
97ed0ac3
EZ
142
143@example
144deego: fsbot rules!
145@end example
146
147@cindex nick completion
148@cindex completion of nicks
149@kindex TAB
150Since this is so common, you can use @key{TAB} to do nick completion.
151
152@node Getting started with rcirc, , Internet Relay Chat, Basics
153@section Getting started with rcirc
154@cindex getting started
155@cindex connecting to a server
156
157@cindex irc command
fe5a02b3
AS
158Use the command @kbd{M-x irc} to connect using the defaults.
159@xref{Configuration}, if you want to change the defaults.
160
161Use @kbd{C-u M-x irc} if you don't want to use the defaults, eg. if you
162want to connect to a different network, or connect to the same network
163using a different nick. This will prompt you for four things:
97ed0ac3
EZ
164
165@table @asis
166@cindex server, connecting
167@cindex Freenode network
168@item IRC server
169What server do you want to connect to? All the servers in a particular
170network are equivalent. Some networks use a round-robin system where a
171single server redirects new connections to a random server in the
172network. @code{irc.freenode.net} is such a server for the Freenode
173network. Freenode provides the network ``for the Free and Open Source
174Software communities, for not-for-profit organisations and for related
175communities and organizations.''
176
177@cindex port, connecting
178@cindex 6667, default IRC port
179@item IRC port
180All network connections require a port. Just as web servers and clients
181use port 80 per default, IRC uses port 6667 per default. You rarely
182have to use a different port.
183
184@cindex nick, connecting
185@cindex changing nick
186@cindex name changes
187@item IRC nick
188@vindex user-login-name
189Every users needs a handle on-line. You will automatically be assigned
190a slightly different nick if your chosen nick is already in use. If
fe5a02b3 191your @code{user-login-name} is @code{alex}, and this nick is already
97ed0ac3
EZ
192in use, you might for example get assigned the nick @code{alex`}.
193
194@cindex channels, connecting
195@cindex initial channels
196@cindex startup channels
197@item Channels
198A space separated list of channels you want to join when connecting.
199You don't need to join any channels, if you just want to have one-to-one
200conversations with friends on the same network. If you're new to the
fe5a02b3
AS
201Freenode network, join @code{#emacs}, the channel about all things
202Emacs, or join @code{#rcirc}, the channel about @code{rcirc}.
97ed0ac3
EZ
203@end table
204
205@cindex server buffer
206When you have answered these questions, @code{rcirc} will create a server
207buffer, which will be named something like @code{*irc.freenode.net*},
208and a channel buffer for each of the channels you wanted to join.
209
210@kindex RET
211@cindex talking
212@cindex communicating
213To talk in a channel, just type in what you want to say in a channel
d177d64e 214buffer, and press @key{RET}.
97ed0ac3
EZ
215
216@kindex C-c C-c
217@cindex multiline messages
218@cindex messages, multiple lines
219@cindex pasting multiple lines
220@cindex edit message before sending
221If you want to paste multiple lines, such as source code, you can use
222@kbd{C-c C-c} to edit your message in a separate buffer. Use @kbd{C-c
d177d64e 223C-c} to finish editing. You still need to press @key{RET} to send it,
97ed0ac3
EZ
224though. Generally, IRC users don't like people pasting more than around
225four lines of code, so use with care.
226
97ed0ac3
EZ
227@node Reference, Hacking and Tweaking, Basics, Top
228@chapter Reference
229@cindex reference
230
231This is the reference section of the manual. It is not complete. For
232complete listings of @code{rcirc} features, use Emacs built-in
233documentation.
234
235@menu
62e77f3d
LT
236* rcirc commands::
237* Useful IRC commands::
238* Configuration::
97ed0ac3
EZ
239@end menu
240
241@node rcirc commands, Useful IRC commands, Reference, Reference
242@section rcirc commands
d177d64e 243@cindex rcirc commands
97ed0ac3
EZ
244@cindex commands
245
246@kindex C-h m
247This is a list of commands that you may use in @code{rcirc}. It is not
248complete. For a complete listing, press @kbd{C-h m} in an @code{rcirc}
249buffer.
250
251In addition to using regular Emacs key bindings, you can call them by
252typing them into an @code{rcirc} buffer.
253
254@cindex call commands
255@cindex typing commands
256@cindex commands
257For instance, instead of using the command @kbd{C-c C-j} to join a new
d177d64e 258channel, you may type this in an @code{rcirc} buffer, and press @key{RET}:
97ed0ac3
EZ
259
260@example
261/join #emacs
262@end example
263
264@cindex / starts a command
265@cindex messages starting with a slash disappear
266@cindex disappearing messages if starting with a slash
267@cindex slash hides message
268This is why you cannot start a message with a slash. You will have to
269precede the command with a space, or rewrite your message in order to
270send it to a channel.
271
272@cindex multiple words as parameters
273@cindex string delimiters
274@cindex quotes
275@cindex double-quotes
276Many commands take parameters. IRC commands usually ignore string
277delimiters. Neither quote nor double-quote have special meanings in
278IRC.
279
280@example
281/nick "alex schroeder"
282@end example
283
284This will try to change your nick to @code{"alex}. Usually this will
285fail because the double quote character is not a legal character for
286nicks.
287
288@cindex case insensitive commands
289These commands are case insensitive.
290
291@cindex new command
292@cindex unknown command
293@cindex command unknown
294If a command isn't known by @code{rcirc}, it will simply be sent along to the
295server. There is a list of some useful commands like that in the next
296section.
297
298@table @kbd
299@item C-c C-j
300@kindex C-c C-j
301@cindex /join
302@cindex join channels
303@cindex other channels
304@cindex rooms, joining
305@cindex discussion, joining
306This joins a channel such as @code{#rcirc} or @code{#emacs}. On most
307networks, anybody can create new channels. If you want to talk with
308some friends, for example, all you have to do is agree on a valid
309channel name and join that channel. (Also @code{/join #emacs}.)
310
311@item C-c C-p
312@kindex C-c C-p
313@cindex /part
314@cindex part a channel
315@cindex leave a channel
316@cindex disconnect from a channel
317@cindex stop talking on a channel
318@cindex kill channel buffer
319This leaves the current channel. You can optionally provide a reason
320for parting. When you kill a channel buffer, you automatically part the
321corresponding channel. (Also @code{/part you are too weird!}.)
322
323@item C-c C-r
324@kindex C-c C-r
325@cindex /nick
326@cindex change name
327@cindex nick changing
328@cindex rename yourself
329@cindex other name
330This changes your nick to some other name. Your nick must be unique
331across the network. Most networks don't allow too many nick changes in
332quick succession, and have restrictions on the valid characters in nick
333names. (Also @code{/nick alex-test})
334
335@item C-c C-w
336@kindex C-c C-w
337@cindex /whois
338@cindex who are these people
339@cindex identifying people
340@cindex channels other people are on
341@cindex what channels people are on
342Gives you some basic information about a nick. This often includes what
343other channels people are on. (Also @code{/whois fsbot}.)
344
345@item C-c C-q
346@kindex C-c C-q
347@cindex /query
348@cindex starting a private conversation
349@cindex one-to-one conversation
350@cindex talk privately
351@cindex private conversation
352@cindex contact one person only
353@cindex query a person
354Starts a one-to-one conversation with another person on the same
355network. A new buffer will be created for this conversation. It works
356like a channel with only two members. (Also @code{/query fsbot}.)
357
d177d64e 358@item C-c @key{RET}
97ed0ac3
EZ
359@kindex C-c RET
360@cindex /msg
361@cindex single message
362@cindex message sending
363This sends a single message to a nick. Like with @kbd{C-c C-q}, a new
364buffer is created, where the response from the other party will show
365up. (Also @code{/msg nickserv identify secret}.)
366
367@item C-c C-x
368@kindex C-c C-x
369@cindex /quit
370@cindex quit
371@cindex disconnect
372@cindex kill connection
373@cindex connection end
374@cindex part all channels
375@cindex end connection
376@cindex server buffer killing
377@cindex reason for quitting
378This disconnects from the server and parts all channels. You can
379optionally provide a reason for quitting. When you kill the server
380buffer, you automatically quit the server and part all channels. (Also
381@code{/quit ZZZzzz...}.)
382@end table
383
384Some commands may not have a key binding, but only be available as typed
385commands, such as:
386
387@table @code
388@item /ignore
389@cindex /ignore
390@cindex ignoring other people
391@cindex trolls, ignoring
392@cindex hide some posts
393@cindex idiots online
394This command toggles the ignore status of a nick, if you provide one.
395If you don't provide a nick, the command lists all the nicks you are
d177d64e
AS
396ignoring. All messages by ignored nicks are---you guessed it---ignored.
397Since only ``operators'' can kick people from channels, the
97ed0ac3
EZ
398ignore command is often the only way to deal with some of the more
399obnoxious fellows online. Example: @code{/ignore xah}.
400@end table
401
402@node Useful IRC commands, Configuration, rcirc commands, Reference
403@section Useful IRC commands
404@cindex irc commands
405@cindex commands
406
407As mentioned, if a command isn't known by @code{rcirc}, it will simply be sent
408along to the server. Some such commands are available on nearly all IRC
409servers, such as:
410
411@table @code
412@item /away
413@cindex /away
414@cindex away status
415@cindex pause status
416@cindex unavailable status
417@cindex set away status
418This sets your status as ``being away'' if you provide a reason, or sets
419your status as ``being back'' if you do not. People can use the
420@kbd{C-c C-w} command to check your status. Example: @code{/away food}.
421@end table
422
423@cindex irc resources
424@cindex help about irc
425Typical IRC servers implement many more commands. You can read more
426about the fantastic world of IRC online at
b4a349d1
EZ
427@uref{http://www.irchelp.org/, the Internet Relay Chat (IRC) help
428archive}.
97ed0ac3
EZ
429
430@node Configuration, , Useful IRC commands, Reference
431@section Configuration
d177d64e 432@cindex configuring rcirc
97ed0ac3
EZ
433
434These are some variables you can change to configure @code{rcirc} to your
435liking.
436
437@table @code
fe5a02b3
AS
438@item rcirc-default-server
439@vindex rcirc-default-server
97ed0ac3
EZ
440the default server to connect to.
441
fe5a02b3
AS
442@item rcirc-default-port
443@vindex rcirc-default-port
97ed0ac3
EZ
444the default port to connect to.
445
fe5a02b3
AS
446@item rcirc-default-nick
447@vindex rcirc-default-nick
97ed0ac3
EZ
448the default nick to use.
449@end table
450
451@example
fe5a02b3
AS
452(setq rcirc-default-server "irc.mozilla.org"
453 rcirc-default-port 6666
454 rcirc-default-nick "alx")
97ed0ac3
EZ
455@end example
456
fe5a02b3 457@vindex rcirc-default-user-full-name
97ed0ac3
EZ
458@cindex full name
459@cindex real name
460@cindex surname
fe5a02b3
AS
461@code{rcirc-default-user-full-name} is used to set your ``real name'' on
462IRC. It defaults to @code{user-full-name}. If you want to hide your
463full name, you might want to set it to some pseudonym.
97ed0ac3
EZ
464
465@example
fe5a02b3 466(setq rcirc-default-user-full-name "Curious Minds Want To Know")
97ed0ac3
EZ
467@end example
468
469@vindex rcirc-startup-channels-alist
470@cindex channels, configuration
471@cindex initial channels, configuration
472@cindex startup channels, configuration
473@code{rcirc-startup-channels-alist} is the alist of channels to join
474when connecting to a particular network. An alist is a list of lists.
475Each sublist starts with a regular expression that is compared to the
476server address you're connecting to. The remaining sublist items are
477the channels to join.
478
479@example
480(setq rcirc-startup-channels-alist
481 '(("\\.freenode\\.net$" "#emacs" "#rcirc" "#wiki")))
482@end example
483
484Note the subtle problem, here --- IRC clients connect to servers, and
485there is no way of knowing which servers belong to a particular network.
486In the example above we're exploiting a naming convention used by within
487the Freenode network --- all servers within the network have a host in
488the @code{freenode.net} domain.
489
fe5a02b3
AS
490@vindex rcirc-authinfo
491@cindex authentification
492@cindex identification
493@cindex nickserv
494@cindex login
495@code{rcirc-authinfo} is an alist used to automatically identify
496yourself on networks. Each sublist starts with a regular expression
497that is compared to the server address you're connecting to. The second
498element in the list is a symbol representing the method to use, followed
499by the arguments this method requires.
500
501Here is an example to illustrate how you would set it:
502
503@example
e96b0051 504(setq rcirc-authinfo
fe5a02b3
AS
505 '(("freenode" nickserv "bob" "p455w0rd")
506 ("freenode" chanserv "bob" "#bobland" "passwd99")
507 ("bitlbee" bitlbee "robert" "sekrit")))
508@end example
509
510And here are the valid method symbols and the arguments they require:
511
512@table @code
513@item nickserv
514@cindex nickserv authentification
515Use this symbol if you need to identify yourself as follows when
516connecting to a network: @code{/msg nickserv identify secret}. The
517necessary arguments are the nickname you want to use this for, and the
518password to use.
519
520Before you can use this method, you will have to register your nick and
521pick a password for it. Contact @code{nickserv} and check out the
522details. (Using @code{/msg nickserv help}, for example.)
523
524@item chanserv
525@cindex chanserv authentification
526Use this symbol if you need to identify yourself as follows if you want
527to join a particular channel: @code{/msg chanserv identify #underground
528secret}. The necessary arguments are the nickname and channel you want
529to use this for, and the password to use.
530
531Before you can use this method, a channel contact must tell you about
532the password to use. Contact @code{chanserv} and check out the details.
533(Using @code{/msg chanserv help}, for example.)
534
535@item bitlbee
536@cindex bitlbee authentification
537Use this symbol if you need to identify yourself in the Bitlbee channel
538as follows: @code{identify secret}. The necessary arguments are the
539nickname you want to use this for, and the password to use.
540
541@cindex gateway to other IM services
542@cindex instant messaging, other services
543@cindex Jabber
544@cindex AIM
545@cindex ICQ
546@cindex MSN
547@cindex Yahoo!
548Bitlbee acts like an IRC server, but in fact it is a gateway to a lot of
549other instant messaging services. You can either install Bitlbee
550locally or use a public Bitlbee server. There, you need to create an
551account with a password. This is the nick and password you need to
552provide for the bitlbee authentification method.
553
554Later, you will tell Bitlbee about your accounts and passwords on all
555the other instant messaging services, and Bitlbee will log you in. All
556@code{rcirc} needs to know, is the login to your Bitlbee account. Don't
557confuse the Bitlbee account with all the other accounts.
558@end table
559
560@kindex C-c C-SPC
561@vindex rcirc-track-minor-mode
562@cindex switching channels
563@cindex tracking activity
564@cindex active channel
565@cindex abbreviated channel names
566@cindex modeline tracks activity
567Most people want a notification when something is said on a channel they
568have joined, particularly if they have been addressed directly. There
569is a global minor mode that will do this kind of tracking for you. All
570you need to do is switch it on using @kbd{M-x rcirc-track-minor-mode}.
571To make this permanent, add the following to your init file:
572
573@example
574(rcirc-track-minor-mode 1)
575@end example
576
577When other people say things in buffers that are currently buried (no
578window is showing them), the mode line will now show you the abbreviated
579channel or nick name. Use @kbd{C-c C-@key{SPC}} to switch to these
580buffers.
581
582@vindex rcirc-mode-hook
583If you prefer not to load @code{rcirc} immediately, you can delay the
584activation of this mode:
585
586@example
587(add-hook 'rcirc-mode-hook
588 (lambda ()
589 (rcirc-track-minor-mode 1)))
590@end example
591
97ed0ac3
EZ
592@node Hacking and Tweaking, Key Index, Reference, Top
593@chapter Hacking and Tweaking
594@cindex hacking and tweaking
595
596Here are some examples of stuff you can do to configure @code{rcirc}.
597
598@menu
62e77f3d
LT
599* Skipping /away messages using handlers::
600* Using fly spell mode::
601* Scrolling conservatively::
602* Changing the time stamp format::
603* Defining a new command::
604* Reconnecting after you have lost the connection::
97ed0ac3
EZ
605@end menu
606
607@node Skipping /away messages using handlers, Using fly spell mode, Hacking and Tweaking, Hacking and Tweaking
608@section Skipping @code{/away} messages using handlers
609@cindex /away messages
610
611@cindex handlers
612@cindex status codes
62e77f3d 613The IRC protocol specifies how certain events are signaled from server
97ed0ac3
EZ
614to client. These events have numbers and are dealt with using so-called
615handlers. You can override existing handlers by exploiting the naming
616convention adopted for @code{rcirc}.
617
618Here's how to stop @code{rcirc} from printing @code{/away} messages.
619Since @code{rcirc} doesn't define a 301 handler, you don't need to
620require @code{rcirc} before defining the handler:
621
622@example
623(defun rcirc-handler-301 (process cmd sender args)
624 "/away message handler.")
625@end example
626
627@node Using fly spell mode, Scrolling conservatively, Skipping /away messages using handlers, Hacking and Tweaking
628@section Using fly spell mode
629@cindex fly spell
630@cindex spelling
631@cindex spell-checking as you type
632@cindex automatic spelling
633@vindex rcirc-mode-hook
634
635The following code activates Fly Spell Mode
636for @code{rcirc} buffers:
637
638@example
639(add-hook 'rcirc-mode-hook (lambda ()
640 (flyspell-mode 1)))
641@end example
642
643@xref{Spelling, , Flyspell mode, emacs, The GNU Emacs Manual},
644for details.
645
646@node Scrolling conservatively, Changing the time stamp format, Using fly spell mode, Hacking and Tweaking
647@section Scrolling conservatively
648@cindex input line
649@cindex scrolling
650@vindex scroll-conservatively
651@vindex rcirc-mode-hook
652
653IRC buffers are constantly growing. If you want to see as much as
654possible at all times, you would want the prompt at the bottom of the
655window when possible. The following snippet uses a local value for
656@code{scroll-conservatively} to achieve this:
657
658@example
659(add-hook 'rcirc-mode-hook
660 (lambda ()
661 (set (make-local-variable 'scroll-conservatively)
662 8192)))
663@end example
664
fe5a02b3 665@xref{Scrolling, , Scrolling conservatively, emacs, The GNU Emacs
97ed0ac3
EZ
666Manual}, for details.
667
668@node Changing the time stamp format, Defining a new command, Scrolling conservatively, Hacking and Tweaking
669@section Changing the time stamp format
670@cindex time stamp
671@cindex date time
672@cindex format time stamp
673@vindex rcirc-time-format
674
675@code{rcirc-time-format} is the format used for the time stamp. Here's
676how to include the date in the time stamp:
677
678@example
679(setq rcirc-time-format "%Y-%m-%d %H:%M ")
680@end example
681
682@node Defining a new command, Reconnecting after you have lost the connection, Changing the time stamp format, Hacking and Tweaking
683@section Defining a new command
684@cindex defining commands
685@cindex commands, defining
686@cindex new commands, defining
687
688Here's a simple new command, @code{/sv}. With it, you can boast about
689your IRC client. It shows how you can use @code{defun-rcirc-command} to
690define new commands.
691
692We're waiting for the definition of this command until @code{rcirc} is loaded
693because @code{defun-rcirc-command} is not yet available, and without
694@code{rcirc} loaded, the command wouldn't do us much good anyway.
695
696@smallexample
697(eval-after-load 'rcirc
698 '(defun-rcirc-command sv (arg)
699 "Boast about rcirc."
700 (interactive "i")
701 (rcirc-send-message process target
702 (concat "I use " rcirc-id-string))))
703@end smallexample
704
705@node Reconnecting after you have lost the connection, , Defining a new command, Hacking and Tweaking
706@section Reconnecting after you have lost the connection
707@cindex reconnecting
708@cindex disconnecting servers, reconnecting
709
710If you're chatting from a laptop, then you might be familiar with this
711problem: When your laptop falls asleep and wakes up later, your IRC
712client doesn't realise that it has been disconnected. It takes several
713minutes until the client decides that the connection has in fact been
714lost. The simple solution is to use @kbd{M-x rcirc}. The problem is
715that this opens an @emph{additional} connection, so you'll have two
716copies of every channel buffer --- one dead and one live.
717
718The real answer, therefore, is a @code{/reconnect} command:
719
720@smallexample
721(eval-after-load 'rcirc
722 '(defun-rcirc-command reconnect (arg)
723 "Reconnect the server process."
724 (interactive "i")
725 (unless process
726 (error "There's no process for this target"))
727 (let* ((server (car (process-contact process)))
728 (port (process-contact process :service))
fe5a02b3 729 (nick (rcirc-nick process))
97ed0ac3
EZ
730 channels query-buffers)
731 (dolist (buf (buffer-list))
732 (with-current-buffer buf
fe5a02b3
AS
733 (when (eq process (rcirc-buffer-process))
734 (remove-hook 'change-major-mode-hook
735 'rcirc-change-major-mode-hook)
97ed0ac3
EZ
736 (if (rcirc-channel-p rcirc-target)
737 (setq channels (cons rcirc-target channels))
738 (setq query-buffers (cons buf query-buffers))))))
739 (delete-process process)
fe5a02b3
AS
740 (rcirc-connect server port nick
741 rcirc-default-user-name
742 rcirc-default-user-full-name
743 channels))))
97ed0ac3
EZ
744@end smallexample
745
746@node Key Index, Variable Index, Hacking and Tweaking, Top
747@unnumbered Key Index
748@printindex ky
749
750@node Variable Index, Index, Key Index, Top
751@unnumbered Variable Index
752@printindex vr
753
754@node Index, , Variable Index, Top
755@unnumbered Index
756@printindex cp
757
758@bye
cd7070ad
MB
759
760@ignore
761 arch-tag: 2589e562-3843-4ffc-8c2f-477cbad57c01
762@end ignore