From 43f52995ea9d4846c84f81d64107314a6577e595 Mon Sep 17 00:00:00 2001 From: Ivan Shmakov Date: Fri, 10 Oct 2014 09:16:12 -0400 Subject: [PATCH] Only initialize erc-last-saved-position if not already a marker. Fixes: debbugs:16145 --- lisp/erc/ChangeLog | 5 +++++ lisp/erc/erc.el | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index fd8f83bd78b..0833bda4cb1 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,8 @@ +2014-10-10 Kelvin White + + * erc.el (erc-initialize-log-marker): Only initialize + erc-last-saved-position if not already a marker. + 2014-10-04 Stefan Monnier * erc.el (erc-channel-receive-names): Silence compiler warning. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 2fd41a34ad4..1e81929d802 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2057,9 +2057,10 @@ Returns the buffer for the given server or channel." "Initialize the `erc-last-saved-position' marker to a sensible position. BUFFER is the current buffer." (with-current-buffer buffer - (setq erc-last-saved-position (make-marker)) - (move-marker erc-last-saved-position - (1- (marker-position erc-insert-marker))))) + (unless (markerp erc-last-saved-position) + (setq erc-last-saved-position (make-marker)) + (move-marker erc-last-saved-position + (1- (marker-position erc-insert-marker))))) ;; interactive startup -- 2.39.5