summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2008-06-24 17:56:14 +0000
committerChong Yidong <cyd@stupidchicken.com>2008-06-24 17:56:14 +0000
commit0858cd02f0a115c4ad7e6c5ce92b545e662b7687 (patch)
treeda651be3e8564c8733fe7e1dbe2a4955c6d96262
parentb09987195749473fe0121feac7a72929c76749a4 (diff)
downloademacs-0858cd02f0a115c4ad7e6c5ce92b545e662b7687.tar.gz
(syms_of_buffer): New variables default-word-wrap and word-wrap.
(init_buffer_once): Initialize them.
-rw-r--r--src/buffer.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 04786dcfa86..4655e05ec63 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5139,6 +5139,7 @@ init_buffer_once ()
XSETFASTINT (buffer_defaults.tab_width, 8);
buffer_defaults.truncate_lines = Qnil;
+ buffer_defaults.word_wrap = Qnil;
buffer_defaults.ctl_arrow = Qt;
buffer_defaults.direction_reversed = Qnil;
buffer_defaults.cursor_type = Qt;
@@ -5211,6 +5212,7 @@ init_buffer_once ()
#endif
XSETFASTINT (buffer_local_flags.tab_width, idx); ++idx;
XSETFASTINT (buffer_local_flags.truncate_lines, idx); ++idx;
+ XSETFASTINT (buffer_local_flags.word_wrap, idx); ++idx;
XSETFASTINT (buffer_local_flags.ctl_arrow, idx); ++idx;
XSETFASTINT (buffer_local_flags.fill_column, idx); ++idx;
XSETFASTINT (buffer_local_flags.left_margin, idx); ++idx;
@@ -5502,6 +5504,11 @@ This is the same as (default-value 'buffer-file-coding-system). */);
doc: /* Default value of `truncate-lines' for buffers that do not override it.
This is the same as (default-value 'truncate-lines). */);
+ DEFVAR_LISP_NOPRO ("default-word-wrap",
+ &buffer_defaults.word_wrap,
+ doc: /* Default value of `word-wrap' for buffers that do not override it.
+This is the same as (default-value 'word-wrap). */);
+
DEFVAR_LISP_NOPRO ("default-fill-column",
&buffer_defaults.fill_column,
doc: /* Default value of `fill-column' for buffers that do not override it.
@@ -5753,6 +5760,15 @@ Note that this is overridden by the variable
`truncate-partial-width-windows' if that variable is non-nil
and this buffer is not full-frame width. */);
+ DEFVAR_PER_BUFFER ("word-wrap", &current_buffer->word_wrap, Qnil,
+ doc: /* *Non-nil means to use word-wrapping for continuation lines.
+When word-wrapping is on, continuation lines are wrapped at the space
+or tab character nearest to the right window edge.
+If nil, continuation lines are wrapped at the right screen edge.
+
+This variable has no effect if long lines are truncated (see
+`truncate-lines' and `truncate-partial-width-windows'). */);
+
#ifdef DOS_NT
DEFVAR_PER_BUFFER ("buffer-file-type", &current_buffer->buffer_file_type,
Qnil,