summaryrefslogtreecommitdiff
path: root/s.el
diff options
context:
space:
mode:
authorWilfred Hughes <me@wilfred.me.uk>2016-07-10 21:31:51 +0100
committerWilfred Hughes <me@wilfred.me.uk>2016-07-10 21:32:41 +0100
commitfa79465d5e21ecf5c9e85d6886123aafa513fffd (patch)
tree0f448bbe853d2020609720f092a6140cbe73534a /s.el
parent2184337a132944f669144d0078d1fa1220012840 (diff)
Preserve text properties.
If we're given a string with properties, ensure the output has the same properties.
Diffstat (limited to 's.el')
-rw-r--r--s.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/s.el b/s.el
index 7cb00f0..efd9a54 100644
--- a/s.el
+++ b/s.el
@@ -70,13 +70,13 @@ See also `s-split'."
(setq op (goto-char (point-min)))
(while (and (re-search-forward separator nil t)
(< 0 n))
- (let ((sub (buffer-substring-no-properties op (match-beginning 0))))
+ (let ((sub (buffer-substring op (match-beginning 0))))
(unless (and omit-nulls
(equal sub ""))
(push sub r)))
(setq op (goto-char (match-end 0)))
(setq n (1- n)))
- (let ((sub (buffer-substring-no-properties op (point-max))))
+ (let ((sub (buffer-substring op (point-max))))
(unless (and omit-nulls
(equal sub ""))
(push sub r))))
@@ -184,7 +184,7 @@ See also `s-split'."
(insert s)
(let ((fill-column len))
(fill-region (point-min) (point-max)))
- (buffer-substring-no-properties (point-min) (point-max))))
+ (buffer-substring (point-min) (point-max))))
(defun s-center (len s)
"If S is shorter than LEN, pad it with spaces so it is centered."