/[emacs]/emacs/src/buffer.c
ViewVC logotype

Diff of /emacs/src/buffer.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.378 by rms, Sat Jan 26 23:04:27 2002 UTC revision 1.378.2.1 by handa, Fri Mar 1 01:07:51 2002 UTC
# Line 45  extern int errno; Line 45  extern int errno;
45  #include "window.h"  #include "window.h"
46  #include "commands.h"  #include "commands.h"
47  #include "buffer.h"  #include "buffer.h"
48  #include "charset.h"  #include "character.h"
49  #include "region-cache.h"  #include "region-cache.h"
50  #include "indent.h"  #include "indent.h"
51  #include "blockinput.h"  #include "blockinput.h"
# Line 2085  but the contents viewed as characters do Line 2085  but the contents viewed as characters do
2085                p = GAP_END_ADDR;                p = GAP_END_ADDR;
2086                stop = Z;                stop = Z;
2087              }              }
2088            if (MULTIBYTE_STR_AS_UNIBYTE_P (p, bytes))            if (ASCII_BYTE_P (*p))
2089              p += bytes, pos += bytes;              p++, pos++;
2090            else            else if (CHAR_BYTE8_HEAD_P (*p))
2091              {              {
2092                c = STRING_CHAR (p, stop - pos);                c = STRING_CHAR (p, stop - pos);
2093                /* Delete all bytes for this 8-bit character but the                /* Delete all bytes for this 8-bit character but the
# Line 2104  but the contents viewed as characters do Line 2104  but the contents viewed as characters do
2104                  zv -= bytes;                  zv -= bytes;
2105                stop = Z;                stop = Z;
2106              }              }
2107              else
2108                {
2109                  bytes = BYTES_BY_CHAR_HEAD (*p);
2110                  p += bytes, pos += bytes;
2111                }
2112          }          }
2113        if (narrowed)        if (narrowed)
2114          Fnarrow_to_region (make_number (begv), make_number (zv));          Fnarrow_to_region (make_number (begv), make_number (zv));
# Line 2112  but the contents viewed as characters do Line 2117  but the contents viewed as characters do
2117      {      {
2118        int pt = PT;        int pt = PT;
2119        int pos, stop;        int pos, stop;
2120        unsigned char *p;        unsigned char *p, *pend;
2121    
2122        /* Be sure not to have a multibyte sequence striding over the GAP.        /* Be sure not to have a multibyte sequence striding over the GAP.
2123           Ex: We change this: "...abc\201 _GAP_ \241def..."           Ex: We change this: "...abc\302 _GAP_ \241def..."
2124               to: "...abc _GAP_ \201\241def..."  */               to: "...abc _GAP_ \302\241def..."  */
2125    
2126        if (GPT_BYTE > 1 && GPT_BYTE < Z_BYTE        if (GPT_BYTE > 1 && GPT_BYTE < Z_BYTE
2127            && ! CHAR_HEAD_P (*(GAP_END_ADDR)))            && ! CHAR_HEAD_P (*(GAP_END_ADDR)))
# Line 2137  but the contents viewed as characters do Line 2142  but the contents viewed as characters do
2142        pos = BEG;        pos = BEG;
2143        stop = GPT;        stop = GPT;
2144        p = BEG_ADDR;        p = BEG_ADDR;
2145          pend = GPT_ADDR;
2146        while (1)        while (1)
2147          {          {
2148            int bytes;            int bytes;
# Line 2146  but the contents viewed as characters do Line 2152  but the contents viewed as characters do
2152                if (pos == Z)                if (pos == Z)
2153                  break;                  break;
2154                p = GAP_END_ADDR;                p = GAP_END_ADDR;
2155                  pend = Z_ADDR;
2156                stop = Z;                stop = Z;
2157              }              }
2158                                
2159            if (UNIBYTE_STR_AS_MULTIBYTE_P (p, stop - pos, bytes))            if ((bytes = MULTIBYTE_LENGTH (p, pend)) > 0)
2160              p += bytes, pos += bytes;              p += bytes, pos += bytes;
2161            else            else
2162              {              {
# Line 4261  buffer_slot_type_mismatch (offset) Line 4268  buffer_slot_type_mismatch (offset)
4268  #include <fcntl.h>  #include <fcntl.h>
4269  #endif  #endif
4270    
 #include "coding.h"  
   
4271    
4272  /* Memory is allocated in regions which are mapped using mmap(2).  /* Memory is allocated in regions which are mapped using mmap(2).
4273     The current implementation lets the system select mapped     The current implementation lets the system select mapped

Legend:
Removed from v.1.378  
changed lines
  Added in v.1.378.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26