]> code.delx.au - gnu-emacs/blobdiff - lisp/composite.el
(c-mode-abbrev-table, c++-mode-abbrev-table, objc-mode-abbrev-table)
[gnu-emacs] / lisp / composite.el
index 102f962151a6672498b604c3a4d14fe7902ce1e3..610ec227a60fc39642cb7d7b5a990fadf30b746b 100644 (file)
@@ -1,4 +1,4 @@
-;;; composite.el --- Support character composition.
+;;; composite.el --- support character composition
 
 ;; Copyright (C) 1999 Electrotechnical Laboratory, JAPAN.
 ;; Licensed to the Free Software Foundation.
@@ -22,6 +22,8 @@
 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
+;;; Commentary:
+
 ;;; Code:
 
 ;;;###autoload
@@ -61,7 +63,7 @@ composed, and NEW-REF-POINT is a reference point in the new glyph to
 be added.
 
 For instance, if GLOBAL-REF-POINT is `br' (bottom-right) and
-NEW-REF-POINT is `tl' (top-left), the overall glyph is updated as
+NEW-REF-POINT is `tc' (top-center), the overall glyph is updated as
 follows (the point `*' corresponds to both reference points):
 
     +-------+--+ <--- new ascent
@@ -340,17 +342,23 @@ This function is the default value of `compose-chars-after-function'."
 ;;;###autoload
 (defun compose-last-chars (args)
   "Compose last characters.
-The argument is a parameterized event of the form (compose-last-chars N),
-where N is the number of characters before point to compose.
+The argument is a parameterized event of the form
+       \(compose-last-chars N COMPONENTS),
+where N is the number of characters before point to compose,
+COMPONENTS, if non-nil, is the same as the argument to `compose-region'
+\(which see).  If it is nil, `compose-chars-after' is called,
+and that function find a proper rule to compose the target characters.
 This function is intended to be used from input methods.
 The global keymap binds special event `compose-last-chars' to this
-function.  Input method may generate an event (compose-last-chars N)
+function.  Input method may generate an event (compose-last-chars N COMPONENTS)
 after a sequence character events."
   (interactive "e")
   (let ((chars (nth 1 args)))
     (if (and (numberp chars)
             (>= (- (point) (point-min)) chars))
-       (compose-chars-after (- (point) chars) (point)))))
+       (if (nth 2 args)
+           (compose-region (- (point) chars) (point) (nth 2 args))
+         (compose-chars-after (- (point) chars) (point))))))
 
 ;;;###autoload(global-set-key [compose-last-chars] 'compose-last-chars)