aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorDave Love2002-05-17 16:33:41 +0000
committerDave Love2002-05-17 16:33:41 +0000
commitcab1603fd543a65a455d7975e6f151f61d83827b (patch)
tree4873f1849e78324d1d8c7f9f3d34c7e9980fe564 /src/buffer.c
parenta980c93231c05db0d18ca8cb6c85d26572ab0894 (diff)
downloademacs-cab1603fd543a65a455d7975e6f151f61d83827b.tar.gz
emacs-cab1603fd543a65a455d7975e6f151f61d83827b.zip
(emacs_strerror): Declare.
(MMAP_ALLOCATED_P, mmap_enlarge, syms_of_buffer): Import changes from trunk.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/buffer.c b/src/buffer.c
index b9c5c2acc52..f050305de59 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1,5 +1,5 @@
1/* Buffer manipulation primitives for GNU Emacs. 1/* Buffer manipulation primitives for GNU Emacs.
2 Copyright (C) 1985,86,87,88,89,93,94,95,97,98, 1999, 2000, 2001 2 Copyright (C) 1985,86,87,88,89,93,94,95,97,98, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -184,6 +184,7 @@ static void free_buffer_text P_ ((struct buffer *b));
184static Lisp_Object copy_overlays P_ ((struct buffer *, Lisp_Object)); 184static Lisp_Object copy_overlays P_ ((struct buffer *, Lisp_Object));
185static void modify_overlay P_ ((struct buffer *, int, int)); 185static void modify_overlay P_ ((struct buffer *, int, int));
186 186
187extern char * emacs_strerror P_ ((int));
187 188
188/* For debugging; temporary. See set_buffer_internal. */ 189/* For debugging; temporary. See set_buffer_internal. */
189/* Lisp_Object Qlisp_mode, Vcheck_symbol; */ 190/* Lisp_Object Qlisp_mode, Vcheck_symbol; */
@@ -4350,6 +4351,18 @@ static int mmap_initialized_p;
4350 4351
4351#define MEM_ALIGN sizeof (double) 4352#define MEM_ALIGN sizeof (double)
4352 4353
4354/* Predicate returning true if part of the address range [START ..
4355 END[ is currently mapped. Used to prevent overwriting an existing
4356 memory mapping.
4357
4358 Default is to conservativly assume the address range is occupied by
4359 something else. This can be overridden by system configuration
4360 files if system-specific means to determine this exists. */
4361
4362#ifndef MMAP_ALLOCATED_P
4363#define MMAP_ALLOCATED_P(start, end) 1
4364#endif
4365
4353/* Function prototypes. */ 4366/* Function prototypes. */
4354 4367
4355static int mmap_free_1 P_ ((struct mmap_region *)); 4368static int mmap_free_1 P_ ((struct mmap_region *));
@@ -4442,16 +4455,13 @@ mmap_enlarge (r, npages)
4442 } 4455 }
4443 else if (npages > 0) 4456 else if (npages > 0)
4444 { 4457 {
4445 struct mmap_region *r2;
4446
4447 nbytes = npages * mmap_page_size; 4458 nbytes = npages * mmap_page_size;
4448 4459
4449 /* Try to map additional pages at the end of the region. We 4460 /* Try to map additional pages at the end of the region. We
4450 cannot do this if the address range is already occupied by 4461 cannot do this if the address range is already occupied by
4451 something else because mmap deletes any previous mapping. 4462 something else because mmap deletes any previous mapping.
4452 I'm not sure this is worth doing, let's see. */ 4463 I'm not sure this is worth doing, let's see. */
4453 r2 = mmap_find (region_end, region_end + nbytes); 4464 if (!MMAP_ALLOCATED_P (region_end, region_end + nbytes))
4454 if (r2 == NULL)
4455 { 4465 {
4456 POINTER_TYPE *p; 4466 POINTER_TYPE *p;
4457 4467
@@ -4971,8 +4981,9 @@ init_buffer ()
4971 if (NILP (buffer_defaults.enable_multibyte_characters)) 4981 if (NILP (buffer_defaults.enable_multibyte_characters))
4972 Fset_buffer_multibyte (Qnil); 4982 Fset_buffer_multibyte (Qnil);
4973 4983
4974 /* If PWD is accurate, use it instead of calling getwd. This is faster 4984 /* If PWD is accurate, use it instead of calling getwd. PWD is
4975 when PWD is right, and may avoid a fatal error. */ 4985 sometimes a nicer name, and using it may avoid a fatal error if a
4986 parent directory is searchable but not readable. */
4976 if ((pwd = getenv ("PWD")) != 0 4987 if ((pwd = getenv ("PWD")) != 0
4977 && (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1]))) 4988 && (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1])))
4978 && stat (pwd, &pwdstat) == 0 4989 && stat (pwd, &pwdstat) == 0
@@ -5233,7 +5244,7 @@ nil here means use current buffer's major mode. */);
5233 doc: /* Symbol for current buffer's major mode. */); 5244 doc: /* Symbol for current buffer's major mode. */);
5234 5245
5235 DEFVAR_PER_BUFFER ("mode-name", &current_buffer->mode_name, 5246 DEFVAR_PER_BUFFER ("mode-name", &current_buffer->mode_name,
5236 make_number (Lisp_String), 5247 Qnil,
5237 doc: /* Pretty name of current buffer's major mode (a string). */); 5248 doc: /* Pretty name of current buffer's major mode (a string). */);
5238 5249
5239 DEFVAR_PER_BUFFER ("abbrev-mode", &current_buffer->abbrev_mode, Qnil, 5250 DEFVAR_PER_BUFFER ("abbrev-mode", &current_buffer->abbrev_mode, Qnil,
@@ -5286,6 +5297,9 @@ If this is nil, the buffer is saved without any code conversion
5286unless some coding system is specified in `file-coding-system-alist' 5297unless some coding system is specified in `file-coding-system-alist'
5287for the buffer file. 5298for the buffer file.
5288 5299
5300If the text to be saved cannot be encoded as specified by this variable,
5301an alternative encoding is selected by `select-safe-coding-system', which see.
5302
5289The variable `coding-system-for-write', if non-nil, overrides this variable. 5303The variable `coding-system-for-write', if non-nil, overrides this variable.
5290 5304
5291This variable is never applied to a way of decoding a file while reading it. */); 5305This variable is never applied to a way of decoding a file while reading it. */);
@@ -5468,7 +5482,7 @@ from happening repeatedly and making Emacs nonfunctional. */);
5468 Vbefore_change_functions = Qnil; 5482 Vbefore_change_functions = Qnil;
5469 5483
5470 DEFVAR_LISP ("after-change-functions", &Vafter_change_functions, 5484 DEFVAR_LISP ("after-change-functions", &Vafter_change_functions,
5471 doc: /* List of function to call after each text change. 5485 doc: /* List of functions to call after each text change.
5472Three arguments are passed to each function: the positions of 5486Three arguments are passed to each function: the positions of
5473the beginning and end of the range of changed text, 5487the beginning and end of the range of changed text,
5474and the length in bytes of the pre-change text replaced by that range. 5488and the length in bytes of the pre-change text replaced by that range.