ERC: Sync version 5.3, release candidate 1.
This commit is contained in:
parent
409dd1209d
commit
5e56b3fb5a
17 changed files with 2022 additions and 1038 deletions
1096
lisp/erc/ChangeLog
1096
lisp/erc/ChangeLog
File diff suppressed because it is too large
Load diff
839
lisp/erc/ChangeLog.07
Normal file
839
lisp/erc/ChangeLog.07
Normal file
|
@ -0,0 +1,839 @@
|
|||
2007-12-16 Diane Murray <disumu@x3y2z1.net>
|
||||
|
||||
* erc-services.el (erc-nickserv-alist): Removed autodetect regexp,
|
||||
added identified regexp for OFTC.
|
||||
(erc-nickserv-identification-autodetect): Make sure success-regex
|
||||
is non-nil.
|
||||
(erc-nickserv-identify-autodetect): Make sure identify-regex is
|
||||
non-nil. Doc fix.
|
||||
|
||||
2007-12-13 Diane Murray <disumu@x3y2z1.net>
|
||||
|
||||
* erc-backend.el (PRIVMSG, QUIT, TOPIC, WALLOPS, 376, 004, 221)
|
||||
(312, 315, 319, 330, 331, 333, 367, 368, 391, 405, 406, 412)
|
||||
(421, 432, 433, 437, 442, 461, 474, 477, 482, 431): Doc fix.
|
||||
|
||||
2007-12-09 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-services.el (erc-nickserv-alist): Fix regexps for GRnet.
|
||||
|
||||
2007-12-09 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change)
|
||||
|
||||
* erc-backend.el, erc.el:
|
||||
Parse 275 (secure connection) responses.
|
||||
|
||||
* erc-services.el: Add identification hooks for GRnet, the Greek
|
||||
IRC network <http://www.irc.gr>.
|
||||
|
||||
2007-12-08 David Kastrup <dak@gnu.org>
|
||||
|
||||
* erc-stamp.el (erc-echo-timestamp):
|
||||
* erc-lang.el (language):
|
||||
* erc-backend.el (erc-server-connect): Fix buggy call to `message'.
|
||||
|
||||
2007-12-07 Edward O'Connor <ted@oconnor.cx>
|
||||
|
||||
* erc-services.el: Provide a hook that runs when nickserv confirms
|
||||
that the user has successfully identified.
|
||||
(services, erc-nickserv-identify-mode): Add and remove
|
||||
erc-nickserv-identification-autodetect from
|
||||
erc-server-NOTICE-functions.
|
||||
(erc-nickserv-alist): Add SUCCESS-REGEXP to each entry.
|
||||
(erc-nickserv-alist-identified-regexp)
|
||||
(erc-nickserv-identification-autodetect): New functions.
|
||||
(erc-nickserv-identified-hook): New hook.
|
||||
|
||||
2007-12-06 D. Goel <deego3@gmail.com>
|
||||
|
||||
* erc-match.el (erc-add-entry-to-list): Fix buggy call to `error'.
|
||||
|
||||
2007-12-01 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* erc-backend.el (erc-server-send-ping): Move after definition of
|
||||
erc-server-send.
|
||||
|
||||
2007-11-29 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change)
|
||||
|
||||
* erc-backend.el, erc.el:
|
||||
Parse 307 (nick has identified) responses.
|
||||
|
||||
2007-11-15 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* erc.el (erc-open):
|
||||
* erc-backend.el (define-erc-response-handler):
|
||||
* erc-log.el (log):
|
||||
* erc-match.el (erc-log-matches): Fix typos in docstrings.
|
||||
|
||||
2007-11-11 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-autoaway.el (erc-autoaway-possibly-set-away):
|
||||
* erc-netsplit.el (erc-netsplit-timer):
|
||||
* erc-notify.el (erc-notify-timer):
|
||||
* erc-track.el (erc-user-is-active): Only run if we have
|
||||
successfully established a connection to the server and have
|
||||
logged in. I suspect that sending messages too soon may make some
|
||||
IRC servers not respond well, particularly when the network
|
||||
connection is iffy or subject to traffic-shaping.
|
||||
|
||||
2007-11-01 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-compat.el (erc-set-write-file-functions): New compatibility
|
||||
function to set the write hooks appropriately.
|
||||
|
||||
* erc-log.el (erc-log-setup-logging): Use
|
||||
erc-set-write-file-functions. This fixes a byte-compiler warning.
|
||||
|
||||
* erc-stamp.el: Silence byte-compiler warning about
|
||||
erc-fill-column.
|
||||
|
||||
* erc.el (erc-with-all-buffers-of-server): Bind the result of
|
||||
mapcar to a variable in order to silence a byte-compiler warning.
|
||||
|
||||
2007-10-29 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-ibuffer.el (erc-modified-channels-alist): Use
|
||||
eval-when-compile, and explain why we are doing this.
|
||||
|
||||
2007-10-25 Dan Nicolaescu <dann@ics.uci.edu>
|
||||
|
||||
* erc-ibuffer.el (erc-modified-channels-alist): Pacify
|
||||
byte-compiler.
|
||||
|
||||
2007-10-13 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* erc-track.el (erc-modified-channels-update): Use mapc rather
|
||||
than mapcar.
|
||||
|
||||
2007-10-12 Diane Murray <disumu@x3y2z1.net>
|
||||
|
||||
* erc.el (erc-join-channel): Prompt for channel key if C-u or
|
||||
another prefix-arg was typed.
|
||||
|
||||
* NEWS: Noted this change.
|
||||
|
||||
2007-10-07 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.el (erc-cmd-ME'S): New command that handles the case where
|
||||
someone types "/me's". It concatenates the text " 's" to the
|
||||
beginning of the input and then sends the result like a normal
|
||||
"/me" command.
|
||||
(erc-command-regexp): Permit single-quote character.
|
||||
|
||||
2007-09-30 Aidan Kehoe <kehoea@parhasard.net> (tiny change)
|
||||
|
||||
* erc-log.el (erc-save-buffer-in-logs): Prevent spurious warnings
|
||||
when looking at a log file and concurrently saving to it.
|
||||
|
||||
2007-09-18 Exal de Jesus Garcia Carrillo <exal@gnu.org> (tiny change)
|
||||
|
||||
* erc.texi (Special-Features): Fix small typo.
|
||||
|
||||
2007-09-16 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-track.el (erc-track-switch-direction): Mention
|
||||
erc-track-faces-priority-list. Thanks to Leo for the suggestion.
|
||||
|
||||
2007-09-11 Exal de Jesus Garcia Carrillo <exal@gnu.org> (tiny change)
|
||||
|
||||
* erc-sound.el: Fix typo in setting up instructions.
|
||||
|
||||
2007-09-10 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* Makefile (elpa): Copy dir template rather than echoing a few
|
||||
lines. The reason for this is that the ELPA package for ERC was
|
||||
getting a corrupt dir entry.
|
||||
|
||||
* dir-template: Template for the ELPA dir file.
|
||||
|
||||
2007-09-08 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-log.el (erc-log-filter-function): New option that specifies
|
||||
the function to call for filtering text before writing it to a log
|
||||
file. Thanks to David O'Toole for the suggestion.
|
||||
(erc-save-buffer-in-logs): Use erc-log-filter-function. Make sure
|
||||
we carry along the value of coding-system-for-write, because this
|
||||
could potentially be shadowed by the temporary buffer.
|
||||
|
||||
* erc.el (erc-version-string): Update to 5.3, development version.
|
||||
|
||||
2007-09-07 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* erc.el (erc-toggle-debug-irc-protocol): Fix call to
|
||||
erc-view-mode-enter.
|
||||
|
||||
2007-08-08 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* erc-log.el, erc.el: Replace `iff' in doc-strings and comments.
|
||||
|
||||
2007-09-03 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.el (erc-default-port): Make this an integer value rather
|
||||
than a string. Thanks to Luca Capello for the report.
|
||||
|
||||
2007-08-27 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.el (erc-cmd-GQUIT): If erc-kill-queries-on-quit is non-nil,
|
||||
kill all query buffers after 4 seconds.
|
||||
|
||||
2007-08-16 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* NEWS: Add ERC 5.3 changes section, and mention jbms' erc-track
|
||||
compatibility note.
|
||||
|
||||
* erc-track.el (erc-track-list-changed-hook): Turn this into a
|
||||
customizable option.
|
||||
(erc-track-switch-direction): Add 'importance option.
|
||||
(erc-modified-channels-display): If erc-track-switch-direction is
|
||||
'importance, call erc-track-sort-by-importance.
|
||||
(erc-track-face-priority): New function that returns a number
|
||||
indicating the position of a face in erc-track-faces-priority-list.
|
||||
(erc-track-sort-by-importance): New function that sorts
|
||||
erc-modified-channels-list according to erc-track-face-priority.
|
||||
(erc-track-get-active-buffer): Make 'oldest a rough opposite of
|
||||
'importance.
|
||||
|
||||
2007-08-14 Jeremy Maitin-Shepard <jbms@cmu.edu>
|
||||
|
||||
* erc-track.el (erc-track-remove-disconnected-buffers): New
|
||||
variable which controls whether buffers associated with a server
|
||||
that is disconnected should be removed from
|
||||
`erc-modified-channels-alist'. Existing behavior is to
|
||||
unconditionally remove such buffers, which is achieved by setting
|
||||
`erc-track-removed-disconnected-buffers' to t. When set to t,
|
||||
which is the new default value, such buffers remain in the list,
|
||||
which I think is often the desired behavior, since the user may
|
||||
likely wish to find out about activity that occurred in a channel
|
||||
prior to it being disconnected.
|
||||
(erc-track-list-changed-hook): New hook that is run whenever the
|
||||
contents of `erc-modified-channels-alist' changes; it is useful
|
||||
for users such as myself that don't use the default mode-line
|
||||
notification but instead use a separate mechanism (which is tied
|
||||
to my window manager) to provide notification of channel activity.
|
||||
(erc-track-get-buffer-window): New function that acts as a wrapper
|
||||
around `get-buffer-window' that handles the `selected-visible'
|
||||
option of `erc-track-visibility'; previously, the value of
|
||||
`erc-track-visibility' was passed directly to `get-buffer-window',
|
||||
which does not support `selected-visible'; consequently,
|
||||
`selected-visible' was not properly supported.
|
||||
(erc-track-modified-channels): Fix a bug in the logic for removing
|
||||
buffers from the list in certain cases.
|
||||
(erc-track-position-in-mode-line): Add a supported value that
|
||||
specifies that the tracking information should not be added to the
|
||||
mode line at all. The value of nil is used to indicate that the
|
||||
information should not be added at all to the mode line.
|
||||
(erc-track-add-to-mode-line): Check for position eq to t, rather
|
||||
than non-nil.
|
||||
(erc-buffer-visible): Use erc-track-get-buffer-window.
|
||||
(erc-modified-channels-update): Take
|
||||
erc-track-remove-disconnected-buffers into account.
|
||||
(erc-modified-channels-display): Run `erc-track-list-changed-hook'.
|
||||
|
||||
* erc.el (erc-reuse-frames): New option that determines whether
|
||||
new frames are always created. Defaults to t. This only has an
|
||||
effect when erc-join-buffer is set to 'frame.
|
||||
(erc-setup-buffer): Use it.
|
||||
|
||||
2007-08-14 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-backend.el (erc-server-reconnect): If the server buffer has
|
||||
been killed, use the current buffer instead. If the current
|
||||
buffer is not an ERC buffer, give an error. This fixes a bug when
|
||||
/reconnect is run from a channel buffer whose server buffer has
|
||||
been deleted. Thanks to jbms for the report.
|
||||
(erc-process-sentinel-1): Take server buffer as an argument, so
|
||||
that we can make sure that it is current.
|
||||
(erc-process-sentinel): Pass buffer to erc-process-sentinel-1.
|
||||
(erc-process-sentinel-2): New function split from
|
||||
erc-process-sentinel-1. If server buffer is deleted during a
|
||||
reconnect attempt, stop trying to reconnect. Fix bug where
|
||||
reconnect was not happening when erc-server-reconnect-attempts was
|
||||
t. Call erc-server-reconnect-p only once each time. If we are
|
||||
instructed to try connecting indefinitely, tell the user that they
|
||||
can stop this by killing the server buffer. Call the process
|
||||
sentinel by means of run-at-time, so that there is time to kill
|
||||
the buffer if need be; this also removes the need for a while
|
||||
loop. Refuse to reconnect again if erc-server-reconnect-timeout
|
||||
is not an number.
|
||||
|
||||
* erc.el (erc-command-no-process-p): Fix bug: the return value of
|
||||
erc-extract-command-from-line is a list rather than a single
|
||||
symbol. Thanks to jbms for the report.
|
||||
(erc-cmd-RECONNECT): Use simpler logic, and use buffer-live-p
|
||||
rather than bufferp.
|
||||
(erc-send-current-line, erc-display-command, erc-display-msg):
|
||||
Handle case where erc-server-process is nil, so that /reconnect
|
||||
works.
|
||||
|
||||
2007-08-12 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-identd.el (erc-identd-filter): Instead of sending an EOF
|
||||
character, which now confuses freenode, stop the server process,
|
||||
so that no new connections are accepted, and kill the current
|
||||
client process.
|
||||
|
||||
2007-07-29 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-list.el: Relicense to GPLv3. Since the file was already
|
||||
licensed under version 2 or later, it turns out that we do not
|
||||
need the permission of all of the authors in order to proceed.
|
||||
|
||||
2007-07-13 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-goodies.el (erc-get-bg-color-face, erc-get-fg-color-face):
|
||||
Use erc-error rather than message and beep.
|
||||
|
||||
* erc-sound.el: Indentation fix.
|
||||
|
||||
* erc.el (erc-command-no-process-p): New function that determines
|
||||
if its argument is an ERC command that can be run when the server
|
||||
process is not alive.
|
||||
(erc-cmd-SET, erc-cmd-CLEAR, erc-cmd-COUNTRY, erc-cmd-HELP)
|
||||
(erc-cmd-LASTLOG, erc-cmd-QUIT, erc-cmd-GQUIT)
|
||||
(erc-cmd-RECONNECT, erc-cmd-SERVER): Denote that these commands
|
||||
can be run even when the server process is not alive.
|
||||
(erc-send-current-line): Call erc-command-no-process-p if the
|
||||
server process is not alive, to determine if we have a command
|
||||
that can be run anyway. Thanks to Tom Tromey for the bug report.
|
||||
(erc-error): New function that either displays a message or throws
|
||||
an error, depending on whether debug-on-error is non-nil.
|
||||
(erc-cmd-SERVER, erc-send-current-line): Use it.
|
||||
|
||||
2007-07-10 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* Relicense all FSF-assigned code to GPLv3.
|
||||
|
||||
2007-06-25 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.texi (Options): Fix typo.
|
||||
(Getting Help and Reporting Bugs): Update webpage URL. Make Gmane
|
||||
part more readable.
|
||||
|
||||
2007-06-20 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-stamp.el (erc-timestamp-format-left): New option that
|
||||
specifies the left timestamp to use for
|
||||
erc-insert-timestamp-left-and-right.
|
||||
(erc-timestamp-format-right): New option that specifies the right
|
||||
timestamp to use for erc-insert-timestamp-left-and-right.
|
||||
(erc-insert-timestamp-function): Change default to
|
||||
erc-insert-timestamp-left-and-right.
|
||||
(erc-insert-away-timestamp-function): Ditto.
|
||||
(erc-timestamp-last-inserted-left)
|
||||
(erc-timestamp-last-inserted-right): New variables to keep track
|
||||
of data for erc-insert-timestamp-left-and-right.
|
||||
(erc-insert-timestamp-left-and-right): New function that places
|
||||
timestamps on both the left and right sides of the screen, but
|
||||
only if each timestamp has changed since it was last computed.
|
||||
Thanks to offby1 for urging me to merge this.
|
||||
|
||||
* erc.el (erc-open-ssl-stream): Display informative error when
|
||||
ssl.el not found.
|
||||
(erc-tls): New function to connect using tls.el.
|
||||
(erc-open-tls-stream): New function to initiate tls connection.
|
||||
Display informative error when tls.el not found.
|
||||
|
||||
2007-06-19 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-log.el: Update header with accurate instructions.
|
||||
|
||||
2007-06-17 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-pkg.el: Update description to match what is currently in ELPA.
|
||||
|
||||
2007-06-14 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* erc-goodies.el (erc-scroll-to-bottom): Remove redundant check.
|
||||
|
||||
2007-06-13 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-compat.el (erc-with-selected-window): New compatibility
|
||||
macro that implements `with-selected-window'.
|
||||
|
||||
* erc-goodies.el (erc-scroll-to-bottom): Use it. This fixes a bug
|
||||
with buffer ordering where ERC buffers would move to the top.
|
||||
Thanks to Ivan Kanis for the patch.
|
||||
|
||||
2007-06-10 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-log.el (erc-logging-enabled): Fix a bug that occurred when
|
||||
`erc-log-channels-directory' had the name of a function.
|
||||
|
||||
2007-06-06 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* erc.el (erc-show-channel-key-p, erc-startup-file-list):
|
||||
Fix typo in docstring.
|
||||
|
||||
2007-06-03 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-compat.el (erc-view-mode-enter): Make this its own function,
|
||||
in order to document what we do, and provide sane fallback
|
||||
behavior.
|
||||
|
||||
* erc.el (erc-toggle-debug-irc-protocol): Don't pass any arguments
|
||||
to erc-view-mode-enter, since we don't do anything special with
|
||||
the exit function. This fixes a bug with Emacs 21 and Emacs 22.
|
||||
Thanks to Leo for noticing.
|
||||
|
||||
2007-05-30 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-compat.el (erc-user-emacs-directory): New variable that
|
||||
determines where to find user-specific Emacs settings. For Emacs,
|
||||
this is usually ~/.emacs.d, and for XEmacs this is usually
|
||||
~/.xemacs.
|
||||
|
||||
* erc.el (erc-startup-file-list): Use erc-user-emacs-directory.
|
||||
|
||||
2007-05-28 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-button.el (erc-button-url-regexp): Recognize parentheses as
|
||||
part of URLs. Thanks to Lawrence Mitchell for the fix.
|
||||
|
||||
2007-05-26 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.texi (Modules): Fix references to completion modules.
|
||||
|
||||
2007-05-21 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* Makefile (SOURCE): Remove erc-pkg.el.
|
||||
(debclean): New rule to clean old Debian packages of ERC.
|
||||
(debprepare): Don't modify the released tarball, but copy it as
|
||||
the .orig.tar.gz file.
|
||||
(debrelease, debrevision): Remove.
|
||||
(debinstall): New target that copies the generated Debian file to
|
||||
a distro-specific location.
|
||||
(deb): New rule that chains together the stages in building a
|
||||
Debian package.
|
||||
(EXTRAS): Add erc-nicklist.el, since it is not release-quality.
|
||||
(extras): Copy images directory.
|
||||
|
||||
* erc-nicklist.el (erc-nicklist-icons-directory): Use
|
||||
locate-library to find the "images" directory. This should be
|
||||
more failsafe. Thanks to Tom Tromey for the idea.
|
||||
|
||||
2007-05-19 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* Makefile (ELPA): New variable that contains the location of my
|
||||
local ELPA repository.
|
||||
(elpa): New rule that makes an ELPA package for ERC.
|
||||
|
||||
2007-04-19 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.el (erc-parse-prefix): New function that retrieves the
|
||||
PREFIX server parameter from the current server and returns an
|
||||
alist of prefix type to prefix character.
|
||||
(erc-channel-receive-names): Use `erc-parse-prefix' to determine
|
||||
whether the first character of a nick is a prefix character or
|
||||
not. This should fix a bug reported by bromine about needing to
|
||||
type "%" first to complete nicks of people who are "hops" on
|
||||
Slashnet. This should also support for very exotic IRC server
|
||||
setups, if any exist.
|
||||
(erc-update-current-channel-member): Indentation.
|
||||
|
||||
2007-04-15 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-log.el (erc-generate-log-file-name-function): Docfix.
|
||||
Mention how to deal with the case for putting log files in
|
||||
different directories. Change a customization type from `symbol'
|
||||
to `function'.
|
||||
(erc-log-channels-directory): Allow this to contain a function
|
||||
name, which is called with the same args as in
|
||||
`erc-generate-log-file-name-function'. Thanks to andrewy for the
|
||||
report and use case.
|
||||
(erc-current-logfile): Detect if `erc-log-channels-directory' is a
|
||||
function and call it with arguments if so.
|
||||
|
||||
2007-04-12 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-backend.el (define-erc-response-handler): Mention that hook
|
||||
processing stops when the function returns non-nil. This should
|
||||
help avoid a nasty "gotcha" when making custom functions. Thanks
|
||||
to John Sullivan for the report.
|
||||
|
||||
2007-04-08 Diane Murray <disumu@x3y2z1.net>
|
||||
|
||||
* erc-nicklist.el (erc-nicklist-voiced-position): Fixed
|
||||
customization mismatch.
|
||||
|
||||
2007-04-01 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.el (erc-version-string): Release ERC 5.2.
|
||||
|
||||
* erc-auto.in, erc-chess.el, erc-list.el, erc-speak.el:
|
||||
* erc-viper.el: Update copyright notices.
|
||||
|
||||
* erc.texi: Make Emacs Lisp source code in this document
|
||||
essentially public domain. Update version to 5.2.
|
||||
(Obtaining ERC): Mention extras tarball.
|
||||
(Releases): Mention local GNU mirror.
|
||||
(Sample Configuration): Remove notice.
|
||||
|
||||
* FOR-RELEASE (5.3): Add item for erc-nicklist.
|
||||
Mark NEWS as done. Mark extras tarball as done.
|
||||
|
||||
* Makefile (VERSION): Increment to 5.2.
|
||||
(TESTING): Remove.
|
||||
(EXTRAS): New variable containing the contents of our "Emacs 22
|
||||
extras" tarball.
|
||||
(SOURCE): Remove $(TESTING).
|
||||
(MISC): Add COPYING and ChangeLog.06. Fix ChangeLog.NNNN ->
|
||||
ChangeLog.NN.
|
||||
(release): Use $(SNAPDIR) instead of erc-$(VERSION).
|
||||
(extras): New rule which implements the building of the extras
|
||||
tarball.
|
||||
(upload-extras): New rule to upload the extras tarball. It's
|
||||
yucky to replicate upload, but oh well.
|
||||
(DISTRIBUTOR): New variable used to differentiate between building
|
||||
packages for Ubuntu and Debian.
|
||||
(debrelease, debrevision): Use it.
|
||||
(debbuild): Run linda in addition to lintian.
|
||||
|
||||
* NEWS: Mention extras tarball. Note which files have been
|
||||
renamed. Note that erc-list is enabled by default, except in
|
||||
Emacs 22.
|
||||
|
||||
* README.extras: New file which serves as a README for the extras
|
||||
tarball.
|
||||
|
||||
2007-03-31 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* NEWS: Update for the 5.2 release.
|
||||
|
||||
* FOR-RELEASE: Finish up 5.2 manual item. Add documentation item
|
||||
for 5.3.
|
||||
|
||||
* erc.texi (Sample Session): Flesh out. Mention #erc.
|
||||
(Modules): Defer to 5.3 release.
|
||||
(Advanced Usage): Move Sample Configuration chapter ahead of
|
||||
unfinished chapters.
|
||||
(Sample Configuration): Write.
|
||||
(Options): Mention how to see available ERC options. Defer to 5.3
|
||||
release.
|
||||
(Tips and Tricks): Remove, since it seems better to just include
|
||||
tips and tricks in the sample configuration, commented out.
|
||||
|
||||
* erc-bbdb.el (erc-bbdb-search-name-and-create): Make prompt more
|
||||
informative about how to skip merging.
|
||||
(erc-bbdb-insinuate-and-show-entry-1): Move contents of
|
||||
erc-bbdb-insinuate-and-show-entry here.
|
||||
(erc-bbdb-insinuate-and-show-entry): Run
|
||||
erc-bbdb-insinuate-and-show-entry-1 "outside" of the calling
|
||||
function, so that we can avoid triggering a process-filter error
|
||||
if the user hits C-g.
|
||||
|
||||
2007-03-30 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* FOR-RELEASE: Solve C-c C-SPC keybinding dilemma.
|
||||
|
||||
* erc-autoaway.el (erc-autoaway-idle-method): Use `if' rather than
|
||||
`cond' and `set' rather than `set-default'.
|
||||
|
||||
* erc-log.el: Avoid compiler warning by requiring erc-network
|
||||
during compilation.
|
||||
(erc-generate-log-file-name-function): Add tag to each option.
|
||||
Add erc-generate-log-file-name-network.
|
||||
(erc-generate-log-file-name-network): New function which generates
|
||||
a log file name that uses network name rather than server name,
|
||||
when possible.
|
||||
|
||||
* erc-track.el (track): Assimilate track-when-inactive module,
|
||||
since there's no need to have two modules in one file -- an option
|
||||
will do. Remove track-modified-channels alias. Call
|
||||
erc-track-minor-mode-maybe, and tear down the minor mode when
|
||||
disabling.
|
||||
(erc-track-when-inactive): New option which determines whether to
|
||||
track visible buffers when inactive. The default is not to do so.
|
||||
(erc-track-visibility): Mention erc-track-when-inactive.
|
||||
(erc-buffer-visible): Use erc-track-when-inactive.
|
||||
(erc-track-enable-keybindings): New option which determines
|
||||
whether to enable the global-level tracking keybindings. The
|
||||
default is to do so, unless they would override another binding,
|
||||
in which case we prompt the user about it.
|
||||
(erc-track-minor-mode-map): Move global keybindings here.
|
||||
(erc-track-minor-mode): New minor mode which only enables the
|
||||
keybindings and does nothing else.
|
||||
(erc-track-minor-mode-maybe): New function which starts
|
||||
erc-track-minor-mode, but only if it hasn't already been started,
|
||||
an ERC buffer exists, and the user OK's it, depending on the value
|
||||
of `erc-track-enable-keybindings'.
|
||||
(erc-track-switch-buffer): Display a message if someone calls this
|
||||
without first enabling erc-track-mode.
|
||||
|
||||
2007-03-17 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.texi (Development): Mention ErcDevelopment page on
|
||||
emacswiki.
|
||||
(Getting Started): Mention ~/.emacs.d/.ercrc.el and the Customize
|
||||
interface.
|
||||
(Sample Session): New section that has a very rough draft for a
|
||||
sample ERC session.
|
||||
(Special Features): New section that explains some of the special
|
||||
features of ERC. Taken from ErcFeatures on emacswiki, with
|
||||
enhancements.
|
||||
|
||||
2007-03-12 Diane Murray <disumu@x3y2z1.net>
|
||||
|
||||
* erc-autoaway.el (erc-autoaway-idle-method): When setting the new
|
||||
value, disable and re-enable `erc-autoaway-mode' only if it was
|
||||
already enabled. This fixes a bug where autoaway was enabled just
|
||||
by loading the file.
|
||||
|
||||
2007-03-10 Diane Murray <disumu@x3y2z1.net>
|
||||
|
||||
* erc-capab.el: Added more information to the Usage section.
|
||||
(erc-capab-identify-prefix): Doc fix.
|
||||
(erc-capab-identify-unidentified): New face.
|
||||
(290): Removed. Definition moved to erc-backend.el.
|
||||
(erc-capab-identify-send-messages): Renamed from
|
||||
`erc-capab-send-identify-messages'.
|
||||
(erc-capab-identify-setup): Use it.
|
||||
(erc-capab-identify-get-unidentified-nickname): Renamed from
|
||||
`erc-capab-get-unidentified-nickname'.
|
||||
(erc-capab-identify-add-prefix): Use it. Use
|
||||
`erc-capab-identify-unidentified' as the face.
|
||||
|
||||
* erc-backend.el (290): Moved here from erc-capab.el.
|
||||
|
||||
* erc.el (erc-select): Added an autoload cookie.
|
||||
(erc-message-type-member, erc-restore-text-properties): Use
|
||||
`erc-get-parsed-vector'.
|
||||
(erc-auto-query): Set the default to 'bury since many new users
|
||||
expect private messages from others to be in dedicated query
|
||||
buffers, not the server buffer.
|
||||
(erc-common-server-suffixes): Use "freenode" for freenode.net, not
|
||||
"OPN". Added oftc.net.
|
||||
|
||||
* NEWS: Added note about erc-auto-query's new default setting.
|
||||
|
||||
2007-03-03 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.el (erc-open, erc): Docfixes.
|
||||
|
||||
2007-03-02 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* FOR-RELEASE: Make section for 5.3 release and move erc-backend
|
||||
cleanup there. Awaiting discussion before doing other things.
|
||||
Add tasks for merging filename changes from the 5.2 release
|
||||
branch, and for making a tarball of modules not in Emacs 22. Add
|
||||
item to remind me to update NEWS. Mark backtab entry as done.
|
||||
|
||||
* erc-button.el (button): Add call to `erc-button-add-keys'.
|
||||
(erc-button-keys-added): New variable tracking whether we've added
|
||||
the keys yet.
|
||||
(erc-button-add-keys): New function that adds the <backtab> key to
|
||||
erc-mode-map.
|
||||
|
||||
* erc.texi: Change version to 5.2 (pre-release).
|
||||
|
||||
2007-02-15 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* CREDITS: Update.
|
||||
|
||||
* erc-backend.el (erc-server-send-ping-interval): Change to use a
|
||||
default of 30 seconds. Improve customize interface.
|
||||
(erc-server-send-ping-timeout): New option that determines when to
|
||||
consider a connection stalled and restart it. The default is
|
||||
after 120 seconds.
|
||||
(erc-server-send-ping): Use erc-server-send-ping-timeout instead
|
||||
of erc-server-send-ping-interval. If
|
||||
erc-server-send-ping-timeout is nil, do not ever kill and restart
|
||||
a hung IRC process.
|
||||
|
||||
* erc.el (erc-modules): Include the name of the module in its
|
||||
description. This should make it easier for people to find and
|
||||
enable a particular module.
|
||||
|
||||
2007-02-15 Vivek Dasmohapatra <vivek@etla.org>
|
||||
|
||||
* erc.el (erc-cmd-RECONNECT): Kill old process if it is still
|
||||
alive.
|
||||
(erc-message-english-PART): Properly escape "%" characters in
|
||||
reason.
|
||||
|
||||
* erc-backend.el (erc-server-reconnecting): New variable that is
|
||||
set when the user requests a reconnect, but the old process is
|
||||
still alive. This forces the reconnect to work even though the
|
||||
process is killed manually during reconnect.
|
||||
(erc-server-connect): Initialize it.
|
||||
(erc-server-reconnect-p): Use it.
|
||||
(erc-process-sentinel-1): Set it to nil after the first reconnect
|
||||
attempt.
|
||||
|
||||
2007-02-07 Diane Murray <disumu@x3y2z1.net>
|
||||
|
||||
* erc-menu.el (erc-menu-definition): Fixed so that the separator
|
||||
is between "Current channel" and "Pals, fools and other keywords",
|
||||
not at the bottom of the "Current channel" submenu.
|
||||
|
||||
2007-01-25 Diane Murray <disumu@x3y2z1.net>
|
||||
|
||||
* erc-networks.el (erc-server-alist): Removed SSL server for now
|
||||
since `erc-server-select' doesn't know to use `erc-ssl'.
|
||||
|
||||
* erc-networks.el (erc-server-alist, erc-networks-alist): Added
|
||||
definitions for oftc.net.
|
||||
|
||||
* erc-services.el (erc-nickserv-alist): Fixed OFTC message regexp.
|
||||
|
||||
2007-01-22 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-backend.el (erc-server-error-occurred): New variable that
|
||||
indicates when an error has been signaled by the server. This
|
||||
should fix an infinite reconnect bug when giving some servers a
|
||||
bogus :full-name. Thanks to Angelina Carlton for the report.
|
||||
(erc-server-connect): Initialize erc-server-error-occurred.
|
||||
(erc-server-reconnect-p): Use it.
|
||||
(ERROR): Set it.
|
||||
|
||||
* erc-services.el (erc-nickserv-alist): Alphabetize and add Ars
|
||||
and QuakeNet. Standardize look of entries. Fix type mismatch
|
||||
error in customize interface.
|
||||
(erc-nickserv-passwords): Alphabetize and add missing entries from
|
||||
erc-nickserv-alist.
|
||||
|
||||
2007-01-21 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.el (erc-header-line-format): Document how to disable the
|
||||
header line, and add a customization type for it. Also, make the
|
||||
changes take effect immediately.
|
||||
|
||||
2007-01-19 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.texi (Modules): Document new menu module. Thanks to Leo
|
||||
for noticing.
|
||||
|
||||
2007-01-16 Diane Murray <disumu@x3y2z1.net>
|
||||
|
||||
* erc-stamp.el (erc-insert-timestamp-left): Fixed so that the
|
||||
whitespace string filler is hidden correctly when timestamps are
|
||||
hidden.
|
||||
(erc-toggle-timestamps): New function to use instead of
|
||||
`erc-show-timestamps' and `erc-hide-timestamps'.
|
||||
|
||||
* erc.el (erc-restore-text-properties): Moved here from
|
||||
erc-fill.el since it could be useful in general.
|
||||
|
||||
* erc-fill.el (erc-restore-text-properties): Removed.
|
||||
|
||||
2007-01-13 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.el (erc-command-regexp): New variable that is used to match
|
||||
a command.
|
||||
(erc-send-input): Use it. This fixes a bug where paths --
|
||||
"/usr/bin/foo", for example -- were being displayed as commands,
|
||||
but still sent correctly.
|
||||
(erc-extract-command-from-line): Use it.
|
||||
|
||||
* erc.texi (Modules): Document erc-capab-identify.
|
||||
|
||||
2007-01-11 Diane Murray <disumu@x3y2z1.net>
|
||||
|
||||
* erc.el (erc-find-parsed-property): Moved here from erc-track.el
|
||||
since it can be useful in general.
|
||||
|
||||
* erc-track.el (erc-find-parsed-property): Removed.
|
||||
|
||||
* erc-capab.el (erc-capab-find-parsed): Removed.
|
||||
(erc-capab-identify-add-prefix): Use `erc-find-parsed-property'.
|
||||
|
||||
* erc.el (erc-open): Run `erc-before-connect' hook here. This
|
||||
makes sure the hook always gets called before a connection is
|
||||
made, as some functions, like `erc-handle-irc-url', use `erc-open'
|
||||
instead of `erc'.
|
||||
(erc): Removed `erc-before-connect' hook.
|
||||
|
||||
* erc-menu.el (erc-menu-definition): Put items specific to
|
||||
channels in a "Current channel" submenu.
|
||||
|
||||
* erc-backend.el (321, 323): Display channel list in server buffer
|
||||
when not using the channel list module.
|
||||
|
||||
* erc.el: Updated copyright years.
|
||||
(erc-version-string): Set to 5.2 (devel).
|
||||
(erc-format-lag-time): Fixed to work when `erc-server-lag' is nil.
|
||||
(erc-update-mode-line-buffer): Set the header face.
|
||||
|
||||
2007-01-11 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc-bbdb.el (erc-bbdb-popup-type): Fix customization type and
|
||||
documentation.
|
||||
|
||||
* erc-services.el (erc-nickserv-identify-mode): Improve
|
||||
documentation for nick-change option and move higher to fix
|
||||
compiler warning. Avoid a recursive load error.
|
||||
(erc-nickserv-alist): Add simple entry for BitlBee, to avoid
|
||||
"NickServ is AWAY: User is offline" error. Oddly enough, bitlbee
|
||||
was smart enough to recognize that as an authentication request
|
||||
and log in regardless, which is why I didn't notice this earlier.
|
||||
(erc-nickserv-alist-sender, erc-nickserv-alist-regexp)
|
||||
(erc-nickserv-alist-nickserv, erc-nickserv-alist-ident-keyword)
|
||||
(erc-nickserv-alist-use-nick-p)
|
||||
(erc-nickserv-alist-ident-command): New accessors for
|
||||
erc-nickserv-alist. Using nth is unwieldy.
|
||||
(erc-nickserv-identify-autodetect)
|
||||
(erc-nickserv-identify-on-connect)
|
||||
(erc-nickserv-identify-on-nick-change, erc-nickserv-identify): Use
|
||||
the new accessors.
|
||||
|
||||
2007-01-11 Diane Murray <disumu@x3y2z1.net>
|
||||
|
||||
* NEWS: Added note for `erc-my-nick-face'. Fixed capab-identify
|
||||
wording.
|
||||
|
||||
2007-01-10 Diane Murray <disumu@x3y2z1.net>
|
||||
|
||||
* erc.el (erc-mode-line-format): Added %l to documentation.
|
||||
(erc-header-line-format): Removed "[IRC]". Use the new %l
|
||||
replacement character. Doc fix.
|
||||
(erc-format-channel-modes): Removed lag code. Removed parentheses
|
||||
from mode string.
|
||||
(erc-format-lag-time): New function.
|
||||
(erc-update-mode-line-buffer): Use it.
|
||||
|
||||
2007-01-10 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.el: Fix typo in url-irc-function instructions.
|
||||
|
||||
2007-01-09 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.el (erc-system-name): New option that determines the system
|
||||
name to use when logging in. The default is to figure this out by
|
||||
calling `system-name'.
|
||||
(erc-login): Use it.
|
||||
|
||||
2007-01-07 Michael Olson <mwolson@gnu.org>
|
||||
|
||||
* erc.el (erc-modules): Add the menu module. This should fix a
|
||||
bug with incorrect ERC submenus being displayed.
|
||||
|
||||
* erc-menu.el: Turn this into a module.
|
||||
(erc-menu-add, erc-menu-remove): New functions that add and remove
|
||||
the ERC menu.
|
||||
|
||||
|
||||
See ChangeLog.06 for earlier changes.
|
||||
|
||||
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Emacs.
|
||||
|
||||
GNU Emacs is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Emacs is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU Emacs; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
|
||||
;; Local Variables:
|
||||
;; coding: utf-8
|
||||
;; add-log-time-zone-rule: t
|
||||
;; End:
|
||||
|
||||
;; arch-tag: 3369b6e5-96b1-4b32-96cd-9a905c747496
|
|
@ -332,11 +332,10 @@ This is either a coding system, a cons, a function, or nil.
|
|||
|
||||
If a cons, the encoding system for outgoing text is in the car
|
||||
and the decoding system for incoming text is in the cdr. The most
|
||||
interesting use for this is to put `undecided' in the cdr. If a
|
||||
function, it is called with no arguments and should return a
|
||||
coding system or a cons as described above. Note that you can use
|
||||
the dynamically bound variable `target' to get the current
|
||||
target. See `erc-coding-system-for-target'.
|
||||
interesting use for this is to put `undecided' in the cdr.
|
||||
|
||||
If a function, it is called with the argument `target' and should
|
||||
return a coding system or a cons as described above.
|
||||
|
||||
If you need to send non-ASCII text to people not using a client that
|
||||
does decoding on its own, you must tell ERC what encoding to use.
|
||||
|
@ -491,6 +490,8 @@ We will store server variables in the buffer given by BUFFER."
|
|||
(let ((process (funcall erc-server-connect-function
|
||||
(format "erc-%s-%s" server port)
|
||||
nil server port)))
|
||||
(unless (processp process)
|
||||
(error "Connection attempt failed"))
|
||||
(message "%s...done" msg)
|
||||
;; Misc server variables
|
||||
(with-current-buffer buffer
|
||||
|
@ -686,7 +687,7 @@ This is determined via `erc-encoding-coding-alist' or
|
|||
(when (string-match (car pat) target)
|
||||
(throw 'match (cdr pat)))))))
|
||||
(and (functionp erc-server-coding-system)
|
||||
(funcall erc-server-coding-system))
|
||||
(funcall erc-server-coding-system target))
|
||||
erc-server-coding-system))
|
||||
|
||||
(defun erc-decode-string-from-target (str target)
|
||||
|
@ -1649,8 +1650,13 @@ See `erc-display-server-message'." nil
|
|||
|
||||
(define-erc-response-handler (321)
|
||||
"LIST header." nil
|
||||
(setq erc-channel-list nil)
|
||||
(erc-display-message parsed 'notice proc 's321))
|
||||
(setq erc-channel-list nil))
|
||||
|
||||
(defun erc-server-321-message (proc parsed)
|
||||
"Display a message for the 321 event."
|
||||
(erc-display-message parsed 'notice proc 's321)
|
||||
nil)
|
||||
(add-hook 'erc-server-321-functions 'erc-server-321-message t)
|
||||
|
||||
(define-erc-response-handler (322)
|
||||
"LIST notice." nil
|
||||
|
@ -1658,10 +1664,17 @@ See `erc-display-server-message'." nil
|
|||
(multiple-value-bind (channel num-users)
|
||||
(cdr (erc-response.command-args parsed))
|
||||
(add-to-list 'erc-channel-list (list channel))
|
||||
(erc-update-channel-topic channel topic)
|
||||
(erc-update-channel-topic channel topic))))
|
||||
|
||||
(defun erc-server-322-message (proc parsed)
|
||||
"Display a message for the 322 event."
|
||||
(let ((topic (erc-response.contents parsed)))
|
||||
(multiple-value-bind (channel num-users)
|
||||
(cdr (erc-response.command-args parsed))
|
||||
(erc-display-message
|
||||
parsed 'notice proc 's322
|
||||
?c channel ?u num-users ?t (or topic "")))))
|
||||
(add-hook 'erc-server-322-functions 'erc-server-322-message t)
|
||||
|
||||
(define-erc-response-handler (324)
|
||||
"Channel or nick modes." nil
|
||||
|
|
|
@ -57,16 +57,15 @@
|
|||
((add-hook 'erc-insert-modify-hook 'erc-button-add-buttons 'append)
|
||||
(add-hook 'erc-send-modify-hook 'erc-button-add-buttons 'append)
|
||||
(add-hook 'erc-complete-functions 'erc-button-next)
|
||||
(add-hook 'erc-mode-hook 'erc-button-add-keys))
|
||||
(add-hook 'erc-mode-hook 'erc-button-setup))
|
||||
((remove-hook 'erc-insert-modify-hook 'erc-button-add-buttons)
|
||||
(remove-hook 'erc-send-modify-hook 'erc-button-add-buttons)
|
||||
(remove-hook 'erc-complete-functions 'erc-button-next)
|
||||
(remove-hook 'erc-mode-hook 'erc-button-add-keys)))
|
||||
|
||||
;; Make XEmacs use `erc-button-face'.
|
||||
(when (featurep 'xemacs)
|
||||
(add-hook 'erc-mode-hook
|
||||
(lambda () (set (make-local-variable 'widget-button-face) nil))))
|
||||
(remove-hook 'erc-mode-hook 'erc-button-setup)
|
||||
(when (featurep 'xemacs)
|
||||
(dolist (buffer (erc-buffer-list))
|
||||
(with-current-buffer buffer
|
||||
(kill-local-variable 'widget-button-face))))))
|
||||
|
||||
;;; Variables
|
||||
|
||||
|
@ -247,8 +246,12 @@ constituents.")
|
|||
"Internal variable used to keep track of whether we've added the
|
||||
global-level ERC button keys yet.")
|
||||
|
||||
(defun erc-button-add-keys ()
|
||||
(defun erc-button-setup ()
|
||||
"Add ERC mode-level button movement keys. This is only done once."
|
||||
;; Make XEmacs use `erc-button-face'.
|
||||
(when (featurep 'xemacs)
|
||||
(set (make-local-variable 'widget-button-face) nil))
|
||||
;; Add keys.
|
||||
(unless erc-button-keys-added
|
||||
(define-key erc-mode-map (kbd "<backtab>") 'erc-button-previous)
|
||||
(setq erc-button-keys-added t)))
|
||||
|
@ -299,9 +302,10 @@ specified by `erc-button-alist'."
|
|||
(setq bounds (bounds-of-thing-at-point 'word))
|
||||
(setq word (buffer-substring-no-properties
|
||||
(car bounds) (cdr bounds)))
|
||||
(if (erc-get-server-user word)
|
||||
(erc-button-add-button (car bounds) (cdr bounds)
|
||||
fun t (list word)))))))
|
||||
(when (or (and (erc-server-buffer-p) (erc-get-server-user word))
|
||||
(and erc-channel-users (erc-get-channel-user word)))
|
||||
(erc-button-add-button (car bounds) (cdr bounds)
|
||||
fun t (list word)))))))
|
||||
|
||||
(defun erc-button-add-buttons-1 (regexp entry)
|
||||
"Search through the buffer for matches to ENTRY and add buttons."
|
||||
|
|
|
@ -88,53 +88,6 @@ See `replace-match' for explanations of FIXEDCASE and LITERAL."
|
|||
(defalias 'erc-make-obsolete 'make-obsolete)
|
||||
(defalias 'erc-make-obsolete-variable 'make-obsolete-variable)
|
||||
|
||||
;; Provde an equivalent of `assert', based on the code from cl-macs.el
|
||||
(defun erc-const-expr-p (x)
|
||||
(cond ((consp x)
|
||||
(or (eq (car x) 'quote)
|
||||
(and (memq (car x) '(function function*))
|
||||
(or (symbolp (nth 1 x))
|
||||
(and (eq (and (consp (nth 1 x))
|
||||
(car (nth 1 x))) 'lambda) 'func)))))
|
||||
((symbolp x) (and (memq x '(nil t)) t))
|
||||
(t t)))
|
||||
|
||||
(put 'erc-assertion-failed 'error-conditions '(error))
|
||||
(put 'erc-assertion-failed 'error-message "Assertion failed")
|
||||
|
||||
(defun erc-list* (arg &rest rest)
|
||||
"Return a new list with specified args as elements, cons'd to last arg.
|
||||
Thus, `(list* A B C D)' is equivalent to `(nconc (list A B C) D)', or to
|
||||
`(cons A (cons B (cons C D)))'."
|
||||
(cond ((not rest) arg)
|
||||
((not (cdr rest)) (cons arg (car rest)))
|
||||
(t (let* ((n (length rest))
|
||||
(copy (copy-sequence rest))
|
||||
(last (nthcdr (- n 2) copy)))
|
||||
(setcdr last (car (cdr last)))
|
||||
(cons arg copy)))))
|
||||
|
||||
(defmacro erc-assert (form &optional show-args string &rest args)
|
||||
"Verify that FORM returns non-nil; signal an error if not.
|
||||
Second arg SHOW-ARGS means to include arguments of FORM in message.
|
||||
Other args STRING and ARGS... are arguments to be passed to `error'.
|
||||
They are not evaluated unless the assertion fails. If STRING is
|
||||
omitted, a default message listing FORM itself is used."
|
||||
(let ((sargs
|
||||
(and show-args
|
||||
(delq nil (mapcar
|
||||
(function
|
||||
(lambda (x)
|
||||
(and (not (erc-const-expr-p x)) x)))
|
||||
(cdr form))))))
|
||||
(list 'progn
|
||||
(list 'or form
|
||||
(if string
|
||||
(erc-list* 'error string (append sargs args))
|
||||
(list 'signal '(quote erc-assertion-failed)
|
||||
(erc-list* 'list (list 'quote form) sargs))))
|
||||
nil)))
|
||||
|
||||
;; Provide a simpler replacement for `member-if'
|
||||
(defun erc-member-if (predicate list)
|
||||
"Find the first item satisfying PREDICATE in LIST.
|
||||
|
|
|
@ -60,6 +60,12 @@
|
|||
(require 'cl)
|
||||
(require 'pcomplete))
|
||||
|
||||
;;;###autoload (autoload 'erc-dcc-mode "erc-dcc")
|
||||
(define-erc-module dcc nil
|
||||
"Provide Direct Client-to-Client support for ERC."
|
||||
((add-hook 'erc-server-401-functions 'erc-dcc-no-such-nick))
|
||||
((remove-hook 'erc-server-401-functions 'erc-dcc-no-such-nick)))
|
||||
|
||||
(defgroup erc-dcc nil
|
||||
"DCC stands for Direct Client Communication, where you and your
|
||||
friend's client programs connect directly to each other,
|
||||
|
@ -70,7 +76,7 @@ Using DCC get and send, you can transfer files directly from and to other
|
|||
IRC users."
|
||||
:group 'erc)
|
||||
|
||||
(defcustom erc-verbose-dcc t
|
||||
(defcustom erc-dcc-verbose nil
|
||||
"*If non-nil, be verbose about DCC activity reporting."
|
||||
:group 'erc-dcc
|
||||
:type 'boolean)
|
||||
|
@ -195,20 +201,22 @@ compared with `erc-nick-equal-p' which is IRC case-insensitive."
|
|||
(setq list (cdr list)))))
|
||||
result))
|
||||
|
||||
;; msa wrote this nifty little frob to convert an n-byte integer to a packed
|
||||
;; string.
|
||||
(defun erc-pack-int (value count)
|
||||
(if (> count 0)
|
||||
(concat (erc-pack-int (/ value 256) (1- count))
|
||||
(char-to-string (% value 256)))
|
||||
""))
|
||||
(defun erc-pack-int (value)
|
||||
"Convert an integer into a packed string."
|
||||
(let* ((len (ceiling (/ value 256.0)))
|
||||
(str (make-string len ?a))
|
||||
(i (1- len)))
|
||||
(while (>= i 0)
|
||||
(aset str i (% value 256))
|
||||
(setq value (/ value 256))
|
||||
(setq i (1- i)))
|
||||
str))
|
||||
|
||||
(defun erc-unpack-int (str)
|
||||
"Unpack a 1-4 character packed string into an integer."
|
||||
"Unpack a packed string into an integer."
|
||||
(let ((len (length str))
|
||||
(num 0)
|
||||
(count 0))
|
||||
(erc-assert (<= len 4)) ;; this isn't going to fit in elisp bounds
|
||||
(while (< count len)
|
||||
(setq num (+ num (lsh (aref str (- len count 1)) (* 8 count))))
|
||||
(setq count (1+ count)))
|
||||
|
@ -256,15 +264,24 @@ The result is also a string."
|
|||
|
||||
;;; Server code
|
||||
|
||||
(defcustom erc-dcc-host nil
|
||||
"*IP address to use for outgoing DCC offers.
|
||||
Should be set to a string or nil, if nil, automatic detection of the
|
||||
host interface to use will be attempted."
|
||||
(defcustom erc-dcc-listen-host nil
|
||||
"IP address to listen on when offering files.
|
||||
Should be set to a string or nil. If nil, automatic detection of
|
||||
the host interface to use will be attempted."
|
||||
:group 'erc-dcc
|
||||
:type (list 'choice (list 'const :tag "Auto-detect" nil)
|
||||
(list 'string :tag "IP-address"
|
||||
:valid-regexp erc-dcc-ipv4-regexp)))
|
||||
|
||||
(defcustom erc-dcc-public-host nil
|
||||
"IP address to use for outgoing DCC offers.
|
||||
Should be set to a string or nil. If nil, use the value of
|
||||
`erc-dcc-listen-host'."
|
||||
:group 'erc-dcc
|
||||
:type (list 'choice (list 'const :tag "Same as erc-dcc-listen-host" nil)
|
||||
(list 'string :tag "IP-address"
|
||||
:valid-regexp erc-dcc-ipv4-regexp)))
|
||||
|
||||
(defcustom erc-dcc-send-request 'ask
|
||||
"*How to treat incoming DCC Send requests.
|
||||
'ask - Report the Send request, and wait for the user to manually accept it
|
||||
|
@ -282,7 +299,7 @@ host interface to use will be attempted."
|
|||
"Determine the IP address we are using.
|
||||
If variable `erc-dcc-host' is non-nil, use it. Otherwise call
|
||||
`erc-dcc-get-host' on the erc-server-process."
|
||||
(or erc-dcc-host (erc-dcc-get-host erc-server-process)
|
||||
(or erc-dcc-listen-host (erc-dcc-get-host erc-server-process)
|
||||
(error "Unable to determine local address")))
|
||||
|
||||
(defcustom erc-dcc-port-range nil
|
||||
|
@ -311,6 +328,7 @@ created subprocess, or nil."
|
|||
process)
|
||||
(while (not process)
|
||||
(condition-case err
|
||||
(progn
|
||||
(setq process
|
||||
(make-network-process :name name
|
||||
:buffer nil
|
||||
|
@ -322,6 +340,11 @@ created subprocess, or nil."
|
|||
:sentinel sentinel
|
||||
:log #'erc-dcc-server-accept
|
||||
:server t))
|
||||
(when (processp process)
|
||||
(when (fboundp 'set-process-coding-system)
|
||||
(set-process-coding-system process 'binary 'binary))
|
||||
(when (fboundp 'set-process-filter-multibyte)
|
||||
(set-process-filter-multibyte process nil))))
|
||||
(file-error
|
||||
(unless (and (string= "Cannot bind server socket" (cadr err))
|
||||
(string= "address already in use" (caddr err)))
|
||||
|
@ -698,7 +721,7 @@ bytes sent."
|
|||
(confirmed-marker (plist-get elt :sent))
|
||||
(sent-marker (plist-get elt :sent)))
|
||||
(with-current-buffer (process-buffer proc)
|
||||
(when erc-verbose-dcc
|
||||
(when erc-dcc-verbose
|
||||
(erc-display-message
|
||||
nil 'notice (erc-dcc-get-parent proc)
|
||||
(format "DCC: Confirmed %d, sent %d, sending block now"
|
||||
|
@ -713,8 +736,7 @@ bytes sent."
|
|||
(length string)))))
|
||||
|
||||
(defun erc-dcc-send-filter (proc string)
|
||||
(erc-assert (= (% (length string) 4) 0))
|
||||
(let* ((size (erc-unpack-int (substring string (- (length string) 4))))
|
||||
(let* ((size (erc-unpack-int string))
|
||||
(elt (erc-dcc-member :peer proc))
|
||||
(parent (plist-get elt :parent))
|
||||
(sent-marker (plist-get elt :sent))
|
||||
|
@ -742,16 +764,21 @@ bytes sent."
|
|||
((> confirmed-marker sent-marker)
|
||||
(erc-display-message
|
||||
nil 'notice parent
|
||||
(format "DCC: Client confirmed too much!"))
|
||||
(format "DCC: Client confirmed too much (%s vs %s)!"
|
||||
(marker-position confirmed-marker)
|
||||
(marker-position sent-marker)))
|
||||
(set-buffer-modified-p nil)
|
||||
(kill-buffer (current-buffer))
|
||||
(delete-process proc))))))
|
||||
|
||||
(defun erc-dcc-display-send (proc)
|
||||
(erc-display-message
|
||||
nil 'notice (erc-dcc-get-parent proc)
|
||||
(format "DCC: SEND connect from %s"
|
||||
(format-network-address (process-contact proc :remote)))))
|
||||
|
||||
(defcustom erc-dcc-send-connect-hook
|
||||
'((lambda (proc)
|
||||
(erc-display-message
|
||||
nil 'notice (erc-dcc-get-parent proc)
|
||||
(format "DCC: SEND connect from %s"
|
||||
(format-network-address (process-contact proc :remote)))))
|
||||
erc-dcc-send-block)
|
||||
'(erc-dcc-display-send erc-dcc-send-block)
|
||||
"*Hook run whenever the remote end of a DCC SEND offer connected to your
|
||||
listening port."
|
||||
:group 'erc-dcc
|
||||
|
@ -762,14 +789,14 @@ listening port."
|
|||
(erc-extract-nick (plist-get plist :nick)))
|
||||
|
||||
(defun erc-dcc-send-sentinel (proc event)
|
||||
(let* ((elt (erc-dcc-member :peer proc))
|
||||
(buf (marker-buffer (plist-get elt :sent))))
|
||||
(let* ((elt (erc-dcc-member :peer proc)))
|
||||
(cond
|
||||
((string-match "^open from " event)
|
||||
(when elt
|
||||
(with-current-buffer buf
|
||||
(set-process-buffer proc buf)
|
||||
(setq erc-dcc-entry-data elt))
|
||||
(let ((buf (marker-buffer (plist-get elt :sent))))
|
||||
(with-current-buffer buf
|
||||
(set-process-buffer proc buf)
|
||||
(setq erc-dcc-entry-data elt)))
|
||||
(run-hook-with-args 'erc-dcc-send-connect-hook proc))))))
|
||||
|
||||
(defun erc-dcc-find-file (file)
|
||||
|
@ -807,15 +834,23 @@ other client."
|
|||
(process-send-string
|
||||
pproc (format "PRIVMSG %s :\C-aDCC SEND %s %s %d %d\C-a\n"
|
||||
nick (erc-dcc-file-to-name file)
|
||||
(erc-ip-to-decimal (nth 0 contact))
|
||||
(erc-ip-to-decimal (or erc-dcc-public-host
|
||||
(nth 0 contact)))
|
||||
(nth 1 contact)
|
||||
size)))
|
||||
(error "`make-network-process' not supported by your Emacs")))
|
||||
|
||||
;;; GET handling
|
||||
|
||||
(defcustom erc-dcc-receive-cache (* 1024 512)
|
||||
"Number of bytes to let the receive buffer grow before flushing it."
|
||||
:group 'erc-dcc
|
||||
:type 'integer)
|
||||
|
||||
(defvar erc-dcc-byte-count nil)
|
||||
(make-variable-buffer-local 'erc-dcc-byte-count)
|
||||
(defvar erc-dcc-file-name nil)
|
||||
(make-variable-buffer-local 'erc-dcc-file-name)
|
||||
|
||||
(defun erc-dcc-get-file (entry file parent-proc)
|
||||
"This function does the work of setting up a transfer from the remote client
|
||||
|
@ -825,6 +860,7 @@ filter and a process sentinel, and making the connection."
|
|||
proc)
|
||||
(with-current-buffer buffer
|
||||
(fundamental-mode)
|
||||
(buffer-disable-undo (current-buffer))
|
||||
;; This is necessary to have the buffer saved as-is in GNU
|
||||
;; Emacs.
|
||||
;; XEmacs change: We don't have `set-buffer-multibyte', setting
|
||||
|
@ -835,7 +871,10 @@ filter and a process sentinel, and making the connection."
|
|||
(setq mode-line-process '(":%s")
|
||||
buffer-file-type t
|
||||
buffer-read-only t)
|
||||
(set-visited-file-name file)
|
||||
(setq erc-dcc-file-name file)
|
||||
|
||||
;; Truncate the given file to size 0 before appending to it.
|
||||
(write-region (point) (point) erc-dcc-file-name nil 'nomessage)
|
||||
|
||||
(setq erc-server-process parent-proc
|
||||
erc-dcc-entry-data entry)
|
||||
|
@ -847,7 +886,6 @@ filter and a process sentinel, and making the connection."
|
|||
(string-to-number (plist-get entry :port))
|
||||
entry))
|
||||
(set-process-buffer proc buffer)
|
||||
;; The following two lines make saving as-is work under Windows
|
||||
(set-process-coding-system proc 'binary 'binary)
|
||||
(set-buffer-file-coding-system 'binary t)
|
||||
|
||||
|
@ -856,6 +894,14 @@ filter and a process sentinel, and making the connection."
|
|||
(setq entry (plist-put entry :start-time (erc-current-time)))
|
||||
(setq entry (plist-put entry :peer proc)))))
|
||||
|
||||
(defun erc-dcc-append-contents (buffer file)
|
||||
"Append the contents of BUFFER to FILE.
|
||||
The contents of the BUFFER will then be erased."
|
||||
(with-current-buffer buffer
|
||||
(let ((coding-system-for-write 'binary))
|
||||
(write-region (point-min) (point-max) erc-dcc-file-name t 'nomessage)
|
||||
(erase-buffer))))
|
||||
|
||||
(defun erc-dcc-get-filter (proc str)
|
||||
"This is the process filter for transfers from other clients to this one.
|
||||
It reads incoming bytes from the network and stores them in the DCC
|
||||
|
@ -868,8 +914,10 @@ rather than every 1024 byte block, but nobody seems to care."
|
|||
(insert (string-make-unibyte str))
|
||||
|
||||
(setq erc-dcc-byte-count (+ (length str) erc-dcc-byte-count))
|
||||
(erc-assert (= erc-dcc-byte-count (1- (point-max))))
|
||||
(and erc-verbose-dcc
|
||||
(when (> (point-max) erc-dcc-receive-cache)
|
||||
(erc-dcc-append-contents (current-buffer) erc-dcc-file-name))
|
||||
|
||||
(and erc-dcc-verbose
|
||||
(erc-display-message
|
||||
nil 'notice erc-server-process
|
||||
'dcc-get-bytes-received
|
||||
|
@ -885,7 +933,7 @@ rather than every 1024 byte block, but nobody seems to care."
|
|||
(delete-process proc))
|
||||
(t
|
||||
(process-send-string
|
||||
proc (erc-pack-int erc-dcc-byte-count 4)))))))
|
||||
proc (erc-pack-int erc-dcc-byte-count)))))))
|
||||
|
||||
|
||||
(defun erc-dcc-get-sentinel (proc event)
|
||||
|
@ -895,17 +943,18 @@ transfer is complete."
|
|||
;; FIXME, we should look at EVENT, and also check size.
|
||||
(with-current-buffer (process-buffer proc)
|
||||
(delete-process proc)
|
||||
(setq buffer-read-only nil)
|
||||
(setq erc-dcc-list (delete erc-dcc-entry-data erc-dcc-list))
|
||||
(unless (= (point-min) (point-max))
|
||||
(setq erc-dcc-byte-count (+ (buffer-size) erc-dcc-byte-count))
|
||||
(erc-dcc-append-contents (current-buffer) erc-dcc-file-name))
|
||||
(erc-display-message
|
||||
nil 'notice erc-server-process
|
||||
'dcc-get-complete
|
||||
?f (file-name-nondirectory buffer-file-name)
|
||||
?s (number-to-string (buffer-size))
|
||||
?f erc-dcc-file-name
|
||||
?s (number-to-string erc-dcc-byte-count)
|
||||
?t (format "%.0f"
|
||||
(erc-time-diff (plist-get erc-dcc-entry-data :start-time)
|
||||
(erc-current-time))))
|
||||
(save-buffer))
|
||||
(erc-current-time)))))
|
||||
(kill-buffer (process-buffer proc))
|
||||
(delete-process proc))
|
||||
|
||||
|
@ -1126,8 +1175,6 @@ other client."
|
|||
(if (processp peer) (delete-process peer)))
|
||||
nil))
|
||||
|
||||
(add-hook 'erc-server-401-functions 'erc-dcc-no-such-nick)
|
||||
|
||||
(provide 'erc-dcc)
|
||||
|
||||
;;; erc-dcc.el ends here
|
||||
|
|
|
@ -33,10 +33,14 @@
|
|||
|
||||
(require 'erc)
|
||||
|
||||
;; Imenu Autoload
|
||||
(add-hook 'erc-mode-hook
|
||||
(lambda ()
|
||||
(setq imenu-create-index-function 'erc-create-imenu-index)))
|
||||
;;; Imenu support
|
||||
|
||||
(defun erc-imenu-setup ()
|
||||
"Setup Imenu support in an ERC buffer."
|
||||
(set (make-local-variable 'imenu-create-index-function)
|
||||
'erc-create-imenu-index))
|
||||
|
||||
(add-hook 'erc-mode-hook 'erc-imenu-setup)
|
||||
(autoload 'erc-create-imenu-index "erc-imenu" "Imenu index creation function")
|
||||
|
||||
;;; Automatically scroll to bottom
|
||||
|
@ -51,11 +55,15 @@ argument to `recenter'."
|
|||
:type '(choice integer (const nil)))
|
||||
|
||||
(define-erc-module scrolltobottom nil
|
||||
"This mode causes the prompt to stay at the end of the window.
|
||||
You have to activate or deactivate it in already created windows
|
||||
separately."
|
||||
((add-hook 'erc-mode-hook 'erc-add-scroll-to-bottom))
|
||||
((remove-hook 'erc-mode-hook 'erc-add-scroll-to-bottom)))
|
||||
"This mode causes the prompt to stay at the end of the window."
|
||||
((add-hook 'erc-mode-hook 'erc-add-scroll-to-bottom)
|
||||
(dolist (buffer (erc-buffer-list))
|
||||
(with-current-buffer buffer
|
||||
(erc-add-scroll-to-bottom))))
|
||||
((remove-hook 'erc-mode-hook 'erc-add-scroll-to-bottom)
|
||||
(dolist (buffer (erc-buffer-list))
|
||||
(with-current-buffer buffer
|
||||
(remove-hook 'window-scroll-functions 'erc-scroll-to-bottom t)))))
|
||||
|
||||
(defun erc-add-scroll-to-bottom ()
|
||||
"A hook function for `erc-mode-hook' to recenter output at bottom of window.
|
||||
|
@ -110,7 +118,46 @@ Put this function on `erc-insert-post-hook' and/or `erc-send-post-hook'."
|
|||
(put-text-property (point-min) (point-max) 'front-sticky t)
|
||||
(put-text-property (point-min) (point-max) 'rear-nonsticky t))
|
||||
|
||||
;; Distinguish non-commands
|
||||
;;; Move to prompt when typing text
|
||||
(define-erc-module move-to-prompt nil
|
||||
"This mode causes the point to be moved to the prompt when typing text."
|
||||
((add-hook 'erc-mode-hook 'erc-move-to-prompt-setup)
|
||||
(dolist (buffer (erc-buffer-list))
|
||||
(with-current-buffer buffer
|
||||
(erc-move-to-prompt-setup))))
|
||||
((remove-hook 'erc-mode-hook 'erc-move-to-prompt-setup)
|
||||
(dolist (buffer (erc-buffer-list))
|
||||
(with-current-buffer buffer
|
||||
(remove-hook 'pre-command-hook 'erc-move-to-prompt t)))))
|
||||
|
||||
(defun erc-move-to-prompt ()
|
||||
"Move the point to the ERC prompt if this is a self-inserting command."
|
||||
(when (and erc-input-marker (< (point) erc-input-marker)
|
||||
(eq 'self-insert-command this-command))
|
||||
(deactivate-mark)
|
||||
(push-mark)
|
||||
(goto-char (point-max))))
|
||||
|
||||
(defun erc-move-to-prompt-setup ()
|
||||
"Initialize the move-to-prompt module for XEmacs."
|
||||
(add-hook 'pre-command-hook 'erc-move-to-prompt nil t))
|
||||
|
||||
;;; Keep place in unvisited channels
|
||||
(define-erc-module keep-place nil
|
||||
"Leave point above un-viewed text in other channels."
|
||||
((add-hook 'erc-insert-pre-hook 'erc-keep-place))
|
||||
((remove-hook 'erc-insert-pre-hook 'erc-keep-place)))
|
||||
|
||||
(defun erc-keep-place (ignored)
|
||||
"Move point away from the last line in a non-selected ERC buffer."
|
||||
(when (and (not (eq (window-buffer (selected-window))
|
||||
(current-buffer)))
|
||||
(>= (point) erc-insert-marker))
|
||||
(deactivate-mark)
|
||||
(goto-char (erc-beg-of-input-line))
|
||||
(forward-line -1)))
|
||||
|
||||
;;; Distinguish non-commands
|
||||
(defvar erc-noncommands-list '(erc-cmd-ME
|
||||
erc-cmd-COUNTRY
|
||||
erc-cmd-SV
|
||||
|
@ -496,8 +543,19 @@ channel that has weird people talking in morse to each other.
|
|||
|
||||
See also `unmorse-region'."
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward "[.-]+\\([.-]+[/ ]\\)+[.-]+" nil t)
|
||||
(unmorse-region (match-beginning 0) (match-end 0))))
|
||||
(when (re-search-forward "[.-]+\\([.-]*/? *\\)+[.-]+/?" nil t)
|
||||
(save-restriction
|
||||
(narrow-to-region (match-beginning 0) (match-end 0))
|
||||
;; Turn " / " into " "
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward " / " nil t)
|
||||
(replace-match " "))
|
||||
;; Turn "/ " into "/"
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "/ " nil t)
|
||||
(replace-match "/"))
|
||||
;; Unmorse region
|
||||
(unmorse-region (point-min) (point-max)))))
|
||||
|
||||
;;; erc-occur
|
||||
(defun erc-occur (string &optional proc)
|
||||
|
|
227
lisp/erc/erc-list.el
Normal file
227
lisp/erc/erc-list.el
Normal file
|
@ -0,0 +1,227 @@
|
|||
;;; erc-list.el --- /list support for ERC
|
||||
|
||||
;; Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Tom Tromey <tromey@redhat.com>
|
||||
;; Version: 0.1
|
||||
;; Keywords: comm
|
||||
|
||||
;; This file is part of ERC.
|
||||
|
||||
;; ERC is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 3, or (at your option)
|
||||
;; any later version.
|
||||
|
||||
;; ERC is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with ERC; see the file COPYING. If not, write to the
|
||||
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
;; Boston, MA 02110-1301, USA.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This file provides nice support for /list in ERC.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'erc)
|
||||
|
||||
;; This is implicitly the width of the channel name column. Pick
|
||||
;; something small enough that the topic has a chance of being
|
||||
;; readable, but long enough that most channel names won't make for
|
||||
;; strange formatting.
|
||||
(defconst erc-list-nusers-column 25)
|
||||
|
||||
;; Width of the number-of-users column.
|
||||
(defconst erc-list-topic-column (+ erc-list-nusers-column 10))
|
||||
|
||||
;; The list buffer. This is buffer local in the server buffer.
|
||||
(defvar erc-list-buffer nil)
|
||||
|
||||
;; The argument to the last "/list". This is buffer local in the
|
||||
;; server buffer.
|
||||
(defvar erc-list-last-argument nil)
|
||||
|
||||
;; The server buffer corresponding to the list buffer. This is buffer
|
||||
;; local in the list buffer.
|
||||
(defvar erc-list-server-buffer nil)
|
||||
|
||||
;; Define module:
|
||||
;;;###autoload (autoload 'erc-list-mode "erc-list")
|
||||
(define-erc-module list nil
|
||||
"List channels nicely in a separate buffer."
|
||||
((remove-hook 'erc-server-321-functions 'erc-server-321-message)
|
||||
(remove-hook 'erc-server-322-functions 'erc-server-322-message))
|
||||
((erc-with-all-buffers-of-server nil
|
||||
#'erc-open-server-buffer-p
|
||||
(remove-hook 'erc-server-322-functions 'erc-list-handle-322 t))
|
||||
(add-hook 'erc-server-321-functions 'erc-server-321-message t)
|
||||
(add-hook 'erc-server-322-functions 'erc-server-322-message t)))
|
||||
|
||||
;; Format a record for display.
|
||||
(defun erc-list-make-string (channel users topic)
|
||||
(concat
|
||||
channel
|
||||
(erc-propertize " "
|
||||
'display (list 'space :align-to erc-list-nusers-column)
|
||||
'face 'fixed-pitch)
|
||||
users
|
||||
(erc-propertize " "
|
||||
'display (list 'space :align-to erc-list-topic-column)
|
||||
'face 'fixed-pitch)
|
||||
topic))
|
||||
|
||||
;; Insert a record into the list buffer.
|
||||
(defun erc-list-insert-item (channel users topic)
|
||||
(save-excursion
|
||||
(let ((buffer-read-only nil))
|
||||
(goto-char (point-max))
|
||||
(insert (erc-list-make-string channel users topic) "\n"))))
|
||||
|
||||
(defun erc-list-join ()
|
||||
"Join the irc channel named on this line."
|
||||
(interactive)
|
||||
(unless (eobp)
|
||||
(beginning-of-line)
|
||||
(unless (looking-at "\\([&#+!][^ \n]+\\)")
|
||||
(error "Not looking at channel name?"))
|
||||
(let ((chan (match-string 1)))
|
||||
(with-current-buffer erc-list-server-buffer
|
||||
(erc-join-channel chan)))))
|
||||
|
||||
(defun erc-list-kill ()
|
||||
"Kill the current ERC list buffer."
|
||||
(interactive)
|
||||
(kill-buffer (current-buffer)))
|
||||
|
||||
(defun erc-list-revert ()
|
||||
"Refresh the list of channels."
|
||||
(interactive)
|
||||
(with-current-buffer erc-list-server-buffer
|
||||
(erc-cmd-LIST erc-list-last-argument)))
|
||||
|
||||
(defun erc-list-menu-sort-by-column (&optional e)
|
||||
"Sort the channel list by the column clicked on."
|
||||
(interactive (list last-input-event))
|
||||
(if e (mouse-select-window e))
|
||||
(let* ((pos (event-start e))
|
||||
(obj (posn-object pos))
|
||||
(col (if obj
|
||||
(get-text-property (cdr obj) 'column-number (car obj))
|
||||
(get-text-property (posn-point pos) 'column-number))))
|
||||
(let ((buffer-read-only nil))
|
||||
(if (= col 1)
|
||||
(sort-fields col (point-min) (point-max))
|
||||
(sort-numeric-fields col (point-min) (point-max))))))
|
||||
|
||||
(defvar erc-list-menu-mode-map nil
|
||||
"Local keymap for `erc-list-mode' buffers.")
|
||||
|
||||
(unless erc-list-menu-mode-map
|
||||
(setq erc-list-menu-mode-map (make-keymap))
|
||||
(suppress-keymap erc-list-menu-mode-map)
|
||||
(define-key erc-list-menu-mode-map "k" 'erc-list-kill)
|
||||
(define-key erc-list-menu-mode-map "j" 'erc-list-join)
|
||||
(define-key erc-list-menu-mode-map "g" 'erc-list-revert)
|
||||
(define-key erc-list-menu-mode-map "n" 'next-line)
|
||||
(define-key erc-list-menu-mode-map "p" 'previous-line)
|
||||
(define-key erc-list-menu-mode-map "q" 'quit-window))
|
||||
|
||||
(defvar erc-list-menu-sort-button-map nil
|
||||
"Local keymap for ERC list menu mode sorting buttons.")
|
||||
|
||||
(unless erc-list-menu-sort-button-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key map [header-line mouse-1] 'erc-list-menu-sort-by-column)
|
||||
(define-key map [follow-link] 'mouse-face)
|
||||
(setq erc-list-menu-sort-button-map map)))
|
||||
|
||||
;; Helper function that makes a buttonized column header.
|
||||
(defun erc-list-button (title column)
|
||||
(erc-propertize title
|
||||
'column-number column
|
||||
'help-echo "mouse-1: sort by column"
|
||||
'mouse-face 'highlight
|
||||
'keymap erc-list-menu-sort-button-map))
|
||||
|
||||
(define-derived-mode erc-list-menu-mode nil "ERC-List"
|
||||
"Major mode for editing a list of irc channels."
|
||||
(setq header-line-format
|
||||
(concat
|
||||
(erc-propertize " "
|
||||
'display '(space :align-to 0)
|
||||
'face 'fixed-pitch)
|
||||
(erc-list-make-string (erc-list-button "Channel" 1)
|
||||
(erc-list-button "# Users" 2)
|
||||
"Topic")))
|
||||
(setq truncate-lines t))
|
||||
|
||||
(put 'erc-list-menu-mode 'mode-class 'special)
|
||||
|
||||
;; Handle a "322" response. This response tells us about a single
|
||||
;; channel.
|
||||
(defun erc-list-handle-322 (proc parsed)
|
||||
(let* ((args (cdr (erc-response.command-args parsed)))
|
||||
(channel (car args))
|
||||
(nusers (car (cdr args)))
|
||||
(topic (erc-response.contents parsed)))
|
||||
(when (buffer-live-p erc-list-buffer)
|
||||
(with-current-buffer erc-list-buffer
|
||||
(erc-list-insert-item channel nusers topic))))
|
||||
;; Don't let another hook run.
|
||||
t)
|
||||
|
||||
;; Helper function to install our 322 handler and make our buffer.
|
||||
(defun erc-list-install-322-handler (server-buffer)
|
||||
(with-current-buffer server-buffer
|
||||
;; Arrange for 322 responses to insert into our buffer.
|
||||
(add-hook 'erc-server-322-functions 'erc-list-handle-322 t t)
|
||||
;; Arrange for 323 (end of list) to end this.
|
||||
(erc-once-with-server-event
|
||||
323
|
||||
'(progn
|
||||
(remove-hook 'erc-server-322-functions 'erc-list-handle-322 t)))
|
||||
;; Find the list buffer, empty it, and display it.
|
||||
(set (make-local-variable 'erc-list-buffer)
|
||||
(get-buffer-create (concat "*Channels of "
|
||||
erc-server-announced-name
|
||||
"*")))
|
||||
(with-current-buffer erc-list-buffer
|
||||
(erc-list-menu-mode)
|
||||
(setq buffer-read-only nil)
|
||||
(erase-buffer)
|
||||
(set (make-local-variable 'erc-list-server-buffer) server-buffer)
|
||||
(setq buffer-read-only t))
|
||||
(pop-to-buffer erc-list-buffer))
|
||||
t)
|
||||
|
||||
;; The main entry point.
|
||||
(defun erc-cmd-LIST (&optional line)
|
||||
"Show a listing of channels on the current server in a separate window.
|
||||
|
||||
If LINE is specified, include it with the /LIST command. It
|
||||
should usually be one or more channels, separated by commas.
|
||||
|
||||
Please note that this function only works with IRC servers which conform
|
||||
to RFC and send the LIST header (#321) at start of list transmission."
|
||||
(erc-with-server-buffer
|
||||
(set (make-local-variable 'erc-list-last-argument) line)
|
||||
(erc-once-with-server-event
|
||||
321
|
||||
(list 'progn
|
||||
(list 'erc-list-install-322-handler (current-buffer)))))
|
||||
(erc-server-send (concat "LIST :" (or (and line (substring line 1))
|
||||
""))))
|
||||
(put 'erc-cmd-LIST 'do-not-parse-args t)
|
||||
|
||||
;;; erc-list.el ends here
|
||||
;;
|
||||
;; Local Variables:
|
||||
;; indent-tabs-mode: t
|
||||
;; tab-width: 8
|
||||
;; End:
|
|
@ -28,9 +28,7 @@
|
|||
;;
|
||||
;; Usage:
|
||||
;;
|
||||
;; Put into your .emacs:
|
||||
;;
|
||||
;; (require 'erc-networks)
|
||||
;; This is the "networks" module.
|
||||
;;
|
||||
;; M-x erc-server-select provides an alternative way to connect to servers by
|
||||
;; choosing networks.
|
||||
|
@ -351,6 +349,7 @@
|
|||
("Relicnet: Random server" Relicnet "irc.relic.net" 6667)
|
||||
("Rezosup: Random server" Rezosup "irc.rezosup.org" 6667)
|
||||
("Risanet: Random server" Risanet "irc.risanet.com" ((6667 6669)))
|
||||
("Rizon: Random server" Rizon "irc.rizon.net" (6633 (6660 6669) 6697 7000 8080 9999))
|
||||
("Rubiks: Random server" Rubiks "irc.rubiks.net" 6667)
|
||||
("Rusnet: EU, RU, Tomsk" Rusnet "irc.tsk.ru" ((6667 6669) (7770 7775) ))
|
||||
("Rusnet: EU, RU, Vladivostok" Rusnet "irc.vladivostok.ru" ((6667 6669) (7770 7775) ))
|
||||
|
@ -765,9 +764,14 @@ network as a symbol."
|
|||
(setq erc-network nil)
|
||||
nil)
|
||||
|
||||
(add-hook 'erc-server-375-functions 'erc-set-network-name)
|
||||
(add-hook 'erc-server-422-functions 'erc-set-network-name)
|
||||
(add-hook 'erc-disconnected-hook 'erc-unset-network-name)
|
||||
(define-erc-module networks nil
|
||||
"Provide data about IRC networks."
|
||||
((add-hook 'erc-server-375-functions 'erc-set-network-name)
|
||||
(add-hook 'erc-server-422-functions 'erc-set-network-name)
|
||||
(add-hook 'erc-disconnected-hook 'erc-unset-network-name))
|
||||
((remove-hook 'erc-server-375-functions 'erc-set-network-name)
|
||||
(remove-hook 'erc-server-422-functions 'erc-set-network-name)
|
||||
(remove-hook 'erc-disconnected-hook 'erc-unset-network-name)))
|
||||
|
||||
(defun erc-ports-list (ports)
|
||||
"Return a list of PORTS.
|
||||
|
|
|
@ -104,5 +104,11 @@ receive pages if `erc-page-mode' is on."
|
|||
|
||||
(provide 'erc-page)
|
||||
|
||||
;; arch-tag: 82fd2e0e-6060-4dd2-9788-8c1411e844de
|
||||
;;; erc-page.el ends here
|
||||
;;
|
||||
;; Local Variables:
|
||||
;; indent-tabs-mode: t
|
||||
;; tab-width: 8
|
||||
;; End:
|
||||
|
||||
;; arch-tag: 82fd2e0e-6060-4dd2-9788-8c1411e844de
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
;; erc-replace.el -- wash and massage messages inserted into the buffer
|
||||
|
||||
;; Copyright (C) 2001, 2002, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2001, 2002, 2004, 2006, 2007,
|
||||
;; 2008 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Andreas Fuchs <asf@void.at>
|
||||
;; Maintainer: Mario Lang (mlang@delysid.org)
|
||||
|
@ -88,5 +89,11 @@ It replaces text according to `erc-replace-alist'."
|
|||
|
||||
(provide 'erc-replace)
|
||||
|
||||
;; arch-tag: dd904a59-d8a6-47f8-ac3a-76b698289a18
|
||||
;;; erc-replace.el ends here
|
||||
;;
|
||||
;; Local Variables:
|
||||
;; indent-tabs-mode: t
|
||||
;; tab-width: 8
|
||||
;; End:
|
||||
|
||||
;; arch-tag: dd904a59-d8a6-47f8-ac3a-76b698289a18
|
||||
|
|
|
@ -123,6 +123,10 @@ You can also use M-x erc-nickserv-identify-mode to change modes."
|
|||
'(("autodetect") ("nick-change") ("both")) nil t))))
|
||||
(add-hook 'erc-server-NOTICE-functions
|
||||
'erc-nickserv-identification-autodetect)
|
||||
(unless erc-networks-mode
|
||||
;; Force-enable networks module, because we need it to set
|
||||
;; erc-network for us.
|
||||
(erc-networks-enable))
|
||||
(cond ((eq mode 'autodetect)
|
||||
(setq erc-nickserv-identify-mode 'autodetect)
|
||||
(add-hook 'erc-server-NOTICE-functions
|
||||
|
@ -187,6 +191,7 @@ Example of use:
|
|||
(const iip)
|
||||
(const OFTC)
|
||||
(const QuakeNet)
|
||||
(const Rizon)
|
||||
(const SlashNET)
|
||||
(symbol :tag "Network name"))
|
||||
(repeat :tag "Nickname and password"
|
||||
|
@ -256,6 +261,12 @@ Example of use:
|
|||
"NickServ"
|
||||
"IDENTIFY" nil nil
|
||||
"You\\s-are\\s-successfully\\s-identified\\s-as\\s-")
|
||||
(Rizon
|
||||
"NickServ!service@rizon.net"
|
||||
"This\\s-nickname\\s-is\\s-registered\\s-and\\s-protected."
|
||||
"NickServ"
|
||||
"IDENTIFY" nil nil
|
||||
"Password\\s-accepted\\s--\\s-you\\s-are\\s-now\\s-recognized.")
|
||||
(QuakeNet
|
||||
nil nil
|
||||
"Q@CServe.quakenet.org"
|
||||
|
|
|
@ -101,9 +101,13 @@ disconnected from `erc-modified-channels-alist'."
|
|||
:group 'erc-track
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom erc-track-exclude-types '("NICK")
|
||||
(defcustom erc-track-exclude-types '("NICK" "333" "353")
|
||||
"*List of message types to be ignored.
|
||||
This list could look like '(\"JOIN\" \"PART\")."
|
||||
This list could look like '(\"JOIN\" \"PART\").
|
||||
|
||||
By default, exclude changes of nicknames (NICK), display of who
|
||||
set the channel topic (333), and listing of users on the current
|
||||
channel (353)."
|
||||
:group 'erc-track
|
||||
:type 'erc-message-type)
|
||||
|
||||
|
@ -175,15 +179,32 @@ The faces used are the same as used for text in the buffers.
|
|||
:type 'boolean)
|
||||
|
||||
(defcustom erc-track-faces-priority-list
|
||||
'(erc-error-face erc-current-nick-face erc-keyword-face erc-pal-face
|
||||
erc-nick-msg-face erc-direct-msg-face erc-button erc-dangerous-host-face
|
||||
erc-default-face erc-action-face erc-nick-default-face erc-fool-face
|
||||
erc-notice-face erc-input-face erc-prompt-face)
|
||||
'(erc-error-face
|
||||
(erc-nick-default-face erc-current-nick-face)
|
||||
erc-current-nick-face
|
||||
erc-keyword-face
|
||||
(erc-nick-default-face erc-pal-face)
|
||||
erc-pal-face
|
||||
erc-nick-msg-face
|
||||
erc-direct-msg-face
|
||||
(erc-button erc-default-face)
|
||||
(erc-nick-default-face erc-dangerous-host-face)
|
||||
erc-dangerous-host-face
|
||||
erc-nick-default-face
|
||||
(erc-nick-default-face erc-default-face)
|
||||
erc-default-face
|
||||
erc-action-face
|
||||
(erc-nick-default-face erc-fool-face)
|
||||
erc-fool-face
|
||||
erc-notice-face
|
||||
erc-input-face
|
||||
erc-prompt-face)
|
||||
"A list of faces used to highlight active buffer names in the modeline.
|
||||
If a message contains one of the faces in this list, the buffer name will
|
||||
be highlighted using that face. The first matching face is used."
|
||||
:group 'erc-track
|
||||
:type '(repeat face))
|
||||
:type '(repeat (choice face
|
||||
(repeat :tag "Combination" face))))
|
||||
|
||||
(defcustom erc-track-priority-faces-only nil
|
||||
"Only track text highlighted with a priority face.
|
||||
|
@ -193,6 +214,7 @@ this variable. You can set a list of channel name strings, so those
|
|||
will be ignored while all other channels will be tracked as normal.
|
||||
Other options are 'all, to apply this to all channels or nil, to disable
|
||||
this feature.
|
||||
|
||||
Note: If you have a lot of faces listed in `erc-track-faces-priority-list',
|
||||
setting this variable might not be very useful."
|
||||
:group 'erc-track
|
||||
|
@ -200,17 +222,38 @@ setting this variable might not be very useful."
|
|||
(repeat string)
|
||||
(const all)))
|
||||
|
||||
(defcustom erc-track-faces-normal-list
|
||||
'((erc-button erc-default-face)
|
||||
(erc-nick-default-face erc-dangerous-host-face)
|
||||
erc-dangerous-host-face
|
||||
erc-nick-default-face
|
||||
(erc-nick-default-face erc-default-face)
|
||||
erc-default-face
|
||||
erc-action-face)
|
||||
"A list of faces considered to be part of normal conversations.
|
||||
This list is used to highlight active buffer names in the modeline.
|
||||
|
||||
If a message contains one of the faces in this list, and the
|
||||
previous modeline face for this buffer is also in this list, then
|
||||
the buffer name will be highlighted using the face from the
|
||||
message. This gives a rough indication that active conversations
|
||||
are occurring in these channels.
|
||||
|
||||
The effect may be disabled by setting this variable to nil."
|
||||
:group 'erc-track
|
||||
:type '(repeat (choice face
|
||||
(repeat :tag "Combination" face))))
|
||||
|
||||
(defcustom erc-track-position-in-mode-line 'before-modes
|
||||
"Where to show modified channel information in the mode-line.
|
||||
|
||||
Setting this variable only has effects in GNU Emacs versions above 21.3.
|
||||
|
||||
Choices are:
|
||||
'before-modes - add to the beginning of `mode-line-modes'
|
||||
'after-modes - add to the end of `mode-line-modes'
|
||||
t - add to the end of `global-mode-string'.
|
||||
nil - don't add to mode line
|
||||
"
|
||||
'before-modes - add to the beginning of `mode-line-modes',
|
||||
'after-modes - add to the end of `mode-line-modes',
|
||||
t - add to the end of `global-mode-string',
|
||||
nil - don't add to mode line."
|
||||
:group 'erc-track
|
||||
:type '(choice (const :tag "Just before mode information" before-modes)
|
||||
(const :tag "Just after mode information" after-modes)
|
||||
|
@ -443,7 +486,7 @@ START is the minimum length of the name used."
|
|||
|
||||
;;; Test:
|
||||
|
||||
(erc-assert
|
||||
(assert
|
||||
(and
|
||||
;; verify examples from the doc strings
|
||||
(equal (let ((erc-track-shorten-aggressively nil))
|
||||
|
@ -560,13 +603,15 @@ module, otherwise the keybindings will not do anything useful."
|
|||
:global t
|
||||
:group 'erc-track)
|
||||
|
||||
(defun erc-track-minor-mode-maybe ()
|
||||
(defun erc-track-minor-mode-maybe (&optional buffer)
|
||||
"Enable `erc-track-minor-mode', depending on `erc-track-enable-keybindings'."
|
||||
(unless (or erc-track-minor-mode
|
||||
;; don't start the minor mode until we have an ERC
|
||||
;; process running, because we don't want to prompt the
|
||||
;; user while starting Emacs
|
||||
(null (erc-buffer-list)))
|
||||
(when (and (not erc-track-minor-mode)
|
||||
;; don't start the minor mode until we have an ERC
|
||||
;; process running, because we don't want to prompt the
|
||||
;; user while starting Emacs
|
||||
(or (and (buffer-live-p buffer)
|
||||
(with-current-buffer buffer (eq major-mode 'erc-mode)))
|
||||
(erc-buffer-list)))
|
||||
(cond ((eq erc-track-enable-keybindings 'ask)
|
||||
(let ((key (or (and (key-binding (kbd "C-c C-SPC")) "C-SPC")
|
||||
(and (key-binding (kbd "C-c C-@")) "C-@"))))
|
||||
|
@ -616,6 +661,7 @@ module, otherwise the keybindings will not do anything useful."
|
|||
(add-hook 'erc-insert-post-hook 'erc-track-modified-channels)
|
||||
(add-hook 'erc-disconnected-hook 'erc-modified-channels-update))
|
||||
;; enable the tracking keybindings
|
||||
(add-hook 'erc-connect-pre-hook 'erc-track-minor-mode-maybe)
|
||||
(erc-track-minor-mode-maybe)))
|
||||
;; Disable:
|
||||
((when (boundp 'erc-track-when-inactive)
|
||||
|
@ -637,6 +683,7 @@ module, otherwise the keybindings will not do anything useful."
|
|||
(remove-hook 'erc-disconnected-hook 'erc-modified-channels-update)
|
||||
(remove-hook 'erc-insert-post-hook 'erc-track-modified-channels))
|
||||
;; disable the tracking keybindings
|
||||
(remove-hook 'erc-connect-pre-hook 'erc-track-minor-mode-maybe)
|
||||
(when erc-track-minor-mode
|
||||
(erc-track-minor-mode -1)))))
|
||||
|
||||
|
@ -821,15 +868,36 @@ Use `erc-make-mode-line-buffer-name' to create buttons."
|
|||
(defun erc-track-find-face (faces)
|
||||
"Return the face to use in the modeline from the faces in FACES.
|
||||
If `erc-track-faces-priority-list' is set, the one from FACES who is
|
||||
first in that list will be used."
|
||||
(let ((candidates erc-track-faces-priority-list)
|
||||
candidate face)
|
||||
(while (and candidates (not face))
|
||||
(setq candidate (car candidates)
|
||||
candidates (cdr candidates))
|
||||
(when (memq candidate faces)
|
||||
(setq face candidate)))
|
||||
face))
|
||||
first in that list will be used.
|
||||
|
||||
If `erc-track-faces-normal-list' is non-nil, use it to produce a
|
||||
blinking effect that indicates channel activity when the first
|
||||
element in FACES and the highest-ranking face among the rest of
|
||||
FACES are both members of `erc-track-faces-normal-list'.
|
||||
|
||||
If `erc-track-faces-priority-list' is not set, the first element
|
||||
in FACES will be used.
|
||||
|
||||
If one of the faces is a list, then it will be ranked according
|
||||
to its highest-tanking face member. A list of faces including
|
||||
that member will take priority over just the single member
|
||||
element."
|
||||
(let ((choice (catch 'face
|
||||
(dolist (candidate erc-track-faces-priority-list)
|
||||
(when (member candidate faces)
|
||||
(throw 'face candidate)))))
|
||||
(no-first (and erc-track-faces-normal-list
|
||||
(catch 'face
|
||||
(dolist (candidate erc-track-faces-priority-list)
|
||||
(when (member candidate (cdr faces))
|
||||
(throw 'face candidate)))))))
|
||||
(cond ((null choice)
|
||||
(car faces))
|
||||
((and (member choice erc-track-faces-normal-list)
|
||||
(member no-first erc-track-faces-normal-list))
|
||||
no-first)
|
||||
(t
|
||||
choice))))
|
||||
|
||||
(defun erc-track-modified-channels ()
|
||||
"Hook function for `erc-insert-post-hook' to check if the current
|
||||
|
@ -898,14 +966,15 @@ is in `erc-mode'."
|
|||
"Return a list of all faces used in STR."
|
||||
(let ((i 0)
|
||||
(m (length str))
|
||||
(faces (erc-list (get-text-property 0 'face str))))
|
||||
(faces (erc-list (get-text-property 0 'face str)))
|
||||
cur)
|
||||
(while (and (setq i (next-single-property-change i 'face str m))
|
||||
(not (= i m)))
|
||||
(dolist (face (erc-list (get-text-property i 'face str)))
|
||||
(add-to-list 'faces face)))
|
||||
(when (setq cur (get-text-property i 'face str))
|
||||
(add-to-list 'faces cur)))
|
||||
faces))
|
||||
|
||||
(erc-assert
|
||||
(assert
|
||||
(let ((str "is bold"))
|
||||
(put-text-property 3 (length str)
|
||||
'face '(bold erc-current-nick-face)
|
||||
|
@ -935,7 +1004,7 @@ higher number than any other face in that list."
|
|||
(let ((count 0))
|
||||
(catch 'done
|
||||
(dolist (item erc-track-faces-priority-list)
|
||||
(if (eq item face)
|
||||
(if (equal item face)
|
||||
(throw 'done t)
|
||||
(setq count (1+ count)))))
|
||||
count))
|
||||
|
|
|
@ -62,6 +62,11 @@ being evaluated and should return stings."
|
|||
:group 'erc-dcc
|
||||
:type '(repeat (repeat :tag "Message" (choice string sexp))))
|
||||
|
||||
;;;###autoload (autoload 'erc-xdcc-mode "erc-xdcc")
|
||||
(define-erc-module xdcc nil
|
||||
"Act as an XDCC file-server."
|
||||
nil nil)
|
||||
|
||||
;;;###autoload
|
||||
(defun erc-xdcc-add-file (file)
|
||||
"Add a file to `erc-xdcc-files'."
|
||||
|
@ -126,5 +131,11 @@ being evaluated and should return stings."
|
|||
|
||||
(provide 'erc-xdcc)
|
||||
|
||||
;; arch-tag: a13b62fe-2399-4562-af4e-f18a8dd4b9c8
|
||||
;;; erc-xdcc.el ends here
|
||||
;;
|
||||
;; Local Variables:
|
||||
;; indent-tabs-mode: t
|
||||
;; tab-width: 8
|
||||
;; End:
|
||||
|
||||
;; arch-tag: a13b62fe-2399-4562-af4e-f18a8dd4b9c8
|
||||
|
|
150
lisp/erc/erc.el
150
lisp/erc/erc.el
|
@ -66,7 +66,7 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(defconst erc-version-string "Version 5.3 (devel)"
|
||||
(defconst erc-version-string "Version 5.3 (RC 1)"
|
||||
"ERC version. This is used by function `erc-version'.")
|
||||
|
||||
(eval-when-compile (require 'cl))
|
||||
|
@ -1167,7 +1167,12 @@ This will only be used if `erc-header-line-face-method' is non-nil."
|
|||
See the variable `erc-command-indicator'."
|
||||
:group 'erc-faces)
|
||||
|
||||
(defface erc-notice-face '((t (:bold t :foreground "SlateBlue")))
|
||||
(defface erc-notice-face
|
||||
(if (featurep 'xemacs)
|
||||
'((t (:bold t :foreground "blue")))
|
||||
'((((class color) (min-colors 88))
|
||||
(:bold t :foreground "SlateBlue"))
|
||||
(t (:bold t :foreground "blue"))))
|
||||
"ERC face for notices."
|
||||
:group 'erc-faces)
|
||||
|
||||
|
@ -1465,18 +1470,23 @@ Turning on `erc-mode' runs the hook `erc-mode-hook'."
|
|||
"IRC port to use if it cannot be detected otherwise.")
|
||||
|
||||
(defcustom erc-join-buffer 'buffer
|
||||
"Determines how to display the newly created IRC buffer.
|
||||
'window - in another window,
|
||||
'window-noselect - in another window, but don't select that one,
|
||||
'frame - in another frame,
|
||||
'bury - bury it in a new buffer,
|
||||
any other value - in place of the current buffer."
|
||||
"Determines how to display a newly created IRC buffer.
|
||||
|
||||
The available choices are:
|
||||
|
||||
'window - in another window,
|
||||
'window-noselect - in another window, but don't select that one,
|
||||
'frame - in another frame,
|
||||
'bury - bury it in a new buffer,
|
||||
'buffer - in place of the current buffer,
|
||||
any other value - in place of the current buffer."
|
||||
:group 'erc-buffers
|
||||
:type '(choice (const window)
|
||||
(const window-noselect)
|
||||
(const frame)
|
||||
(const bury)
|
||||
(const buffer)))
|
||||
:type '(choice (const :tag "Split window and select" window)
|
||||
(const :tag "Split window, don't select" window-noselect)
|
||||
(const :tag "New frame" frame)
|
||||
(const :tag "Bury in new buffer" bury)
|
||||
(const :tag "Use current buffer" buffer)
|
||||
(const :tag "Use current buffer" t)))
|
||||
|
||||
(defcustom erc-frame-alist nil
|
||||
"*Alist of frame parameters for creating erc frames.
|
||||
|
@ -1804,8 +1814,8 @@ buffer rather than a server buffer.")
|
|||
mods))))
|
||||
|
||||
(defcustom erc-modules '(netsplit fill button match track completion readonly
|
||||
ring autojoin noncommands irccontrols
|
||||
stamp menu)
|
||||
networks ring autojoin noncommands irccontrols
|
||||
move-to-prompt stamp menu list)
|
||||
"A list of modules which ERC should enable.
|
||||
If you set the value of this without using `customize' remember to call
|
||||
\(erc-update-modules) after you change it. When using `customize', modules
|
||||
|
@ -1837,14 +1847,20 @@ removed from the list will be disabled."
|
|||
(const :tag "completion: Complete nicknames and commands (programmable)"
|
||||
completion)
|
||||
(const :tag "hecomplete: Complete nicknames and commands (old)" hecomplete)
|
||||
(const :tag "dcc: Provide Direct Client-to-Client support" dcc)
|
||||
(const :tag "fill: Wrap long lines" fill)
|
||||
(const :tag "identd: Launch an identd server on port 8113" identd)
|
||||
(const :tag "irccontrols: Highlight or remove IRC control characters"
|
||||
irccontrols)
|
||||
(const :tag "keep-place: Leave point above un-viewed text" keep-place)
|
||||
(const :tag "list: List channels in a separate buffer" list)
|
||||
(const :tag "log: Save buffers in logs" log)
|
||||
(const :tag "match: Highlight pals, fools, and other keywords" match)
|
||||
(const :tag "menu: Display a menu in ERC buffers" menu)
|
||||
(const :tag "move-to-prompt: Move to the prompt when typing text"
|
||||
move-to-prompt)
|
||||
(const :tag "netsplit: Detect netsplits" netsplit)
|
||||
(const :tag "networks: Provide data about IRC networks" networks)
|
||||
(const :tag "noncommands: Don't display non-IRC commands after evaluation"
|
||||
noncommands)
|
||||
(const :tag
|
||||
|
@ -1866,6 +1882,7 @@ removed from the list will be disabled."
|
|||
(const :tag "track: Track channel activity in the mode-line" track)
|
||||
(const :tag "truncate: Truncate buffers to a certain size" truncate)
|
||||
(const :tag "unmorse: Translate morse code in messages" unmorse)
|
||||
(const :tag "xdcc: Act as an XDCC file-server" xdcc)
|
||||
(repeat :tag "Others" :inline t symbol))
|
||||
:group 'erc)
|
||||
|
||||
|
@ -2324,6 +2341,15 @@ If ARG is non-nil, show the *erc-protocol* buffer."
|
|||
I.e. any char in it has the `invisible' property set."
|
||||
(text-property-any 0 (length string) 'invisible t string))
|
||||
|
||||
(defcustom erc-remove-parsed-property t
|
||||
"Whether to remove the erc-parsed text property after displaying a message.
|
||||
|
||||
The default is to remove it, since it causes ERC to take up extra
|
||||
memory. If you have code that relies on this property, then set
|
||||
this option to nil."
|
||||
:type 'boolean
|
||||
:group 'erc)
|
||||
|
||||
(defun erc-display-line-1 (string buffer)
|
||||
"Display STRING in `erc-mode' BUFFER.
|
||||
Auxiliary function used in `erc-display-line'. The line gets filtered to
|
||||
|
@ -2364,7 +2390,10 @@ If STRING is nil, the function does nothing."
|
|||
(save-restriction
|
||||
(narrow-to-region insert-position (point))
|
||||
(run-hooks 'erc-insert-modify-hook)
|
||||
(run-hooks 'erc-insert-post-hook))))))
|
||||
(run-hooks 'erc-insert-post-hook)
|
||||
(when erc-remove-parsed-property
|
||||
(remove-text-properties (point-min) (point-max)
|
||||
'(erc-parsed nil))))))))
|
||||
(erc-update-undo-list (- (or (marker-position erc-insert-marker)
|
||||
(point-max))
|
||||
insert-position))))))
|
||||
|
@ -3161,14 +3190,35 @@ just as you provided it. Use this command with care!"
|
|||
(t nil)))
|
||||
(put 'erc-cmd-QUOTE 'do-not-parse-args t)
|
||||
|
||||
(defcustom erc-query-display 'window
|
||||
"Indicates how to display query buffers when using the /QUERY
|
||||
command to talk to someone.
|
||||
|
||||
The default behavior is to display the message in a new window
|
||||
and bring it to the front. See the documentation for
|
||||
`erc-join-buffer' for a description of the available choices.
|
||||
|
||||
See also `erc-auto-query' to decide how private messages from
|
||||
other people should be displayed."
|
||||
:group 'erc-query
|
||||
:type '(choice (const :tag "Split window and select" window)
|
||||
(const :tag "Split window, don't select" window-noselect)
|
||||
(const :tag "New frame" frame)
|
||||
(const :tag "Bury in new buffer" bury)
|
||||
(const :tag "Use current buffer" buffer)
|
||||
(const :tag "Use current buffer" t)))
|
||||
|
||||
(defun erc-cmd-QUERY (&optional user)
|
||||
"Open a query with USER.
|
||||
The type of query window/frame/etc will depend on the value of
|
||||
`erc-join-buffer'. If USER is omitted, close the current query buffer if one
|
||||
exists - except this is broken now ;-)"
|
||||
`erc-query-display'.
|
||||
|
||||
If USER is omitted, close the current query buffer if one exists
|
||||
- except this is broken now ;-)"
|
||||
(interactive
|
||||
(list (read-from-minibuffer "Start a query with: " nil)))
|
||||
(let ((session-buffer (erc-server-buffer)))
|
||||
(let ((session-buffer (erc-server-buffer))
|
||||
(erc-join-buffer erc-query-display))
|
||||
(if user
|
||||
(erc-query user session-buffer)
|
||||
;; currently broken, evil hack to display help anyway
|
||||
|
@ -3707,8 +3757,9 @@ If `point' is at the beginning of a channel name, use that as default."
|
|||
(read-from-minibuffer
|
||||
(concat "Set topic of " (erc-default-target) ": ")
|
||||
(when erc-channel-topic
|
||||
(cons (apply 'concat (butlast (split-string erc-channel-topic "\C-o")))
|
||||
0)))))
|
||||
(let ((ss (split-string erc-channel-topic "\C-o")))
|
||||
(cons (apply 'concat (if (cdr ss) (butlast ss) ss))
|
||||
0))))))
|
||||
(let ((topic-list (split-string topic "\C-o"))) ; strip off the topic setter
|
||||
(erc-cmd-TOPIC (concat (erc-default-target) " " (car topic-list)))))
|
||||
|
||||
|
@ -3841,20 +3892,22 @@ To change how this query window is displayed, use `let' to bind
|
|||
(erc-update-mode-line)
|
||||
buf))
|
||||
|
||||
(defcustom erc-auto-query 'bury
|
||||
(defcustom erc-auto-query 'window-noselect
|
||||
"If non-nil, create a query buffer each time you receive a private message.
|
||||
If the buffer doesn't already exist, it is created.
|
||||
|
||||
If the buffer doesn't already exist it is created. This can be
|
||||
set to a symbol, to control how the new query window should
|
||||
appear. See the documentation for `erc-join-buffer' for
|
||||
available choices."
|
||||
This can be set to a symbol, to control how the new query window
|
||||
should appear. The default behavior is to display the buffer in
|
||||
a new window, but not to select it. See the documentation for
|
||||
`erc-join-buffer' for a description of the available choices."
|
||||
:group 'erc-query
|
||||
:type '(choice (const nil)
|
||||
(const buffer)
|
||||
(const window)
|
||||
(const window-noselect)
|
||||
(const bury)
|
||||
(const frame)))
|
||||
:type '(choice (const :tag "Don't create query window" nil)
|
||||
(const :tag "Split window and select" window)
|
||||
(const :tag "Split window, don't select" window-noselect)
|
||||
(const :tag "New frame" frame)
|
||||
(const :tag "Bury in new buffer" bury)
|
||||
(const :tag "Use current buffer" buffer)
|
||||
(const :tag "Use current buffer" t)))
|
||||
|
||||
(defcustom erc-query-on-unjoined-chan-privmsg t
|
||||
"If non-nil create query buffer on receiving any PRIVMSG at all.
|
||||
|
@ -5822,7 +5875,7 @@ See `current-time' for details on the time format."
|
|||
|
||||
;; Mode line handling
|
||||
|
||||
(defcustom erc-mode-line-format "%s %a"
|
||||
(defcustom erc-mode-line-format "%S %a"
|
||||
"A string to be formatted and shown in the mode-line in `erc-mode'.
|
||||
|
||||
The string is formatted using `format-spec' and the result is set as the value
|
||||
|
@ -5833,12 +5886,16 @@ The following characters are replaced:
|
|||
%l: The estimated lag time to the server
|
||||
%m: The modes of the channel
|
||||
%n: The current nick name
|
||||
%N: The name of the network
|
||||
%o: The topic of the channel
|
||||
%p: The session port
|
||||
%t: The name of the target (channel, nickname, or servername:port)
|
||||
%s: In the server-buffer, this gets filled with the value of
|
||||
`erc-server-announced-name', in a channel, the value of
|
||||
(erc-default-target) also get concatenated."
|
||||
(erc-default-target) also get concatenated.
|
||||
%S: In the server-buffer, this gets filled with the value of
|
||||
`erc-network', in a channel, the value of (erc-default-target)
|
||||
also get concatenated."
|
||||
:group 'erc-mode-line-and-header
|
||||
:type 'string)
|
||||
|
||||
|
@ -5932,6 +5989,29 @@ This should be a string with substitution variables recognized by
|
|||
(server-name server-name)
|
||||
(t (buffer-name (current-buffer))))))
|
||||
|
||||
(defun erc-format-network ()
|
||||
"Return the name of the network we are currently on."
|
||||
(let ((network (and (fboundp 'erc-network-name) (erc-network-name))))
|
||||
(if (and network (symbolp network))
|
||||
(symbol-name network)
|
||||
"")))
|
||||
|
||||
(defun erc-format-target-and/or-network ()
|
||||
"Return the network or the current target and network combined.
|
||||
If the name of the network is not available, then use the
|
||||
shortened server name instead."
|
||||
(let ((network-name (or (and (fboundp 'erc-network-name) (erc-network-name))
|
||||
(erc-shorten-server-name
|
||||
(or erc-server-announced-name
|
||||
erc-session-server)))))
|
||||
(when (and network-name (symbolp network-name))
|
||||
(setq network-name (symbol-name network-name)))
|
||||
(cond ((erc-default-target)
|
||||
(concat (erc-string-no-properties (erc-default-target))
|
||||
"@" network-name))
|
||||
(network-name network-name)
|
||||
(t (buffer-name (current-buffer))))))
|
||||
|
||||
(defun erc-format-away-status ()
|
||||
"Return a formatted `erc-mode-line-away-status-format'
|
||||
if `erc-away' is non-nil."
|
||||
|
@ -5975,9 +6055,11 @@ if `erc-away' is non-nil."
|
|||
?l (erc-format-lag-time)
|
||||
?m (erc-format-channel-modes)
|
||||
?n (or (erc-current-nick) "")
|
||||
?N (erc-format-network)
|
||||
?o (erc-controls-strip erc-channel-topic)
|
||||
?p (erc-port-to-string erc-session-port)
|
||||
?s (erc-format-target-and/or-server)
|
||||
?S (erc-format-target-and/or-network)
|
||||
?t (erc-format-target)))
|
||||
(process-status (cond ((and (erc-server-process-alive)
|
||||
(not erc-server-connected))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue