diff options
author | David Edmondson <dme@dme.org> | 2012-01-26 07:19:37 +0000 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-01-26 08:35:02 -0400 |
commit | c70c7f86b83601231bac94db8a6596a1d729ae24 (patch) | |
tree | 31f717961359ebd87e9d08483d59f3408c0c758d /test | |
parent | d0a048f8561f63de5e30cb23dec6b6facb79c851 (diff) |
test: `visible-buffer-substring' should not return text properties.
When using `visible-buffer-substring' to examine a buffer, the text
properties are not useful, so don't include them.
Diffstat (limited to 'test')
-rw-r--r-- | test/test-lib.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/test-lib.el b/test/test-lib.el index bc75f06e..5b32e0ab 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -51,16 +51,19 @@ FILENAME is OUTPUT." (with-temp-file (or filename "OUTPUT") (insert text)))) (defun visible-buffer-string () - "Same as `buffer-string', but excludes invisible text." + "Same as `buffer-string', but excludes invisible text and +removes any text properties." (visible-buffer-substring (point-min) (point-max))) (defun visible-buffer-substring (start end) - "Same as `buffer-substring', but excludes invisible text." + "Same as `buffer-substring-no-properties', but excludes +invisible text." (let (str) (while (< start end) (let ((next-pos (next-char-property-change start end))) (when (not (invisible-p start)) - (setq str (concat str (buffer-substring start next-pos)))) + (setq str (concat str (buffer-substring-no-properties + start next-pos)))) (setq start next-pos))) str)) |