aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-01-07 15:54:53 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-01-07 15:54:53 -0200
commitdc98b2bd2a7b805e5d3c8a410bcaf137cd4cf78a (patch)
tree0e7e7a411024bd69ee9f1e7233c6d68f02f10094
parentc46dd1cde6d8428a73be0f2e6918b701af541004 (diff)
sx-format-replacements: Fix propertizing
-rw-r--r--sx.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/sx.el b/sx.el
index 4159933..d67771b 100644
--- a/sx.el
+++ b/sx.el
@@ -364,10 +364,10 @@ if ALIST contains a different string at the ?% entry."
(unless val
(error "Invalid format character: `%%%c'" char))
;; Insert first, to preserve text properties.
- (insert-and-inherit
- (apply #'propertize
- (format (concat "%" flag "s") val)
- (cdr-safe (assq char property-alist))))
+ (insert-and-inherit (format (concat "%" flag "s") val))
+ (when property-alist
+ (add-text-properties (match-end 0) (point)
+ (cdr-safe (assq char property-alist))))
;; Delete the specifier body.
(delete-region (match-beginning 0)
(match-end 0))