XEmacs 21.4.15
[chise/xemacs-chise.git.1] / src / buffer.c
index 6fcbe8d..bd44a47 100644 (file)
@@ -208,8 +208,8 @@ Lisp_Object Qfind_file_compare_truenames;
 Lisp_Object Qswitch_to_buffer;
 
 /* Two thresholds controlling how much undo information to keep.  */
-int undo_threshold;
-int undo_high_threshold;
+Fixnum undo_threshold;
+Fixnum undo_high_threshold;
 
 int find_file_compare_truenames;
 int find_file_use_truenames;
@@ -356,7 +356,7 @@ get_buffer (Lisp_Object name, int error_if_deleted_or_does_not_exist)
 struct buffer *
 decode_buffer (Lisp_Object buffer, int allow_string)
 {
-  if (NILP (buffer))
+  if (NILP (buffer) || (!POINTER_TYPE_P( XTYPE(buffer))))
     return current_buffer;
 
   if (allow_string && STRINGP (buffer))
@@ -998,8 +998,8 @@ The ordering is for this frame; If second optional argument FRAME
 is provided, then the ordering is for that frame.  If the second arg
 is t, then the global ordering is returned.
 
-Note: In FSF Emacs, this function takes two arguments: BUFFER and
-VISIBLE-OK.
+Note: In FSF Emacs, this function takes the arguments in the order of
+BUFFER, VISIBLE-OK and FRAME.
 */
        (buffer, frame, visible_ok))
 {
@@ -1256,10 +1256,14 @@ with `delete-process'.
 
     delete_from_buffer_alist (buf);
 
-    /* #### This is a problem if this buffer is in a dedicated window.
-       Need to undedicate any windows of this buffer first (and delete them?)
-       */
-    Freplace_buffer_in_windows (buf, Qnil, Qnil);
+    /* Undedicate any windows of this buffer, and make sure no windows
+       show it.  */
+
+    undedicate_windows (buf, Qt);
+    
+    GCPRO1 (buf);
+    Freplace_buffer_in_windows (buf, Qnil, Qall);
+    UNGCPRO;
 
     font_lock_buffer_was_killed (b);
 
@@ -1622,7 +1626,6 @@ BUFFER defaults to the current buffer if omitted.
      implies that the future text is not really related to the past text.  */
   b->saved_size = Qzero;
 
-  zmacs_region_stays = 0;
   return Qnil;
 }
 
@@ -1916,7 +1919,7 @@ dfc_convert_to_external_format (dfc_conversion_type source_type,
 
       while (1)
         {
-          ssize_t size_in_bytes;
+          Lstream_data_count size_in_bytes;
          char tempbuf[1024]; /* some random amount */
 
          size_in_bytes = Lstream_read (reader, tempbuf, sizeof (tempbuf));
@@ -2054,7 +2057,7 @@ dfc_convert_to_internal_format (dfc_conversion_type source_type,
 
       while (1)
         {
-          ssize_t size_in_bytes;
+          Lstream_data_count size_in_bytes;
          char tempbuf[1024]; /* some random amount */
 
          size_in_bytes = Lstream_read (reader, tempbuf, sizeof (tempbuf));
@@ -2429,6 +2432,7 @@ common_init_complex_vars_of_buffer (void)
   defs->auto_save_modified = 0;
   defs->auto_save_failure_time = -1;
   defs->invisibility_spec = Qt;
+  defs->buffer_local_face_property = 0;
 
   defs->indirect_children = Qnil;
   syms->indirect_children = Qnil;
@@ -2502,7 +2506,9 @@ common_init_complex_vars_of_buffer (void)
 
     /* #### Warning: 1<<31 is the largest number currently allowable
        due to the XINT() handling of this value.  With some
-       rearrangement you can get 3 more bits. */
+       rearrangement you can get 3 more bits.
+
+       #### 3 more?  34 bits???? -ben */
   }
 }
 
@@ -2548,8 +2554,8 @@ complex_vars_of_buffer (void)
   syms = XBUFFER (Vbuffer_local_symbols);
   buffer_defaults_saved_slots      = &defs->BUFFER_SLOTS_FIRST_NAME;
   buffer_local_symbols_saved_slots = &syms->BUFFER_SLOTS_FIRST_NAME;
-  dumpstruct (&buffer_defaults_saved_slots,      &buffer_slots_description);
-  dumpstruct (&buffer_local_symbols_saved_slots, &buffer_slots_description);
+  dump_add_root_struct_ptr (&buffer_defaults_saved_slots,      &buffer_slots_description);
+  dump_add_root_struct_ptr (&buffer_local_symbols_saved_slots, &buffer_slots_description);
 
   DEFVAR_BUFFER_DEFAULTS ("default-modeline-format", modeline_format /*
 Default value of `modeline-format' for buffers that don't override it.
@@ -2672,12 +2678,6 @@ Automatically becomes buffer-local when set in any fashion.
   DEFVAR_BUFFER_LOCAL ("case-fold-search", case_fold_search /*
 *Non-nil if searches should ignore case.
 Automatically becomes buffer-local when set in any fashion.
-
-BUG: Under XEmacs/Mule, translations to or from non-ASCII characters
- (this includes chars in the range 128 - 255) are ignored by
- the string/buffer-searching routines.  Thus, `case-fold-search'
- will not correctly conflate a-umlaut and A-umlaut even if the
- case tables call for this.
 */ );
 
   DEFVAR_BUFFER_LOCAL ("fill-column", fill_column /*