aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c55
1 files changed, 41 insertions, 14 deletions
diff --git a/src/buffer.c b/src/buffer.c
index b7b471d6d46..e78962e1550 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1770,7 +1770,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1770 since anything can happen within do_yes_or_no_p. */ 1770 since anything can happen within do_yes_or_no_p. */
1771 1771
1772 /* Don't kill the minibuffer now current. */ 1772 /* Don't kill the minibuffer now current. */
1773 if (EQ (buffer, XWINDOW (minibuf_window)->buffer)) 1773 if (EQ (buffer, XWINDOW (minibuf_window)->contents))
1774 return Qnil; 1774 return Qnil;
1775 1775
1776 /* When we kill an ordinary buffer which shares it's buffer text 1776 /* When we kill an ordinary buffer which shares it's buffer text
@@ -1821,7 +1821,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1821 /* If the buffer now current is shown in the minibuffer and our buffer 1821 /* If the buffer now current is shown in the minibuffer and our buffer
1822 is the sole other buffer give up. */ 1822 is the sole other buffer give up. */
1823 XSETBUFFER (tem, current_buffer); 1823 XSETBUFFER (tem, current_buffer);
1824 if (EQ (tem, XWINDOW (minibuf_window)->buffer) 1824 if (EQ (tem, XWINDOW (minibuf_window)->contents)
1825 && EQ (buffer, Fother_buffer (buffer, Qnil, Qnil))) 1825 && EQ (buffer, Fother_buffer (buffer, Qnil, Qnil)))
1826 return Qnil; 1826 return Qnil;
1827 1827
@@ -2395,8 +2395,9 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2395 BUF_MARKERS(buf) should either be for `buf' or dead. */ 2395 BUF_MARKERS(buf) should either be for `buf' or dead. */
2396 eassert (!m->buffer); 2396 eassert (!m->buffer);
2397 } 2397 }
2398 { /* Some of the C code expects that w->buffer == w->pointm->buffer. 2398 { /* Some of the C code expects that both window markers of a
2399 So since we just swapped the markers between the two buffers, we need 2399 live window points to that window's buffer. So since we
2400 just swapped the markers between the two buffers, we need
2400 to undo the effect of this swap for window markers. */ 2401 to undo the effect of this swap for window markers. */
2401 Lisp_Object w = Fselected_window (), ws = Qnil; 2402 Lisp_Object w = Fselected_window (), ws = Qnil;
2402 Lisp_Object buf1, buf2; 2403 Lisp_Object buf1, buf2;
@@ -2406,12 +2407,19 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2406 { 2407 {
2407 ws = Fcons (w, ws); 2408 ws = Fcons (w, ws);
2408 if (MARKERP (XWINDOW (w)->pointm) 2409 if (MARKERP (XWINDOW (w)->pointm)
2409 && (EQ (XWINDOW (w)->buffer, buf1) 2410 && (EQ (XWINDOW (w)->contents, buf1)
2410 || EQ (XWINDOW (w)->buffer, buf2))) 2411 || EQ (XWINDOW (w)->contents, buf2)))
2411 Fset_marker (XWINDOW (w)->pointm, 2412 Fset_marker (XWINDOW (w)->pointm,
2412 make_number 2413 make_number
2413 (BUF_BEGV (XBUFFER (XWINDOW (w)->buffer))), 2414 (BUF_BEGV (XBUFFER (XWINDOW (w)->contents))),
2414 XWINDOW (w)->buffer); 2415 XWINDOW (w)->contents);
2416 if (MARKERP (XWINDOW (w)->start)
2417 && (EQ (XWINDOW (w)->contents, buf1)
2418 || EQ (XWINDOW (w)->contents, buf2)))
2419 Fset_marker (XWINDOW (w)->start,
2420 make_number
2421 (XBUFFER (XWINDOW (w)->contents)->last_window_start),
2422 XWINDOW (w)->contents);
2415 w = Fnext_window (w, Qt, Qt); 2423 w = Fnext_window (w, Qt, Qt);
2416 } 2424 }
2417 } 2425 }
@@ -3894,7 +3902,7 @@ modify_overlay (struct buffer *buf, ptrdiff_t start, ptrdiff_t end)
3894 if (buffer_window_count (buf) > 0) 3902 if (buffer_window_count (buf) > 0)
3895 { 3903 {
3896 /* ... it's visible in other window than selected, */ 3904 /* ... it's visible in other window than selected, */
3897 if (buf != XBUFFER (XWINDOW (selected_window)->buffer)) 3905 if (buf != XBUFFER (XWINDOW (selected_window)->contents))
3898 windows_or_buffers_changed = 1; 3906 windows_or_buffers_changed = 1;
3899 /* ... or if we modify an overlay at the end of the buffer 3907 /* ... or if we modify an overlay at the end of the buffer
3900 and so we cannot be sure that window end is still valid. */ 3908 and so we cannot be sure that window end is still valid. */
@@ -5494,6 +5502,8 @@ This is the same as (default-value 'left-margin). */);
5494 DEFVAR_BUFFER_DEFAULTS ("default-tab-width", 5502 DEFVAR_BUFFER_DEFAULTS ("default-tab-width",
5495 tab_width, 5503 tab_width,
5496 doc: /* Default value of `tab-width' for buffers that do not override it. 5504 doc: /* Default value of `tab-width' for buffers that do not override it.
5505NOTE: This controls the display width of a TAB character, and not
5506the size of an indentation step.
5497This is the same as (default-value 'tab-width). */); 5507This is the same as (default-value 'tab-width). */);
5498 5508
5499 DEFVAR_BUFFER_DEFAULTS ("default-case-fold-search", 5509 DEFVAR_BUFFER_DEFAULTS ("default-case-fold-search",
@@ -5685,6 +5695,8 @@ Linefeed indents to this column in Fundamental mode. */);
5685 DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width), 5695 DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width),
5686 Qintegerp, 5696 Qintegerp,
5687 doc: /* Distance between tab stops (for display of tab characters), in columns. 5697 doc: /* Distance between tab stops (for display of tab characters), in columns.
5698NOTE: This controls the display width of a TAB character, and not
5699the size of an indentation step.
5688This should be an integer greater than zero. */); 5700This should be an integer greater than zero. */);
5689 5701
5690 DEFVAR_PER_BUFFER ("ctl-arrow", &BVAR (current_buffer, ctl_arrow), Qnil, 5702 DEFVAR_PER_BUFFER ("ctl-arrow", &BVAR (current_buffer, ctl_arrow), Qnil,
@@ -5876,29 +5888,44 @@ See also the functions `display-table-slot' and `set-display-table-slot'. */);
5876 DEFVAR_PER_BUFFER ("left-margin-width", &BVAR (current_buffer, left_margin_cols), 5888 DEFVAR_PER_BUFFER ("left-margin-width", &BVAR (current_buffer, left_margin_cols),
5877 Qintegerp, 5889 Qintegerp,
5878 doc: /* Width of left marginal area for display of a buffer. 5890 doc: /* Width of left marginal area for display of a buffer.
5879A value of nil means no marginal area. */); 5891A value of nil means no marginal area.
5892
5893Setting this variable does not take effect until a new buffer is displayed
5894in a window. To make the change take effect, call `set-window-buffer'. */);
5880 5895
5881 DEFVAR_PER_BUFFER ("right-margin-width", &BVAR (current_buffer, right_margin_cols), 5896 DEFVAR_PER_BUFFER ("right-margin-width", &BVAR (current_buffer, right_margin_cols),
5882 Qintegerp, 5897 Qintegerp,
5883 doc: /* Width of right marginal area for display of a buffer. 5898 doc: /* Width of right marginal area for display of a buffer.
5884A value of nil means no marginal area. */); 5899A value of nil means no marginal area.
5900
5901Setting this variable does not take effect until a new buffer is displayed
5902in a window. To make the change take effect, call `set-window-buffer'. */);
5885 5903
5886 DEFVAR_PER_BUFFER ("left-fringe-width", &BVAR (current_buffer, left_fringe_width), 5904 DEFVAR_PER_BUFFER ("left-fringe-width", &BVAR (current_buffer, left_fringe_width),
5887 Qintegerp, 5905 Qintegerp,
5888 doc: /* Width of this buffer's left fringe (in pixels). 5906 doc: /* Width of this buffer's left fringe (in pixels).
5889A value of 0 means no left fringe is shown in this buffer's window. 5907A value of 0 means no left fringe is shown in this buffer's window.
5890A value of nil means to use the left fringe width from the window's frame. */); 5908A value of nil means to use the left fringe width from the window's frame.
5909
5910Setting this variable does not take effect until a new buffer is displayed
5911in a window. To make the change take effect, call `set-window-buffer'. */);
5891 5912
5892 DEFVAR_PER_BUFFER ("right-fringe-width", &BVAR (current_buffer, right_fringe_width), 5913 DEFVAR_PER_BUFFER ("right-fringe-width", &BVAR (current_buffer, right_fringe_width),
5893 Qintegerp, 5914 Qintegerp,
5894 doc: /* Width of this buffer's right fringe (in pixels). 5915 doc: /* Width of this buffer's right fringe (in pixels).
5895A value of 0 means no right fringe is shown in this buffer's window. 5916A value of 0 means no right fringe is shown in this buffer's window.
5896A value of nil means to use the right fringe width from the window's frame. */); 5917A value of nil means to use the right fringe width from the window's frame.
5918
5919Setting this variable does not take effect until a new buffer is displayed
5920in a window. To make the change take effect, call `set-window-buffer'. */);
5897 5921
5898 DEFVAR_PER_BUFFER ("fringes-outside-margins", &BVAR (current_buffer, fringes_outside_margins), 5922 DEFVAR_PER_BUFFER ("fringes-outside-margins", &BVAR (current_buffer, fringes_outside_margins),
5899 Qnil, 5923 Qnil,
5900 doc: /* Non-nil means to display fringes outside display margins. 5924 doc: /* Non-nil means to display fringes outside display margins.
5901A value of nil means to display fringes between margins and buffer text. */); 5925A value of nil means to display fringes between margins and buffer text.
5926
5927Setting this variable does not take effect until a new buffer is displayed
5928in a window. To make the change take effect, call `set-window-buffer'. */);
5902 5929
5903 DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, scroll_bar_width), 5930 DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, scroll_bar_width),
5904 Qintegerp, 5931 Qintegerp,