diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-11-15 18:14:44 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-11-15 18:14:44 +0100 |
commit | 966af419f98887673f37020ae5e05e5ce764006a (patch) | |
tree | fdbf01200b34ab1c6bc6d6f485e2e24687630932 | |
parent | 64ac3bb5b39f5028ac89bda5c8ab1c344a1fee71 (diff) | |
parent | 40f73953f661bec0e70d38d6e11f6d39c92504f8 (diff) | |
download | org-mode-966af419f98887673f37020ae5e05e5ce764006a.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/org-macs.el | 19 | ||||
-rw-r--r-- | testing/lisp/test-org-macs.el | 8 |
2 files changed, 16 insertions, 11 deletions
diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 1dae1e6..78dac9e 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -334,16 +334,15 @@ text properties." (value (if (stringp display) display (cl-some #'stringp display)))) (when value - (apply - #'propertize - ;; Displayed string could contain - ;; invisible parts, but no nested display. - (funcall prune-invisible value) - (plist-put props - 'display - (and (not (stringp display)) - (cl-remove-if #'stringp - display))))))))))) + (apply #'propertize + ;; Displayed string could contain + ;; invisible parts, but no nested + ;; display. + (funcall prune-invisible value) + 'display + (and (not (stringp display)) + (cl-remove-if #'stringp display)) + props)))))))) ;; `display' property overrides `invisible' one. So we first ;; replace characters with `display' property. Then we remove ;; invisible characters. diff --git a/testing/lisp/test-org-macs.el b/testing/lisp/test-org-macs.el index 438e871..5b5e0b6 100644 --- a/testing/lisp/test-org-macs.el +++ b/testing/lisp/test-org-macs.el @@ -70,7 +70,13 @@ (eq 'foo (get-text-property 1 'face (org-string-display - #("123" 1 2 (display "abc" face foo))))))) + #("123" 1 2 (display "abc" face foo)))))) + ;; Also preserve `display' property in original string. + (should + (equal "abc" + (let ((s #("123" 1 2 (display "abc" face foo)))) + (org-string-display s) + (get-text-property 1 'display s))))) ;;; Regexp |