]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/stream.el: Fix stream-buffer initial position
authorNicolas Petton <nicolas@petton.fr>
Fri, 14 Aug 2015 13:43:48 +0000 (15:43 +0200)
committerNicolas Petton <nicolas@petton.fr>
Fri, 14 Aug 2015 13:43:48 +0000 (15:43 +0200)
lisp/emacs-lisp/stream.el

index eed436a58b48e393683346139342a21807e1cc28..d5a5c9013c3497fe0a15c824fdea5f90855f2659 100644 (file)
@@ -210,13 +210,15 @@ SEQ can be a list, vector or string."
      (car list)
      (stream-list (cdr list)))))
 
+
 (defun stream-buffer (buffer-or-name &optional pos)
   "Return a stream of the characters of the buffer BUFFER-OR-NAME.
 BUFFER-OR-NAME may be a buffer or a string (buffer name).
 The sequence starts at POS if non-nil, 1 otherwise."
-  (unless pos (setq pos 1))
-  (if (>= pos (point-max))
-      (stream-empty)
+  (with-current-buffer buffer-or-name
+    (unless pos (setq pos (point-min)))
+    (if (>= pos (point-max))
+        (stream-empty))
     (stream-cons
      (with-current-buffer buffer-or-name
        (save-excursion