summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-log.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc/erc-log.el')
-rw-r--r--lisp/erc/erc-log.el25
1 files changed, 13 insertions, 12 deletions
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el
index 1dd2e0aba49..584f566f049 100644
--- a/lisp/erc/erc-log.el
+++ b/lisp/erc/erc-log.el
@@ -344,18 +344,19 @@ 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"
(unless buffer (setq buffer (current-buffer)))
- (let ((target (or (buffer-name buffer) (erc-default-target)))
- (nick (erc-current-nick))
- (server erc-session-server)
- (port erc-session-port))
- (expand-file-name
- (erc-log-standardize-name
- (funcall erc-generate-log-file-name-function
- buffer target nick server port))
- (if (functionp erc-log-channels-directory)
- (funcall erc-log-channels-directory
- buffer target nick server port)
- erc-log-channels-directory))))
+ (with-current-buffer buffer
+ (let ((target (or (buffer-name buffer) (erc-default-target)))
+ (nick (erc-current-nick))
+ (server erc-session-server)
+ (port erc-session-port))
+ (expand-file-name
+ (erc-log-standardize-name
+ (funcall erc-generate-log-file-name-function
+ buffer target nick server port))
+ (if (functionp erc-log-channels-directory)
+ (funcall erc-log-channels-directory
+ buffer target nick server port)
+ erc-log-channels-directory)))))
(defun erc-generate-log-file-name-with-date (buffer &rest ignore)
"This function computes a short log file name.