(GT-K02180): New character.
[chise/xemacs-chise.git-] / src / insdel.c
index a6d7eb2..d17322b 100644 (file)
@@ -200,7 +200,6 @@ Boston, MA 02111-1307, USA.  */
 
 #include <config.h>
 #include "lisp.h"
-#include <limits.h>
 
 #include "buffer.h"
 #include "device.h"
@@ -1223,6 +1222,7 @@ bytind_to_bufpos (struct buffer *buf, Bytind x)
 Bufpos
 get_buffer_pos_char (struct buffer *b, Lisp_Object pos, unsigned int flags)
 {
+  /* Does not GC */
   Bufpos ind;
   Bufpos min_allowed, max_allowed;
 
@@ -1272,6 +1272,7 @@ void
 get_buffer_range_char (struct buffer *b, Lisp_Object from, Lisp_Object to,
                       Bufpos *from_out, Bufpos *to_out, unsigned int flags)
 {
+  /* Does not GC */
   Bufpos min_allowed, max_allowed;
 
   min_allowed = (flags & GB_ALLOW_PAST_ACCESSIBLE) ?
@@ -2351,16 +2352,15 @@ prepare_to_modify_buffer (struct buffer *buf, Bufpos start, Bufpos end,
   if (!NILP (buf->filename) && lockit &&
       BUF_SAVE_MODIFF (buf) >= BUF_MODIFF (buf))
     {
-#ifdef CLASH_DETECTION
-      if (!NILP (buf->file_truename))
-       /* Make binding buffer-file-name to nil effective.  */
-       lock_file (buf->file_truename);
-#else
       /* At least warn if this file has changed on disk since it was visited.*/
       if (NILP (Fverify_visited_file_modtime (buffer))
          && !NILP (Ffile_exists_p (buf->filename)))
        call1_in_buffer (buf, intern ("ask-user-about-supersession-threat"),
                         buf->filename);
+#ifdef CLASH_DETECTION
+      if (!NILP (buf->file_truename))
+       /* Make binding buffer-file-name to nil effective.  */
+       lock_file (buf->file_truename);
 #endif /* not CLASH_DETECTION */
     }
   UNGCPRO;
@@ -3153,7 +3153,7 @@ find_charsets_in_charc_string (Charset_ID *charsets, const Charc *str,
 
   for (i = 0; i < len; i++)
     {
-      charsets[XCHARSET_ID (str[i].charset) - MIN_LEADING_BYTE] = 1;
+      charsets[CHARC_CHARSET_ID (str[i]) - MIN_LEADING_BYTE] = 1;
     }
 #endif
 }
@@ -3186,7 +3186,7 @@ charc_string_displayed_columns (const Charc *str, Charcount len)
   int i;
 
   for (i = 0; i < len; i++)
-    cols += CHARSET_COLUMNS (XCHARSET (str[i].charset));
+    cols += CHARC_COLUMNS (str[i]);
 
   return cols;
 #else  /* not MULE */
@@ -3204,10 +3204,7 @@ convert_bufbyte_string_into_charc_dynarr (const Bufbyte *str, Bytecount len,
 
   while (str < strend)
     {
-      Charc ec;
-
-      ec.code_point = ENCODE_CHAR (charptr_emchar (str), ec.charset);
-      Dynarr_add (dyn, ec);
+      Dynarr_add (dyn, CHAR_TO_CHARC (charptr_emchar (str)));
       INC_CHARPTR (str);
     }
 }
@@ -3240,10 +3237,7 @@ convert_charc_string_into_bufbyte_dynarr (Charc *arr, int nels,
 
   for (i = 0; i < nels; i++)
     {
-      Charc ec = arr[i];
-
-      Bytecount len
-       = set_charptr_emchar (str, DECODE_CHAR (ec.charset, ec.code_point));
+      Bytecount len = set_charptr_emchar (str, CHARC_TO_CHAR (arr[i]));
       Dynarr_add_many (dyn, str, len);
     }
 }
@@ -3267,10 +3261,7 @@ convert_charc_string_into_malloced_string (Charc *arr, int nels,
 
   for (i = 0; i < nels; i++)
     {
-      Charc ec = arr[i];
-
-      str += set_charptr_emchar (str,
-                                DECODE_CHAR (ec.charset, ec.code_point));
+      str += set_charptr_emchar (str, CHARC_TO_CHAR (arr[i]));
     }
   *str = '\0';
   len = str - strorig;