]> code.delx.au - gnu-emacs/blobdiff - lisp/composite.el
*** empty log message ***
[gnu-emacs] / lisp / composite.el
index 7c04bcff088e3b1ec63f1d833dd0a190a0581b95..c9f16e2f518ab285da07b0b81858d4a1a5d96813 100644 (file)
@@ -185,8 +185,17 @@ RULE is a cons of global and new reference point symbols
 (defun compose-region (start end &optional components modification-func)
   "Compose characters in the current region.
 
-Characters are composed relatively, i.e. composed by overstricking or
-stacking depending on ascent, descent and other properties.
+Characters are composed relatively, i.e. composed by overstriking
+or stacking depending on ascent, descent and other metrics of
+glyphs.
+
+For instance, if the region has three characters \"XYZ\", X is
+regarded as BASE glyph, and Y is displayed:
+  (1) above BASE if Y's descent value is not positive
+  (2) below BASE if Y's ascent value is not positive
+  (3) on BASE (i.e. at the BASE position) otherwise
+and Z is displayed with the same rule while regarding the whole
+XY glyphs as BASE.
 
 When called from a program, expects these four arguments.
 
@@ -681,7 +690,14 @@ a prepending a space before it."
              (lglyph-set-from-to glyph i i)
              (setq i (1+ i))))
        (if (= (lglyph-width glyph) 0)
-           (progn
+           (if (eq (get-char-code-property (lglyph-char glyph)
+                                           'general-category)
+                   'Cf)
+               (progn
+                 ;; Compose by replacing with a space.
+                 (lglyph-set-char glyph 32)
+                 (lglyph-set-width glyph 1)
+                 (setq i (1+ i)))
              ;; Compose by prepending a space.
              (setq gstring (lgstring-insert-glyph gstring i
                                                   (lglyph-copy glyph))
@@ -712,9 +728,7 @@ FUNC is called with one argument GSTRING which is built for characters
 in the region FROM (inclusive) and TO (exclusive).
 
 If the character are composed on a graphic display, FONT-OBJECT
-is a font to use.
-
-Otherwise, FONT-OBJECT is nil, and the fucntion
+is a font to use.  Otherwise, FONT-OBJECT is nil, and the function
 `compose-gstring-for-terminal' is used instead of FUNC.
 
 If STRING is non-nil, it is a string, and FROM and TO are indices
@@ -759,8 +773,10 @@ Auto Composition mode in all buffers (this is the default)."
 ;;;###autoload
 (define-global-minor-mode global-auto-composition-mode
   auto-composition-mode turn-on-auto-composition-if-enabled
-  :extra-args (dummy)
-  :initialize 'custom-initialize-safe-default
+  ;; This :extra-args' appears to be the result of a naive copy&paste
+  ;; from global-font-lock-mode.
+  ;; :extra-args (dummy)
+  :initialize 'custom-initialize-delay
   :init-value (not noninteractive)
   :group 'auto-composition
   :version "23.1")