diff options
author | Wilfred Hughes <me@wilfred.me.uk> | 2016-07-10 21:31:51 +0100 |
---|---|---|
committer | Wilfred Hughes <me@wilfred.me.uk> | 2016-07-10 21:32:41 +0100 |
commit | fa79465d5e21ecf5c9e85d6886123aafa513fffd (patch) | |
tree | 0f448bbe853d2020609720f092a6140cbe73534a /s.el | |
parent | 2184337a132944f669144d0078d1fa1220012840 (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.el | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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." |