aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/composite.el25
1 files changed, 10 insertions, 15 deletions
diff --git a/lisp/composite.el b/lisp/composite.el
index 6df3b690071..3db2ff09644 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -40,8 +40,7 @@
40 (mid-left . 3) (mid-center . 10) (mid-right . 5)) 40 (mid-left . 3) (mid-center . 10) (mid-right . 5))
41 "Alist of symbols vs integer codes of glyph reference points. 41 "Alist of symbols vs integer codes of glyph reference points.
42A glyph reference point symbol is to be used to specify a composition 42A glyph reference point symbol is to be used to specify a composition
43rule in COMPONENTS argument to such functions as `compose-region' and 43rule in COMPONENTS argument to such functions as `compose-region'.
44`make-composition'.
45 44
46Meanings of glyph reference point codes are as follows: 45Meanings of glyph reference point codes are as follows:
47 46
@@ -164,9 +163,9 @@ When called from a program, expects these four arguments.
164First two arguments START and END are positions (integers or markers) 163First two arguments START and END are positions (integers or markers)
165specifying the region. 164specifying the region.
166 165
167Optional 3rd argument COMPONENTS, if non-nil, is a character or a 166Optional 3rd argument COMPONENTS, if non-nil, is a character, a string
168sequence (vector, list, or string) of integers. In this case, 167Optional 3rd argument COMPONENTS, if non-nil, is a character, a string
169characters are composed not relatively but according to COMPONENTS. 168or a vector or list of integers and rules.
170 169
171If it is a character, it is an alternate character to display instead 170If it is a character, it is an alternate character to display instead
172of the text in the region. 171of the text in the region.
@@ -315,7 +314,7 @@ is:
315Optional 2nd arg LIMIT, if non-nil, limits the matching of text. 314Optional 2nd arg LIMIT, if non-nil, limits the matching of text.
316 315
317Optional 3rd arg OBJECT, if non-nil, is a string that contains the 316Optional 3rd arg OBJECT, if non-nil, is a string that contains the
318text to compose. In that case, POS and LIMIT index to the string. 317text to compose. In that case, POS and LIMIT index into the string.
319 318
320This function is the default value of `compose-chars-after-function'." 319This function is the default value of `compose-chars-after-function'."
321 (let ((tail (aref composition-function-table (char-after pos))) 320 (let ((tail (aref composition-function-table (char-after pos)))
@@ -373,7 +372,7 @@ If STRING is nil, POS is a position in the current buffer, and the
373function has to compose a character at POS with surrounding characters 372function has to compose a character at POS with surrounding characters
374in the current buffer. 373in the current buffer.
375 374
376Otherwise, STRING is a string, and POS is an index to the string. In 375Otherwise, STRING is a string, and POS is an index into the string. In
377this case, the function has to compose a character at POS with 376this case, the function has to compose a character at POS with
378surrounding characters in the string. 377surrounding characters in the string.
379 378
@@ -381,10 +380,6 @@ See also the command `toggle-auto-composition'.")
381 380
382;; Copied from font-lock.el. 381;; Copied from font-lock.el.
383(eval-when-compile 382(eval-when-compile
384 ;;
385 ;; We don't do this at the top-level as we only use non-autoloaded macros.
386 (require 'cl)
387 ;;
388 ;; Borrowed from lazy-lock.el. 383 ;; Borrowed from lazy-lock.el.
389 ;; We use this to preserve or protect things when modifying text properties. 384 ;; We use this to preserve or protect things when modifying text properties.
390 (defmacro save-buffer-state (varlist &rest body) 385 (defmacro save-buffer-state (varlist &rest body)
@@ -398,17 +393,17 @@ See also the command `toggle-auto-composition'.")
398 (unless modified 393 (unless modified
399 (restore-buffer-modified-p nil)))) 394 (restore-buffer-modified-p nil))))
400 (put 'save-buffer-state 'lisp-indent-function 1) 395 (put 'save-buffer-state 'lisp-indent-function 1)
401 ;; Fixme: This makes bootstrapping fails by this error. 396 ;; Fixme: This makes bootstrapping fail with this error.
402 ;; Symbol's function definition is void: eval-defun 397 ;; Symbol's function definition is void: eval-defun
403 ;;(def-edebug-spec save-buffer-state let) 398 ;;(def-edebug-spec save-buffer-state let)
404 ) 399 )
405 400
406(defvar auto-composition-chunk-size 500 401(defvar auto-composition-chunk-size 500
407 "*Automatic composition chunks of this many characters, or smaller.") 402 "*Automatic composition uses chunks of this many characters, or smaller.")
408 403
409(defun auto-compose-chars (pos string) 404(defun auto-compose-chars (pos string)
410 "Compose characters after the buffer position POS. 405 "Compose characters after the buffer position POS.
411If STRING is non-nil, it is a string, and POS is an index to the string. 406If STRING is non-nil, it is a string, and POS is an index into the string.
412In that case, compose characters in the string. 407In that case, compose characters in the string.
413 408
414This function is the default value of `auto-composition-function' (which see)." 409This function is the default value of `auto-composition-function' (which see)."
@@ -430,7 +425,7 @@ This function is the default value of `auto-composition-function' (which see)."
430 (or (< pos limit) 425 (or (< pos limit)
431 (/= ch ?\n))) 426 (/= ch ?\n)))
432 (setq func (aref composition-function-table ch)) 427 (setq func (aref composition-function-table ch))
433 (if (fboundp func) 428 (if (functionp func)
434 (setq newpos (funcall func pos string) 429 (setq newpos (funcall func pos string)
435 pos (if (and (integerp newpos) (> newpos pos)) 430 pos (if (and (integerp newpos) (> newpos pos))
436 newpos 431 newpos