aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/erc
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/ChangeLog38
-rw-r--r--lisp/erc/erc-backend.el15
-rw-r--r--lisp/erc/erc-log.el22
-rw-r--r--lisp/erc/erc-match.el2
-rw-r--r--lisp/erc/erc.el39
5 files changed, 81 insertions, 35 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 0129bd43976..72754aa1cd3 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,41 @@
12006-08-13 Romain Francoise <romain@orebokech.com>
2
3 * erc-match.el (erc-log-matches-make-buffer): End `y-or-n-p'
4 prompt with a space.
5
62006-08-07 Michael Olson <mwolson@gnu.org>
7
8 * erc-backend.el (erc-process-sentinel-1): Use erc-display-message
9 in several places instead of inserting text.
10 (erc-process-sentinel): Move to the input-marker before removing
11 the prompt.
12
13 * erc.el (erc-port): Fix customization options.
14 (erc-display-message): Handle null type explicitly. Previously,
15 this was relying on a chance side-effect. Cosmetic indentation
16 tweak.
17 (english): Add 'finished and 'terminated entries to the catalog.
18 Add initial and terminal newlines to 'disconnected and
19 'disconnected-noreconnect entries. Avoid long lines.
20
212006-08-06 Michael Olson <mwolson@gnu.org>
22
23 * erc.el (erc-arrange-session-in-multiple-windows): Fix bug with
24 multi-tty Emacs.
25 (erc-select-startup-file): Fix bug introduced by recent change.
26
272006-08-05 Michael Olson <mwolson@gnu.org>
28
29 * erc-log.el (erc-log-standardize-name): New function that returns
30 a filename that is safe for use for a log file.
31 (erc-current-logfile): Use it.
32
33 * erc.el (erc-startup-file-list): Search in ~/.emacs.d first,
34 since that is a fairly standard directory.
35 (erc-select-startup-file): Re-write to use
36 convert-standard-filename, which will ensure that MS-DOS systems
37 look for the _ercrc.el file.
38
12006-08-02 Michael Olson <mwolson@gnu.org> 392006-08-02 Michael Olson <mwolson@gnu.org>
2 40
3 * erc.el (erc-version-string): Release ERC 5.1.4. 41 * erc.el (erc-version-string): Release ERC 5.1.4.
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 705ca7a9e63..5acbcb05ab8 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -493,11 +493,7 @@ action."
493 (if erc-server-quitting 493 (if erc-server-quitting
494 ;; normal quit 494 ;; normal quit
495 (progn 495 (progn
496 (let ((string "\n\n*** ERC finished ***\n") 496 (erc-display-message nil 'error (current-buffer) 'finished)
497 (inhibit-read-only t))
498 (erc-put-text-property 0 (length string)
499 'face 'erc-error-face string)
500 (insert string))
501 (when erc-kill-server-buffer-on-quit 497 (when erc-kill-server-buffer-on-quit
502 (set-buffer-modified-p nil) 498 (set-buffer-modified-p nil)
503 (kill-buffer (current-buffer)))) 499 (kill-buffer (current-buffer))))
@@ -519,12 +515,8 @@ action."
519 (erc erc-session-server erc-session-port erc-server-current-nick 515 (erc erc-session-server erc-session-port erc-server-current-nick
520 erc-session-user-full-name t erc-session-password) 516 erc-session-user-full-name t erc-session-password)
521 ;; terminate, do not reconnect 517 ;; terminate, do not reconnect
522 (let ((string (concat "\n\n*** ERC terminated: " event 518 (erc-display-message nil 'error (current-buffer)
523 "\n")) 519 'terminated ?e event))))
524 (inhibit-read-only t))
525 (erc-put-text-property 0 (length string)
526 'face 'erc-error-face string)
527 (insert string)))))
528 520
529(defun erc-process-sentinel (cproc event) 521(defun erc-process-sentinel (cproc event)
530 "Sentinel function for ERC process." 522 "Sentinel function for ERC process."
@@ -545,6 +537,7 @@ action."
545 (run-hook-with-args 'erc-disconnected-hook 537 (run-hook-with-args 'erc-disconnected-hook
546 (erc-current-nick) (system-name) "") 538 (erc-current-nick) (system-name) "")
547 ;; Remove the prompt 539 ;; Remove the prompt
540 (goto-char (or (marker-position erc-input-marker) (point-max)))
548 (forward-line 0) 541 (forward-line 0)
549 (erc-remove-text-properties-region (point) (point-max)) 542 (erc-remove-text-properties-region (point) (point-max))
550 (delete-region (point) (point-max)) 543 (delete-region (point) (point-max))
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el
index 418e45060bd..2fe29e82fe5 100644
--- a/lisp/erc/erc-log.el
+++ b/lisp/erc/erc-log.el
@@ -71,8 +71,6 @@
71;; markers. 71;; markers.
72 72
73;;; TODO: 73;;; TODO:
74;; * Erc needs a generalised make-safe-file-name function, so that
75;; generated file names don't contain any invalid file characters.
76;; 74;;
77;; * Really, we need to lock the logfiles somehow, so that if a user 75;; * Really, we need to lock the logfiles somehow, so that if a user
78;; is running multiple emacsen and/or on the same channel as more 76;; is running multiple emacsen and/or on the same channel as more
@@ -293,17 +291,27 @@ is writeable (it will be created as necessary) and
293 (funcall erc-enable-logging (or buffer (current-buffer))) 291 (funcall erc-enable-logging (or buffer (current-buffer)))
294 erc-enable-logging))) 292 erc-enable-logging)))
295 293
294(defun erc-log-standardize-name (filename)
295 "Make FILENAME safe to use as the name of an ERC log.
296This will not work with full paths, only names.
297
298Any unsafe characters in the name are replaced with \"!\". The
299filename is downcased."
300 (downcase (erc-replace-regexp-in-string
301 "[/\\]" "!" (convert-standard-filename filename))))
302
296(defun erc-current-logfile (&optional buffer) 303(defun erc-current-logfile (&optional buffer)
297 "Return the logfile to use for BUFFER. 304 "Return the logfile to use for BUFFER.
298If BUFFER is nil, the value of `current-buffer' is used. 305If BUFFER is nil, the value of `current-buffer' is used.
299This is determined by `erc-generate-log-file-name-function'. 306This is determined by `erc-generate-log-file-name-function'.
300The result is converted to lowercase, as IRC is case-insensitive" 307The result is converted to lowercase, as IRC is case-insensitive"
301 (expand-file-name 308 (expand-file-name
302 (downcase (funcall erc-generate-log-file-name-function 309 (erc-log-standardize-name
303 (or buffer (current-buffer)) 310 (funcall erc-generate-log-file-name-function
304 (or (erc-default-target) (buffer-name buffer)) 311 (or buffer (current-buffer))
305 (erc-current-nick) 312 (or (erc-default-target) (buffer-name buffer))
306 erc-session-server erc-session-port)) 313 (erc-current-nick)
314 erc-session-server erc-session-port))
307 erc-log-channels-directory)) 315 erc-log-channels-directory))
308 316
309(defun erc-generate-log-file-name-with-date (buffer &rest ignore) 317(defun erc-generate-log-file-name-with-date (buffer &rest ignore)
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index ffbc7482aae..b5dc913a8c4 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -566,7 +566,7 @@ deactivate/activate match logging in the latter. See
566 (unless buffer-already 566 (unless buffer-already
567 (insert " == Type \"q\" to dismiss messages ==\n") 567 (insert " == Type \"q\" to dismiss messages ==\n")
568 (erc-view-mode-enter nil (lambda (buffer) 568 (erc-view-mode-enter nil (lambda (buffer)
569 (when (y-or-n-p "Discard messages?") 569 (when (y-or-n-p "Discard messages? ")
570 (kill-buffer buffer))))) 570 (kill-buffer buffer)))))
571 buffer))) 571 buffer)))
572 572
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 4317b831d56..41d59576251 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -157,8 +157,8 @@ parameters and authentication."
157This can be either a string or a number." 157This can be either a string or a number."
158 :group 'erc 158 :group 'erc
159 :type '(choice (const :tag "None" nil) 159 :type '(choice (const :tag "None" nil)
160 (const :tag "Port number" number) 160 (integer :tag "Port number")
161 (const :tag "Port string" string))) 161 (string :tag "Port string")))
162 162
163(defcustom erc-nick nil 163(defcustom erc-nick nil
164 "Nickname to use if one is not provided. 164 "Nickname to use if one is not provided.
@@ -822,7 +822,8 @@ See `erc-server-flood-margin' for other flood-related parameters.")
822;; Script parameters 822;; Script parameters
823 823
824(defcustom erc-startup-file-list 824(defcustom erc-startup-file-list
825 '("~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc") 825 '("~/.emacs.d/.ercrc.el" "~/.emacs.d/.ercrc"
826 "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
826 "List of files to try for a startup script. 827 "List of files to try for a startup script.
827The first existent and readable one will get executed. 828The first existent and readable one will get executed.
828 829
@@ -2362,6 +2363,8 @@ See also `erc-format-message' and `erc-display-line'."
2362 msg))) 2363 msg)))
2363 (setq string 2364 (setq string
2364 (cond 2365 (cond
2366 ((null type)
2367 string)
2365 ((listp type) 2368 ((listp type)
2366 (mapc (lambda (type) 2369 (mapc (lambda (type)
2367 (setq string 2370 (setq string
@@ -2374,7 +2377,7 @@ See also `erc-format-message' and `erc-display-line'."
2374 (if (not (erc-response-p parsed)) 2377 (if (not (erc-response-p parsed))
2375 (erc-display-line string buffer) 2378 (erc-display-line string buffer)
2376 (unless (member (erc-response.command parsed) erc-hide-list) 2379 (unless (member (erc-response.command parsed) erc-hide-list)
2377 (erc-put-text-property 0 (length string) 'erc-parsed parsed string) 2380 (erc-put-text-property 0 (length string) 'erc-parsed parsed string)
2378 (erc-put-text-property 0 (length string) 'rear-sticky t string) 2381 (erc-put-text-property 0 (length string) 'rear-sticky t string)
2379 (erc-display-line string buffer))))) 2382 (erc-display-line string buffer)))))
2380 2383
@@ -5241,13 +5244,11 @@ If FILE is found, return the path to it."
5241(defun erc-select-startup-file () 5244(defun erc-select-startup-file ()
5242 "Select an ERC startup file. 5245 "Select an ERC startup file.
5243See also `erc-startup-file-list'." 5246See also `erc-startup-file-list'."
5244 (let ((l erc-startup-file-list) 5247 (catch 'found
5245 (f nil)) 5248 (dolist (f erc-startup-file-list)
5246 (while (and (not f) l) 5249 (setq f (convert-standard-filename f))
5247 (if (file-readable-p (car l)) 5250 (when (file-readable-p f)
5248 (setq f (car l))) 5251 (throw 'found f)))))
5249 (setq l (cdr l)))
5250 f))
5251 5252
5252(defun erc-find-script-file (file) 5253(defun erc-find-script-file (file)
5253 "Search for FILE in `default-directory', and any in `erc-script-path'." 5254 "Search for FILE in `default-directory', and any in `erc-script-path'."
@@ -5894,7 +5895,8 @@ All windows are opened in the current frame."
5894 (setq bufs (cdr bufs)) 5895 (setq bufs (cdr bufs))
5895 (while bufs 5896 (while bufs
5896 (split-window) 5897 (split-window)
5897 (switch-to-buffer-other-window (car bufs)) 5898 (other-window 1)
5899 (switch-to-buffer (car bufs))
5898 (setq bufs (cdr bufs)) 5900 (setq bufs (cdr bufs))
5899 (balance-windows))))) 5901 (balance-windows)))))
5900 5902
@@ -5946,12 +5948,17 @@ All windows are opened in the current frame."
5946 (ctcp-request-to . "==> CTCP request from %n (%u@%h) to %t: %r") 5948 (ctcp-request-to . "==> CTCP request from %n (%u@%h) to %t: %r")
5947 (ctcp-too-many . "Too many CTCP queries in single message. Ignoring") 5949 (ctcp-too-many . "Too many CTCP queries in single message. Ignoring")
5948 (flood-ctcp-off . "FLOOD PROTECTION: Automatic CTCP responses turned off.") 5950 (flood-ctcp-off . "FLOOD PROTECTION: Automatic CTCP responses turned off.")
5949 (flood-strict-mode . "FLOOD PROTECTION: Switched to Strict Flood Control mode.") 5951 (flood-strict-mode
5950 (disconnected . "Connection failed! Re-establishing connection...") 5952 . "FLOOD PROTECTION: Switched to Strict Flood Control mode.")
5951 (disconnected-noreconnect . "Connection failed! Not re-establishing connection.") 5953 (disconnected . "\n\nConnection failed! Re-establishing connection...\n")
5954 (disconnected-noreconnect
5955 . "\n\nConnection failed! Not re-establishing connection.\n")
5956 (finished . "\n\n*** ERC finished ***\n")
5957 (terminated . "\n\n*** ERC terminated: %e\n")
5952 (login . "Logging in as \'%n\'...") 5958 (login . "Logging in as \'%n\'...")
5953 (nick-in-use . "%n is in use. Choose new nickname: ") 5959 (nick-in-use . "%n is in use. Choose new nickname: ")
5954 (nick-too-long . "WARNING: Nick length (%i) exceeds max NICKLEN(%l) defined by server") 5960 (nick-too-long
5961 . "WARNING: Nick length (%i) exceeds max NICKLEN(%l) defined by server")
5955 (no-default-channel . "No default channel") 5962 (no-default-channel . "No default channel")
5956 (no-invitation . "You've got no invitation") 5963 (no-invitation . "You've got no invitation")
5957 (no-target . "No target") 5964 (no-target . "No target")