emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/buffer.h,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/buffer.h,v
Date: Fri, 01 Feb 2008 16:02:13 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     08/02/01 16:01:31

Index: src/buffer.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/buffer.h,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -b -r1.115 -r1.116
--- src/buffer.h        8 Jan 2008 20:44:24 -0000       1.115
+++ src/buffer.h        1 Feb 2008 16:00:53 -0000       1.116
@@ -326,7 +326,6 @@
 
 /* Variables used locally in FETCH_MULTIBYTE_CHAR.  */
 extern unsigned char *_fetch_multibyte_char_p;
-extern int _fetch_multibyte_char_len;
 
 /* Return character code of multi-byte form at position POS.  If POS
    doesn't point the head of valid multi-byte form, only the byte at
@@ -335,9 +334,17 @@
 #define FETCH_MULTIBYTE_CHAR(pos)                                      \
   (_fetch_multibyte_char_p = (((pos) >= GPT_BYTE ? GAP_SIZE : 0)       \
                               + (pos) + BEG_ADDR - BEG_BYTE),                  
\
-   _fetch_multibyte_char_len                                           \
-      = ((pos) >= GPT_BYTE ? ZV_BYTE : GPT_BYTE) - (pos),              \
-   STRING_CHAR (_fetch_multibyte_char_p, _fetch_multibyte_char_len))
+   STRING_CHAR (_fetch_multibyte_char_p, 0))
+
+/* Return character at position POS.  If the current buffer is unibyte
+   and the character is not ASCII, make the returning character
+   multibyte.  */
+
+#define FETCH_CHAR_AS_MULTIBYTE(pos)                   \
+  (!NILP (current_buffer->enable_multibyte_characters) \
+   ? FETCH_MULTIBYTE_CHAR ((pos))                      \
+   : unibyte_char_to_multibyte (FETCH_BYTE ((pos))))
+
 
 /* Macros for accessing a character or byte,
    or converting between byte positions and addresses,
@@ -386,10 +393,7 @@
   (_fetch_multibyte_char_p                                             \
      = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_GAP_SIZE (buf) : 0)         \
         + (pos) + BUF_BEG_ADDR (buf) - BEG_BYTE),                      \
-   _fetch_multibyte_char_len                                           \
-     = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_ZV_BYTE (buf) : BUF_GPT_BYTE (buf)) 
\
-        - (pos)),                                                      \
-   STRING_CHAR (_fetch_multibyte_char_p, _fetch_multibyte_char_len))
+   STRING_CHAR (_fetch_multibyte_char_p, 0))
 
 /* Define the actual buffer data structures.  */
 
@@ -445,6 +449,11 @@
        successive elements in its marker `chain'
        are the other markers referring to this buffer.  */
     struct Lisp_Marker *markers;
+
+    /* Usually 0.  Temporarily set to 1 in decode_coding_gap to
+       prevent Fgarbage_collect from shrinking the gap and loosing
+       not-yet-decoded bytes.  */
+    int inhibit_shrinking;
   };
 
 /* This is the structure that the buffer Lisp object points to.  */
@@ -855,6 +864,7 @@
       }                                                                        
\
   } while (0)
 
+EXFUN (Fbuffer_live_p, 1);
 EXFUN (Fbuffer_name, 1);
 EXFUN (Fget_file_buffer, 1);
 EXFUN (Fnext_overlay_change, 1);
@@ -898,7 +908,7 @@
    We assume you know which buffer it's pointing into.  */
 
 #define OVERLAY_POSITION(P) \
- (GC_MARKERP (P) ? marker_position (P) : (abort (), 0))
+ (MARKERP (P) ? marker_position (P) : (abort (), 0))
 
 
 /***********************************************************************




reply via email to

[Prev in Thread] Current Thread [Next in Thread]