[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] stream 8d3eb02 1/4: * lisp/emacs-lisp/stream.el: Fix strea
From: |
Nicolas Petton |
Subject: |
[Emacs-diffs] stream 8d3eb02 1/4: * lisp/emacs-lisp/stream.el: Fix stream-buffer initial position |
Date: |
Fri, 14 Aug 2015 20:31:25 +0000 |
branch: stream
commit 8d3eb023633fd4f4131ef34ba9266daa3f05cfe4
Author: Nicolas Petton <address@hidden>
Commit: Nicolas Petton <address@hidden>
* lisp/emacs-lisp/stream.el: Fix stream-buffer initial position
---
lisp/emacs-lisp/stream.el | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lisp/emacs-lisp/stream.el b/lisp/emacs-lisp/stream.el
index eed436a..d5a5c90 100644
--- a/lisp/emacs-lisp/stream.el
+++ b/lisp/emacs-lisp/stream.el
@@ -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