/* Coding system handler (conversion, detection, etc).
- Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ Copyright (C) 2001-2013 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
static Lisp_Object Qcoding_system, Qeol_type;
static Lisp_Object Qcoding_aliases;
Lisp_Object Qunix, Qdos;
+static Lisp_Object Qmac;
Lisp_Object Qbuffer_file_coding_system;
static Lisp_Object Qpost_read_conversion, Qpre_write_conversion;
static Lisp_Object Qdefault_char;
Lisp_Object Qemacs_mule, Qraw_text;
Lisp_Object Qutf_8_emacs;
-#if defined (WINDOWSNT) || defined (HAVE_NTGUI)
+#if defined (WINDOWSNT) || defined (CYGWIN)
static Lisp_Object Qutf_16le;
#endif
GPT -= gap_head_used, GPT_BYTE -= gap_head_used;
}
else
- {
- Lisp_Object this_buffer;
-
- this_buffer = Fcurrent_buffer ();
- set_buffer_internal (XBUFFER (coding->dst_object));
- make_gap (bytes);
- set_buffer_internal (XBUFFER (this_buffer));
- }
+ make_gap_1 (XBUFFER (coding->dst_object), bytes);
}
}
if (single_shifting)
break;
- check_extra_latin:
- if (! VECTORP (Vlatin_extra_code_table)
- || NILP (AREF (Vlatin_extra_code_table, c)))
- {
- rejected = CATEGORY_MASK_ISO;
- break;
- }
- if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_1])
- & CODING_ISO_FLAG_LATIN_EXTRA)
- found |= CATEGORY_MASK_ISO_8_1;
- else
- rejected |= CATEGORY_MASK_ISO_8_1;
- rejected |= CATEGORY_MASK_ISO_8_2;
- break;
+ goto check_extra_latin;
default:
if (c < 0)
}
break;
}
+ check_extra_latin:
+ if (! VECTORP (Vlatin_extra_code_table)
+ || NILP (AREF (Vlatin_extra_code_table, c)))
+ {
+ rejected = CATEGORY_MASK_ISO;
+ break;
+ }
+ if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_1])
+ & CODING_ISO_FLAG_LATIN_EXTRA)
+ found |= CATEGORY_MASK_ISO_8_1;
+ else
+ rejected |= CATEGORY_MASK_ISO_8_1;
+ rejected |= CATEGORY_MASK_ISO_8_2;
+ break;
}
}
detect_info->rejected |= CATEGORY_MASK_ISO;
return CODING_ID_NAME (id);
}
-#if defined (WINDOWSNT) || defined (HAVE_NTGUI)
+#if defined (WINDOWSNT) || defined (CYGWIN)
Lisp_Object
from_unicode (Lisp_Object str)
*buf = str;
return WCSDATA (*buf);
}
-#endif /* WINDOWSNT || HAVE_NTGUI */
+
+#endif /* WINDOWSNT || CYGWIN */
\f
#ifdef emacs
ptrdiff_t from, to;
ptrdiff_t from_byte, to_byte;
- CHECK_NUMBER_COERCE_MARKER (start);
- CHECK_NUMBER_COERCE_MARKER (end);
-
validate_region (&start, &end);
from = XINT (start), to = XINT (end);
from_byte = CHAR_TO_BYTE (from);
ptrdiff_t from, from_byte, to, to_byte;
Lisp_Object src_object;
- CHECK_NUMBER_COERCE_MARKER (start);
- CHECK_NUMBER_COERCE_MARKER (end);
if (NILP (coding_system))
coding_system = Qno_conversion;
else
DEFSYM (Qeol_type, "eol-type");
DEFSYM (Qunix, "unix");
DEFSYM (Qdos, "dos");
+ DEFSYM (Qmac, "mac");
DEFSYM (Qbuffer_file_coding_system, "buffer-file-coding-system");
DEFSYM (Qpost_read_conversion, "post-read-conversion");
DEFSYM (Qutf_8, "utf-8");
DEFSYM (Qutf_8_emacs, "utf-8-emacs");
-#if defined (WINDOWSNT) || defined (HAVE_NTGUI)
+#if defined (WINDOWSNT) || defined (CYGWIN)
/* No, not utf-16-le: that one has a BOM. */
DEFSYM (Qutf_16le, "utf-16le");
#endif