diff options
| author | Lars Ingebrigtsen | 2021-11-24 11:55:53 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-11-24 11:55:58 +0100 |
| commit | a13b437c81f1f2e54555e7281480ea7e8eee8753 (patch) | |
| tree | 602c0751912e81fef3113bd47720bdad4d649e9e /test/src | |
| parent | 8efee422e1915a000f7220e680e3165407171388 (diff) | |
| download | emacs-a13b437c81f1f2e54555e7281480ea7e8eee8753.tar.gz emacs-a13b437c81f1f2e54555e7281480ea7e8eee8753.zip | |
Add support for the min-width display property
* doc/lispref/display.texi (Display Property): Document
get-display-property.
(Other Display Specs): Document min-width property.
* src/dispextern.h (struct it): Add fields for min-width handling.
* src/xdisp.c (find_display_property, get_display_property): New
helper functions.
(display_min_width): Insert stretch glyphs based on the min width.
(Fget_display_property): New defun.
(handle_display_prop): Handle min-width ends.
(handle_single_display_spec): Handle min-width starts.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/xdisp-tests.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/src/xdisp-tests.el b/test/src/xdisp-tests.el index cc67aef8e15..ae4aacd9c7c 100644 --- a/test/src/xdisp-tests.el +++ b/test/src/xdisp-tests.el | |||
| @@ -154,4 +154,20 @@ int main () { | |||
| 154 | nil) | 154 | nil) |
| 155 | 138)))) | 155 | 138)))) |
| 156 | 156 | ||
| 157 | (ert-deftest test-get-display-property () | ||
| 158 | (with-temp-buffer | ||
| 159 | (insert (propertize "foo" 'face 'bold 'display '(height 2.0))) | ||
| 160 | (should (equal (get-display-property 2 'height) 2.0))) | ||
| 161 | (with-temp-buffer | ||
| 162 | (insert (propertize "foo" 'face 'bold 'display '((height 2.0) | ||
| 163 | (space-width 2.0)))) | ||
| 164 | (should (equal (get-display-property 2 'height) 2.0)) | ||
| 165 | (should (equal (get-display-property 2 'space-width) 2.0))) | ||
| 166 | (with-temp-buffer | ||
| 167 | (insert (propertize "foo bar" 'face 'bold | ||
| 168 | 'display '[(height 2.0) | ||
| 169 | (space-width 20)])) | ||
| 170 | (should (equal (get-display-property 2 'height) 2.0)) | ||
| 171 | (should (equal (get-display-property 2 'space-width) 20)))) | ||
| 172 | |||
| 157 | ;;; xdisp-tests.el ends here | 173 | ;;; xdisp-tests.el ends here |