* calendar/calendar.el (calendar-cursor-to-date): Add argument `event'.
[bpt/emacs.git] / src / composite.c
index 332f4df..e59ba35 100644 (file)
@@ -1,7 +1,7 @@
 /* Composite sequence support.
    Copyright (C) 2001, 2002, 2003, 2004, 2005,
-                 2006, 2007 Free Software Foundation, Inc.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+                 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H14PRO021
    Copyright (C) 2003, 2006
 
 This file is part of GNU Emacs.
 
-GNU Emacs is free software; you can redistribute it and/or modify
+GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,9 +21,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 #include "lisp.h"
@@ -159,7 +157,6 @@ EXFUN (Fremove_list_of_text_properties, 4);
 /* Temporary variable used in macros COMPOSITION_XXX.  */
 Lisp_Object composition_temp;
 
-extern int enable_font_backend;
 \f
 /* Return COMPOSITION-ID of a composition at buffer position
    CHARPOS/BYTEPOS and length NCHARS.  The `composition' property of
@@ -276,9 +273,7 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
      vector or a list.  It should be a sequence of:
        char1 rule1 char2 rule2 char3 ...    ruleN charN+1  */
 
-#ifdef USE_FONT_BACKEND
-  if (enable_font_backend
-      && VECTORP (components)
+  if (VECTORP (components)
       && ASIZE (components) >= 2
       && VECTORP (AREF (components, 0)))
     {
@@ -289,9 +284,7 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
        if (! VECTORP (AREF (key, i)))
          goto invalid_composition;
     }
-  else
-#endif  /* USE_FONT_BACKEND */
-  if (VECTORP (components) || CONSP (components))
+  else if (VECTORP (components) || CONSP (components))
     {
       int len = XVECTOR (key)->size;
 
@@ -324,12 +317,10 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
                 : ((INTEGERP (components) || STRINGP (components))
                    ? COMPOSITION_WITH_ALTCHARS
                    : COMPOSITION_WITH_RULE_ALTCHARS));
-#ifdef USE_FONT_BACKEND
   if (cmp->method == COMPOSITION_WITH_RULE_ALTCHARS
       && VECTORP (components)
       && ! INTEGERP (AREF (components, 0)))
     cmp->method = COMPOSITION_WITH_GLYPH_STRING;
-#endif  /* USE_FONT_BACKEND */
   cmp->hash_index = hash_index;
   glyph_len = (cmp->method == COMPOSITION_WITH_RULE_ALTCHARS
               ? (XVECTOR (key)->size + 1) / 2
@@ -338,16 +329,13 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
   cmp->offsets = (short *) xmalloc (sizeof (short) * glyph_len * 2);
   cmp->font = NULL;
 
-#ifdef USE_FONT_BACKEND
+  /* Calculate the width of overall glyphs of the composition.  */
   if (cmp->method == COMPOSITION_WITH_GLYPH_STRING)
     {
       cmp->width = 1;          /* Should be fixed later.  */
       cmp->glyph_len--;
     }
-  else
-#endif /* USE_FONT_BACKEND */
-  /* Calculate the width of overall glyphs of the composition.  */
-  if (cmp->method != COMPOSITION_WITH_RULE_ALTCHARS)
+  else if (cmp->method != COMPOSITION_WITH_RULE_ALTCHARS)
     {
       /* Relative composition.  */
       cmp->width = 0;
@@ -795,7 +783,7 @@ syms_of_composite ()
     args[1] = Qequal;
     args[2] = QCweakness;
     /* We used to make the hash table weak so that unreferenced
-       compostions can be garbage-collected.  But, usually once
+       compositions can be garbage-collected.  But, usually once
        created compositions are repeatedly used in an Emacs session,
        and thus it's not worth to save memory in such a way.  So, we
        make the table not weak.  */
@@ -832,15 +820,15 @@ The default value is the function `compose-chars-after'.  */);
 
   DEFVAR_LISP ("auto-composition-function", &Vauto_composition_function,
               doc: /* Function to call to compose characters automatically.
-The function is called from the display routine with two arguments,
-POS and STRING.
+The function is called from the display routine with four arguments,
+FROM, TO, WINDOW, and STRING.
 
-If STRING is nil, the function must compose characters following POS
-in the current buffer.
+If STRING is nil, the function must compose characters in the region
+between FROM and TO in the current buffer.
 
-Otherwise, STRING is a string, and POS is an index to the string.  In
-this case, the function must compose characters following POS in
-the string.  */);
+Otherwise, STRING is a string, and FROM and TO are indices into the
+string.  In this case, the function must compose characters in the
+string.  */);
   Vauto_composition_function = Qnil;
 
   defsubr (&Scompose_region_internal);