]> code.delx.au - gnu-emacs/blobdiff - src/charset.c
Merge latest Org fixes (commit 7524ef2).
[gnu-emacs] / src / charset.c
index 972a0598059e06e10e5d52c56f53494afe721437..7c67ecb941accfd249125dc37cb1f0cb376ec128 100644 (file)
@@ -1,5 +1,5 @@
 /* Basic character set support.
-   Copyright (C) 2001-201 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)
@@ -32,7 +32,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <unistd.h>
 #include <limits.h>
 #include <sys/types.h>
-#include <setjmp.h>
 #include <c-ctype.h>
 #include "lisp.h"
 #include "character.h"
@@ -422,7 +421,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries,
 /* Read a hexadecimal number (preceded by "0x") from the file FP while
    paying attention to comment character '#'.  */
 
-static inline unsigned
+static unsigned
 read_hex (FILE *fp, bool *eof, bool *overflow)
 {
   int c;
@@ -1618,7 +1617,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
 /* Return a unified character code for C (>= 0x110000).  VAL is a
    value of Vchar_unify_table for C; i.e. it is nil, an integer, or a
    charset symbol.  */
-int
+static int
 maybe_unify_char (int c, Lisp_Object val)
 {
   struct charset *charset;
@@ -1724,8 +1723,12 @@ decode_char (struct charset *charset, unsigned int code)
        {
          c = char_index + CHARSET_CODE_OFFSET (charset);
          if (CHARSET_UNIFIED_P (charset)
-             && c > MAX_UNICODE_CHAR)
-           MAYBE_UNIFY_CHAR (c);
+             && MAX_UNICODE_CHAR < c && c <= MAX_5_BYTE_CHAR)
+           {
+             /* Unify C with a Unicode character if possible.  */
+             Lisp_Object val = CHAR_TABLE_REF (Vchar_unify_table, c);
+             c = maybe_unify_char (c, val);
+           }
        }
     }