aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKenichi Handa2012-02-02 09:30:09 +0900
committerKenichi Handa2012-02-02 09:30:09 +0900
commitd2a51fd7a1d5d3c8f661c2068120b60e84eca875 (patch)
treee2bb35b589f1f9948e9fafb64395a96e6f8ec754 /lisp
parentfce3fdeb947e51656675129592c8514be32b46bf (diff)
downloademacs-d2a51fd7a1d5d3c8f661c2068120b60e84eca875.tar.gz
emacs-d2a51fd7a1d5d3c8f661c2068120b60e84eca875.zip
Inhibit null-string composition component (Bug#6988).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/composite.el10
2 files changed, 12 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ad25d537f2b..2ee709f62b2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-02-01 Kenichi Handa <handa@m17n.org>
2
3 * composite.el (compose-region, compose-string): Signal error for
4 a null string component (Bug#6988).
5
12012-01-31 Chong Yidong <cyd@gnu.org> 62012-01-31 Chong Yidong <cyd@gnu.org>
2 7
3 * frame.el (set-frame-font): New arg ALL-FRAMES. 8 * frame.el (set-frame-font): New arg ALL-FRAMES.
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.
211If it is a character, it is an alternate character to display instead 211If it is a character, it is an alternate character to display instead
212of the text in the region. 212of the text in the region.
213 213
214If it is a string, the elements are alternate characters. In 214If it is a string, the elements are one or more alternate characters. In
215this case, TAB element has a special meaning. If the first 215this case, TAB element has a special meaning. If the first
216character is TAB, the glyphs are displayed with left padding space 216character is TAB, the glyphs are displayed with left padding space
217so that no pixel overlaps with the previous column. If the last 217so that no pixel overlaps with the previous column. If the last
@@ -234,7 +234,9 @@ text in the composition."
234 (let ((modified-p (buffer-modified-p)) 234 (let ((modified-p (buffer-modified-p))
235 (inhibit-read-only t)) 235 (inhibit-read-only t))
236 (if (or (vectorp components) (listp components)) 236 (if (or (vectorp components) (listp components))
237 (setq components (encode-composition-components components))) 237 (setq components (encode-composition-components components))
238 (if (= (length components) 0)
239 (error "Invalid composition component: %s" components)))
238 (compose-region-internal start end components modification-func) 240 (compose-region-internal start end components modification-func)
239 (restore-buffer-modified-p modified-p))) 241 (restore-buffer-modified-p modified-p)))
240 242
@@ -267,7 +269,9 @@ Optional 5th argument MODIFICATION-FUNC is a function to call to
267adjust the composition when it gets invalid because of a change of 269adjust the composition when it gets invalid because of a change of
268text in the composition." 270text in the composition."
269 (if (or (vectorp components) (listp components)) 271 (if (or (vectorp components) (listp components))
270 (setq components (encode-composition-components components))) 272 (setq components (encode-composition-components components))
273 (if (= (length components) 0)
274 (error "Invalid composition component: %s" components)))
271 (or start (setq start 0)) 275 (or start (setq start 0))
272 (or end (setq end (length string))) 276 (or end (setq end (length string)))
273 (compose-string-internal string start end components modification-func) 277 (compose-string-internal string start end components modification-func)