Subject: Re: bug#16145: ERC disregards data to be logged when reconnecting

From: Ivan Shmakov <[email-masked]>
Date: Sun, 05 Oct 2014 11:22:25 +0000

tag 16145 + patch
thanks

	I hereby suggest the patch MIMEd.  (In the same spirit as the
	one for Bug#18599.)

2014-10-05  Ivan Shmakov  <[email-masked]>

	* erc.el (erc-initialize-log-marker): Only initialize
	  erc-last-saved-position if not already a marker.  (Closes
	  #16145.)

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2052,9 +2052,10 @@ defun erc-initialize-log-marker (buffer)
   "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