/[emacs]/emacs/src/coding.c
ViewVC logotype

Diff of /emacs/src/coding.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.222.4.15 by rms, Wed Oct 23 17:39:36 2002 UTC revision 1.222.4.16 by handa, Fri Mar 7 04:37:21 2003 UTC
# Line 673  detect_coding_emacs_mule (src, src_end, Line 673  detect_coding_emacs_mule (src, src_end,
673    
674  /* Record one COMPONENT (alternate character or composition rule).  */  /* Record one COMPONENT (alternate character or composition rule).  */
675    
676  #define CODING_ADD_COMPOSITION_COMPONENT(coding, component)     \  #define CODING_ADD_COMPOSITION_COMPONENT(coding, component)             \
677    (coding->cmp_data->data[coding->cmp_data->used++] = component)    do {                                                                  \
678        coding->cmp_data->data[coding->cmp_data->used++] = component;       \
679        if (coding->cmp_data->used - coding->cmp_data_start                 \
680            == COMPOSITION_DATA_MAX_BUNCH_LENGTH)                           \
681          {                                                                 \
682            CODING_ADD_COMPOSITION_END (coding, coding->produced_char);     \
683            coding->composing = COMPOSITION_NO;                             \
684          }                                                                 \
685      } while (0)
686    
687  /* Get one byte from a data pointed by SRC and increment SRC.  If SRC  /* Get one byte from a data pointed by SRC and increment SRC.  If SRC
688     is not less than SRC_END, return -1 without incrementing Src.  */     is not less than SRC_END, return -1 without incrementing Src.  */
# Line 1319  enum iso_code_class_type iso_code_class[ Line 1326  enum iso_code_class_type iso_code_class[
1326  #define SHIFT_OUT_OK(idx) \  #define SHIFT_OUT_OK(idx) \
1327    (CODING_SPEC_ISO_INITIAL_DESIGNATION (coding_system_table[idx], 1) >= 0)    (CODING_SPEC_ISO_INITIAL_DESIGNATION (coding_system_table[idx], 1) >= 0)
1328    
1329    #define COMPOSITION_OK(idx)     \
1330      (coding_system_table[idx]->composing != COMPOSITION_DISABLED)
1331    
1332  /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".  /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
1333     Check if a text is encoded in ISO2022.  If it is, return an     Check if a text is encoded in ISO2022.  If it is, return an
1334     integer in which appropriate flag bits any of:     integer in which appropriate flag bits any of:
# Line 1395  detect_coding_iso2022 (src, src_end, mul Line 1405  detect_coding_iso2022 (src, src_end, mul
1405            else if (c >= '0' && c <= '4')            else if (c >= '0' && c <= '4')
1406              {              {
1407                /* ESC <Fp> for start/end composition.  */                /* ESC <Fp> for start/end composition.  */
1408                mask_found |= CODING_CATEGORY_MASK_ISO;                if (COMPOSITION_OK (CODING_CATEGORY_IDX_ISO_7))
1409                    mask_found |= CODING_CATEGORY_MASK_ISO_7;
1410                  else
1411                    mask &= ~CODING_CATEGORY_MASK_ISO_7;
1412                  if (COMPOSITION_OK (CODING_CATEGORY_IDX_ISO_7_TIGHT))
1413                    mask_found |= CODING_CATEGORY_MASK_ISO_7_TIGHT;
1414                  else
1415                    mask &= ~CODING_CATEGORY_MASK_ISO_7_TIGHT;
1416                  if (COMPOSITION_OK (CODING_CATEGORY_IDX_ISO_8_1))
1417                    mask_found |= CODING_CATEGORY_MASK_ISO_8_1;
1418                  else
1419                    mask &= ~CODING_CATEGORY_MASK_ISO_8_1;
1420                  if (COMPOSITION_OK (CODING_CATEGORY_IDX_ISO_8_2))
1421                    mask_found |= CODING_CATEGORY_MASK_ISO_8_2;
1422                  else
1423                    mask &= ~CODING_CATEGORY_MASK_ISO_8_2;
1424                  if (COMPOSITION_OK (CODING_CATEGORY_IDX_ISO_7_ELSE))
1425                    mask_found |= CODING_CATEGORY_MASK_ISO_7_ELSE;
1426                  else
1427                    mask &= ~CODING_CATEGORY_MASK_ISO_7_ELSE;
1428                  if (COMPOSITION_OK (CODING_CATEGORY_IDX_ISO_8_ELSE))
1429                    mask_found |= CODING_CATEGORY_MASK_ISO_8_ELSE;
1430                  else
1431                    mask &= ~CODING_CATEGORY_MASK_ISO_8_ELSE;
1432                break;                break;
1433              }              }
1434            else            else
# Line 5287  coding_restore_composition (coding, obj) Line 5320  coding_restore_composition (coding, obj)
5320                int len = data[0] - 4, j;                int len = data[0] - 4, j;
5321                Lisp_Object args[MAX_COMPOSITION_COMPONENTS * 2 - 1];                Lisp_Object args[MAX_COMPOSITION_COMPONENTS * 2 - 1];
5322    
5323                  if (method == COMPOSITION_WITH_RULE_ALTCHARS
5324                      && len % 2 == 0)
5325                    len --;
5326                for (j = 0; j < len; j++)                for (j = 0; j < len; j++)
5327                  args[j] = make_number (data[4 + j]);                  args[j] = make_number (data[4 + j]);
5328                components = (method == COMPOSITION_WITH_ALTCHARS                components = (method == COMPOSITION_WITH_ALTCHARS

Legend:
Removed from v.1.222.4.15  
changed lines
  Added in v.1.222.4.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26