+2006-08-06 Michael Olson <mwolson@gnu.org>
+
+ * erc.el (erc-arrange-session-in-multiple-windows): Fix bug with
+ multi-tty Emacs.
+
+2006-08-05 Michael Olson <mwolson@gnu.org>
+
+ * erc-log.el (erc-log-standardize-name): New function that returns
+ a filename that is safe for use for a log file.
+ (erc-current-logfile): Use it.
+
+ * erc.el (erc-startup-file-list): Search in ~/.emacs.d first,
+ since that is a fairly standard directory.
+ (erc-select-startup-file): Re-write to use
+ convert-standard-filename, which will ensure that MS-DOS systems
+ look for the _ercrc.el file.
+
2006-08-02 Michael Olson <mwolson@gnu.org>
* erc.el (erc-version-string): Release ERC 5.1.4.
;; markers.
;;; TODO:
-;; * Erc needs a generalised make-safe-file-name function, so that
-;; generated file names don't contain any invalid file characters.
;;
;; * Really, we need to lock the logfiles somehow, so that if a user
;; is running multiple emacsen and/or on the same channel as more
(funcall erc-enable-logging (or buffer (current-buffer)))
erc-enable-logging)))
+(defun erc-log-standardize-name (filename)
+ "Make FILENAME safe to use as the name of an ERC log.
+This will not work with full paths, only names.
+
+Any unsafe characters in the name are replaced with \"!\". The
+filename is downcased."
+ (downcase (erc-replace-regexp-in-string
+ "[/\\]" "!" (convert-standard-filename filename))))
+
(defun erc-current-logfile (&optional buffer)
"Return the logfile to use for BUFFER.
If BUFFER is nil, the value of `current-buffer' is used.
This is determined by `erc-generate-log-file-name-function'.
The result is converted to lowercase, as IRC is case-insensitive"
(expand-file-name
- (downcase (funcall erc-generate-log-file-name-function
- (or buffer (current-buffer))
- (or (erc-default-target) (buffer-name buffer))
- (erc-current-nick)
- erc-session-server erc-session-port))
+ (erc-log-standardize-name
+ (funcall erc-generate-log-file-name-function
+ (or buffer (current-buffer))
+ (or (erc-default-target) (buffer-name buffer))
+ (erc-current-nick)
+ erc-session-server erc-session-port))
erc-log-channels-directory))
(defun erc-generate-log-file-name-with-date (buffer &rest ignore)
;; Script parameters
(defcustom erc-startup-file-list
- '("~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
+ '("~/.emacs.d/.ercrc.el" "~/.emacs.d/.ercrc"
+ "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
"List of files to try for a startup script.
The first existent and readable one will get executed.
(defun erc-select-startup-file ()
"Select an ERC startup file.
See also `erc-startup-file-list'."
- (let ((l erc-startup-file-list)
- (f nil))
- (while (and (not f) l)
- (if (file-readable-p (car l))
- (setq f (car l)))
- (setq l (cdr l)))
- f))
+ (catch 'found
+ (dolist (f erc-startup-file-list)
+ (setq f (convert-standard-file-name f))
+ (when (file-readable-p f)
+ (throw 'found f)))))
(defun erc-find-script-file (file)
"Search for FILE in `default-directory', and any in `erc-script-path'."
(setq bufs (cdr bufs))
(while bufs
(split-window)
- (switch-to-buffer-other-window (car bufs))
+ (other-window 1)
+ (switch-to-buffer (car bufs))
(setq bufs (cdr bufs))
(balance-windows)))))