comparison src/buffer.c @ 89943:4c90ffeb71c5

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-15 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-218 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-220 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-221 Restore deleted tagline in etc/TUTORIAL.ru * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-222 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-228 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-229 Remove TeX output files from the archive * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-230 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-247 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-248 src/lisp.h (CYCLE_CHECK): Macro moved from xfaces.c * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-249 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-256 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-258 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-263 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-264 Update from CVS: lispref/display.texi: emacs -> Emacs. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-265 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-274 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-275 Update from CVS: man/makefile.w32-in: Revert last change * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-276 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-295 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-296 Allow restarting an existing debugger session that's exited * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-297 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-299 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-300 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-327 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-328 Update from CVS: src/.gdbinit (xsymbol): Fix last change. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-329 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-344 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-345 Tweak source regexps so that building in place won't cause problems * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-346 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-351 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-352 Update from CVS: lisp/flymake.el: New file. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-353 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-361 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-362 Support " [...]" style defaults in minibuffer-electric-default-mode * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-363 (read-number): Use canonical format for default in prompt. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-364 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-367 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-368 Improve display-supports-face-attributes-p on non-ttys * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-369 Rewrite face-differs-from-default-p * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-370 Move `display-supports-face-attributes-p' entirely into C code * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-371 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-372 Simplify face-differs-from-default-p; don't consider :stipple. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-373 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-374 (tty_supports_face_attributes_p): Ensure attributes differ from default * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-375 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-376 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-377 (Fdisplay_supports_face_attributes_p): Work around bootstrapping problem * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-378 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-380 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-381 Face merging cleanups * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-382 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-384 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-385 src/xfaces.c (push_named_merge_point): Return 0 if a cycle is detected * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-386 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-395 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-396 Tweak arch tagging to make build/install-in-place less annoying * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-397 Work around vc-arch problems when building eshell * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-398 Tweak permissions * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-399 Tweak directory permissions * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-400 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-401 More build-in-place tweaking of arch tagging * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-402 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-403 Yet more build-in-place tweaking of arch tagging * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-404 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-409 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-410 Make sure image types are initialized for lookup too * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-411 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-416 Update from CVS
author Miles Bader <miles@gnu.org>
date Mon, 28 Jun 2004 07:56:49 +0000
parents 68c22ea6027c e9132cd92733
children 029a652ac817
comparison
equal deleted inserted replaced
89942:9cb747ae49af 89943:4c90ffeb71c5
486 486
487 static void 487 static void
488 clone_per_buffer_values (from, to) 488 clone_per_buffer_values (from, to)
489 struct buffer *from, *to; 489 struct buffer *from, *to;
490 { 490 {
491 Lisp_Object to_buffer; 491 Lisp_Object to_buffer, tem;
492 int offset; 492 int offset;
493 493
494 XSETBUFFER (to_buffer, to); 494 XSETBUFFER (to_buffer, to);
495 495
496 for (offset = PER_BUFFER_VAR_OFFSET (name) + sizeof (Lisp_Object); 496 for (offset = PER_BUFFER_VAR_OFFSET (name) + sizeof (Lisp_Object);
513 513
514 bcopy (from->local_flags, to->local_flags, sizeof to->local_flags); 514 bcopy (from->local_flags, to->local_flags, sizeof to->local_flags);
515 515
516 to->overlays_before = copy_overlays (to, from->overlays_before); 516 to->overlays_before = copy_overlays (to, from->overlays_before);
517 to->overlays_after = copy_overlays (to, from->overlays_after); 517 to->overlays_after = copy_overlays (to, from->overlays_after);
518
519 /* Copy the alist of local variables,
520 and all the alist elements too. */
521 to->local_var_alist
522 = Fcopy_sequence (from->local_var_alist);
523 for (tem = to->local_var_alist; CONSP (tem);
524 tem = XCDR (tem))
525 XSETCAR (tem, Fcons (XCAR (XCAR (tem)), XCDR (XCAR (tem))));
518 } 526 }
519 527
520 528
521 DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, 529 DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer,
522 2, 3, 530 2, 3,
831 } 839 }
832 840
833 DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer, 841 DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer,
834 0, 1, 0, 842 0, 1, 0,
835 doc: /* Return the base buffer of indirect buffer BUFFER. 843 doc: /* Return the base buffer of indirect buffer BUFFER.
836 If BUFFER is not indirect, return nil. */) 844 If BUFFER is not indirect, return nil.
845 BUFFER defaults to the current buffer. */)
837 (buffer) 846 (buffer)
838 register Lisp_Object buffer; 847 register Lisp_Object buffer;
839 { 848 {
840 struct buffer *base; 849 struct buffer *base;
841 Lisp_Object base_buffer; 850 Lisp_Object base_buffer;
1681 1690
1682 DEFUN ("pop-to-buffer", Fpop_to_buffer, Spop_to_buffer, 1, 3, 0, 1691 DEFUN ("pop-to-buffer", Fpop_to_buffer, Spop_to_buffer, 1, 3, 0,
1683 doc: /* Select buffer BUFFER in some window, preferably a different one. 1692 doc: /* Select buffer BUFFER in some window, preferably a different one.
1684 If BUFFER is nil, then some other buffer is chosen. 1693 If BUFFER is nil, then some other buffer is chosen.
1685 If `pop-up-windows' is non-nil, windows can be split to do this. 1694 If `pop-up-windows' is non-nil, windows can be split to do this.
1686 If optional second arg OTHER-WINDOW is nil, insist on finding another 1695 If optional second arg OTHER-WINDOW is non-nil, insist on finding another
1687 window even if BUFFER is already visible in the selected window, 1696 window even if BUFFER is already visible in the selected window,
1688 and ignore `same-window-regexps' and `same-window-buffer-names'. 1697 and ignore `same-window-regexps' and `same-window-buffer-names'.
1689 This uses the function `display-buffer' as a subroutine; see the documentation 1698 This uses the function `display-buffer' as a subroutine; see the documentation
1690 of `display-buffer' for additional customization information. 1699 of `display-buffer' for additional customization information.
1691 1700
2143 BEGV = BEGV_BYTE; 2152 BEGV = BEGV_BYTE;
2144 ZV = ZV_BYTE; 2153 ZV = ZV_BYTE;
2145 GPT = GPT_BYTE; 2154 GPT = GPT_BYTE;
2146 TEMP_SET_PT_BOTH (PT_BYTE, PT_BYTE); 2155 TEMP_SET_PT_BOTH (PT_BYTE, PT_BYTE);
2147 2156
2148 2157
2149 for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next) 2158 for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next)
2150 tail->charpos = tail->bytepos; 2159 tail->charpos = tail->bytepos;
2151 2160
2152 /* Convert multibyte form of 8-bit characters to unibyte. */ 2161 /* Convert multibyte form of 8-bit characters to unibyte. */
2153 pos = BEG; 2162 pos = BEG;
3352 Qnil); 3361 Qnil);
3353 } 3362 }
3354 3363
3355 if (endpos < start) 3364 if (endpos < start)
3356 break; 3365 break;
3357 3366
3358 if (endpos < end 3367 if (endpos < end
3359 || (startpos >= start && startpos < end)) 3368 || (startpos >= start && startpos < end))
3360 { 3369 {
3361 /* Add it to the end of the wrong list. Later on, 3370 /* Add it to the end of the wrong list. Later on,
3362 recenter_overlay_lists will move it to the right place. */ 3371 recenter_overlay_lists will move it to the right place. */
3395 /* If the overlay is backwards, make it empty. */ 3404 /* If the overlay is backwards, make it empty. */
3396 if (endpos < startpos) 3405 if (endpos < startpos)
3397 { 3406 {
3398 startpos = endpos; 3407 startpos = endpos;
3399 Fset_marker (OVERLAY_START (overlay), make_number (startpos), 3408 Fset_marker (OVERLAY_START (overlay), make_number (startpos),
3400 Qnil); 3409 Qnil);
3401 } 3410 }
3402 3411
3403 if (startpos >= end) 3412 if (startpos >= end)
3404 break; 3413 break;
3405 3414
4206 prop = Foverlay_get (overlay, Qmodification_hooks); 4215 prop = Foverlay_get (overlay, Qmodification_hooks);
4207 if (!NILP (prop)) 4216 if (!NILP (prop))
4208 add_overlay_mod_hooklist (prop, overlay); 4217 add_overlay_mod_hooklist (prop, overlay);
4209 } 4218 }
4210 } 4219 }
4211 4220
4212 for (tail = current_buffer->overlays_after; tail; tail = tail->next) 4221 for (tail = current_buffer->overlays_after; tail; tail = tail->next)
4213 { 4222 {
4214 int startpos, endpos; 4223 int startpos, endpos;
4215 Lisp_Object ostart, oend; 4224 Lisp_Object ostart, oend;
4216 4225
5442 doc: /* *Non-nil if searches and matches should ignore case. */); 5451 doc: /* *Non-nil if searches and matches should ignore case. */);
5443 5452
5444 DEFVAR_PER_BUFFER ("fill-column", &current_buffer->fill_column, 5453 DEFVAR_PER_BUFFER ("fill-column", &current_buffer->fill_column,
5445 make_number (Lisp_Int), 5454 make_number (Lisp_Int),
5446 doc: /* *Column beyond which automatic line-wrapping should happen. 5455 doc: /* *Column beyond which automatic line-wrapping should happen.
5447 Interactively, you can set this using \\[set-fill-column]. */); 5456 Interactively, you can set the buffer local value using \\[set-fill-column]. */);
5448 5457
5449 DEFVAR_PER_BUFFER ("left-margin", &current_buffer->left_margin, 5458 DEFVAR_PER_BUFFER ("left-margin", &current_buffer->left_margin,
5450 make_number (Lisp_Int), 5459 make_number (Lisp_Int),
5451 doc: /* *Column for the default indent-line-function to indent to. 5460 doc: /* *Column for the default indent-line-function to indent to.
5452 Linefeed indents to this column in Fundamental mode. */); 5461 Linefeed indents to this column in Fundamental mode. */);
5852 5861
5853 DEFVAR_LISP ("transient-mark-mode", &Vtransient_mark_mode, 5862 DEFVAR_LISP ("transient-mark-mode", &Vtransient_mark_mode,
5854 doc: /* *Non-nil means deactivate the mark when the buffer contents change. 5863 doc: /* *Non-nil means deactivate the mark when the buffer contents change.
5855 Non-nil also enables highlighting of the region whenever the mark is active. 5864 Non-nil also enables highlighting of the region whenever the mark is active.
5856 The variable `highlight-nonselected-windows' controls whether to highlight 5865 The variable `highlight-nonselected-windows' controls whether to highlight
5857 all windows or just the selected window. */); 5866 all windows or just the selected window.
5867
5868 If the value is `lambda', that enables Transient Mark mode temporarily
5869 until the next buffer modification. If a command sets the value to `only',
5870 that enables Transient Mark mode for the following command only. */);
5858 Vtransient_mark_mode = Qnil; 5871 Vtransient_mark_mode = Qnil;
5859 5872
5860 DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only, 5873 DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only,
5861 doc: /* *Non-nil means disregard read-only status of buffers or characters. 5874 doc: /* *Non-nil means disregard read-only status of buffers or characters.
5862 If the value is t, disregard `buffer-read-only' and all `read-only' 5875 If the value is t, disregard `buffer-read-only' and all `read-only'
5869 doc: /* Cursor to use when this buffer is in the selected window. 5882 doc: /* Cursor to use when this buffer is in the selected window.
5870 Values are interpreted as follows: 5883 Values are interpreted as follows:
5871 5884
5872 t use the cursor specified for the frame 5885 t use the cursor specified for the frame
5873 nil don't display a cursor 5886 nil don't display a cursor
5874 bar display a bar cursor with default width 5887 box display a filled box cursor
5875 (bar . WIDTH) display a bar cursor with width WIDTH 5888 hollow display a hollow box cursor
5876 ANYTHING ELSE display a box cursor. 5889 bar display a vertical bar cursor with default width
5890 (bar . WIDTH) display a vertical bar cursor with width WIDTH
5891 hbar display a horisontal bar cursor with default width
5892 (hbar . WIDTH) display a horisontal bar cursor with width WIDTH
5893 ANYTHING ELSE display a hollow box cursor.
5877 5894
5878 When the buffer is displayed in a nonselected window, 5895 When the buffer is displayed in a nonselected window,
5879 this variable has no effect; the cursor appears as a hollow box. */); 5896 this variable has no effect; the cursor appears as a hollow box. */);
5880 5897
5881 DEFVAR_PER_BUFFER ("line-spacing", 5898 DEFVAR_PER_BUFFER ("line-spacing",
5882 &current_buffer->extra_line_spacing, Qnil, 5899 &current_buffer->extra_line_spacing, Qnil,
5883 doc: /* Additional space to put between lines when displaying a buffer. 5900 doc: /* Additional space to put between lines when displaying a buffer.
5884 The space is measured in pixels, and put below lines on window systems. */); 5901 The space is measured in pixels, and put below lines on window systems.
5902 If value is a floating point number, it specifies the spacing relative
5903 to the default frame line height. */);
5885 5904
5886 DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions, 5905 DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions,
5887 doc: /* List of functions called with no args to query before killing a buffer. */); 5906 doc: /* List of functions called with no args to query before killing a buffer. */);
5888 Vkill_buffer_query_functions = Qnil; 5907 Vkill_buffer_query_functions = Qnil;
5889 5908