diff options
author | Kenichi Handa <handa@m17n.org> | 2012-02-02 09:30:09 +0900 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2012-02-02 09:30:09 +0900 |
commit | d2a51fd7a1d5d3c8f661c2068120b60e84eca875 (patch) | |
tree | e2bb35b589f1f9948e9fafb64395a96e6f8ec754 /lisp/composite.el | |
parent | fce3fdeb947e51656675129592c8514be32b46bf (diff) | |
download | emacs-d2a51fd7a1d5d3c8f661c2068120b60e84eca875.tar.gz |
Inhibit null-string composition component (Bug#6988).
Diffstat (limited to 'lisp/composite.el')
-rw-r--r-- | lisp/composite.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/composite.el b/lisp/composite.el index 72317ac470e..739ec8bbcbd 100644 --- a/lisp/composite.el +++ b/lisp/composite.el @@ -211,7 +211,7 @@ or a vector or list of integers and rules. If it is a character, it is an alternate character to display instead of the text in the region. -If it is a string, the elements are alternate characters. In +If it is a string, the elements are one or more alternate characters. In this case, TAB element has a special meaning. If the first character is TAB, the glyphs are displayed with left padding space so that no pixel overlaps with the previous column. If the last @@ -234,7 +234,9 @@ text in the composition." (let ((modified-p (buffer-modified-p)) (inhibit-read-only t)) (if (or (vectorp components) (listp components)) - (setq components (encode-composition-components components))) + (setq components (encode-composition-components components)) + (if (= (length components) 0) + (error "Invalid composition component: %s" components))) (compose-region-internal start end components modification-func) (restore-buffer-modified-p modified-p))) @@ -267,7 +269,9 @@ Optional 5th argument MODIFICATION-FUNC is a function to call to adjust the composition when it gets invalid because of a change of text in the composition." (if (or (vectorp components) (listp components)) - (setq components (encode-composition-components components))) + (setq components (encode-composition-components components)) + (if (= (length components) 0) + (error "Invalid composition component: %s" components))) (or start (setq start 0)) (or end (setq end (length string))) (compose-string-internal string start end components modification-func) |