diff options
| author | Lars Ingebrigtsen | 2021-11-24 19:38:41 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-11-24 19:38:41 +0100 |
| commit | fde9363a57d0d38d592122fe5ca01aaafd0afa52 (patch) | |
| tree | 0f80c2aa5effa3bea4248d6c5a741e23dc75b93b /test | |
| parent | 34f2878ce25a74c1283266b67575a56554684be5 (diff) | |
| download | emacs-fde9363a57d0d38d592122fe5ca01aaafd0afa52.tar.gz emacs-fde9363a57d0d38d592122fe5ca01aaafd0afa52.zip | |
Add new function 'add-display-text-property'
* doc/lispref/display.texi (Display Property): Document it.
* lisp/emacs-lisp/subr-x.el (add-display-text-property): New function.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/subr-x-tests.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el index f9cfea888c7..69d59e84f6d 100644 --- a/test/lisp/emacs-lisp/subr-x-tests.el +++ b/test/lisp/emacs-lisp/subr-x-tests.el | |||
| @@ -676,5 +676,23 @@ | |||
| 676 | (buffer-string)) | 676 | (buffer-string)) |
| 677 | "foo\n"))) | 677 | "foo\n"))) |
| 678 | 678 | ||
| 679 | (ert-deftest test-add-display-text-property () | ||
| 680 | (with-temp-buffer | ||
| 681 | (insert "Foo bar zot gazonk") | ||
| 682 | (add-display-text-property 4 8 'height 2.0) | ||
| 683 | (add-display-text-property 2 12 'raise 0.5) | ||
| 684 | (should (equal (get-text-property 2 'display) '(raise 0.5))) | ||
| 685 | (should (equal (get-text-property 5 'display) | ||
| 686 | '((raise 0.5) (height 2.0)))) | ||
| 687 | (should (equal (get-text-property 9 'display) '(raise 0.5)))) | ||
| 688 | (with-temp-buffer | ||
| 689 | (insert "Foo bar zot gazonk") | ||
| 690 | (put-text-property 4 8 'display [(height 2.0)]) | ||
| 691 | (add-display-text-property 2 12 'raise 0.5) | ||
| 692 | (should (equal (get-text-property 2 'display) '(raise 0.5))) | ||
| 693 | (should (equal (get-text-property 5 'display) | ||
| 694 | [(raise 0.5) (height 2.0)])) | ||
| 695 | (should (equal (get-text-property 9 'display) '(raise 0.5))))) | ||
| 696 | |||
| 679 | (provide 'subr-x-tests) | 697 | (provide 'subr-x-tests) |
| 680 | ;;; subr-x-tests.el ends here | 698 | ;;; subr-x-tests.el ends here |