diff options
| author | Eli Zaretskii | 2010-01-01 06:22:52 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2010-01-01 06:22:52 -0500 |
| commit | b44d9321f299626113e7b2e15371b20f7ad38892 (patch) | |
| tree | b0078c8e083dd9ef6bc6bb338fd9fbb505a76da8 /src/buffer.c | |
| parent | be39f003e91ecb81161e5cf14ec0b635a6dc229d (diff) | |
| download | emacs-b44d9321f299626113e7b2e15371b20f7ad38892.tar.gz emacs-b44d9321f299626113e7b2e15371b20f7ad38892.zip | |
Retrospective commit from 2009-10-05.
Continue working on paragraph base direction.
Support per-buffer default paragraph direction.
buffer.h (struct buffer): New member paragraph_direction.
buffer.c (init_buffer_once): Initialize it.
(syms_of_buffer): Declare Lisp variables
default-paragraph-direction and paragraph-direction.
dispextern.h (struct it): New member paragraph_embedding.
xdisp.c (init_iterator): Initialize it from the buffer's value
of paragraph-direction.
<Qright_to_left, Qleft_to_right>: New variables.
(syms_of_xdisp): Initialize and staticpro them.
(set_iterator_to_next, next_element_from_buffer): Use the value of
paragraph_embedding to determine the paragraph direction.
bidi.c (bidi_line_init): Fix second argument to
bidi_set_sor_type.
(bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
(bidi_get_next_char_visually): Record the last character of the
separator in separator_limit, not the character after that.
(bidi_find_paragraph_start): Accept character and byte positions
instead of the whole iterator stricture. All callers changed.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c index 2930465834d..8484abcdbb5 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5188,6 +5188,7 @@ init_buffer_once () | |||
| 5188 | buffer_defaults.ctl_arrow = Qt; | 5188 | buffer_defaults.ctl_arrow = Qt; |
| 5189 | buffer_defaults.bidi_display_reordering = Qnil; | 5189 | buffer_defaults.bidi_display_reordering = Qnil; |
| 5190 | buffer_defaults.direction_reversed = Qnil; | 5190 | buffer_defaults.direction_reversed = Qnil; |
| 5191 | buffer_defaults.paragraph_direction = Qnil; | ||
| 5191 | buffer_defaults.cursor_type = Qt; | 5192 | buffer_defaults.cursor_type = Qt; |
| 5192 | buffer_defaults.extra_line_spacing = Qnil; | 5193 | buffer_defaults.extra_line_spacing = Qnil; |
| 5193 | buffer_defaults.cursor_in_non_selected_windows = Qt; | 5194 | buffer_defaults.cursor_in_non_selected_windows = Qt; |
| @@ -5274,6 +5275,7 @@ init_buffer_once () | |||
| 5274 | XSETFASTINT (buffer_local_flags.category_table, idx); ++idx; | 5275 | XSETFASTINT (buffer_local_flags.category_table, idx); ++idx; |
| 5275 | XSETFASTINT (buffer_local_flags.bidi_display_reordering, idx); ++idx; | 5276 | XSETFASTINT (buffer_local_flags.bidi_display_reordering, idx); ++idx; |
| 5276 | XSETFASTINT (buffer_local_flags.direction_reversed, idx); ++idx; | 5277 | XSETFASTINT (buffer_local_flags.direction_reversed, idx); ++idx; |
| 5278 | XSETFASTINT (buffer_local_flags.paragraph_direction, idx); ++idx; | ||
| 5277 | XSETFASTINT (buffer_local_flags.buffer_file_coding_system, idx); | 5279 | XSETFASTINT (buffer_local_flags.buffer_file_coding_system, idx); |
| 5278 | /* Make this one a permanent local. */ | 5280 | /* Make this one a permanent local. */ |
| 5279 | buffer_permanent_local_flags[idx++] = 1; | 5281 | buffer_permanent_local_flags[idx++] = 1; |
| @@ -5545,6 +5547,11 @@ This is the same as (default-value 'direction-reversed). */); | |||
| 5545 | doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it. | 5547 | doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it. |
| 5546 | This is the same as (default-value 'enable-multibyte-characters). */); | 5548 | This is the same as (default-value 'enable-multibyte-characters). */); |
| 5547 | 5549 | ||
| 5550 | DEFVAR_LISP_NOPRO ("default-paragraph-direction", | ||
| 5551 | &buffer_defaults.paragraph_direction, | ||
| 5552 | doc: /* Default value of `paragraph-direction' for buffers that do not override it. | ||
| 5553 | This is the same as (default-value 'paragraph-direction). */); | ||
| 5554 | |||
| 5548 | DEFVAR_LISP_NOPRO ("default-buffer-file-coding-system", | 5555 | DEFVAR_LISP_NOPRO ("default-buffer-file-coding-system", |
| 5549 | &buffer_defaults.buffer_file_coding_system, | 5556 | &buffer_defaults.buffer_file_coding_system, |
| 5550 | doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it. | 5557 | doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it. |
| @@ -5806,6 +5813,18 @@ See also the variable `bidi-display-reordering'. */); | |||
| 5806 | doc: /*Non-nil means reorder bidirectional text for display in the visual order. | 5813 | doc: /*Non-nil means reorder bidirectional text for display in the visual order. |
| 5807 | See also the variable `direction-reversed'. */); | 5814 | See also the variable `direction-reversed'. */); |
| 5808 | 5815 | ||
| 5816 | DEFVAR_PER_BUFFER ("paragraph-direction", | ||
| 5817 | ¤t_buffer->paragraph_direction, Qnil, | ||
| 5818 | doc: /* *If non-nil, forces directionality of text paragraphs in the buffer. | ||
| 5819 | |||
| 5820 | If this is nil (the default), the direction of each paragraph is | ||
| 5821 | determined by the first strong directional character of its text. | ||
| 5822 | The values of `right-to-left' and `left-to-right' override that. | ||
| 5823 | Any other value is treated as nil. | ||
| 5824 | |||
| 5825 | This variable has no effect unless the buffer's value of | ||
| 5826 | \`bidi-display-reordering' is non-nil. */); | ||
| 5827 | |||
| 5809 | DEFVAR_PER_BUFFER ("truncate-lines", ¤t_buffer->truncate_lines, Qnil, | 5828 | DEFVAR_PER_BUFFER ("truncate-lines", ¤t_buffer->truncate_lines, Qnil, |
| 5810 | doc: /* *Non-nil means do not display continuation lines. | 5829 | doc: /* *Non-nil means do not display continuation lines. |
| 5811 | Instead, give each line of text just one screen line. | 5830 | Instead, give each line of text just one screen line. |