Mercurial > emacs
annotate admin/make-emacs @ 107648:babfb0a156a1
Initial support for bidirectional editing.
Makefile.in (obj): Include bidi.o.
(bidi.o): New target.
makefile.w32-in (OBJ1): Add $(BLD)/bidi.$(O).
($(BLD)/bidi.$(O)): New target.
bidi.c: New file.
buffer.h (struct buffer): New members bidi_display_reordering
and bidi_paragraph_direction.
buffer.c (init_buffer_once): Initialize bidi_display_reordering
and bidi_paragraph_direction.
(syms_of_buffer): Declare Lisp variables bidi-display-reordering
and bidi-paragraph-direction.
(Fbuffer_swap_text): Swap the values of
bidi_display_reordering and bidi_paragraph_direction.
dispextern.h (BIDI_MAXLEVEL, BIDI_AT_BASE_LEVEL): New macros.
(bidi_type_t, bidi_dir_t): New types.
(bidi_saved_info, bidi_stack, bidi_it): New structures.
(struct it): New members bidi_p, bidi_it, paragraph_embedding,
prev_stop, base_level_stop, and eol_pos.
(bidi_init_it, bidi_get_next_char_visually): New prototypes.
(IT_STACK_SIZE): Enlarge to 5.
(struct glyph_row): New member reversed_p.
<string_buffer_position>: Update prototype.
(PRODUCE_GLYPHS): Set the reversed_p flag in the iterator's
glyph_row if bidi_it.paragraph_dir == R2L.
(struct glyph): New members resolved_level and bidi_type.
dispnew.c (direct_output_forward_char): Give up if we need bidi
processing or buffer's direction is right-to-left.
(prepare_desired_row): Preserve the reversed_p flag.
(row_equal_p): Compare the reversed_p attributes as well.
xdisp.c (init_iterator): Initialize it->bidi_p. Call
bidi_init_it and set it->paragraph_embedding from the current
buffer's value of bidi_paragraph_direction.
(reseat_1): Initialize bidi_it.first_elt.
(set_iterator_to_next, next_element_from_buffer): Use the value of
paragraph_embedding to determine the paragraph direction.
(set_iterator_to_next): Under bidi reordering, call
bidi_get_next_char_visually. Call bidi_paragraph_init if the
new_paragraph flag is set in the bidi iterator.
(next_element_from_buffer): If bidi_it.first_elt is set,
initialize paragraph direction and find the first character to
display in the visual order. If reseated to a middle of a line,
prime the bidi iterator starting at the line's beginning. Handle
the situation where we overstepped stop_charpos due to
non-linearity of the bidi iteration. Likewise for when we back up
beyond the previous stop_charpos. When moving across stop_charpos,
record it in prev_stop.
(display_line): Set row->end and it->start for the next row to the
next character in logical order. Always extend reversed_p rows to
the end of line, even if they end at ZV. Copy the reversed_p flag
to the next glyph row. Keep calling set_cursor_from_row for
bidi-reordered rows even if we already have a possible candidate
for cursor position. Set row_end after all the row's glyphs have
been produced, by looping over the glyphs. Record the position
after EOL in it->eol_pos, and use it to set end_pos of the last
row produced for a continued line.
<Qright_to_left, Qleft_to_right>: New variables.
(syms_of_xdisp): Initialize and staticpro them.
(string_buffer_position_lim): New function.
(string_buffer_position): Most of code moved to
string_buffer_position_lim. Last argument and return value are
now EMACS_INT; all callers changed.
(set_cursor_from_row): Rewritten to support bidirectional text and
reversed glyph rows.
(text_outside_line_unchanged_p, try_window_id): Disable
optimizations if we are reordering bidirectional text and the
paragraph direction can be affected by the change.
(append_glyph, append_composite_glyph)
(produce_image_glyph, append_stretch_glyph): Set the
resolved_level and bidi_type members of each glyph.
(append_glyph): If the glyph row is reversed, prepend the glyph
rather than appending it.
(handle_stop_backwards): New function.
(reseat_1, pop_it, push_it): Set prev_stop and base_level_stop.
(reseat): call handle_stop_backwards to recompute prev_stop and
base_level_stop for the new position.
(handle_invisible_prop): Under bidi iteration, skip invisible text
using bidi_get_next_char_visually. If we are `reseat'ed, init the
paragraph direction. Update IT->prev_stop after skipping
invisible text.
(move_it_in_display_line_to): New variables prev_method
and prev_pos. Compare for strict equality in
BUFFER_POS_REACHED_P.
(try_cursor_movement): Examine all the candidate rows that occlude
point, to return the best match. If rows are bidi-reordered
and point moved backwards, back up to the row that is not a
continuation line, and start looking for a suitable row from
there.
term.c (append_glyph): Reverse glyphs by pre-pending them,
rather than appending, if the glyph_row's reversed_p flag is set.
Set the resolved_level and bidi_type members of each glyph.
.gdbinit (pbiditype): New command.
(pgx): Use it to display bidi level and type of the glyph.
(pitx): Display some bidi information about the iterator.
(prowlims, pmtxrows): New commands.
files.el: Make bidi-display-reordering safe variable for boolean
values.
mule.texi (International): Mention support of bidirectional editing.
(Bidirectional Editing): New section.
HELLO: Reorder Arabic and Hebrew into logical order, and
insert RLM before the opening paren, to make the display more
reasonable. Add setting for bidi-display-reordering in the local
variables section.
NEWS: Mention initial support for bidirectional editing.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Tue, 30 Mar 2010 05:13:07 -0400 |
parents | 1d1d5d9bd884 |
children | 376148b31b5e |
rev | line source |
---|---|
38850 | 1 #! /usr/bin/perl |
94833
e6db9ee945b8
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
2 # Build Emacs with various options for profiling, debugging, |
e6db9ee945b8
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
3 # with and without warnings enabled etc. |
38850 | 4 |
106815 | 5 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
75348 | 6 # Free Software Foundation, Inc. |
94833
e6db9ee945b8
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
7 |
38850 | 8 # This file is part of GNU Emacs. |
94833
e6db9ee945b8
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
9 |
e6db9ee945b8
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
10 # GNU Emacs is free software: you can redistribute it and/or modify |
38850 | 11 # it under the terms of the GNU General Public License as published by |
94833
e6db9ee945b8
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
12 # the Free Software Foundation, either version 3 of the License, or |
e6db9ee945b8
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
13 # (at your option) any later version. |
e6db9ee945b8
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
14 |
38850 | 15 # GNU Emacs is distributed in the hope that it will be useful, |
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 # GNU General Public License for more details. | |
94833
e6db9ee945b8
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
19 |
38850 | 20 # You should have received a copy of the GNU General Public License |
94833
e6db9ee945b8
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
21 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
38850 | 22 |
23 | |
24 require 5; | |
25 use Getopt::Long; | |
26 use File::Basename; | |
27 use Cwd; | |
28 | |
29 # Default CVS sandbox directory. Only used when called from outside | |
30 # of the sandbox. | |
31 | |
32 $root = $ENV{"EMACS_ROOT"}; | |
33 $root = "/gd/gnu/emacs" unless $root; | |
34 | |
35 # Default make command. | |
36 | |
37 $make = $ENV{"EMACS_MAKE"}; | |
38 $make = "gmake" unless $make; | |
39 | |
40 $rc = GetOptions ("help" => \$help, | |
41 "enable-checking" => \$enable_checking, | |
42 "no-warn" => \$no_warn, | |
43 "check-marked" => \$check_marked, | |
44 "all" => \$all, | |
45 "no-optim" => \$no_optim, | |
46 "union-type" => \$union_type, | |
47 "gprof" => \$profile, | |
48 "malloc-check" => \$malloc_check, | |
49 "no-mcheck" => \$no_mcheck, | |
50 "alias" => \$aliasing, | |
39871
6bd2a61edfa8
Add --boot switch for bootstrapping. Logs to
Gerd Moellmann <gerd@gnu.org>
parents:
38850
diff
changeset
|
51 "boot" => \$boot, |
38850 | 52 "wall" => \$wall, |
53 "gcc3" => \$gcc3, | |
54 "trace-selection" => \$trace_selection, | |
41841 | 55 "trace-move" => \$trace_move, |
38850 | 56 "stabs" => \$use_stabs, |
57 "optim" => \$optim); | |
58 | |
59 if ($rc == 0 || $help) | |
60 { | |
61 print <<USAGE; | |
62 make-emacs [options] ... | |
63 | |
64 Build Emacs. | |
65 | |
66 --help show this help | |
67 --all make clean versionclean first | |
96267 | 68 --boot make bootstrap, log to boot.log |
85357 | 69 --enable-checking ENABLE_CHECKING=1 |
38850 | 70 --no-warn disable warnings |
71 --check-marked GC_CHECK_MARKED_OBJECTS=1 | |
72 --optim no debug defines | |
73 --gprof make Emacs for profiling | |
74 --union-type define USE_LISP_UNION_TYPE (bad for GDB) | |
75 --malloc-check define GC_MALLOC_CHECK | |
76 --no-mcheck dont define GC_MCHECK | |
77 --wall compile with -Wall | |
78 --gcc3 use GCC 3.0 (30% slower compilation, slower code) | |
79 --trace-selection print traces in xselect.c | |
41841 | 80 --trace-move print traces for move_it* functions |
38850 | 81 --stabs use -gstabs instead -g |
82 | |
83 Default is to compile with warnings, with -DGC_MCHECK=1, and | |
84 with -DGLYPH_DEBUG=1. | |
85 | |
86 USAGE | |
87 exit 1; | |
88 } | |
89 | |
90 # Chdir to the top-level directory of the tree. If not in a tree | |
91 # containing Emacs, use the default. | |
92 | |
93 while (! -f "src/emacs.c" && cwd () ne "/") | |
94 { | |
95 chdir ".."; | |
96 } | |
97 | |
98 chdir $root if cwd () eq "/"; | |
99 chdir "./src"; | |
100 print "Build in ", cwd (), "\n"; | |
101 | |
102 # If first arg is `all' or if `--all' specified, ensure a clean | |
103 # build. | |
104 | |
105 if (@ARGV && $ARGV[0] eq "all") | |
106 { | |
107 $all = 1; | |
108 shift @ARGV; | |
109 } | |
110 | |
111 system ("$make clean versionclean") if $all; | |
112 | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
41841
diff
changeset
|
113 if ($wall) |
38850 | 114 { |
115 $warn = "-Wall"; | |
116 } | |
117 elsif (!$no_warn) | |
118 { | |
119 $warn = "-Wpointer-arith -Wchar-subscripts -Wformat -Wimplicit-int"; | |
120 $warn = "$warn -Wreturn-type -Wswitch -Wuninitialized"; | |
121 } | |
122 | |
123 $defs = "-DGLYPH_DEBUG=1" unless $optim; | |
124 $defs = "$defs -DGC_CHECK_MARKED_OBJECTS=1" if $check_marked; | |
125 $defs = "$defs -DENABLE_CHECKING=1" if $enable_checking; | |
126 | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
41841
diff
changeset
|
127 if ($profile) |
38850 | 128 { |
129 $opts = "-pg"; | |
130 $defs = "$defs -DPROFILING=1"; | |
131 } | |
132 else | |
133 { | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
41841
diff
changeset
|
134 if ($use_stabs) |
38850 | 135 { |
136 $opts = "-gstabs"; | |
137 } | |
138 else | |
139 { | |
140 $opts = "-g"; | |
141 } | |
142 } | |
143 | |
144 $defs = "$defs -DUSE_LISP_UNION_TYPE" if $union_type; | |
145 $defs = "$defs -DGC_MALLOC_CHECK=1 -DGC_PROTECT_MALLOC_STATE=1" if $malloc_check; | |
146 $defs = "$defs -DGC_MCHECK=1" unless $no_mcheck; | |
147 | |
148 $defs = "$defs -DTRACE_SELECTION" if $trace_selection; | |
41841 | 149 $defs = "$defs -DDEBUG_TRACE_MOVE" if $trace_move; |
38850 | 150 |
151 # arch=pentium leads to slightly faster code than without. | |
152 $opts = "$opts -march=pentiumpro"; | |
153 | |
154 if ($optim) | |
155 { | |
156 $opts = "$opts -pipe -O3"; | |
157 } | |
158 elsif ($no_optim) | |
159 { | |
160 $opts = "$opts -pipe -fno-inline"; | |
161 } | |
162 else | |
163 { | |
164 $opts = "$opts -O -pipe -fno-inline"; | |
165 } | |
166 | |
167 $opts = "$opts -fstrict-aliasing" if $aliasing; | |
168 | |
169 $opts = "$opts $defs" if $defs; | |
170 $opts = "$opts $warn" if $warn; | |
171 | |
172 $cc = "/usr/bin/gcc"; | |
173 $cc = "/gd/local/bin/gcc" if $gcc3; | |
174 | |
39871
6bd2a61edfa8
Add --boot switch for bootstrapping. Logs to
Gerd Moellmann <gerd@gnu.org>
parents:
38850
diff
changeset
|
175 if ($boot) |
6bd2a61edfa8
Add --boot switch for bootstrapping. Logs to
Gerd Moellmann <gerd@gnu.org>
parents:
38850
diff
changeset
|
176 { |
6bd2a61edfa8
Add --boot switch for bootstrapping. Logs to
Gerd Moellmann <gerd@gnu.org>
parents:
38850
diff
changeset
|
177 chdir ".."; |
6bd2a61edfa8
Add --boot switch for bootstrapping. Logs to
Gerd Moellmann <gerd@gnu.org>
parents:
38850
diff
changeset
|
178 system "mv boot.log boot.log.old" if -f "boot.log"; |
6bd2a61edfa8
Add --boot switch for bootstrapping. Logs to
Gerd Moellmann <gerd@gnu.org>
parents:
38850
diff
changeset
|
179 exit system "script boot.log $make CC=\"$cc\" CFLAGS=\"$opts\" bootstrap"; |
6bd2a61edfa8
Add --boot switch for bootstrapping. Logs to
Gerd Moellmann <gerd@gnu.org>
parents:
38850
diff
changeset
|
180 } |
6bd2a61edfa8
Add --boot switch for bootstrapping. Logs to
Gerd Moellmann <gerd@gnu.org>
parents:
38850
diff
changeset
|
181 |
38850 | 182 exit system "$make CC=\"$cc\" CFLAGS=\"$opts\" @ARGV"; |
183 | |
184 # Local Variables: | |
185 # mode: cperl | |
186 # End: | |
52401 | 187 |
188 # arch-tag: 5c3f9713-9ece-4a12-b3f8-deaff15974ba |