diff options
| author | Miciah Masters | 2017-12-10 19:56:48 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2018-08-29 22:53:43 -0400 |
| commit | 3d09d533d15eae2974f3858df43746cf6e8f897b (patch) | |
| tree | 56ec5e15731e8f6876d4376974da0933ecd37b1d | |
| parent | a1e615618dfef25c7fd14cbe1a16bdacca1148f4 (diff) | |
| download | emacs-3d09d533d15eae2974f3858df43746cf6e8f897b.tar.gz emacs-3d09d533d15eae2974f3858df43746cf6e8f897b.zip | |
rcirc: Document /reconnect as a built-in command (Bug#29656)
The change "New command rcirc-cmd-reconnect" from 2014-04-09 (shipped
in Emacs 25.1) added a /reconnect command to rcirc but did not
document it and did not delete the example /reconnect command
definition in the manual.
* doc/misc/rcirc.texi (rcirc commands): Document the built-in /reconnect
command.
(Hacking and Tweaking): Delete example reconnect command.
Copyright-paperwork-exempt: yes
| -rw-r--r-- | doc/misc/rcirc.texi | 60 |
1 files changed, 17 insertions, 43 deletions
diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi index 2437e020eee..0287054b1d2 100644 --- a/doc/misc/rcirc.texi +++ b/doc/misc/rcirc.texi | |||
| @@ -88,7 +88,6 @@ Hacking and Tweaking | |||
| 88 | * Scrolling conservatively:: | 88 | * Scrolling conservatively:: |
| 89 | * Changing the time stamp format:: | 89 | * Changing the time stamp format:: |
| 90 | * Defining a new command:: | 90 | * Defining a new command:: |
| 91 | * Reconnecting after you have lost the connection:: | ||
| 92 | 91 | ||
| 93 | @end detailmenu | 92 | @end detailmenu |
| 94 | @end menu | 93 | @end menu |
| @@ -401,6 +400,23 @@ This disconnects from the server and parts all channels. You can | |||
| 401 | optionally provide a reason for quitting. When you kill the server | 400 | optionally provide a reason for quitting. When you kill the server |
| 402 | buffer, you automatically quit the server and part all channels. (Also | 401 | buffer, you automatically quit the server and part all channels. (Also |
| 403 | @code{/quit ZZZzzz...}.) | 402 | @code{/quit ZZZzzz...}.) |
| 403 | |||
| 404 | @item /reconnect | ||
| 405 | @cindex /reconnect | ||
| 406 | @cindex reconnect | ||
| 407 | @cindex lost connection | ||
| 408 | @cindex disconnecting servers, reconnecting | ||
| 409 | This reconnects after you have lost the connection. | ||
| 410 | |||
| 411 | If you're chatting from a laptop, then you might be familiar with this | ||
| 412 | problem: When your laptop falls asleep and wakes up later, your IRC | ||
| 413 | client doesn't realize that it has been disconnected. It takes several | ||
| 414 | minutes until the client decides that the connection has in fact been | ||
| 415 | lost. The simple solution is to use @kbd{M-x rcirc}. The problem is | ||
| 416 | that this opens an @emph{additional} connection, so you'll have two | ||
| 417 | copies of every channel buffer, one dead and one live. | ||
| 418 | |||
| 419 | The real answer, therefore, is the @code{/reconnect} command. | ||
| 404 | @end table | 420 | @end table |
| 405 | 421 | ||
| 406 | @node Useful IRC commands | 422 | @node Useful IRC commands |
| @@ -787,7 +803,6 @@ Here are some examples of stuff you can do to configure @code{rcirc}. | |||
| 787 | * Scrolling conservatively:: | 803 | * Scrolling conservatively:: |
| 788 | * Changing the time stamp format:: | 804 | * Changing the time stamp format:: |
| 789 | * Defining a new command:: | 805 | * Defining a new command:: |
| 790 | * Reconnecting after you have lost the connection:: | ||
| 791 | @end menu | 806 | @end menu |
| 792 | 807 | ||
| 793 | @node Skipping /away messages using handlers | 808 | @node Skipping /away messages using handlers |
| @@ -888,47 +903,6 @@ because @code{defun-rcirc-command} is not yet available, and without | |||
| 888 | (concat "I use " rcirc-id-string)))) | 903 | (concat "I use " rcirc-id-string)))) |
| 889 | @end smallexample | 904 | @end smallexample |
| 890 | 905 | ||
| 891 | @node Reconnecting after you have lost the connection | ||
| 892 | @section Reconnecting after you have lost the connection | ||
| 893 | @cindex reconnecting | ||
| 894 | @cindex disconnecting servers, reconnecting | ||
| 895 | |||
| 896 | If you're chatting from a laptop, then you might be familiar with this | ||
| 897 | problem: When your laptop falls asleep and wakes up later, your IRC | ||
| 898 | client doesn't realize that it has been disconnected. It takes several | ||
| 899 | minutes until the client decides that the connection has in fact been | ||
| 900 | lost. The simple solution is to use @kbd{M-x rcirc}. The problem is | ||
| 901 | that this opens an @emph{additional} connection, so you'll have two | ||
| 902 | copies of every channel buffer, one dead and one live. | ||
| 903 | |||
| 904 | The real answer, therefore, is a @code{/reconnect} command: | ||
| 905 | |||
| 906 | @smallexample | ||
| 907 | (with-eval-after-load 'rcirc | ||
| 908 | (defun-rcirc-command reconnect (arg) | ||
| 909 | "Reconnect the server process." | ||
| 910 | (interactive "i") | ||
| 911 | (unless process | ||
| 912 | (error "There's no process for this target")) | ||
| 913 | (let* ((server (car (process-contact process))) | ||
| 914 | (port (process-contact process :service)) | ||
| 915 | (nick (rcirc-nick process)) | ||
| 916 | channels query-buffers) | ||
| 917 | (dolist (buf (buffer-list)) | ||
| 918 | (with-current-buffer buf | ||
| 919 | (when (eq process (rcirc-buffer-process)) | ||
| 920 | (remove-hook 'change-major-mode-hook | ||
| 921 | 'rcirc-change-major-mode-hook) | ||
| 922 | (if (rcirc-channel-p rcirc-target) | ||
| 923 | (setq channels (cons rcirc-target channels)) | ||
| 924 | (setq query-buffers (cons buf query-buffers)))))) | ||
| 925 | (delete-process process) | ||
| 926 | (rcirc-connect server port nick | ||
| 927 | rcirc-default-user-name | ||
| 928 | rcirc-default-full-name | ||
| 929 | channels)))) | ||
| 930 | @end smallexample | ||
| 931 | |||
| 932 | @node GNU Free Documentation License | 906 | @node GNU Free Documentation License |
| 933 | @appendix GNU Free Documentation License | 907 | @appendix GNU Free Documentation License |
| 934 | @include doclicense.texi | 908 | @include doclicense.texi |