aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona <[email protected]>2010-06-14 11:48:51 +0200
committerJoakim Verona <[email protected]>2010-06-14 11:48:51 +0200
commitc05c21ed109720d66c834a0c5b21ea29416683a6 (patch)
tree8d19421c6601094a1326bbd167d09e349742ef02 /src
parent69fd80388b70ccb8ea04dd3ff046c56672243ffa (diff)
parentd8b0cdddb3c1e4555a50423a9b69234f55fc8f9b (diff)
merged from trunk
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit7
-rw-r--r--src/ChangeLog679
-rw-r--r--src/ChangeLog.104
-rw-r--r--src/ChangeLog.83
-rw-r--r--src/Makefile.in981
-rw-r--r--src/README14
-rw-r--r--src/alloc.c1
-rw-r--r--src/autodeps.mk6
-rw-r--r--src/bidi.c389
-rw-r--r--src/bidimirror.h365
-rw-r--r--src/biditype.h446
-rw-r--r--src/buffer.c12
-rw-r--r--src/callproc.c4
-rw-r--r--src/ccl.c10
-rw-r--r--src/character.c30
-rw-r--r--src/character.h25
-rw-r--r--src/charset.c1
-rw-r--r--src/cmds.c26
-rw-r--r--src/composite.c588
-rw-r--r--src/config.in111
-rw-r--r--src/data.c16
-rw-r--r--src/dbusbind.c17
-rw-r--r--src/deps.mk280
-rw-r--r--src/dispextern.h64
-rw-r--r--src/dispnew.c19
-rw-r--r--src/editfns.c19
-rw-r--r--src/emacs.c82
-rw-r--r--src/eval.c32
-rw-r--r--src/fileio.c73
-rw-r--r--src/fns.c7
-rw-r--r--src/font.c80
-rw-r--r--src/fringe.c2
-rw-r--r--src/gmalloc.c3
-rw-r--r--src/image.c83
-rw-r--r--src/indent.c10
-rw-r--r--src/insdel.c8
-rw-r--r--src/keyboard.c12
-rw-r--r--src/keymap.c39
-rw-r--r--src/lisp.h122
-rw-r--r--src/lread.c4
-rw-r--r--src/m/alpha.h5
-rw-r--r--src/m/hp800.h8
-rw-r--r--src/m/ia64.h9
-rw-r--r--src/m/ibms390.h2
-rw-r--r--src/m/ibms390x.h31
-rw-r--r--src/m/macppc.h6
-rw-r--r--src/m/template.h18
-rw-r--r--src/makefile.w32-in2
-rw-r--r--src/minibuf.c3
-rw-r--r--src/ns.mk39
-rw-r--r--src/nsfns.m2
-rw-r--r--src/nsfont.m2
-rw-r--r--src/nsimage.m2
-rw-r--r--src/nsselect.m2
-rw-r--r--src/nsterm.m2
-rw-r--r--src/process.c31
-rw-r--r--src/regex.c11
-rw-r--r--src/s/aix4-2.h13
-rw-r--r--src/s/bsd-common.h5
-rw-r--r--src/s/cygwin.h9
-rw-r--r--src/s/darwin.h9
-rw-r--r--src/s/gnu-linux.h17
-rw-r--r--src/s/gnu.h15
-rw-r--r--src/s/hpux10-20.h8
-rw-r--r--src/s/irix6-5.h2
-rw-r--r--src/s/ms-w32.h5
-rw-r--r--src/s/msdos.h5
-rw-r--r--src/s/netbsd.h10
-rw-r--r--src/s/sol2-10.h15
-rw-r--r--src/s/sol2-6.h12
-rw-r--r--src/s/template.h8
-rw-r--r--src/s/usg5-4.h12
-rw-r--r--src/search.c8
-rw-r--r--src/sysdep.c76
-rw-r--r--src/systty.h10
-rw-r--r--src/w32.c29
-rw-r--r--src/w32proc.c10
-rw-r--r--src/window.c5
-rw-r--r--src/xdisp.c640
-rw-r--r--src/xgselect.c2
-rw-r--r--src/xsettings.c2
-rw-r--r--src/xterm.c2
82 files changed, 3635 insertions, 2143 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index 5ecdaa4a57..1fd7e28873 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -616,7 +616,7 @@ Pretty print all glyphs in it->glyph_row.
end
define prowlims
- printf "start=%d,end=%d,reversed=%d,cont=%d,at_zv=%d\n", $arg0->start.pos.charpos, $arg0->end.pos.charpos, $arg0->reversed_p, $arg0->continued_p, $arg0->ends_at_zv_p
+ printf "edges=(%d,%d),r2l=%d,cont=%d,trunc=(%d,%d),at_zv=%d\n", $arg0->minpos.charpos, $arg0->maxpos.charpos, $arg0->reversed_p, $arg0->continued_p, $arg0->truncated_on_left_p, $arg0->truncated_on_right_p, $arg0->ends_at_zv_p
end
document prowlims
Print important attributes of a glyph_row structure.
@@ -626,10 +626,13 @@ end
define pmtxrows
set $mtx = $arg0
set $gl = $mtx->rows
- set $glend = $mtx->rows + $mtx->nrows
+ set $glend = $mtx->rows + $mtx->nrows - 1
+ set $i = 0
while ($gl < $glend)
+ printf "%d: ", $i
prowlims $gl
set $gl = $gl + 1
+ set $i = $i + 1
end
end
document pmtxrows
diff --git a/src/ChangeLog b/src/ChangeLog
index 16c20e188b..3e6c8f2439 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,656 @@
+2010-06-12 Eli Zaretskii <[email protected]>
+
+ * makefile.w32-in ($(BLD)/bidi.$(O)): Depend on biditype.h and
+ bidimirror.h.
+
+ * deps.mk (bidi.o): Depend on biditype.h and bidimirror.h.
+
+ * bidi.c (bidi_initialize): Remove explicit initialization of
+ bidi_type_table; include biditype.h instead. Don't support
+ entries whose second codepoint is zero. Initialize
+ bidi_mirror_table.
+ (bidi_mirror_char): Use bidi_mirror_table.
+
+ * biditype.h: New file.
+
+ * bidimirror.h: New file.
+
+ * window.c (syms_of_window): Doc fix (bug#6409).
+
+2010-06-12 Romain Francoise <[email protected]>
+
+ * Makefile.in (lisp, shortlisp): Use new location of vc-hooks and
+ ediff-hook.
+
+2010-06-10 Glenn Morris <[email protected]>
+
+ * editfns.c (Fbyte_to_string): Pacify compiler.
+
+ * m/ibms390x.h: Rather than duplicating ibms390.h, just include it.
+
+2010-06-09 Stefan Monnier <[email protected]>
+
+ * dbusbind.c (xd_append_arg): Don't "make-unibyte" the string.
+ Check `object's type before accessing its guts.
+
+2010-06-09 Dan Nicolaescu <[email protected]>
+
+ * s/usg5-4.h: Fix previous change.
+ Suggested by Lawrence Mitchell <[email protected]>
+
+2010-06-08 Andreas Schwab <[email protected]>
+
+ * minibuf.c (Fall_completions): Add more checks.
+
+2010-06-08 Juanma Barranquero <[email protected]>
+
+ * minibuf.c (Fall_completions): Check COLLECTION's size (bug#6378).
+
+2010-06-08 Dan Nicolaescu <[email protected]>
+
+ * lread.c (X_OK): Remove, unused.
+
+ * dispnew.c: Remove obsolete comment.
+
+ Remove INCLUDED_FCNTL.
+ * xterm.c (INCLUDED_FCNTL):
+ * callproc.c (INCLUDED_FCNTL):
+ * alloc.c (INCLUDED_FCNTL):
+ * systty.h (INCLUDED_FCNTL): Remove all uses, not needed anymore.
+ (emacs_get_tty, emacs_set_tty): Declare unconditionally.
+
+2010-06-07 Martin Rudalics <[email protected]>
+
+ * window.c (Fselect_window): Move `record_buffer' up to the
+ beginning of this function, so the buffer gets recorded
+ even if the selected window does not change.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00137.html
+
+2010-06-07 Juanma Barranquero <[email protected]>
+
+ * cmds.c (Fforward_char, Fbackward_char): Fix typos in docstrings.
+ (Fforward_line, Fbeginning_of_line): Reflow docstrings.
+
+2010-06-06 Dan Nicolaescu <[email protected]>
+
+ Remove BSTRING related code, all platforms define it.
+ * s/usg5-4.h (BSTRING): Remove definition.
+ * s/template.h (BSTRING):
+ * s/msdos.h (BSTRING):
+ * s/ms-w32.h (BSTRING):
+ * s/hpux10-20.h (BSTRING):
+ * s/gnu-linux.h (BSTRING):
+ * s/darwin.h (BSTRING):
+ * s/cygwin.h (BSTRING):
+ * s/bsd-common.h (BSTRING):
+ * s/aix4-2.h (BSTRING): Likewise.
+ * sysdep.c: Remove code depending on BSTRING not being defined.
+
+2010-06-05 Juanma Barranquero <[email protected]>
+
+ Remove obsolete macro BASE_LEADING_CODE_P.
+ * character.h (BASE_LEADING_CODE_P): Remove.
+ * regex.c [!emacs] (BASE_LEADING_CODE_P): Remove.
+ * buffer.c (Fset_buffer_multibyte):
+ * indent.c (scan_for_column, compute_motion):
+ * insdel.c (count_combining_before, count_combining_after):
+ Use LEADING_CODE_P instead of BASE_LEADING_CODE_P.
+
+2010-06-04 Juanma Barranquero <[email protected]>
+
+ Turn `directory-sep-char' into a noop.
+
+ * lisp.h [WINDOWSNT] (Vdirectory_sep_char): Don't declare.
+ (DIRECTORY_SEP): Define unconditionally.
+
+ * s/ms-w32.h (DIRECTORY_SEP): Remove.
+
+ * emacs.c (decode_env_path): Don't check DIRECTORY_SEP,
+ call dostounix_filename directly.
+
+ * fileio.c (CORRECT_DIR_SEPS): Remove.
+ (Ffile_name_directory, directory_file_name, Fexpand_file_name)
+ (Fsubstitute_in_file_name): Use dostounix_filename instead.
+ (file_name_as_directory): Use dostounix_filename, DIRECTORY_SEP.
+ (syms_of_fileio) <directory-sep-char>: Move to subr.el.
+
+ * w32proc.c (CORRECT_DIR_SEPS): Remove.
+ (Fw32_short_file_name, Fw32_long_file_name): Use dostounix_filename.
+
+2010-06-03 Andreas Schwab <[email protected]>
+
+ * process.c (conv_lisp_to_sockaddr): Fix conversion of IPv4
+ address. (Bug#6346)
+
+2010-06-03 Juanma Barranquero <[email protected]>
+
+ * ccl.c (Fccl_program_p): Fix typo in docstring.
+
+2010-06-03 Dan Nicolaescu <[email protected]>
+
+ Move UNEXEC definition to autoconf.
+ * s/usg5-4.h (UNEXEC): Remove, move to configure.in.
+ * s/sol2-10.h (UNEXEC):
+ * s/irix6-5.h (UNEXEC):
+ * s/hpux10-20.h (UNEXEC):
+ * s/gnu-linux.h (UNEXEC):
+ * s/darwin.h (UNEXEC):
+ * s/cygwin.h (UNEXEC):
+ * s/bsd-common.h (UNEXEC):
+ * s/aix4-2.h (UNEXEC):
+ * m/alpha.h (UNEXEC): Likewise.
+ * Makefile.in (UNEXEC_OBJ): Define using @UNEXEC_OBJ@.
+
+2010-06-03 Juanma Barranquero <[email protected]>
+
+ Remove obsolete pre-unicode2 macros.
+ * character.h (MULTIBYTE_FORM_LENGTH, PARSE_MULTIBYTE_SEQ): Remove.
+ * composite.c (composition_reseat_it):
+ * data.c (Faset):
+ * fns.c (Ffillarray):
+ * regex.c (re_search_2): Use BYTES_BY_CHAR_HEAD.
+ [!emacs] (BYTES_BY_CHAR_HEAD): Define instead of MULTIBYTE_FORM_LENGTH.
+
+2010-06-03 Juri Linkov <[email protected]>
+
+ * buffer.c (Fother_buffer): Add CHECK_FRAME.
+ (Fswitch_to_buffer): Remove unused variable `err'.
+
+2010-06-03 Glenn Morris <[email protected]>
+
+ * m/template.h (NO_SOCK_SIGIO): Remove, no longer used.
+
+ * m/hp800.h (alloca) [__NetBSD__ && __GNUC__]: No need to define it,
+ now that AH_BOTTOM does it.
+
+ * m/hp800.h (HAVE_ALLOCA):
+ * m/ibms390x.h (HAVE_ALLOCA): Do not define, no longer needed.
+
+ * m/ia64.h, s/gnu-linux.h, s/gnu.h, s/netbsd.h, s/usg5-4.h:
+ Remove NOT_C_CODE tests, it is always true now.
+
+2010-06-02 Dan Nicolaescu <[email protected]>
+
+ Fix config.h includes.
+ * xsettings.c:
+ * xgselect.c:
+ * nsterm.m:
+ * nsselect.m:
+ * nsimage.m:
+ * nsfont.m:
+ * nsfns.m:
+ * dbusbind.c: Use #include <config.h> instead of "config.h" as all
+ other files do.
+
+ * gmalloc.c: Remove BROKEN_PROTOTYPES reference, unused.
+
+ * s/sol2-6.h: Remove obsolete comments.
+
+ Remove unnecessary alloca.h includes.
+ * keymap.c: Do not include alloca.h, config.h does that.
+ * sysdep.c: Likewise. Do not define fwrite, not used.
+
+2010-06-01 Stefan Monnier <[email protected]>
+
+ * sysdep.c (child_setup_tty): Move the non-canonical initialization to
+ the HAVE_TERMIO where it belongs (bug#6149).
+
+2010-05-31 Stefan Monnier <[email protected]>
+
+ * keymap.c (Fwhere_is_internal): Fix handling of remapping (in thread
+ of bug#6305).
+
+2010-05-30 Eli Zaretskii <[email protected]>
+
+ * bidi.c (bidi_move_to_visually_next): Make sure the sentinel
+ state is always cached (bug#6306).
+
+2010-05-29 Eli Zaretskii <[email protected]>
+
+ Fix cursor motion in bidi-reordered continued lines.
+ * xdisp.c (try_cursor_movement): Backup to non-continuation line
+ only after finding point's row. Fix the logic. Rewrite the loop
+ over continuation lines in bidi-reordered buffers. Return
+ CURSOR_MOVEMENT_MUST_SCROLL upon failure to find a suitable row,
+ rather than CURSOR_MOVEMENT_CANNOT_BE_USED.
+
+2010-05-28 Michael Albinus <[email protected]>
+
+ * fileio.c (Fdelete_file): Pass TRASH arg to handler call.
+
+2010-05-28 Kenichi Handa <[email protected]>
+
+ * font.c (font_delete_unmatched): Check Vface_ignored_fonts.
+ Don't sheck SPEC if it is nil.
+ (font_list_entities): Call font_delete_unmatched if
+ Vface_ignored_fonts is non-nil. (Bug#6287)
+
+2010-05-28 Glenn Morris <[email protected]>
+
+ * Makefile.in (LIBES): Remove $LOADLIBES, it is never set.
+
+2010-05-27 Chong Yidong <[email protected]>
+
+ * fileio.c (Fdelete_file): Change meaning of optional arg to mean
+ whether to trash.
+ (internal_delete_file, Frename_file): Callers changed.
+ (delete_by_moving_to_trash): Doc fix.
+ (Fdelete_directory_internal): Don't move to trash.
+
+ * callproc.c (delete_temp_file):
+ * buffer.c (Fkill_buffer): Callers changed.
+
+ * lisp.h: Update prototype.
+
+2010-05-27 Chong Yidong <[email protected]>
+
+ * xdisp.c (redisplay_window): After redisplay, check if point is
+ still valid before setting it (Bug#6177).
+
+2010-05-27 Glenn Morris <[email protected]>
+
+ * Makefile.in, autodeps.mk, deps.mk, ns.mk:
+ Convert comments to Makefile format.
+
+ * Makefile.in (bootstrap-clean): No more Makefile.c.
+
+2010-05-26 Glenn Morris <[email protected]>
+
+ * Makefile.in (YMF_PASS_LDFLAGS): Remove.
+ (temacs${EXEEXT}): Use PRE_EDIT_LDFLAGS, POST_EDIT_LDFLAGS.
+
+ * Makefile.in (NS_IMPL_GNUSTEP_INC, NS_IMPL_GNUSTEP_TEMACS_LDFLAGS):
+ Remove.
+ (TEMACS_LDFLAGS): Do not use NS_IMPL_GNUSTEP_TEMACS_LDFLAGS.
+
+2010-05-26 Kenichi Handa <[email protected]>
+
+ * composite.c (composition_compute_stop_pos): Fix condition for
+ backward scanning.
+
+2010-05-25 Glenn Morris <[email protected]>
+
+ * Makefile.in (@NS_IMPL_GNUSTEP_INC@, NS_IMPL_GNUSTEP_TEMACS_LDFLAGS):
+ Move before TEMACS_LDFLAGS.
+ (TEMACS_LDFLAGS): Use $NS_IMPL_GNUSTEP_TEMACS_LDFLAGS.
+ (temacs${EXEEXT}): Do not use $NS_IMPL_GNUSTEP_TEMACS_LDFLAGS.
+
+ * Makefile.in (NOT_C_CODE): No longer define.
+ (config.h): No longer include.
+
+ * Makefile.in (LD_SWITCH_SYSTEM_TEMACS): Move definition after some
+ variables it may reference.
+
+ * Makefile.in (LD_SWITCH_SYSTEM_EXTRA): Remove.
+ (TEMACS_LDFLAGS): Remove LD_SWITCH_SYSTEM_EXTRA.
+
+2010-05-25 Kenichi Handa <[email protected]>
+
+ * dispextern.h (struct composition_it): New members rule_idx and
+ charpos.
+
+ * xdisp.c (set_iterator_to_next): While scanning backward, assume
+ that the character positions of IT point the last character of the
+ current grapheme cluster.
+ (next_element_from_composition): Don't change character positions
+ of IT.
+ (append_composite_glyph): Set glyph->charpos to
+ it->cmp_it.charpos.
+
+ * composite.c (autocmp_chars): Change the first argument to RULE,
+ and try composition with RULE only.
+ (composition_compute_stop_pos): Record the index number of the
+ composition rule in CMP_IT->rule_idx.
+ (composition_reseat_it): Call autocmp_chars repeatedly until the
+ correct rule of the composition is found.
+ (composition_update_it): Set CMP_IT->charpos. Assume the CHARPOS
+ is at the last character of the current grapheme cluster when
+ CMP_IT->reversed_p is nonzero.
+
+2010-05-24 Stefan Monnier <[email protected]>
+
+ * editfns.c (Fbyte_to_string): New function.
+
+2010-05-24 Stefan Monnier <[email protected]>
+
+ * process.c (Fmake_network_process): Set :host to nil if it's not used.
+ Suggested by Masatake YAMATO <[email protected]>.
+
+2010-05-23 Eli Zaretskii <[email protected]>
+
+ * dispextern.h (init_iterator): Sync prototype with changed definition.
+
+2010-05-20 enami tsugutomo <[email protected]>
+
+ * s/netbsd.h: If terminfo is found, use it in preference to
+ termcap. (Bug#6190) [Backport from trunk]
+
+2010-05-19 Eli Zaretskii <[email protected]>
+
+ Redesign and reimplement bidi-aware edge positions of glyph rows.
+
+ * dispextern.h (struct glyph_row): New members minpos and maxpos.
+ (MATRIX_ROW_START_CHARPOS, MATRIX_ROW_START_BYTEPOS)
+ (MATRIX_ROW_END_CHARPOS, MATRIX_ROW_END_BYTEPOS): Reference minpos
+ and maxpos members instead of start.pos and end.pos, respectively.
+
+ * xdisp.c (display_line): Compare IT_CHARPOS with the position in
+ row->start.pos, rather than with MATRIX_ROW_START_CHARPOS.
+ (cursor_row_p): Use row->end.pos rather than MATRIX_ROW_END_CHARPOS.
+ (try_window_reusing_current_matrix, try_window_id):
+ Use ROW->minpos rather than ROW->start.pos.
+ (init_from_display_pos, init_iterator): Use EMACS_INT for
+ character and byte positions.
+ (find_row_edges): Rename from find_row_end. Accept additional
+ arguments for minimum and maximum buffer positions seen by
+ display_line for this row. Don't use iterator to find the
+ position following the maximum one; instead, increment the
+ position found by display_line directly. Fix logic; eol_pos
+ should be tested before the rest. Handle the case of characters
+ delivered from display vector (bug#6036). Fix tests related to
+ it->method. Handle the truncated_on_right_p rows.
+ (RECORD_MAX_MIN_POS): New macro.
+ (display_line): Use it to record the minimum and maximum buffer
+ positions for glyphs in the row being assembled. Record the
+ position of the newline that terminates the line. If word wrap is
+ in effect, restore minimum and maximum positions seen up to the
+ wrap point, when iterator returns to it.
+ (try_window_reusing_current_matrix): Give up if in bidi-reordered
+ row and cursor not already at point. Restore original pre-bidi
+ code for unidirectional buffers.
+
+ * dispnew.c (increment_row_positions, check_matrix_invariants):
+ Increment and check row->start.pos and row->end.pos, in addition
+ to MATRIX_ROW_START_CHARPOS and MATRIX_ROW_END_CHARPOS.
+
+ * .gdbinit (prowlims): Display row->minpos and row->maxpos.
+ Display truncated_on_left_p and truncated_on_right_p flags.
+ Formatting fixes.
+ (pmtxrows): Display the ordinal number of each row. Don't display
+ rows beyond the last one.
+
+ * bidi.c (bidi_cache_iterator_state): Don't zero out new_paragraph:
+ it is not copied by bidi_copy_it.
+
+2010-05-22 Eli Zaretskii <[email protected]>
+
+ * w32.c (sys_write): Break writes into chunks smaller than 32MB.
+ (Bug#6237)
+
+2010-05-22 Chong Yidong <[email protected]>
+
+ * image.c (Fimage_flush): Rename from image-refresh.
+
+2010-05-21 Chong Yidong <[email protected]>
+
+ * xdisp.c (redisplay_internal): Clear caches even if redisplaying
+ just one window.
+
+ * image.c (Vimage_cache_eviction_delay): Decrease to 300.
+ (clear_image_cache): If the number of cached images is unusually
+ large, decrease the cache eviction delay (Bug#6230).
+
+2010-05-21 Glenn Morris <[email protected]>
+
+ * Makefile.in (${ns_appdir}, ${ns_appbindir}Emacs, ns-app):
+ Move these rules to ns.mk.
+ * ns.mk: New file.
+
+ * Makefile.in (../src/$(OLDXMENU), $(OLDXMENU)): Always define rules.
+
+ * Makefile.in (CANNOT_DUMP): New, set by configure.
+ (emacs${EXEEXT}, bootstrap-emacs${EXEEXT}): Use $CANNOT_DUMP.
+
+2010-05-20 Juri Linkov <[email protected]>
+
+ * fileio.c (Fdelete_file): Change interative spec to use
+ `read-file-name' like in `find-file-read-args' where the default
+ value is `default-directory' instead of `buffer-file-name'.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00533.html
+
+2010-05-20 Kevin Ryde <[email protected]>
+
+ * keyboard.c (Vlast_command, Vkeyboard_translate_table)
+ (Voverriding_terminal_local_map, Vsystem_key_alist)
+ (Vlocal_function_key_map): Fix manual link in docstring (Bug#6224).
+
+2010-05-20 Glenn Morris <[email protected]>
+
+ * Makefile.in (DEPDIR): New constant.
+ (DEPFLAGS): Set with configure, not cpp.
+ (MKDEPDIR): New, set by configure.
+ (.c.o, .m.o, ecrt0.o): Use $MKDEPDIR.
+ (clean): Use $DEPDIR.
+ (deps_frag): Include from configure.
+ Move static/dynamic dependency stuff to deps.mk/autodeps.mk.
+ * deps.mk, autodeps.mk: New files, extracted from Makefile.in.
+
+ * bidi.c (bidi_cache_shrink, bidi_cache_iterator_state): Fix
+ reallocation of the cache. (Bug#6210)
+
+2010-05-19 Glenn Morris <[email protected]>
+
+ * s/msdos.h (ORDINARY_LINK): Move to sed2v2.inp.
+
+ * Makefile.in (LD, YMF_PASS_LDFLAGS): Set with configure, not cpp.
+ (GNULIB_VAR): Remove.
+ (LIBES): Use LIB_GCC instead of GNULIB_VAR.
+
+ * m/ibms390x.h (LINKER):
+ * m/macppc.h (LINKER) [GNU_LINUX]:
+ * s/aix4-2.h (ORDINARY_LINK):
+ * s/cygwin.h (LINKER):
+ * s/darwin.h (ORDINARY_LINK):
+ * s/gnu.h (ORDINARY_LINK):
+ * s/netbsd.h (LINKER):
+ * s/usg5-4.h (ORDINARY_LINK):
+ Move to configure.
+
+ * s/aix4-2.h (LINKER): Remove; this file sets ORDINARY_LINK.
+
+2010-05-18 Chong Yidong <[email protected]>
+
+ * character.c (Fstring, Funibyte_string): Use SAFE_ALLOCA to
+ prevent stack overflow if number of arguments is too large
+ (Bug#6214).
+
+2010-05-18 Juanma Barranquero <[email protected]>
+
+ * charset.c (load_charset_map_from_file): Don't call close after fclose.
+
+2010-05-18 Glenn Morris <[email protected]>
+
+ * s/gnu-linux.h: Combine two conditionals.
+
+ * Makefile.in (otherobj): Include $(VMLIMIT_OBJ) separately from
+ $(POST_ALLOC_OBJ).
+
+ * Makefile.in (RALLOC_OBJ): New, set by configure.
+ (rallocobj): Replace with the previous variable.
+ (otherobj): Use $RALLOC_OBJ.
+
+ * s/gnu.h (REL_ALLOC) [DOUG_LEA_MALLOC]:
+ * s/gnu-linux.h (REL_ALLOC) [DOUG_LEA_MALLOC]: Move undef to configure.
+
+ * Makefile.in (GMALLOC_OBJ, VMLIMIT_OBJ): New, set by configure.
+ (gmallocobj, vmlimitobj): Replace with previous two variables.
+ (otherobj): Use $GMALLOC_OBJ, $VMLIMIT_OBJ.
+
+2010-05-17 Glenn Morris <[email protected]>
+
+ * Makefile.in (OLDXMENU_DEPS): New, set by configure.
+ (stamp-oldxmenu): Use $OLDXMENU_DEPS.
+
+2010-05-16 Glenn Morris <[email protected]>
+
+ * Makefile.in (${ns_appbindir}Emacs, ns-app): Always define these rules.
+
+ * Makefile.in (clean): Get rid of HAVE_NS conditional.
+
+ * Makefile.in (ns_appdir, ns_appbindir): Now configure adds the
+ trailing "/".
+
+ * Makefile.in (TEMACS_LDFLAGS2): New, set by configure.
+ (temacs${EXEEXT}): Combine the NS_IMPL_GNUSTEP case with the default.
+
+ * Makefile.in (GNUSTEP_SYSTEM_LIBRARIES): Remove, unused.
+ (NS_IMPL_GNUSTEP_TEMACS_LDFLAGS): New, set by configure.
+ (LD) [NS_IMPL_GNUSTEP]: Set to $(CC) -rdynamic.
+ (temacs${EXEEXT}): Remove $LOCALCPP, never defined or referenced.
+ Make most of the NS_IMPL_GNUSTEP case the same as the default case.
+
+ * Makefile.in (temacs${EXEEXT}) [!NS_IMPL_GNUSTEP]:
+ Remove ${STARTFLAGS}, nothing ever sets it.
+
+2010-05-16 Dan Nicolaescu <[email protected]>
+
+ * m/ia64.h (UNEXEC): Remove, set in s/*.h.
+
+2010-05-16 Glenn Morris <[email protected]>
+
+ * Makefile.in (LIBX_BASE): Always define.
+
+ * Makefile.in (LIBX_OTHER): Move out of cpp section.
+
+ * Makefile.in (LIBXT): Always define.
+
+2010-05-15 Glenn Morris <[email protected]>
+
+ * Makefile.in (OLDXMENU, LIBXMENU, LIBX_OTHER): Always define.
+
+ * Makefile.in (FONT_DRIVERS): Remove, replace with $FONT_OBJ.
+ (obj, SOME_MACHINE_OBJECTS): Use $FONT_OBJ.
+
+2010-05-15 Ken Raeburn <[email protected]>
+
+ * lisp.h (XFLOAT_DATA): Use "0?x:x" to generate an rvalue. (Bug#5916)
+ (LISP_MAKE_RVALUE) [!USE_LISP_UNION_TYPE && !__GNUC__]: Likewise.
+
+ * emacs.c (main): Initialize initial-environment and
+ process-environment before generating from env, not after.
+
+ Handle --version reasonably in CANNOT_DUMP configuration.
+ * emacs.c (emacs_version, emacs_copyright): New string variables.
+ (Vemacs_version, Vemacs_copyright): New Lisp_Object variables.
+ (syms_of_emacs): Defvar them, and initialize them from the C
+ string variables.
+ (main): If initialization hasn't been done, print initial version
+ info from the C strings, instead of starting an interactive session.
+
+2010-05-15 Eli Zaretskii <[email protected]>
+
+ * bidi.c (bidi_paragraph_init): Don't leave alone garbage values
+ of bidi_it->paragraph_dir. Call bidi_initialize if needed.
+ (bidi_paragraph_init): Remove redundant assertion that we are at
+ the beginning of a line after call to bidi_find_paragraph_start.
+
+ * xdisp.c (Fcurrent_bidi_paragraph_direction): New function.
+ (syms_of_xdisp): Defsubr it.
+
+ * cmds.c (Fforward_char, Fbackward_char): Doc fix.
+
+ * Makefile.in: Fix MSDOS-related comments.
+
+2010-05-15 Glenn Morris <[email protected]>
+
+ * Makefile.in (OLDXMENU_TARGET): New, set by configure.
+ (really-lwlib, really-oldXMenu): Always define.
+ ($OLDXMENU): Depend on $OLDXMENU_TARGET.
+
+ * Makefile.in: Simplify cpp conditional.
+
+ * Makefile.in (${ns_appdir}): Simplify using umask.
+
+ * Makefile.in (${ns_appdir}): Remove references to CVS-related files.
+
+2010-05-14 Stefan Monnier <[email protected]>
+
+ * eval.c (specbind): Remove left-over duplicate test.
+ Disallow let-binding frame-local vars. Add comment.
+
+2010-05-14 Eli Zaretskii <[email protected]>
+
+ Make the cache of bidi iterator states dynamically allocated.
+ * bidi.c (bidi_cache_shrink): New function.
+ (bidi_init_it): Call it.
+ (bidi_cache_iterator_state): Enlarge the cache if needed.
+
+ * bidi.c (bidi_move_to_visually_next): Rename from
+ bidi_get_next_char_visually. All callers changed.
+
+2010-05-14 Kenichi Handa <[email protected]>
+
+ * dispextern.h (struct composition_it): New member reversed_p.
+
+ * composite.c (composition_compute_stop_pos): Search backward if
+ ENDPOS < CHARPOS.
+ (composition_reseat_it): Handle the case that ENDPOS < CHARPOS.
+ Set CMP_IT->reversed_p.
+ (composition_update_it): Pay attention to CMP_IT->reversed_p.
+
+ * xdisp.c (set_iterator_to_next):
+ Call composition_compute_stop_pos with negative ENDPOS if we are
+ scanning backward. Call composition_compute_stop_pos if scan
+ direction is changed.
+ (next_element_from_buffer): Call composition_compute_stop_pos with
+ negative ENDPOS if we are scanning backward.
+ (next_element_from_composition): Pay attention to
+ IT->cmp_it.reversed_p.
+
+2010-05-14 Kenichi Handa <[email protected]>
+
+ * font.c (font_range): Return the range for the font found at first.
+
+2010-05-14 Glenn Morris <[email protected]>
+
+ * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Always define.
+
+ * Makefile.in (mktime, X11, register): Move undefs to configure.
+
+ * Makefile.in (MSDOS_OBJ): Default to empty, let msdos scripts set it.
+ (MSDOS_X_OBJ): New variable.
+ (MSDOS_SUPPORT_REAL): New constant.
+ (MSDOS_SUPPORT): Set as a variable, not with cpp.
+ (obj): Use MSDOS_X_OBJ.
+ (lisp): Use MSDOS_SUPPORT as a variable.
+
+ * Makefile.in (REAL_MOUSE_SUPPORT): New constant.
+ (GPM_MOUSE_SUPPORT): Now it's a constant.
+ (MOUSE_SUPPORT, TOOLTIP_SUPPORT, WINDOW_SUPPORT): Set with configure,
+ not cpp.
+
+ * Makefile.in (@NS_IMPL_GNUSTEP_INC@): Use in place of #ifdef.
+ (ns_appresdir): Remove, unused.
+
+ * Makefile.in (SHELL): Move outside cpp section.
+
+ * s/netbsd.h (AMPERSAND_FULL_NAME): Remove (defined in AH_BOTTOM).
+
+2010-05-13 Glenn Morris <[email protected]>
+
+ * Makefile.in (FONT_DRIVERS): Place with other HAVE_X_WINDOWS stuff.
+ (TOOLTIP_SUPPORT): Place with other HAVE_WINDOW_SYSTEM stuff.
+
+ * Makefile.in (FONT_DRIVERS): If HAVE_X_WINDOWS is defined,
+ HAVE_WINDOW_SYSTEM must be too.
+
+ * Makefile.in (WINNT_SUPPORT): Remove, nt build does not use this file.
+ (lisp): Remove WINNT_SUPPORT.
+
+ * Makefile.in (OLDXMENU, LIBXMENU) [!HAVE_MENUS]:
+ Let configure set these variables (to empty) in this case as well.
+
+ * Makefile.in (LD_SWITCH_X_SITE): Define as a variable, not via cpp.
+ (LIBX_BASE): Use $LD_SWITCH_X_SITE.
+
+ * Makefile.in (C_SWITCH_X_SYSTEM, C_SWITCH_X_SITE, LIB_STANDARD)
+ (LIB_MATH, FONTCONFIG_CFLAGS, FONTCONFIG_LIBS, FREETYPE_CFLAGS)
+ (FREETYPE_LIBS, LIBOTF_CFLAGS, LIBOTF_LIBS, M17N_FLT_CFLAGS)
+ (M17N_FLT_LIBS, GNU_OBJC_CFLAGS, GNUSTEP_SYSTEM_LIBRARIES, LIBGPM)
+ (LIBRESOLV, UNEXEC_OBJ): For clarity, define variables to hold
+ the values output by configure.
+ (ALL_CFLAGS, obj, LIBES, temacs${EXEEXT}): Use the above variables.
+
2010-05-12 Glenn Morris <[email protected]>
* Makefile.in (YMF_PASS_LDFLAGS, LD, LINKER): Simplify the logic.
@@ -1319,11 +1972,6 @@
(gif_load): Put GIF extension data to the property
`Qextension_data'.
-2010-04-05 Chong Yidong <[email protected]>
-
- * xdisp.c (prepare_menu_bars): Don't call ns_set_doc_edited for
- terminal frames (Bug#5837).
-
2010-03-31 Chong Yidong <[email protected]>
* nsfns.m (ns_set_doc_edited): Remove unused arg OLDVAL.
@@ -1565,11 +2213,6 @@
case that the output buffer is fullfilled.
(encode_coding): Setup ccl program here.
-2010-03-24 Andreas Politz <[email protected]> (tiny change)
-
- * editfns.c (Fformat): Account for string precision when computing
- field width (Bug#5710).
-
2010-03-23 Dan Nicolaescu <[email protected]>
* s/gnu-linux.h (LIBS_SYSTEM): Remove, same as default.
@@ -1819,7 +2462,7 @@
(xg_toggle_notify_cb, xg_set_toolkit_scroll_bar_thumb)
(xg_create_tool_bar): Remove unused variables.
(x_wm_set_size_hint): Move declarations before statements.
- (xg_create_frame_widgets): Remove variable grav,
+ (xg_create_frame_widgets): Remove variable grav.
2010-02-21 Chong Yidong <[email protected]>
@@ -1937,7 +2580,7 @@
* xfns.c (Fx_create_frame): Remove window size matching code from
2010-01-15.
- (x_get_current_desktop, x_get_desktop_workarea): Remove
+ (x_get_current_desktop, x_get_desktop_workarea): Remove.
2010-01-27 Jason Rumney <[email protected]>
@@ -2774,7 +3417,7 @@
fontconfig settings like hinting.
(font_load_for_lface): If spec had a name in it, store it in entity.
- * emacs.c (main): Call syms_of_xsettings
+ * emacs.c (main): Call syms_of_xsettings.
* config.in: HAVE_GCONF is new.
@@ -8359,7 +9002,7 @@
(composition_adjust_point, Fcomposition_get_gstring): New functions.
(syms_of_composite): Initialize gstring_hash_table, gstrint_work,
and gstring_work_headers. DEFVAR_LISP composition-function-table.
- Defsubr compostion_get_gstring.
+ Defsubr composition_get_gstring.
* dispextern.h (struct glyph): New union u.cmp. Delete the member
cmp_id.
@@ -11405,7 +12048,7 @@
definitions from xmenu.c. Suggested by Adrian Robert.
* xmenu.c: Remove platform-independent menu definitions.
- (menu_items menu_items_inuse, menu_items_allocated)
+ (menu_items, menu_items_inuse, menu_items_allocated)
(menu_items_used, menu_items_n_panes)
(menu_items_submenu_depth): Move to keyboard.h.
(init_menu_items, finish_menu_items, unuse_menu_items)
@@ -13400,12 +14043,6 @@
Report an error when image size is invalid.
Read two bytes at a time when raw images have max_color_idx above 255.
-2008-04-05 Eli Zaretskii <[email protected]>
-
- * w32.c (readdir): If FindFirstFile/FindNextFile return in
- cFileName a file name that includes `?' characters, use the 8+3
- alias in cAlternateFileName instead.
-
2008-04-05 Kenichi Handa <[email protected]>
* ccl.c (ccl_driver): If ccl->quit_silently is nonzero, don't
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10
index 39b70d9b19..24818e6770 100644
--- a/src/ChangeLog.10
+++ b/src/ChangeLog.10
@@ -4645,10 +4645,6 @@
* image.c: Include "charset.h" and "coding.h".
(x_find_image_file): Return an encoded file name.
-2006-04-01 Eli Zaretskii <[email protected]>
-
- * configure: Regenerated.
-
2006-03-31 Kenichi Handa <[email protected]>
* xfns.c (xg_set_icon): Delete superfluous UNGCPRO.
diff --git a/src/ChangeLog.8 b/src/ChangeLog.8
index 6da7b6862a..4dd3d0dd07 100644
--- a/src/ChangeLog.8
+++ b/src/ChangeLog.8
@@ -4629,9 +4629,6 @@
* Makefile.in (LIBGIF): Use libungif.
- * configure.in (HAVE_GIF): Use libungif instead of libgif
- because the former doesn't contain patented compression code.
-
* xdisp.c (compute_window_start_on_continuation_line): Don't
do it if line start is too far away from window start.
diff --git a/src/Makefile.in b/src/Makefile.in
index 2719f3a232..fd95fe6d28 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -24,13 +24,7 @@
# script may need modifying in sync with changes made here. Try to
# avoid shell-ism because the DOS build has to use the DOS shell.
-# Don't try to replace the cpp processing using autoconf facilities,
-# says rms.
-# Replacing a particular part of the conditionals to work via autoconf
-# is OK.
-# Some of the conditionals might be dead now. Finding them and
-# deleting them would be fine.
-
+SHELL = /bin/sh
# Here are the things that we expect ../configure to edit.
# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
@@ -47,7 +41,7 @@ version = @version@
# BSD doesn't have it as a default.
@SET_MAKE@
# Don't use LIBS. configure puts stuff in it that either shouldn't be
-# linked with Emacs or is duplicated by the cpp stuff below.
+# linked with Emacs or is duplicated by the other stuff below.
# LIBS = @LIBS@
LIBOBJS = @LIBOBJS@
@@ -65,6 +59,7 @@ config_h = config.h $(M_FILE) $(S_FILE)
bootstrap_exe = ${abs_builddir}/bootstrap-emacs${EXEEXT}
+## ns-app if HAVE_NS, else empty.
OTHER_FILES = @OTHER_FILES@
CRT_DIR=@CRT_DIR@
@@ -73,21 +68,48 @@ CRT_DIR=@CRT_DIR@
C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
## System-specific CFLAGS.
C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
-## This holds any special options for linking temacs only (ie, not
-## used by configure). Not used elsewhere because it sometimes
-## contains options that have to do with using Emacs's crt0,
-## which are only good with temacs.
-LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
+
+## Currently only set if NS_IMPL_GNUSTEP.
+## C_SWITCH_X_SITE may override this.
+C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@
+
+## Define C_SWITCH_X_SITE to contain any special flags your compiler
+## may need to deal with X Windows. For instance, if you've defined
+## HAVE_X_WINDOWS and your X include files aren't in a place that your
+## compiler can find on its own, you might want to add "-I/..." or
+## something similar. This is normally set by configure.
+## This is used before C_SWITCH_X_SYSTEM and may override it.
+C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
+
+## Define LD_SWITCH_X_SITE to contain any special flags your loader
+## may need to deal with X Windows. For instance, if your X libraries
+## aren't in a place that your loader can find on its own, you might
+## want to add "-L/..." or something similar. Only used if
+## HAVE_X_WINDOWS.
+## FIXME? configure sets a value for this, but it has never been
+## substituted in this or any other Makefile. Cf C_SWITCH_X_SITE.
+LD_SWITCH_X_SITE=
+
## Next two must come before LD_SWITCH_SYSTEM.
## If needed, a -R option that says where to find X windows at run time.
LD_SWITCH_X_SITE_AUX=@LD_SWITCH_X_SITE_AUX@
## As above, but using -rpath instead.
LD_SWITCH_X_SITE_AUX_RPATH=@LD_SWITCH_X_SITE_AUX_RPATH@
+
## System-specific LDFLAGS.
LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@
-LD_SWITCH_SYSTEM_EXTRA=@LD_SWITCH_SYSTEM_EXTRA@
+
+## This holds any special options for linking temacs only (ie, not
+## used by configure). Not used elsewhere because it sometimes
+## contains options that have to do with using Emacs's crt0,
+## which are only good with temacs.
+LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
+
## Flags to pass to ld only for temacs.
-TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_EXTRA) $(LD_SWITCH_SYSTEM_TEMACS)
+TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_TEMACS)
+
+## $LDFLAGS, or empty if NS_IMPL_GNUSTEP (for some reason).
+TEMACS_LDFLAGS2 = @TEMACS_LDFLAGS2@
## Some systems define this to request special libraries.
LIBS_SYSTEM=@LIBS_SYSTEM@
@@ -95,6 +117,14 @@ LIBS_SYSTEM=@LIBS_SYSTEM@
## Where to find libgcc.a, if using gcc and necessary.
LIB_GCC=@LIB_GCC@
+LD=@LINKER@
+
+## May use $CRT_DIR.
+LIB_STANDARD=@LIB_STANDARD@
+
+## -lm, or empty.
+LIB_MATH=@LIB_MATH@
+
LIBTIFF=@LIBTIFF@
LIBJPEG=@LIBJPEG@
LIBPNG=@LIBPNG@
@@ -103,6 +133,15 @@ LIBXPM=@LIBXPM@
XFT_LIBS=@XFT_LIBS@
LIBX_EXTRA=$(LIBTIFF) $(LIBJPEG) $(LIBPNG) $(LIBGIF) $(LIBXPM) -lX11 $(XFT_LIBS)
+FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
+FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+LIBOTF_CFLAGS = @LIBOTF_CFLAGS@
+LIBOTF_LIBS = @LIBOTF_LIBS@
+M17N_FLT_CFLAGS = @M17N_FLT_CFLAGS@
+M17N_FLT_LIBS = @M17N_FLT_LIBS@
+
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
DBUS_OBJ = @DBUS_OBJ@
@@ -127,11 +166,50 @@ LIBXTR6=@LIBXTR6@
## Only used if HAVE_X_WINDOWS.
LIBXT_OTHER=@LIBXT_OTHER@
+## If !HAVE_X11 || USE_GTK, empty.
+## Else if USE_X_TOOLKIT really-lwlib, else really-oldxmenu.
+OLDXMENU_TARGET=@OLDXMENU_TARGET@
+
+## If !HAVE_X11 || USE_GTK, empty.
+## Else if USE_X_TOOLKIT, ${lwlibdir}liblw.a.
+## Else ${oldXMenudir}libXMenu11.a.
+## (Actually, rather than being empty, it is set to "nothing".
+## It is never actually used for anything in this case.
+## This is done because there is a rule with target $(OLDXMENU) below,
+## and I think it might be a syntax error with some makes to have
+## an empty target, even if the associated rule is never run.
+## http://lists.gnu.org/archive/html/help-make/2010-05/msg00058.html
+## The alternative would be to put that rule in a makefile fragment.)
+OLDXMENU=@OLDXMENU@
+
+## If HAVE_X11 && !USE_GTK, ${OLDXMENU} ../src/${OLDXMENU}; else empty.
+## We use stamp-xmenu with these two deps to both ensure that lwlib
+## gets remade based on its dependencies in its own makefile,
+## and remake temacs if lwlib gets changed by this.
+OLDXMENU_DEPS=@OLDXMENU_DEPS@
+
+## If !HAVE_X11 && HAVE_X_WINDOWS, -lXMenu (this case no longer possible).
+## Else if !HAVE_X11 || USE_GTK, empty.
+## Else $(OLDXMENU).
+LIBXMENU=@LIBXMENU@
+
XMENU_OBJ=@XMENU_OBJ@
XOBJ=@XOBJ@
TOOLKIT_LIBW=@TOOLKIT_LIBW@
+## Only used if HAVE_X11, in LIBX_OTHER.
+LIBXT=$(TOOLKIT_LIBW) $(LIBXT_OTHER)
+
+## If HAVE_X11, $(LIBXT) $(LIBX_EXTRA), else empty.
+LIBX_OTHER=@LIBX_OTHER@
+
+## LIBXMENU is nil if !HAVE_X_WINDOWS.
+## LD_SWITCH_X_SITE should not be used if not using X, but nothing
+## sets it at present, and if something ever does, it should be
+## configure, which should set it to nil in non-X builds.
+LIBX_BASE=$(LIBXMENU) $(LD_SWITCH_X_SITE)
+
LIBSOUND= @LIBSOUND@
CFLAGS_SOUND= @CFLAGS_SOUND@
@@ -148,15 +226,41 @@ WIDGET_OBJ=@WIDGET_OBJ@
## sheap.o if CYGWIN, otherwise empty.
CYGWIN_OBJ=@CYGWIN_OBJ@
+## dosfns.o msdos.o w16select.o if MSDOS.
+MSDOS_OBJ =
+## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS.
+MSDOS_X_OBJ =
+MSDOS_SUPPORT_REAL = ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc \
+ ${lispsource}dos-fns.elc ${lispsource}dos-w32.elc ${lispsource}dos-vars.elc \
+ ${lispsource}term/internal.elc ${lispsource}term/pc-win.elc
+## $MSDOS_SUPPORT_REAL if MSDOS.
+MSDOS_SUPPORT =
+
+ns_appdir=@ns_appdir@
+ns_appbindir=@ns_appbindir@
+ns_appsrc=@ns_appsrc@
NS_OBJ=@NS_OBJ@
NS_SUPPORT=@NS_SUPPORT@
+## Only set if NS_IMPL_GNUSTEP.
+GNU_OBJC_CFLAGS=@GNU_OBJC_CFLAGS@
-## Only used if HAVE_X_WINDOWS and HAVE_WINDOW_SYSTEM.
+## Empty if !HAVE_X_WINDOWS
+## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT
+## xfont.o ftfont.o ftxfont.o if HAVE_FREETYPE
+## else xfont.o
FONT_OBJ=@FONT_OBJ@
-## ${lispsource}mouse.elc if HAVE_GPM, otherwise empty.
-## Not used if HAVE_MOUSE.
-GPM_MOUSE_SUPPORT=@GPM_MOUSE_SUPPORT@
+## Used if HAVE_MOUSE.
+REAL_MOUSE_SUPPORT=${lispsource}mouse.elc ${lispsource}select.elc \
+ ${lispsource}scroll-bar.elc
+## Used if HAVE_GPM && !HAVE_MOUSE
+GPM_MOUSE_SUPPORT=${lispsource}mouse.elc
+LIBGPM = @LIBGPM@
+## Either of the two preceding options, or empty.
+MOUSE_SUPPORT=@MOUSE_SUPPORT@
+
+## ${lispsource}tooltip.elc if HAVE_WINDOW_SYSTEM, else empty.
+TOOLTIP_SUPPORT=@TOOLTIP_SUPPORT@
BASE_WINDOW_SUPPORT=${lispsource}fringe.elc ${lispsource}image.elc \
${lispsource}international/fontset.elc ${lispsource}dnd.elc \
@@ -165,6 +269,13 @@ BASE_WINDOW_SUPPORT=${lispsource}fringe.elc ${lispsource}image.elc \
X_WINDOW_SUPPORT=${lispsource}x-dnd.elc ${lispsource}term/common-win.elc \
${lispsource}term/x-win.elc ${lispsource}dynamic-setting.elc
+## If HAVE_X_WINDOWS, both the above
+## else if HAVE_WINDOW_SYSTEM (ie, HAVE_NS) just the former; else empty.
+WINDOW_SUPPORT=@WINDOW_SUPPORT@
+
+## -lresolv, or empty.
+LIBRESOLV = @LIBRESOLV@
+
LIBSELINUX_LIBS = @LIBSELINUX_LIBS@
INTERVALS_H = dispextern.h intervals.h composite.h
@@ -175,161 +286,49 @@ RUN_TEMACS = `/bin/pwd`/temacs
START_FILES = @START_FILES@
-# ========================== start of cpp stuff =======================
-/* From here on, comments must be done in C syntax. */
-
-/* just to be sure the sh is used */
-SHELL=/bin/sh
-
-#define NOT_C_CODE
-#include "config.h"
-
-#ifdef AUTO_DEPEND
-DEPFLAGS = -MMD -MF deps/$*.d
-#endif
-
-/* Do not let the file name mktime.c get messed up. */
-#ifdef mktime
-#undef mktime
-#endif
-
-/* Use HAVE_X11 as an alias for X11 in this file
- to avoid problems with X11 as a subdirectory name
- in -I and other such options which pass through this file. */
-
-#ifdef X11
-#define HAVE_X11
-#undef X11
-#endif
-
-/* On some machines #define register is done in config;
- do not let it interfere with this file. */
-#undef register
-
-/* This macro is for switches specifically related to X Windows. */
-#ifndef LD_SWITCH_X_SITE
-#define LD_SWITCH_X_SITE
-#endif
-
-#ifdef NS_IMPL_GNUSTEP
-/* Pull in stuff from GNUstep-make. */
-FOUNDATION_LIB=gnu
-GUI_LIB=gnu
-include @GNUSTEP_MAKEFILES@/Additional/base.make
-include @GNUSTEP_MAKEFILES@/Additional/gui.make
-shared=no
-#endif
-
-/* DO NOT use -R. There is a special hack described in lastfile.c
- which is used instead. Some initialized data areas are modified
- at initial startup, then labeled as part of the text area when
- Emacs is dumped for the first time, and never changed again. */
-
-/* -Demacs is needed to make some files produce the correct version
- for use in Emacs.
-
- -DHAVE_CONFIG_H is needed for some other files to take advantage of
- the information in ``config.h''. */
-
-/* C_SWITCH_X_SITE must come before C_SWITCH_X_SYSTEM
- since it may have -I options that should override those two. */
-/* MYCPPFLAGS only referenced in etc/DEBUG. */
-ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} ${C_SWITCH_MACHINE} ${C_SWITCH_SYSTEM} @C_SWITCH_X_SITE@ @C_SWITCH_X_SYSTEM@ ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${IMAGEMAGICK_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS}
-ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@
+UNEXEC_OBJ = @UNEXEC_OBJ@
+
+CANNOT_DUMP=@cannot_dump@
+
+DEPDIR=deps
+## -MMD -MF ${DEPDIR}/$*.d if AUTO_DEPEND; else empty.
+DEPFLAGS=@DEPFLAGS@
+## test -d ${DEPDIR} || mkdir ${DEPDIR} (if AUTO_DEPEND); else ':'.
+MKDEPDIR=@MKDEPDIR@
+
+## DO NOT use -R. There is a special hack described in lastfile.c
+## which is used instead. Some initialized data areas are modified
+## at initial startup, then labeled as part of the text area when
+## Emacs is dumped for the first time, and never changed again.
+##
+## -Demacs is needed to make some files produce the correct version
+## for use in Emacs.
+##
+## -DHAVE_CONFIG_H is needed for some other files to take advantage of
+## the information in `config.h'.
+##
+## C_SWITCH_X_SITE must come before C_SWITCH_X_SYSTEM
+## since it may have -I options that should override those.
+##
+## FIXME? MYCPPFLAGS only referenced in etc/DEBUG.
+ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} \
+ ${C_SWITCH_MACHINE} ${C_SWITCH_SYSTEM} ${C_SWITCH_X_SITE} \
+ ${C_SWITCH_X_SYSTEM} ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${IMAGEMAGICK_CFLAGS} ${DBUS_CFLAGS} \
+ ${GCONF_CFLAGS} ${CFLAGS} ${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS} \
+ ${LIBOTF_CFLAGS} ${M17N_FLT_CFLAGS} ${DEPFLAGS}
+ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
.SUFFIXES: .m
.c.o:
-#ifdef AUTO_DEPEND
- @-test -d deps || mkdir deps
-#endif
+ @$(MKDEPDIR)
$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
.m.o:
-#ifdef AUTO_DEPEND
- @-test -d deps || mkdir deps
-#endif
+ @$(MKDEPDIR)
$(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
-#ifdef HAVE_X_WINDOWS
-/* This test needs to say in cpp for the time being, since s/msdos.h
- defines HAVE_MENUS, and does not use the configure script. */
-#ifdef HAVE_MENUS
-OLDXMENU=@OLDXMENU@
-LIBXMENU=@LIBXMENU@
-#else /* not HAVE_MENUS */
-OLDXMENU=
-LIBXMENU=
-#endif /* not HAVE_MENUS */
-
-LIBXT=$(TOOLKIT_LIBW) $(LIBXT_OTHER)
-LIBX_BASE=$(LIBXMENU) LD_SWITCH_X_SITE
-LIBX_OTHER=@LIBX_OTHER@
-#endif /* not HAVE_X_WINDOWS */
-
-
-/* A macro which other sections of Makefile can redefine to munge the
- flags before they are passed to LD. This is helpful if you have
- redefined LD to something odd, like "gcc".
- (The YMF prefix is a holdover from the old name "ymakefile".) */
-#define YMF_PASS_LDFLAGS(flags) flags
-
-
-#ifdef ORDINARY_LINK
-LD = $(CC)
-
-#else /* not ORDINARY_LINK */
-GNULIB_VAR = $(LIB_GCC)
-
-/* Fix linking if compiled with GCC. */
-#if defined (__GNUC__) && ! defined (LINKER)
-/* Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
- places that are difficult to figure out at make time. Fortunately,
- these same versions allow you to pass arbitrary flags on to the
- linker, so there is no reason not to use it as a linker.
-
- Well, it is not quite perfect. The "-nostdlib" keeps GCC from
- searching for libraries in its internal directories, so we have to
- ask GCC explicitly where to find libgcc.a. */
-#define LINKER $(CC) -nostdlib
-/* GCC passes any argument prefixed with -Xlinker directly to the linker.
- See prefix-args.c for an explanation of why we do not do this with the
- shell''s ``for'' construct. Note that sane people do not have '.' in
- their paths, so we must use ./prefix-args. */
-#undef YMF_PASS_LDFLAGS
-#define YMF_PASS_LDFLAGS(flags) `./prefix-args -Xlinker flags`
-#endif /* defined (__GNUC__) && ! defined (LINKER) */
-
-#ifdef LINKER
-LD=LINKER
-#else /* not LINKER */
-LD=ld
-#endif /* not LINKER */
-
-#endif /* not ORDINARY_LINK */
-
-
-#ifdef MSDOS
-#ifdef HAVE_X_WINDOWS
-MSDOS_OBJ = dosfns.o msdos.o
-#else
-MSDOS_OBJ = dosfns.o msdos.o w16select.o termcap.o
-#endif
-#endif
-
-#ifdef HAVE_NS
-ns_appdir=@ns_appdir@/
-ns_appbindir=@ns_appbindir@/
-ns_appresdir=@ns_appresdir@/
-ns_appsrc=@ns_appsrc@
-#endif /* HAVE_NS */
-#ifdef HAVE_WINDOW_SYSTEM
-#ifdef HAVE_X_WINDOWS
-FONT_DRIVERS=$(FONT_OBJ)
-#endif /* HAVE_X_WINDOWS */
-#endif /* HAVE_WINDOW_SYSTEM */
-
-/* lastfile must follow all files
- whose initialized data areas should be dumped as pure by dump-emacs. */
+## lastfile must follow all files whose initialized data areas should
+## be dumped as pure by dump-emacs.
obj= dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \
cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
@@ -339,102 +338,53 @@ obj= dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
alloc.o data.o doc.o editfns.o callint.o \
eval.o floatfns.o fns.o font.o print.o lread.o \
- syntax.o @unexec@ bytecode.o \
+ syntax.o $(UNEXEC_OBJ) bytecode.o \
process.o callproc.o \
region-cache.o sound.o atimer.o \
doprnt.o strftime.o intervals.o textprop.o composite.o md5.o \
- $(MSDOS_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_DRIVERS)
+ $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ)
-/* Object files used on some machine or other.
- These go in the DOC file on all machines
- in case they are needed there. */
+## Object files used on some machine or other.
+## These go in the DOC file on all machines in case they are needed.
SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
fontset.o dbusbind.o \
nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
- w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_DRIVERS)
+ w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_OBJ)
-gmallocobj =
-rallocobj =
-vmlimitobj =
-#ifndef SYSTEM_MALLOC
-#ifndef DOUG_LEA_MALLOC
-gmallocobj = gmalloc.o
-#endif
+## gmalloc.o if !SYSTEM_MALLOC && !DOUG_LEA_MALLOC, else empty.
+GMALLOC_OBJ=@GMALLOC_OBJ@
-#ifdef REL_ALLOC
-rallocobj = ralloc.o
-#endif
+## vm-limit.o if !SYSTEM_MALLOC, else empty.
+VMLIMIT_OBJ=@VMLIMIT_OBJ@
-vmlimitobj = vm-limit.o
-#endif /* !SYSTEM_MALLOC */
+## ralloc.o if !SYSTEM_MALLOC && REL_ALLOC, else empty.
+RALLOC_OBJ=@RALLOC_OBJ@
-/* Empty on Cygwin, lastfile.o elsewhere. */
+## Empty on Cygwin, lastfile.o elsewhere.
PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@
-/* lastfile.o vm-limit.o on Cygwin, $vmlimitobj elsewhere. */
+## lastfile.o on Cygwin, empty elsewhere.
POST_ALLOC_OBJ=@POST_ALLOC_OBJ@
-/* List of object files that make-docfile should not be told about. */
-otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(gmallocobj) $(rallocobj) \
- $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
-
-#ifdef HAVE_MOUSE
-#define MOUSE_SUPPORT ${lispsource}mouse.elc \
- ${lispsource}select.elc ${lispsource}scroll-bar.elc
-#else
-#define MOUSE_SUPPORT $(GPM_MOUSE_SUPPORT)
-#endif
-
-#ifdef MSDOS
-#define MSDOS_SUPPORT ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc \
- ${lispsource}dos-fns.elc ${lispsource}dos-w32.elc ${lispsource}dos-vars.elc \
- ${lispsource}term/internal.elc ${lispsource}term/pc-win.elc
-
-#else
-#define MSDOS_SUPPORT
-#endif
-
-#ifdef HAVE_WINDOW_SYSTEM
-#ifdef HAVE_X_WINDOWS
-#define WINDOW_SUPPORT $(BASE_WINDOW_SUPPORT) $(X_WINDOW_SUPPORT)
-#else
-#define WINDOW_SUPPORT $(BASE_WINDOW_SUPPORT)
-#endif
-#else
-#define WINDOW_SUPPORT
-#endif
-
-#ifdef WINDOWSNT
-#define WINNT_SUPPORT ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc \
- ${lispsource}dos-w32.elc ${lispsource}w32-vars.elc \
- ${lispsource}w32-fns.elc ${lispsource}term/common-win.elc \
- ${lispsource}term/w32-win.elc
-#else
-#define WINNT_SUPPORT
-#endif
-
-#ifdef HAVE_WINDOW_SYSTEM
-#define TOOLTIP_SUPPORT ${lispsource}tooltip.elc
-#else
-#define TOOLTIP_SUPPORT
-#endif
-
-/* This is the platform-specific list of Lisp files loaded into the
- dumped Emacs. It is arranged like this because it is easier to generate
- it semi-mechanically from loadup.el this way.
-
- Note that this list should not include lisp files which might not
- be present, like site-load.el and site-init.el; this makefile
- expects them all to be either present or buildable.
-
- Files which are loaded unconditionally (i.e., on all platforms) should
- also be in shortlisp. Files which are loaded conditionally (i.e., only
- on some platforms) should instead be in SOME_MACHINE_LISP. */
-
-/* Place loaddefs.el first, so it gets generated first, since it is on
- the critical path (relevant in parallel compilations). */
-
+## List of object files that make-docfile should not be told about.
+otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
+ $(POST_ALLOC_OBJ) $(VMLIMIT_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
+
+## This is the platform-specific list of Lisp files loaded into the
+## dumped Emacs. It is arranged like this because it is easier to generate
+## it semi-mechanically from loadup.el this way.
+##
+## Note that this list should not include lisp files which might not
+## be present, like site-load.el and site-init.el; this makefile
+## expects them all to be either present or buildable.
+##
+## Files which are loaded unconditionally (i.e., on all platforms) should
+## also be in shortlisp. Files which are loaded conditionally (i.e., only
+## on some platforms) should instead be in SOME_MACHINE_LISP.
+##
+## Place loaddefs.el first, so it gets generated first, since it is on
+## the critical path (relevant in parallel compilations).
lisp= \
${lispsource}loaddefs.el \
${lispsource}abbrev.elc \
@@ -453,7 +403,7 @@ lisp= \
${lispsource}files.elc \
${lispsource}format.elc \
${lispsource}facemenu.elc \
- MOUSE_SUPPORT \
+ ${MOUSE_SUPPORT} \
${lispsource}emacs-lisp/float-sup.elc \
${lispsource}frame.elc \
${lispsource}help.elc \
@@ -513,23 +463,22 @@ lisp= \
${lispsource}textmodes/text-mode.elc \
${lispsource}emacs-lisp/timer.elc \
${lispsource}jka-cmpr-hook.elc \
- ${lispsource}vc-hooks.elc \
- ${lispsource}ediff-hook.elc \
+ ${lispsource}vc/vc-hooks.elc \
+ ${lispsource}vc/ediff-hook.elc \
${lispsource}epa-hook.elc \
- TOOLTIP_SUPPORT \
- MSDOS_SUPPORT \
- WINNT_SUPPORT \
- WINDOW_SUPPORT \
+ ${TOOLTIP_SUPPORT} \
+ ${MSDOS_SUPPORT} \
+ ${WINDOW_SUPPORT} \
${NS_SUPPORT} \
${lispsource}widget.elc \
${lispsource}window.elc \
${lispsource}version.el
-/* List of relative names for those files from $lisp that are loaded
- unconditionally (i.e. on all platforms). Files from $lisp that
- are only loaded on some platforms should instead be placed in
- SOME_MACHINE_LISP. The only reason this variable exists is to prevent
- the make-docfile command-line getting too long for some systems. */
+## List of relative names for those files from $lisp that are loaded
+## unconditionally (i.e. on all platforms). Files from $lisp that
+## are only loaded on some platforms should instead be placed in
+## SOME_MACHINE_LISP. The only reason this variable exists is to prevent
+## the make-docfile command-line getting too long for some systems.
shortlisp= \
../lisp/loaddefs.el \
../lisp/abbrev.elc \
@@ -605,16 +554,16 @@ shortlisp= \
../lisp/textmodes/paragraphs.elc \
../lisp/textmodes/text-mode.elc \
../lisp/emacs-lisp/timer.elc \
- ../lisp/vc-hooks.elc \
+ ../lisp/vc/vc-hooks.elc \
+ ../lisp/vc/ediff-hook.elc \
../lisp/jka-cmpr-hook.elc \
- ../lisp/ediff-hook.elc \
../lisp/epa-hook.elc \
../lisp/widget.elc \
../lisp/window.elc \
../lisp/version.el
-/* Like $shortlisp, but includes only those files from $lisp that are loaded
- conditionally (i.e., only on some platforms). */
+## Like $shortlisp, but includes only those files from $lisp that are loaded
+## conditionally (i.e., only on some platforms).
SOME_MACHINE_LISP = ../lisp/mouse.elc \
../lisp/select.elc ../lisp/scroll-bar.elc \
../lisp/ls-lisp.elc ../lisp/dos-fns.elc \
@@ -633,45 +582,45 @@ SOME_MACHINE_LISP = ../lisp/mouse.elc \
../lisp/term/ns-win.elc ../lisp/term/w32-win.elc \
../lisp/emacs-lisp/easymenu.elc
-/* Construct full set of libraries to be linked.
- Note that SunOS needs -lm to come before -lc; otherwise, you get
- duplicated symbols. If the standard libraries were compiled
- with GCC, we might need gnulib again after them. */
-
-LIBES = $(LOADLIBES) $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \
- $(RSVG_LIBS) ${IMAGEMAGICK_LIBS} $(DBUS_LIBS) @LIBGPM@ @LIBRESOLV@ $(LIBS_SYSTEM) \
+## Construct full set of libraries to be linked.
+## Note that SunOS needs -lm to come before -lc; otherwise, you get
+## duplicated symbols. If the standard libraries were compiled
+## with GCC, we might need LIB_GCC again after them.
+LIBES = $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \
+ $(RSVG_LIBS) ${IMAGEMAGICK_LIBS} $(DBUS_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \
$(LIBS_TERMCAP) $(GETLOADAVG_LIBS) ${GCONF_LIBS} ${LIBSELINUX_LIBS} \
- @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @LIBOTF_LIBS@ @M17N_FLT_LIBS@ \
- $(GNULIB_VAR) @LIB_MATH@ @LIB_STANDARD@ $(GNULIB_VAR)
+ $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
+ $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC)
all: emacs${EXEEXT} $(OTHER_FILES)
+## Does anyone ever pay attention to the load-path-shadows output here?
+## The dumped Emacs is as functional and more efficient than
+## bootstrap-emacs, so we replace the latter with the former.
emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp}
-#ifdef CANNOT_DUMP
- rm -f emacs${EXEEXT}
- ln temacs${EXEEXT} emacs${EXEEXT}
- -EMACSLOADPATH=${lispsource} ./emacs -q -batch -f list-load-path-shadows
-#else
- LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump
- @: This new Emacs is as functional and more efficient then
- @: bootstrap-emacs, so let us replace it.
- -ln -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}
- -./emacs -q -batch -f list-load-path-shadows
-#endif /* ! defined (CANNOT_DUMP) */
-
-/* We run make-docfile twice because the command line may get too long
- on some systems. */
-/* ${SOME_MACHINE_OBJECTS} comes before ${obj} because some files may
- or may not be included in ${obj}, but they are always included in
- ${SOME_MACHINE_OBJECTS}. Since a file is processed when it is mentioned
- for the first time, this prevents any variation between configurations
- in the contents of the DOC file.
- Likewise for ${SOME_MACHINE_LISP}. */
-/* Most of this Makefile refers to Lisp files via ${lispsource}, so
- we also use ${lisp} rather than ${shortlisp} for the dependency since
- the Makefile uses string equality to decide when we talk about identical
- files. Apparently we pass ${shortlisp} rather than ${lisp} to make-docfile
- only in order to reduce the command line length. --Stef */
+ if test "${CANNOT_DUMP}" = "yes"; then \
+ ln -f temacs${EXEEXT} emacs${EXEEXT}; \
+ EMACSLOADPATH=${lispsource} ./emacs -q -batch \
+ -f list-load-path-shadows || true; \
+ else \
+ LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump || exit 1; \
+ ln -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}; \
+ ./emacs -q -batch -f list-load-path-shadows || true; \
+ fi
+
+## We run make-docfile twice because the command line may get too long
+## on some systems.
+## ${SOME_MACHINE_OBJECTS} comes before ${obj} because some files may
+## or may not be included in ${obj}, but they are always included in
+## ${SOME_MACHINE_OBJECTS}. Since a file is processed when it is mentioned
+## for the first time, this prevents any variation between configurations
+## in the contents of the DOC file.
+## Likewise for ${SOME_MACHINE_LISP}.
+## Most of this Makefile refers to Lisp files via ${lispsource}, so
+## we also use ${lisp} rather than ${shortlisp} for the dependency since
+## the Makefile uses string equality to decide when we talk about identical
+## files. Apparently we pass ${shortlisp} rather than ${lisp} to make-docfile
+## only in order to reduce the command line length. --Stef
${etc}DOC: ${libsrc}make-docfile${EXEEXT} ${obj} ${lisp} ${SOME_MACHINE_LISP}
-rm -f ${etc}DOC
${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC
@@ -683,56 +632,45 @@ ${libsrc}make-docfile${EXEEXT}:
buildobj.h: Makefile
echo "#define BUILDOBJ \"${obj} ${otherobj} " "\"" > buildobj.h
-/* FIXME LOCALCPP not defined or mentioned anywhere. */
-temacs${EXEEXT}: $(LOCALCPP) $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} prefix-args${EXEEXT}
-#ifdef NS_IMPL_GNUSTEP
- $(CC) -rdynamic YMF_PASS_LDFLAGS ( ${TEMACS_LDFLAGS} \
- -L@GNUSTEP_SYSTEM_LIBRARIES@ -lgnustep-gui -lgnustep-base \
- -lobjc $(CONFIG_SYSTEM_LIBS) -lpthread ) -o temacs \
- ${obj} ${otherobj} ${LIBES}
-#else
- $(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \
- -o temacs ${START_FILES} ${obj} ${otherobj} \
- ${LIBES}
-#endif
+
+## We cannot define variables for PRE_EDIT and POST_EDIT.
+## If !ORDINARY_LINK && !LINKER && GCC, they add a
+## `./prefix-args -Xlinker ... ` wrapper, otherwise they are empty.
+## One alternative to this approach would be to always call prefix-args,
+## and have it DTRT in all cases, by testing the above defines.
+temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} prefix-args${EXEEXT}
+ $(LD) @PRE_EDIT_LDFLAGS@ ${TEMACS_LDFLAGS} @POST_EDIT_LDFLAGS@ \
+ ${TEMACS_LDFLAGS2} \
+ -o temacs ${START_FILES} ${obj} ${otherobj} ${LIBES}
prefix-args${EXEEXT}: prefix-args.o $(config_h)
$(CC) $(LDFLAGS) prefix-args.o -o prefix-args
-#if defined (HAVE_X_WINDOWS) && defined (HAVE_X11) && defined (HAVE_MENUS) && ! defined (USE_GTK)
-
-/* We use stamp-xmenu with these two deps
- to both ensure that lwlib gets remade based on its dependencies
- in its own makefile,
- and remake temacs if lwlib gets changed by this. */
-stamp-oldxmenu: ${OLDXMENU} ../src/$(OLDXMENU)
- touch stamp-oldxmenu
-/* Supply an ordering for parallel make. */
-../src/$(OLDXMENU): ${OLDXMENU}
-
-#ifdef USE_X_TOOLKIT
-$(OLDXMENU): really-lwlib
+## The following oldxmenu-related rules are only (possibly) used if
+## HAVE_X11 && !USE_GTK, but there is no harm in always defining them
+## (provided we take a little care that OLDXMENU is never empty).
really-lwlib:
cd ${lwlibdir}; ${MAKE} ${MFLAGS} \
CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}'
- @true /* make -t should not create really-lwlib. */
+ @true # make -t should not create really-lwlib.
.PHONY: really-lwlib
-#else /* not USE_X_TOOLKIT */
-$(OLDXMENU): really-oldXMenu
really-oldXMenu:
cd ${oldXMenudir}; ${MAKE} ${MFLAGS} \
CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}'
- @true /* make -t should not create really-oldXMenu. */
+ @true # make -t should not create really-oldXMenu.
.PHONY: really-oldXMenu
-#endif /* not USE_X_TOOLKIT */
-#else /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! USE_GTK) */
-/* We don''t really need this, but satisfy the dependency. */
-stamp-oldxmenu:
+## We do not really need this when OLDXMENU_DEPS is empty, but as
+## things stand we need something to satisfy the temacs dependency.
+stamp-oldxmenu: ${OLDXMENU_DEPS}
touch stamp-oldxmenu
-#endif /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! USE_GTK) */
+
+## Supply an ordering for parallel make.
+../src/$(OLDXMENU): ${OLDXMENU}
+
+$(OLDXMENU): $(OLDXMENU_TARGET)
../config.status:: epaths.in
@echo "The file epaths.h needs to be set up from epaths.in."
@@ -745,281 +683,14 @@ stamp-oldxmenu:
exit 1
ecrt0.o: ecrt0.c $(config_h)
-#ifdef AUTO_DEPEND
- @-test -d deps || mkdir deps
-#endif
+ @$(MKDEPDIR)
$(CC) -c $(ALL_CFLAGS) ${srcdir}/ecrt0.c
doc.o: buildobj.h
-#ifndef AUTO_DEPEND
-
-/* FIXME some of these dependencies are platform-specific.
-Eg callproc.c only depends on w32.h for WINDOWSNT builds.
-One way to fix this would be to replace w32.h (etc) by $(W32_H),
-a variable set by configure. Does not seem worth the trouble.
-
-nsgui.h: In fact, every .o file depends directly or indirectly on
-dispextern.h and hence nsgui.h under NS. But the ones that actually
-use stuff there are more limited. */
-atimer.o: atimer.c atimer.h syssignal.h systime.h lisp.h blockinput.h \
- $(config_h)
-bidi.o: bidi.c buffer.h character.h dispextern.h lisp.h $(config_h)
-buffer.o: buffer.c buffer.h region-cache.h commands.h window.h \
- $(INTERVALS_H) blockinput.h atimer.h systime.h character.h \
- indent.h keyboard.h coding.h keymap.h frame.h lisp.h $(config_h)
-callint.o: callint.c window.h commands.h buffer.h keymap.h \
- keyboard.h dispextern.h systime.h coding.h composite.h lisp.h $(config_h)
-callproc.o: callproc.c epaths.h buffer.h commands.h lisp.h $(config_h) \
- process.h systty.h syssignal.h character.h coding.h ccl.h msdos.h \
- composite.h w32.h blockinput.h atimer.h systime.h frame.h termhooks.h \
- buffer.h
-casefiddle.o: casefiddle.c syntax.h commands.h buffer.h character.h \
- composite.h keymap.h lisp.h $(config_h)
-casetab.o: casetab.c buffer.h character.h lisp.h $(config_h)
-category.o: category.c category.h buffer.h charset.h keymap.h \
- character.h lisp.h $(config_h)
-ccl.o: ccl.c ccl.h charset.h character.h coding.h composite.h lisp.h $(config_h)
-character.o: character.c character.h buffer.h charset.h composite.h disptab.h \
- lisp.h $(config_h)
-charset.o: charset.c charset.h character.h buffer.h coding.h composite.h \
- disptab.h lisp.h $(config_h)
-chartab.o: charset.h character.h ccl.h lisp.h $(config_h)
-coding.o: coding.c coding.h ccl.h buffer.h character.h charset.h composite.h \
- window.h dispextern.h frame.h termhooks.h lisp.h $(config_h)
-cm.o: cm.c frame.h cm.h termhooks.h termchar.h dispextern.h lisp.h $(config_h)
-cmds.o: cmds.c syntax.h buffer.h character.h commands.h window.h lisp.h $(config_h) \
- msdos.h dispextern.h keyboard.h keymap.h systime.h coding.h frame.h \
- composite.h
-pre-crt0.o: pre-crt0.c
-dbusbind.o: dbusbind.c termhooks.h frame.h keyboard.h lisp.h $(config_h)
-dired.o: dired.c commands.h buffer.h lisp.h $(config_h) character.h charset.h \
- coding.h regex.h systime.h blockinput.h atimer.h composite.h
-dispnew.o: dispnew.c systime.h commands.h process.h frame.h coding.h \
- window.h buffer.h termchar.h termopts.h termhooks.h cm.h \
- disptab.h indent.h $(INTERVALS_H) nsgui.h \
- xterm.h blockinput.h atimer.h character.h msdos.h keyboard.h \
- syssignal.h lisp.h $(config_h)
-doc.o: doc.c lisp.h $(config_h) epaths.h buffer.h keyboard.h keymap.h \
- character.h systime.h coding.h composite.h
-doprnt.o: doprnt.c character.h lisp.h $(config_h)
-dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \
- msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \
- lisp.h $(config_h)
-editfns.o: editfns.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
- coding.h frame.h blockinput.h atimer.h lisp.h $(config_h)
-emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
- termhooks.h buffer.h atimer.h systime.h $(INTERVALS_H) lisp.h $(config_h) \
- window.h dispextern.h keyboard.h keymap.h frame.h coding.h
-fileio.o: fileio.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
- coding.h msdos.h blockinput.h atimer.h lisp.h $(config_h) frame.h commands.h
-filelock.o: filelock.c buffer.h character.h coding.h systime.h composite.h \
- lisp.h $(config_h)
-filemode.o: filemode.c $(config_h)
-frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \
- blockinput.h atimer.h systime.h buffer.h character.h fontset.h font.h \
- msdos.h dosfns.h dispextern.h w32term.h nsgui.h termchar.h coding.h \
- composite.h lisp.h $(config_h) termhooks.h ccl.h
-fringe.o: fringe.c dispextern.h nsgui.h frame.h window.h buffer.h termhooks.h \
- blockinput.h atimer.h systime.h lisp.h $(config_h)
-font.o: font.c dispextern.h frame.h window.h ccl.h character.h charset.h \
- font.h lisp.h $(config_h) buffer.h composite.h fontset.h xterm.h nsgui.h
-ftfont.o: dispextern.h frame.h character.h charset.h composite.h font.h \
- lisp.h $(config_h) blockinput.h atimer.h systime.h coding.h fontset.h \
- ccl.h ftfont.h
-fontset.o: fontset.c fontset.h ccl.h buffer.h character.h \
- charset.h frame.h keyboard.h termhooks.h font.h lisp.h $(config_h) \
- blockinput.h atimer.h systime.h coding.h $(INTERVALS_H) nsgui.h \
- window.h xterm.h
-getloadavg.o: getloadavg.c $(config_h)
-gtkutil.o: gtkutil.c gtkutil.h xterm.h lisp.h frame.h lisp.h $(config_h) \
- blockinput.h window.h atimer.h systime.h termhooks.h keyboard.h \
- charset.h coding.h syssignal.h dispextern.h composite.h
-image.o: image.c frame.h window.h dispextern.h blockinput.h atimer.h \
- systime.h xterm.h w32term.h w32gui.h font.h epaths.h character.h coding.h \
- nsterm.h nsgui.h lisp.h $(config_h) composite.h termhooks.h ccl.h
-indent.o: indent.c frame.h window.h indent.h buffer.h lisp.h $(config_h) termchar.h \
- termopts.h disptab.h region-cache.h character.h category.h \
- keyboard.h systime.h coding.h $(INTERVALS_H)
-insdel.o: insdel.c window.h buffer.h $(INTERVALS_H) blockinput.h character.h \
- dispextern.h atimer.h systime.h region-cache.h lisp.h $(config_h)
-keyboard.o: keyboard.c termchar.h termhooks.h termopts.h buffer.h character.h \
- commands.h frame.h window.h macros.h disptab.h keyboard.h syssignal.h \
- systime.h syntax.h $(INTERVALS_H) blockinput.h atimer.h composite.h \
- xterm.h puresize.h msdos.h keymap.h w32term.h nsterm.h nsgui.h coding.h \
- lisp.h $(config_h)
-keymap.o: keymap.c buffer.h commands.h keyboard.h termhooks.h blockinput.h \
- atimer.h systime.h puresize.h character.h charset.h $(INTERVALS_H) keymap.h window.h \
- coding.h frame.h lisp.h $(config_h)
-lastfile.o: lastfile.c $(config_h)
-macros.o: macros.c window.h buffer.h commands.h macros.h keyboard.h \
- dispextern.h lisp.h $(config_h) systime.h coding.h composite.h
-gmalloc.o: gmalloc.c $(config_h)
-ralloc.o: ralloc.c lisp.h $(config_h)
-vm-limit.o: vm-limit.c mem-limits.h lisp.h $(config_h)
-marker.o: marker.c buffer.h character.h lisp.h $(config_h)
-md5.o: md5.c md5.h $(config_h)
-minibuf.o: minibuf.c syntax.h frame.h window.h keyboard.h systime.h \
- buffer.h commands.h character.h msdos.h $(INTERVALS_H) keymap.h \
- termhooks.h lisp.h $(config_h) coding.h
-mktime.o: mktime.c $(config_h)
-msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \
- termopts.h termchar.h character.h coding.h ccl.h disptab.h window.h \
- keyboard.h $(INTERVALS_H) buffer.h commands.h blockinput.h atimer.h lisp.h $(config_h)
-nsfns.o: nsfns.m charset.h nsterm.h nsgui.h frame.h window.h buffer.h \
- dispextern.h fontset.h $(INTERVALS_H) keyboard.h blockinput.h \
- atimer.h systime.h epaths.h termhooks.h coding.h systime.h lisp.h $(config_h)
-nsfont.o: nsterm.h dispextern.h frame.h lisp.h lisp.h $(config_h)
-nsimage.o: nsimage.m nsterm.h lisp.h $(config_h)
-nsmenu.o: nsmenu.m termhooks.h frame.h window.h dispextern.h \
- nsgui.h keyboard.h blockinput.h atimer.h systime.h buffer.h \
- nsterm.h lisp.h $(config_h)
-nsterm.o: nsterm.m blockinput.h atimer.h systime.h syssignal.h nsterm.h \
- nsgui.h frame.h charset.h ccl.h dispextern.h fontset.h termhooks.h \
- termopts.h termchar.h disptab.h buffer.h window.h keyboard.h \
- $(INTERVALS_H) process.h coding.h lisp.h $(config_h)
-nsselect.o: nsselect.m blockinput.h nsterm.h nsgui.h frame.h lisp.h $(config_h)
-process.o: process.c process.h buffer.h window.h termhooks.h termopts.h \
- commands.h syssignal.h systime.h systty.h syswait.h frame.h dispextern.h \
- blockinput.h atimer.h charset.h coding.h ccl.h msdos.h composite.h \
- keyboard.h lisp.h $(config_h) character.h xgselect.h sysselect.h
-regex.o: regex.c syntax.h buffer.h lisp.h $(config_h) regex.h category.h character.h
-region-cache.o: region-cache.c buffer.h region-cache.h lisp.h $(config_h)
-scroll.o: scroll.c termchar.h dispextern.h frame.h msdos.h keyboard.h \
- termhooks.h lisp.h $(config_h) systime.h coding.h composite.h window.h
-search.o: search.c regex.h commands.h buffer.h region-cache.h syntax.h \
- blockinput.h atimer.h systime.h category.h character.h charset.h \
- $(INTERVALS_H) \
- lisp.h $(config_h)
-sound.o: sound.c dispextern.h syssignal.h lisp.h $(config_h) atimer.h systime.h
-strftime.o: strftime.c $(config_h)
-syntax.o: syntax.c syntax.h buffer.h commands.h category.h character.h \
- keymap.h regex.h $(INTERVALS_H) lisp.h $(config_h)
-sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \
- process.h dispextern.h termhooks.h termchar.h termopts.h coding.h \
- frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h lisp.h $(config_h) \
- composite.h
-term.o: term.c termchar.h termhooks.h termopts.h lisp.h $(config_h) cm.h frame.h \
- disptab.h keyboard.h character.h charset.h coding.h ccl.h xterm.h \
- msdos.h window.h keymap.h blockinput.h atimer.h systime.h systty.h \
- syssignal.h $(INTERVALS_H) buffer.h
-termcap.o: termcap.c lisp.h $(config_h)
-terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
- keyboard.h lisp.h $(config_h) dispextern.h composite.h systime.h
-terminfo.o: terminfo.c lisp.h $(config_h)
-tparam.o: tparam.c lisp.h $(config_h)
-undo.o: undo.c buffer.h commands.h window.h dispextern.h lisp.h $(config_h)
-unexaix.o: unexaix.c lisp.h $(config_h)
-unexalpha.o: unexalpha.c $(config_h)
-unexcw.o: unexcw.c lisp.h $(config_h)
-unexec.o: unexec.c lisp.h $(config_h)
-unexelf.o: unexelf.c $(config_h)
-unexhp9k800.o: unexhp9k800.c $(config_h)
-unexmacosx.o: unexmacosx.c $(config_h)
-unexsol.o: unexsol.c lisp.h $(config_h)
-unexw32.o: unexw32.c $(config_h)
-w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \
- msdos.h buffer.h charset.h coding.h composite.h lisp.h $(config_h)
-widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \
- $(srcdir)/../lwlib/lwlib.h lisp.h $(config_h)
-window.o: window.c indent.h commands.h frame.h window.h buffer.h termchar.h \
- disptab.h keyboard.h msdos.h coding.h termhooks.h \
- keymap.h blockinput.h atimer.h systime.h $(INTERVALS_H) \
- xterm.h w32term.h nsterm.h nsgui.h lisp.h $(config_h)
-xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h \
- coding.h termchar.h frame.h window.h disptab.h termhooks.h character.h \
- charset.h lisp.h $(config_h) keyboard.h $(INTERVALS_H) region-cache.h \
- xterm.h w32term.h nsterm.h nsgui.h msdos.h composite.h fontset.h ccl.h \
- blockinput.h atimer.h systime.h keymap.h font.h
-xfaces.o: xfaces.c dispextern.h frame.h xterm.h buffer.h blockinput.h \
- window.h character.h charset.h msdos.h dosfns.h composite.h atimer.h \
- systime.h keyboard.h fontset.h w32term.h nsterm.h coding.h ccl.h \
- $(INTERVALS_H) nsgui.h termchar.h termhooks.h font.h lisp.h $(config_h)
-xfns.o: xfns.c buffer.h frame.h window.h keyboard.h xterm.h dispextern.h \
- $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h systime.h epaths.h \
- character.h charset.h coding.h gtkutil.h lisp.h $(config_h) termhooks.h \
- fontset.h termchar.h font.h xsettings.h $(INTERVALS_H) ccl.h
-xfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
- font.h lisp.h $(config_h) atimer.h systime.h fontset.h ccl.h
-xftfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
- font.h lisp.h $(config_h) atimer.h systime.h fontset.h ccl.h ftfont.h
-ftxfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
- font.h lisp.h $(config_h) atimer.h systime.h fontset.h ccl.h
-menu.o: menu.c lisp.h keyboard.h keymap.h frame.h termhooks.h blockinput.h \
- dispextern.h $(srcdir)/../lwlib/lwlib.h xterm.h gtkutil.h menu.h \
- lisp.h $(config_h) systime.h coding.h composite.h window.h atimer.h nsgui.h
-xmenu.o: xmenu.c xterm.h termhooks.h window.h dispextern.h frame.h buffer.h \
- charset.h keyboard.h $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h \
- systime.h gtkutil.h msdos.h coding.h menu.h lisp.h $(config_h) composite.h \
- keymap.h sysselect.h
-xterm.o: xterm.c xterm.h termhooks.h termopts.h termchar.h window.h buffer.h \
- dispextern.h frame.h disptab.h blockinput.h atimer.h systime.h syssignal.h \
- keyboard.h emacs-icon.h character.h charset.h ccl.h fontset.h composite.h \
- coding.h process.h gtkutil.h font.h fontset.h lisp.h $(config_h) \
- xsettings.h intervals.h keymap.h xgselect.h sysselect.h
-xselect.o: xselect.c process.h dispextern.h frame.h xterm.h blockinput.h \
- buffer.h atimer.h systime.h termhooks.h lisp.h $(config_h) keyboard.h \
- coding.h composite.h
-xgselect.o: xgselect.h systime.h sysselect.h lisp.h $(config_h)
-xrdb.o: xrdb.c lisp.h $(config_h) epaths.h
-xsmfns.o: xsmfns.c lisp.h $(config_h) systime.h sysselect.h termhooks.h xterm.h \
- lisp.h termopts.h frame.h dispextern.h
-xsettings.o: xterm.h xsettings.h lisp.h frame.h termhooks.h $(config_h) \
- dispextern.h keyboard.h systime.h coding.h composite.h blockinput.h atimer.h \
- termopts.h
-/* The files of Lisp proper */
-
-alloc.o: alloc.c process.h frame.h window.h buffer.h puresize.h syssignal.h \
- keyboard.h blockinput.h atimer.h systime.h character.h lisp.h $(config_h) \
- $(INTERVALS_H) termhooks.h
-bytecode.o: bytecode.c buffer.h syntax.h character.h window.h dispextern.h \
- frame.h xterm.h lisp.h $(config_h)
-data.o: data.c buffer.h puresize.h character.h syssignal.h keyboard.h frame.h \
- termhooks.h systime.h coding.h composite.h dispextern.h font.h ccl.h \
- lisp.h $(config_h)
-eval.o: eval.c commands.h keyboard.h blockinput.h atimer.h systime.h \
- dispextern.h lisp.h $(config_h) coding.h composite.h xterm.h
-floatfns.o: floatfns.c syssignal.h lisp.h $(config_h)
-fns.o: fns.c commands.h lisp.h $(config_h) frame.h buffer.h character.h keyboard.h \
- keymap.h window.h dispextern.h $(INTERVALS_H) coding.h md5.h \
- blockinput.h atimer.h systime.h xterm.h
-print.o: print.c process.h frame.h window.h buffer.h keyboard.h character.h \
- lisp.h $(config_h) termchar.h $(INTERVALS_H) msdos.h termhooks.h \
- blockinput.h atimer.h systime.h font.h charset.h coding.h ccl.h
-lread.o: lread.c commands.h keyboard.h buffer.h epaths.h character.h \
- charset.h lisp.h $(config_h) $(INTERVALS_H) termhooks.h coding.h msdos.h \
- systime.h frame.h blockinput.h atimer.h
-
-/* Text properties support */
-composite.o: composite.c buffer.h character.h coding.h font.h ccl.h \
- frame.h termhooks.h $(INTERVALS_H) window.h lisp.h $(config_h)
-intervals.o: intervals.c buffer.h $(INTERVALS_H) keyboard.h puresize.h \
- keymap.h lisp.h $(config_h) systime.h coding.h
-textprop.o: textprop.c buffer.h window.h $(INTERVALS_H) \
- lisp.h $(config_h)
-
-#endif /* ! AUTO_DEPEND */
-
-/* System-specific programs to be made.
- OTHER_FILES
- select which of these should be compiled. */
-
-#ifdef HAVE_NS
-${ns_appdir}: ${ns_appsrc}
- rm -fr ${ns_appdir}
- mkdir -p ${ns_appdir}
- ( cd ${ns_appsrc} ; tar cfh - . ) | ( cd ${ns_appdir} ; tar xf - )
- ( cd ${ns_appdir} ; for subdir in `find . -type d ! -name CVS -print` ; do \
- chmod a+rx $${subdir} ; \
- rm -rf $${subdir}/CVS ; \
- rm -f $${subdir}/.cvsignore ; done ; )
-
-${ns_appbindir}Emacs: emacs${EXEEXT}
- mkdir -p ${ns_appbindir}
- cp -f emacs${EXEEXT} ${ns_appbindir}Emacs
-
-ns-app: ${ns_appdir} ${ns_appbindir}Emacs
-
-#endif /* HAVE_NS */
+
+## If HAVE_NS, some ns-specific rules (for OTHER_FILES) are inserted here.
+@ns_frag@
+
mostlyclean:
rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a
@@ -1028,22 +699,21 @@ mostlyclean:
rm -f buildobj.h
clean: mostlyclean
rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT}
- -rm -rf deps
-#ifdef HAVE_NS
- rm -fr ${ns_appdir}
-#endif
-/* bootstrap-clean is used to clean up just before a bootstrap.
- It should remove all files generated during a compilation/bootstrap,
- but not things like config.status or TAGS. */
+ -rm -rf ${DEPDIR}
+ test "X${ns_appdir}" = "X" || rm -rf ${ns_appdir}
+
+## bootstrap-clean is used to clean up just before a bootstrap.
+## It should remove all files generated during a compilation/bootstrap,
+## but not things like config.status or TAGS.
bootstrap-clean: clean
- rm -f epaths.h config.h Makefile.c config.stamp stamp-oldxmenu ../etc/DOC-*
+ rm -f epaths.h config.h config.stamp stamp-oldxmenu ../etc/DOC-*
if test -f ./.gdbinit; then \
mv ./.gdbinit ./.gdbinit.save; \
if test -f "${srcdir}/.gdbinit"; then rm -f ./.gdbinit.save; \
else mv ./.gdbinit.save ./.gdbinit; fi; \
fi
-/**/# This is used in making a distribution.
-/**/# Do not use it on development directories!
+## This is used in making a distribution.
+## Do not use it on development directories!
distclean: bootstrap-clean
rm -f Makefile
maintainer-clean: distclean
@@ -1055,8 +725,8 @@ versionclean:
extraclean: distclean
-rm -f *~ \#* m/?*~ s/?*~
-/* Arrange to make a tags table TAGS-LISP for ../lisp,
- plus TAGS for the C files, which includes ../lisp/TAGS by reference. */
+## Arrange to make a tags table TAGS-LISP for ../lisp,
+## plus TAGS for the C files, which includes ../lisp/TAGS by reference.
ctagsfiles1 = [xyzXYZ]*.[hcm]
ctagsfiles2 = [a-wA-W]*.[hcm]
@@ -1076,59 +746,62 @@ tags: TAGS TAGS-LISP $(lwlibdir)TAGS
.PHONY: tags
-/* Bootstrapping. */
-/* Bootstrapping right is difficult because of the circular dependencies.
- Furthermore, we have to deal with the fact that many compilation targets
- such as loaddefs.el or *.elc can typically be produced by any old
- Emacs executable, so we would like to avoid rebuilding them whenever
- we build a new Emacs executable.
- To solve the circularity, we use 2 different Emacs executables,
- "emacs" is the main target and "bootstrap-emacs" is the one used
- to build the *.elc and loaddefs.el files.
- To solve the freshness issue, we used to use a third file "witness-emacs"
- which was used to witness the fact that there is a bootstrap-emacs
- executable, and then have dependencies on witness-emacs rather than
- bootstrap-emacs, but that lead to problems in parallel builds (because
- witness-emacs needed to be free from dependencies (to avoid rebuilding
- it), so it was compiled in parallel, leading typically to having 2
- processes dumping bootstrap-emacs at the same time).
- So instead, we replace the witness-emacs dependencies by conditional
- bootstrap-dependencies (via ${BOOTSTRAPEMACS}). Of course, since we do
- not want to rely on GNU Make features, we have to rely on an external
- script to do the conditional part of the dependency
- (i.e. see the ${SUBDIR} rule ../Makefile.in). */
+### Bootstrapping.
+
+## Bootstrapping right is difficult because of the circular dependencies.
+## Furthermore, we have to deal with the fact that many compilation targets
+## such as loaddefs.el or *.elc can typically be produced by any old
+## Emacs executable, so we would like to avoid rebuilding them whenever
+## we build a new Emacs executable.
+## To solve the circularity, we use 2 different Emacs executables,
+## "emacs" is the main target and "bootstrap-emacs" is the one used
+## to build the *.elc and loaddefs.el files.
+## To solve the freshness issue, we used to use a third file "witness-emacs"
+## which was used to witness the fact that there is a bootstrap-emacs
+## executable, and then have dependencies on witness-emacs rather than
+## bootstrap-emacs, but that lead to problems in parallel builds (because
+## witness-emacs needed to be free from dependencies (to avoid rebuilding
+## it), so it was compiled in parallel, leading typically to having 2
+## processes dumping bootstrap-emacs at the same time).
+## So instead, we replace the witness-emacs dependencies by conditional
+## bootstrap-dependencies (via ${BOOTSTRAPEMACS}). Of course, since we do
+## not want to rely on GNU Make features, we have to rely on an external
+## script to do the conditional part of the dependency
+## (i.e. see the ${SUBDIR} rule ../Makefile.in).
.SUFFIXES: .elc .el
-/* These suffix rules do not allow additional dependencies, sadly, so
- instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it
- separately below.
- With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)" */
+## These suffix rules do not allow additional dependencies, sadly, so
+## instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it
+## separately below.
+## With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)"
.el.elc:
@cd ../lisp; $(MAKE) $(MFLAGS) compile-onefile \
THEFILE=$< EMACS=${bootstrap_exe}
-/* Since the .el.elc rule cannot specify an extra dependency, we do it here. */
+## Since the .el.elc rule cannot specify an extra dependency, we do it here.
${lisp} ${SOME_MACHINE_LISP}: $(BOOTSTRAPEMACS)
-${lispsource}loaddefs.el: $(BOOTSTRAPEMACS)
+## VCSWITNESS points to the file that holds info about the current checkout.
+## We use it as a heuristic to decide when to rebuild loaddefs.el.
+${lispsource}loaddefs.el: $(BOOTSTRAPEMACS) $(VCSWITNESS)
cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS=${bootstrap_exe}
-/* Dump an Emacs executable named bootstrap-emacs containing the
- files from loadup.el in source form. */
-
+## Dump an Emacs executable named bootstrap-emacs containing the
+## files from loadup.el in source form.
bootstrap-emacs${EXEEXT}: temacs${EXEEXT}
cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs
-#ifdef CANNOT_DUMP
- ln -f temacs${EXEEXT} bootstrap-emacs${EXEEXT}
-#else
- $(RUN_TEMACS) --batch --load loadup bootstrap
- mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}
-#endif /* ! defined (CANNOT_DUMP) */
+ if test "${CANNOT_DUMP}" = "yes"; then \
+ ln -f temacs${EXEEXT} bootstrap-emacs${EXEEXT}; \
+ else \
+ $(RUN_TEMACS) --batch --load loadup bootstrap || exit 1; \
+ mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}; \
+ fi
@: Compile some files earlier to speed up further compilation.
cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS=${bootstrap_exe}
-#ifdef AUTO_DEPEND
-ALLOBJS=$(START_FILES) ${obj} ${otherobj} prefix-args.o
--include $(ALLOBJS:%.o=deps/%.d)
-#endif
+## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk.
+@deps_frag@
+
+
+### Makefile.in ends here
diff --git a/src/README b/src/README
index 679fc961e5..b4ce91b150 100644
--- a/src/README
+++ b/src/README
@@ -1,5 +1,5 @@
-Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010 Free Software Foundation, Inc.
See the end of the file for license conditions.
@@ -10,12 +10,10 @@ and installed, if the dumped Emacs (on Unix systems) is copied elsewhere.
See the files ../README and then ../INSTALL for installation instructions.
Under GNU and Unix systems, the file `Makefile.in' is used as a
-template by the script `../configure' to produce `Makefile.c'. The
-same script then uses `cpp' to produce the machine-dependent
-`Makefile' from `Makefile.c'; `Makefile' is the file which actually
-controls the compilation of Emacs. Most of this should work
-transparently to the user; you should only need to run `../configure',
-and then type `make'.
+template by the script `../configure' to produce `Makefile'. This
+is the file which actually controls the compilation of Emacs.
+All of this should work transparently to the user; you should only
+need to run `../configure', and then type `make'.
This file is part of GNU Emacs.
diff --git a/src/alloc.c b/src/alloc.c
index c1f1094d15..e0f07cc5f5 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -70,7 +70,6 @@ extern POINTER_TYPE *sbrk ();
#endif
#ifdef HAVE_FCNTL_H
-#define INCLUDED_FCNTL
#include <fcntl.h>
#endif
#ifndef O_WRONLY
diff --git a/src/autodeps.mk b/src/autodeps.mk
new file mode 100644
index 0000000000..c3cc91e22a
--- /dev/null
+++ b/src/autodeps.mk
@@ -0,0 +1,6 @@
+### autodeps.mk --- src/Makefile fragment for GNU Emacs
+
+## This is inserted in src/Makefile if AUTO_DEPEND=yes.
+
+ALLOBJS=$(START_FILES) ${obj} ${otherobj} prefix-args.o
+-include $(ALLOBJS:%.o=${DEPDIR}/%.d)
diff --git a/src/bidi.c b/src/bidi.c
index d4c7d2451d..bca32cf110 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -26,13 +26,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
designed to be called once for every character in the buffer or
string.
- The main entry point is bidi_get_next_char_visually. Each time it
+ The main entry point is bidi_move_to_visually_next. Each time it
is called, it finds the next character in the visual order, and
returns its information in a special structure. The caller is then
expected to process this character for display or any other
- purposes, and call bidi_get_next_char_visually for the next
- character. See the comments in bidi_get_next_char_visually for
- more details about its algorithm that finds the next visual-order
+ purposes, and call bidi_move_to_visually_next for the next
+ character. See the comments in bidi_move_to_visually_next for more
+ details about its algorithm that finds the next visual-order
character by resolving their levels on the fly.
The two other entry points are bidi_paragraph_init and
@@ -68,7 +68,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
static int bidi_initialized = 0;
-static Lisp_Object bidi_type_table;
+static Lisp_Object bidi_type_table, bidi_mirror_table;
/* FIXME: Remove these when bidi_explicit_dir_char uses a lookup table. */
#define LRM_CHAR 0x200E
@@ -108,297 +108,26 @@ static Lisp_Object Qparagraph_start, Qparagraph_separate;
static void
bidi_initialize ()
{
- /* FIXME: This should come from the Unicode Database. */
- struct {
- int from, to;
- bidi_type_t type;
- } bidi_type[] =
- { { 0x0000, 0x0008, WEAK_BN },
- { 0x0009, 0x0000, NEUTRAL_S },
- { 0x000A, 0x0000, NEUTRAL_B },
- { 0x000B, 0x0000, NEUTRAL_S },
- { 0x000C, 0x0000, NEUTRAL_WS },
- { 0x000D, 0x0000, NEUTRAL_B },
- { 0x000E, 0x001B, WEAK_BN },
- { 0x001C, 0x001E, NEUTRAL_B },
- { 0x001F, 0x0000, NEUTRAL_S },
- { 0x0020, 0x0000, NEUTRAL_WS },
- { 0x0021, 0x0022, NEUTRAL_ON },
- { 0x0023, 0x0025, WEAK_ET },
- { 0x0026, 0x002A, NEUTRAL_ON },
- { 0x002B, 0x0000, WEAK_ES },
- { 0x002C, 0x0000, WEAK_CS },
- { 0x002D, 0x0000, WEAK_ES },
- { 0x002E, 0x002F, WEAK_CS },
- { 0x0030, 0x0039, WEAK_EN },
- { 0x003A, 0x0000, WEAK_CS },
- { 0x003B, 0x0040, NEUTRAL_ON },
- { 0x005B, 0x0060, NEUTRAL_ON },
- { 0x007B, 0x007E, NEUTRAL_ON },
- { 0x007F, 0x0084, WEAK_BN },
- { 0x0085, 0x0000, NEUTRAL_B },
- { 0x0086, 0x009F, WEAK_BN },
- { 0x00A0, 0x0000, WEAK_CS },
- { 0x00A1, 0x0000, NEUTRAL_ON },
- { 0x00A2, 0x00A5, WEAK_ET },
- { 0x00A6, 0x00A9, NEUTRAL_ON },
- { 0x00AB, 0x00AC, NEUTRAL_ON },
- { 0x00AD, 0x0000, WEAK_BN },
- { 0x00AE, 0x00Af, NEUTRAL_ON },
- { 0x00B0, 0x00B1, WEAK_ET },
- { 0x00B2, 0x00B3, WEAK_EN },
- { 0x00B4, 0x0000, NEUTRAL_ON },
- { 0x00B6, 0x00B8, NEUTRAL_ON },
- { 0x00B9, 0x0000, WEAK_EN },
- { 0x00BB, 0x00BF, NEUTRAL_ON },
- { 0x00D7, 0x0000, NEUTRAL_ON },
- { 0x00F7, 0x0000, NEUTRAL_ON },
- { 0x02B9, 0x02BA, NEUTRAL_ON },
- { 0x02C2, 0x02CF, NEUTRAL_ON },
- { 0x02D2, 0x02DF, NEUTRAL_ON },
- { 0x02E5, 0x02ED, NEUTRAL_ON },
- { 0x0300, 0x036F, WEAK_NSM },
- { 0x0374, 0x0375, NEUTRAL_ON },
- { 0x037E, 0x0385, NEUTRAL_ON },
- { 0x0387, 0x0000, NEUTRAL_ON },
- { 0x03F6, 0x0000, NEUTRAL_ON },
- { 0x0483, 0x0489, WEAK_NSM },
- { 0x058A, 0x0000, NEUTRAL_ON },
- { 0x0591, 0x05BD, WEAK_NSM },
- { 0x05BE, 0x0000, STRONG_R },
- { 0x05BF, 0x0000, WEAK_NSM },
- { 0x05C0, 0x0000, STRONG_R },
- { 0x05C1, 0x05C2, WEAK_NSM },
- { 0x05C3, 0x0000, STRONG_R },
- { 0x05C4, 0x05C5, WEAK_NSM },
- { 0x05C6, 0x0000, STRONG_R },
- { 0x05C7, 0x0000, WEAK_NSM },
- { 0x05D0, 0x05F4, STRONG_R },
- { 0x060C, 0x0000, WEAK_CS },
- { 0x061B, 0x064A, STRONG_AL },
- { 0x064B, 0x0655, WEAK_NSM },
- { 0x0660, 0x0669, WEAK_AN },
- { 0x066A, 0x0000, WEAK_ET },
- { 0x066B, 0x066C, WEAK_AN },
- { 0x066D, 0x066F, STRONG_AL },
- { 0x0670, 0x0000, WEAK_NSM },
- { 0x0671, 0x06D5, STRONG_AL },
- { 0x06D6, 0x06DC, WEAK_NSM },
- { 0x06DD, 0x0000, STRONG_AL },
- { 0x06DE, 0x06E4, WEAK_NSM },
- { 0x06E5, 0x06E6, STRONG_AL },
- { 0x06E7, 0x06E8, WEAK_NSM },
- { 0x06E9, 0x0000, NEUTRAL_ON },
- { 0x06EA, 0x06ED, WEAK_NSM },
- { 0x06F0, 0x06F9, WEAK_EN },
- { 0x06FA, 0x070D, STRONG_AL },
- { 0x070F, 0x0000, WEAK_BN },
- { 0x0710, 0x0000, STRONG_AL },
- { 0x0711, 0x0000, WEAK_NSM },
- { 0x0712, 0x072C, STRONG_AL },
- { 0x0730, 0x074A, WEAK_NSM },
- { 0x0780, 0x07A5, STRONG_AL },
- { 0x07A6, 0x07B0, WEAK_NSM },
- { 0x07B1, 0x0000, STRONG_AL },
- { 0x0901, 0x0902, WEAK_NSM },
- { 0x093C, 0x0000, WEAK_NSM },
- { 0x0941, 0x0948, WEAK_NSM },
- { 0x094D, 0x0000, WEAK_NSM },
- { 0x0951, 0x0954, WEAK_NSM },
- { 0x0962, 0x0963, WEAK_NSM },
- { 0x0981, 0x0000, WEAK_NSM },
- { 0x09BC, 0x0000, WEAK_NSM },
- { 0x09C1, 0x09C4, WEAK_NSM },
- { 0x09CD, 0x0000, WEAK_NSM },
- { 0x09E2, 0x09E3, WEAK_NSM },
- { 0x09F2, 0x09F3, WEAK_ET },
- { 0x0A02, 0x0000, WEAK_NSM },
- { 0x0A3C, 0x0000, WEAK_NSM },
- { 0x0A41, 0x0A4D, WEAK_NSM },
- { 0x0A70, 0x0A71, WEAK_NSM },
- { 0x0A81, 0x0A82, WEAK_NSM },
- { 0x0ABC, 0x0000, WEAK_NSM },
- { 0x0AC1, 0x0AC8, WEAK_NSM },
- { 0x0ACD, 0x0000, WEAK_NSM },
- { 0x0B01, 0x0000, WEAK_NSM },
- { 0x0B3C, 0x0000, WEAK_NSM },
- { 0x0B3F, 0x0000, WEAK_NSM },
- { 0x0B41, 0x0B43, WEAK_NSM },
- { 0x0B4D, 0x0B56, WEAK_NSM },
- { 0x0B82, 0x0000, WEAK_NSM },
- { 0x0BC0, 0x0000, WEAK_NSM },
- { 0x0BCD, 0x0000, WEAK_NSM },
- { 0x0C3E, 0x0C40, WEAK_NSM },
- { 0x0C46, 0x0C56, WEAK_NSM },
- { 0x0CBF, 0x0000, WEAK_NSM },
- { 0x0CC6, 0x0000, WEAK_NSM },
- { 0x0CCC, 0x0CCD, WEAK_NSM },
- { 0x0D41, 0x0D43, WEAK_NSM },
- { 0x0D4D, 0x0000, WEAK_NSM },
- { 0x0DCA, 0x0000, WEAK_NSM },
- { 0x0DD2, 0x0DD6, WEAK_NSM },
- { 0x0E31, 0x0000, WEAK_NSM },
- { 0x0E34, 0x0E3A, WEAK_NSM },
- { 0x0E3F, 0x0000, WEAK_ET },
- { 0x0E47, 0x0E4E, WEAK_NSM },
- { 0x0EB1, 0x0000, WEAK_NSM },
- { 0x0EB4, 0x0EBC, WEAK_NSM },
- { 0x0EC8, 0x0ECD, WEAK_NSM },
- { 0x0F18, 0x0F19, WEAK_NSM },
- { 0x0F35, 0x0000, WEAK_NSM },
- { 0x0F37, 0x0000, WEAK_NSM },
- { 0x0F39, 0x0000, WEAK_NSM },
- { 0x0F3A, 0x0F3D, NEUTRAL_ON },
- { 0x0F71, 0x0F7E, WEAK_NSM },
- { 0x0F80, 0x0F84, WEAK_NSM },
- { 0x0F86, 0x0F87, WEAK_NSM },
- { 0x0F90, 0x0FBC, WEAK_NSM },
- { 0x0FC6, 0x0000, WEAK_NSM },
- { 0x102D, 0x1030, WEAK_NSM },
- { 0x1032, 0x1037, WEAK_NSM },
- { 0x1039, 0x0000, WEAK_NSM },
- { 0x1058, 0x1059, WEAK_NSM },
- { 0x1680, 0x0000, NEUTRAL_WS },
- { 0x169B, 0x169C, NEUTRAL_ON },
- { 0x1712, 0x1714, WEAK_NSM },
- { 0x1732, 0x1734, WEAK_NSM },
- { 0x1752, 0x1753, WEAK_NSM },
- { 0x1772, 0x1773, WEAK_NSM },
- { 0x17B7, 0x17BD, WEAK_NSM },
- { 0x17C6, 0x0000, WEAK_NSM },
- { 0x17C9, 0x17D3, WEAK_NSM },
- { 0x17DB, 0x0000, WEAK_ET },
- { 0x1800, 0x180A, NEUTRAL_ON },
- { 0x180B, 0x180D, WEAK_NSM },
- { 0x180E, 0x0000, WEAK_BN },
- { 0x18A9, 0x0000, WEAK_NSM },
- { 0x1FBD, 0x0000, NEUTRAL_ON },
- { 0x1FBF, 0x1FC1, NEUTRAL_ON },
- { 0x1FCD, 0x1FCF, NEUTRAL_ON },
- { 0x1FDD, 0x1FDF, NEUTRAL_ON },
- { 0x1FED, 0x1FEF, NEUTRAL_ON },
- { 0x1FFD, 0x1FFE, NEUTRAL_ON },
- { 0x2000, 0x200A, NEUTRAL_WS },
- { 0x200B, 0x200D, WEAK_BN },
- { 0x200F, 0x0000, STRONG_R },
- { 0x2010, 0x2027, NEUTRAL_ON },
- { 0x2028, 0x0000, NEUTRAL_WS },
- { 0x2029, 0x0000, NEUTRAL_B },
- { 0x202A, 0x0000, LRE },
- { 0x202B, 0x0000, RLE },
- { 0x202C, 0x0000, PDF },
- { 0x202D, 0x0000, LRO },
- { 0x202E, 0x0000, RLO },
- { 0x202F, 0x0000, NEUTRAL_WS },
- { 0x2030, 0x2034, WEAK_ET },
- { 0x2035, 0x2057, NEUTRAL_ON },
- { 0x205F, 0x0000, NEUTRAL_WS },
- { 0x2060, 0x206F, WEAK_BN },
- { 0x2070, 0x0000, WEAK_EN },
- { 0x2074, 0x2079, WEAK_EN },
- { 0x207A, 0x207B, WEAK_ET },
- { 0x207C, 0x207E, NEUTRAL_ON },
- { 0x2080, 0x2089, WEAK_EN },
- { 0x208A, 0x208B, WEAK_ET },
- { 0x208C, 0x208E, NEUTRAL_ON },
- { 0x20A0, 0x20B1, WEAK_ET },
- { 0x20D0, 0x20EA, WEAK_NSM },
- { 0x2100, 0x2101, NEUTRAL_ON },
- { 0x2103, 0x2106, NEUTRAL_ON },
- { 0x2108, 0x2109, NEUTRAL_ON },
- { 0x2114, 0x0000, NEUTRAL_ON },
- { 0x2116, 0x2118, NEUTRAL_ON },
- { 0x211E, 0x2123, NEUTRAL_ON },
- { 0x2125, 0x0000, NEUTRAL_ON },
- { 0x2127, 0x0000, NEUTRAL_ON },
- { 0x2129, 0x0000, NEUTRAL_ON },
- { 0x212E, 0x0000, WEAK_ET },
- { 0x2132, 0x0000, NEUTRAL_ON },
- { 0x213A, 0x0000, NEUTRAL_ON },
- { 0x2140, 0x2144, NEUTRAL_ON },
- { 0x214A, 0x215F, NEUTRAL_ON },
- { 0x2190, 0x2211, NEUTRAL_ON },
- { 0x2212, 0x2213, WEAK_ET },
- { 0x2214, 0x2335, NEUTRAL_ON },
- { 0x237B, 0x2394, NEUTRAL_ON },
- { 0x2396, 0x244A, NEUTRAL_ON },
- { 0x2460, 0x249B, WEAK_EN },
- { 0x24EA, 0x0000, WEAK_EN },
- { 0x24EB, 0x2FFB, NEUTRAL_ON },
- { 0x3000, 0x0000, NEUTRAL_WS },
- { 0x3001, 0x3004, NEUTRAL_ON },
- { 0x3008, 0x3020, NEUTRAL_ON },
- { 0x302A, 0x302F, WEAK_NSM },
- { 0x3030, 0x0000, NEUTRAL_ON },
- { 0x3036, 0x3037, NEUTRAL_ON },
- { 0x303D, 0x303F, NEUTRAL_ON },
- { 0x3099, 0x309A, WEAK_NSM },
- { 0x309B, 0x309C, NEUTRAL_ON },
- { 0x30A0, 0x0000, NEUTRAL_ON },
- { 0x30FB, 0x0000, NEUTRAL_ON },
- { 0x3251, 0x325F, NEUTRAL_ON },
- { 0x32B1, 0x32BF, NEUTRAL_ON },
- { 0xA490, 0xA4C6, NEUTRAL_ON },
- { 0xFB1D, 0x0000, STRONG_R },
- { 0xFB1E, 0x0000, WEAK_NSM },
- { 0xFB1F, 0xFB28, STRONG_R },
- { 0xFB29, 0x0000, WEAK_ET },
- { 0xFB2A, 0xFB4F, STRONG_R },
- { 0xFB50, 0xFD3D, STRONG_AL },
- { 0xFD3E, 0xFD3F, NEUTRAL_ON },
- { 0xFD50, 0xFDFC, STRONG_AL },
- { 0xFE00, 0xFE23, WEAK_NSM },
- { 0xFE30, 0xFE4F, NEUTRAL_ON },
- { 0xFE50, 0x0000, WEAK_CS },
- { 0xFE51, 0x0000, NEUTRAL_ON },
- { 0xFE52, 0x0000, WEAK_CS },
- { 0xFE54, 0x0000, NEUTRAL_ON },
- { 0xFE55, 0x0000, WEAK_CS },
- { 0xFE56, 0xFE5E, NEUTRAL_ON },
- { 0xFE5F, 0x0000, WEAK_ET },
- { 0xFE60, 0xFE61, NEUTRAL_ON },
- { 0xFE62, 0xFE63, WEAK_ET },
- { 0xFE64, 0xFE68, NEUTRAL_ON },
- { 0xFE69, 0xFE6A, WEAK_ET },
- { 0xFE6B, 0x0000, NEUTRAL_ON },
- { 0xFE70, 0xFEFC, STRONG_AL },
- { 0xFEFF, 0x0000, WEAK_BN },
- { 0xFF01, 0xFF02, NEUTRAL_ON },
- { 0xFF03, 0xFF05, WEAK_ET },
- { 0xFF06, 0xFF0A, NEUTRAL_ON },
- { 0xFF0B, 0x0000, WEAK_ET },
- { 0xFF0C, 0x0000, WEAK_CS },
- { 0xFF0D, 0x0000, WEAK_ET },
- { 0xFF0E, 0x0000, WEAK_CS },
- { 0xFF0F, 0x0000, WEAK_ES },
- { 0xFF10, 0xFF19, WEAK_EN },
- { 0xFF1A, 0x0000, WEAK_CS },
- { 0xFF1B, 0xFF20, NEUTRAL_ON },
- { 0xFF3B, 0xFF40, NEUTRAL_ON },
- { 0xFF5B, 0xFF65, NEUTRAL_ON },
- { 0xFFE0, 0xFFE1, WEAK_ET },
- { 0xFFE2, 0xFFE4, NEUTRAL_ON },
- { 0xFFE5, 0xFFE6, WEAK_ET },
- { 0xFFE8, 0xFFEE, NEUTRAL_ON },
- { 0xFFF9, 0xFFFB, WEAK_BN },
- { 0xFFFC, 0xFFFD, NEUTRAL_ON },
- { 0x1D167, 0x1D169, WEAK_NSM },
- { 0x1D173, 0x1D17A, WEAK_BN },
- { 0x1D17B, 0x1D182, WEAK_NSM },
- { 0x1D185, 0x1D18B, WEAK_NSM },
- { 0x1D1AA, 0x1D1AD, WEAK_NSM },
- { 0x1D7CE, 0x1D7FF, WEAK_EN },
- { 0xE0001, 0xE007F, WEAK_BN } };
+
+#include "biditype.h"
+#include "bidimirror.h"
+
int i;
bidi_type_table = Fmake_char_table (Qnil, make_number (STRONG_L));
staticpro (&bidi_type_table);
for (i = 0; i < sizeof bidi_type / sizeof bidi_type[0]; i++)
- char_table_set_range (bidi_type_table, bidi_type[i].from,
- bidi_type[i].to ? bidi_type[i].to : bidi_type[i].from,
+ char_table_set_range (bidi_type_table, bidi_type[i].from, bidi_type[i].to,
make_number (bidi_type[i].type));
+ bidi_mirror_table = Fmake_char_table (Qnil, Qnil);
+ staticpro (&bidi_mirror_table);
+
+ for (i = 0; i < sizeof bidi_mirror / sizeof bidi_mirror[0]; i++)
+ char_table_set (bidi_mirror_table, bidi_mirror[i].from,
+ make_number (bidi_mirror[i].to));
+
Qparagraph_start = intern ("paragraph-start");
staticpro (&Qparagraph_start);
paragraph_start_re = Fsymbol_value (Qparagraph_start);
@@ -501,24 +230,31 @@ bidi_get_category (bidi_type_t type)
}
}
-/* Return the mirrored character of C, if any.
-
- Note: The conditions in UAX#9 clause L4 must be tested by the
- caller. */
-/* FIXME: exceedingly temporary! Should consult the Unicode database
- of character properties. */
+/* Return the mirrored character of C, if it has one. If C has no
+ mirrored counterpart, return C.
+ Note: The conditions in UAX#9 clause L4 regarding the surrounding
+ context must be tested by the caller. */
int
bidi_mirror_char (int c)
{
- static const char mirrored_pairs[] = "()<>[]{}";
- const char *p = c > 0 && c < 128 ? strchr (mirrored_pairs, c) : NULL;
+ Lisp_Object val;
+
+ if (c == BIDI_EOB)
+ return c;
+ if (c < 0 || c > MAX_CHAR)
+ abort ();
- if (p)
+ val = CHAR_TABLE_REF (bidi_mirror_table, c);
+ if (INTEGERP (val))
{
- size_t i = p - mirrored_pairs;
+ int v = XINT (val);
+
+ if (v < 0 || v > MAX_CHAR)
+ abort ();
- return mirrored_pairs [(i ^ 1)];
+ return v;
}
+
return c;
}
@@ -540,9 +276,12 @@ bidi_copy_it (struct bidi_it *to, struct bidi_it *from)
/* Caching the bidi iterator states. */
-static struct bidi_it bidi_cache[1000]; /* FIXME: make this dynamically allocated! */
-static int bidi_cache_idx;
-static int bidi_cache_last_idx;
+#define BIDI_CACHE_CHUNK 200
+static struct bidi_it *bidi_cache;
+static size_t bidi_cache_size = 0;
+static size_t elsz = sizeof (struct bidi_it);
+static int bidi_cache_idx; /* next unused cache slot */
+static int bidi_cache_last_idx; /* slot of last cache hit */
static INLINE void
bidi_cache_reset (void)
@@ -552,6 +291,18 @@ bidi_cache_reset (void)
}
static INLINE void
+bidi_cache_shrink (void)
+{
+ if (bidi_cache_size > BIDI_CACHE_CHUNK)
+ {
+ bidi_cache_size = BIDI_CACHE_CHUNK;
+ bidi_cache =
+ (struct bidi_it *) xrealloc (bidi_cache, bidi_cache_size * elsz);
+ }
+ bidi_cache_reset ();
+}
+
+static INLINE void
bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it)
{
int current_scan_dir = bidi_it->scan_dir;
@@ -672,9 +423,13 @@ bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved)
if (idx < 0)
{
idx = bidi_cache_idx;
- /* Don't overrun the cache limit. */
- if (idx > sizeof (bidi_cache) / sizeof (bidi_cache[0]) - 1)
- abort ();
+ /* Enlarge the cache as needed. */
+ if (idx >= bidi_cache_size)
+ {
+ bidi_cache_size += BIDI_CACHE_CHUNK;
+ bidi_cache =
+ (struct bidi_it *) xrealloc (bidi_cache, bidi_cache_size * elsz);
+ }
/* Character positions should correspond to cache positions 1:1.
If we are outside the range of cached positions, the cache is
useless and must be reset. */
@@ -688,7 +443,6 @@ bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved)
bidi_copy_it (&bidi_cache[idx], bidi_it);
if (!resolved)
bidi_cache[idx].resolved_level = -1;
- bidi_cache[idx].new_paragraph = 0;
}
else
{
@@ -873,6 +627,9 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it)
EMACS_INT pos;
bidi_type_t type;
+ if (!bidi_initialized)
+ bidi_initialize ();
+
/* If we are inside a paragraph separator, we are just waiting
for the separator to be exhausted; use the previous paragraph
direction. But don't do that if we have been just reseated,
@@ -896,11 +653,6 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it)
middle of it. Find where this paragraph starts. */
bytepos = bidi_find_paragraph_start (pos, bytepos);
- /* We should always be at the beginning of a new line at this
- point. */
- if (!(bytepos == BEGV_BYTE || FETCH_CHAR (bytepos - 1) == '\n'))
- abort ();
-
bidi_it->separator_limit = -1;
bidi_it->new_paragraph = 0;
ch = FETCH_CHAR (bytepos);
@@ -940,7 +692,7 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it)
/* Contrary to UAX#9 clause P3, we only default the paragraph
direction to L2R if we have no previous usable paragraph
direction. */
- if (bidi_it->paragraph_dir == NEUTRAL_DIR)
+ if (bidi_it->paragraph_dir != L2R && bidi_it->paragraph_dir != R2L)
bidi_it->paragraph_dir = L2R; /* P3 and ``higher protocols'' */
if (bidi_it->paragraph_dir == R2L)
bidi_it->level_stack[0].level = 1;
@@ -990,6 +742,7 @@ bidi_init_it (EMACS_INT charpos, EMACS_INT bytepos, struct bidi_it *bidi_it)
bidi_it->prev_for_neutral.type_after_w1 =
bidi_it->prev_for_neutral.orig_type = UNKNOWN_BT;
bidi_it->sor = L2R; /* FIXME: should it be user-selectable? */
+ bidi_cache_shrink ();
}
/* Push the current embedding level and override status; reset the
@@ -1876,7 +1629,7 @@ bidi_find_other_level_edge (struct bidi_it *bidi_it, int level, int end_flag)
}
void
-bidi_get_next_char_visually (struct bidi_it *bidi_it)
+bidi_move_to_visually_next (struct bidi_it *bidi_it)
{
int old_level, new_level, next_level;
struct bidi_it sentinel;
@@ -1890,7 +1643,9 @@ bidi_get_next_char_visually (struct bidi_it *bidi_it)
if (!bidi_it->first_elt && bidi_it->orig_type == NEUTRAL_B)
bidi_line_init (bidi_it);
- /* Prepare the sentinel iterator state. */
+ /* Prepare the sentinel iterator state, and cache it. When we bump
+ into it, scanning backwards, we'll know that the last non-base
+ level is exhausted. */
if (bidi_cache_idx == 0)
{
bidi_copy_it (&sentinel, bidi_it);
@@ -1901,6 +1656,7 @@ bidi_get_next_char_visually (struct bidi_it *bidi_it)
sentinel.ch = '\n'; /* doesn't matter, but why not? */
sentinel.ch_len = 1;
}
+ bidi_cache_iterator_state (&sentinel, 1);
}
old_level = bidi_it->resolved_level;
@@ -1916,11 +1672,6 @@ bidi_get_next_char_visually (struct bidi_it *bidi_it)
int incr = ascending ? 1 : -1;
int expected_next_level = old_level + incr;
- /* If we don't have anything cached yet, we need to cache the
- sentinel state, since we'll need it to record where to jump
- when the last non-base level is exhausted. */
- if (bidi_cache_idx == 0)
- bidi_cache_iterator_state (&sentinel, 1);
/* Jump (or walk) to the other edge of this level. */
bidi_find_other_level_edge (bidi_it, level_to_search, !ascending);
/* Switch scan direction and peek at the next character in the
diff --git a/src/bidimirror.h b/src/bidimirror.h
new file mode 100644
index 0000000000..477f983ad6
--- /dev/null
+++ b/src/bidimirror.h
@@ -0,0 +1,365 @@
+ struct {
+ int from, to;
+ } bidi_mirror[] = {
+ { 0x0028, 0x0029 },
+ { 0x0029, 0x0028 },
+ { 0x003C, 0x003E },
+ { 0x003E, 0x003C },
+ { 0x005B, 0x005D },
+ { 0x005D, 0x005B },
+ { 0x007B, 0x007D },
+ { 0x007D, 0x007B },
+ { 0x00AB, 0x00BB },
+ { 0x00BB, 0x00AB },
+ { 0x0F3A, 0x0F3B },
+ { 0x0F3B, 0x0F3A },
+ { 0x0F3C, 0x0F3D },
+ { 0x0F3D, 0x0F3C },
+ { 0x169B, 0x169C },
+ { 0x169C, 0x169B },
+ { 0x2039, 0x203A },
+ { 0x203A, 0x2039 },
+ { 0x2045, 0x2046 },
+ { 0x2046, 0x2045 },
+ { 0x207D, 0x207E },
+ { 0x207E, 0x207D },
+ { 0x208D, 0x208E },
+ { 0x208E, 0x208D },
+ { 0x2208, 0x220B },
+ { 0x2209, 0x220C },
+ { 0x220A, 0x220D },
+ { 0x220B, 0x2208 },
+ { 0x220C, 0x2209 },
+ { 0x220D, 0x220A },
+ { 0x2215, 0x29F5 },
+ { 0x223C, 0x223D },
+ { 0x223D, 0x223C },
+ { 0x2243, 0x22CD },
+ { 0x2252, 0x2253 },
+ { 0x2253, 0x2252 },
+ { 0x2254, 0x2255 },
+ { 0x2255, 0x2254 },
+ { 0x2264, 0x2265 },
+ { 0x2265, 0x2264 },
+ { 0x2266, 0x2267 },
+ { 0x2267, 0x2266 },
+ { 0x2268, 0x2269 },
+ { 0x2269, 0x2268 },
+ { 0x226A, 0x226B },
+ { 0x226B, 0x226A },
+ { 0x226E, 0x226F },
+ { 0x226F, 0x226E },
+ { 0x2270, 0x2271 },
+ { 0x2271, 0x2270 },
+ { 0x2272, 0x2273 },
+ { 0x2273, 0x2272 },
+ { 0x2274, 0x2275 },
+ { 0x2275, 0x2274 },
+ { 0x2276, 0x2277 },
+ { 0x2277, 0x2276 },
+ { 0x2278, 0x2279 },
+ { 0x2279, 0x2278 },
+ { 0x227A, 0x227B },
+ { 0x227B, 0x227A },
+ { 0x227C, 0x227D },
+ { 0x227D, 0x227C },
+ { 0x227E, 0x227F },
+ { 0x227F, 0x227E },
+ { 0x2280, 0x2281 },
+ { 0x2281, 0x2280 },
+ { 0x2282, 0x2283 },
+ { 0x2283, 0x2282 },
+ { 0x2284, 0x2285 },
+ { 0x2285, 0x2284 },
+ { 0x2286, 0x2287 },
+ { 0x2287, 0x2286 },
+ { 0x2288, 0x2289 },
+ { 0x2289, 0x2288 },
+ { 0x228A, 0x228B },
+ { 0x228B, 0x228A },
+ { 0x228F, 0x2290 },
+ { 0x2290, 0x228F },
+ { 0x2291, 0x2292 },
+ { 0x2292, 0x2291 },
+ { 0x2298, 0x29B8 },
+ { 0x22A2, 0x22A3 },
+ { 0x22A3, 0x22A2 },
+ { 0x22A6, 0x2ADE },
+ { 0x22A8, 0x2AE4 },
+ { 0x22A9, 0x2AE3 },
+ { 0x22AB, 0x2AE5 },
+ { 0x22B0, 0x22B1 },
+ { 0x22B1, 0x22B0 },
+ { 0x22B2, 0x22B3 },
+ { 0x22B3, 0x22B2 },
+ { 0x22B4, 0x22B5 },
+ { 0x22B5, 0x22B4 },
+ { 0x22B6, 0x22B7 },
+ { 0x22B7, 0x22B6 },
+ { 0x22C9, 0x22CA },
+ { 0x22CA, 0x22C9 },
+ { 0x22CB, 0x22CC },
+ { 0x22CC, 0x22CB },
+ { 0x22CD, 0x2243 },
+ { 0x22D0, 0x22D1 },
+ { 0x22D1, 0x22D0 },
+ { 0x22D6, 0x22D7 },
+ { 0x22D7, 0x22D6 },
+ { 0x22D8, 0x22D9 },
+ { 0x22D9, 0x22D8 },
+ { 0x22DA, 0x22DB },
+ { 0x22DB, 0x22DA },
+ { 0x22DC, 0x22DD },
+ { 0x22DD, 0x22DC },
+ { 0x22DE, 0x22DF },
+ { 0x22DF, 0x22DE },
+ { 0x22E0, 0x22E1 },
+ { 0x22E1, 0x22E0 },
+ { 0x22E2, 0x22E3 },
+ { 0x22E3, 0x22E2 },
+ { 0x22E4, 0x22E5 },
+ { 0x22E5, 0x22E4 },
+ { 0x22E6, 0x22E7 },
+ { 0x22E7, 0x22E6 },
+ { 0x22E8, 0x22E9 },
+ { 0x22E9, 0x22E8 },
+ { 0x22EA, 0x22EB },
+ { 0x22EB, 0x22EA },
+ { 0x22EC, 0x22ED },
+ { 0x22ED, 0x22EC },
+ { 0x22F0, 0x22F1 },
+ { 0x22F1, 0x22F0 },
+ { 0x22F2, 0x22FA },
+ { 0x22F3, 0x22FB },
+ { 0x22F4, 0x22FC },
+ { 0x22F6, 0x22FD },
+ { 0x22F7, 0x22FE },
+ { 0x22FA, 0x22F2 },
+ { 0x22FB, 0x22F3 },
+ { 0x22FC, 0x22F4 },
+ { 0x22FD, 0x22F6 },
+ { 0x22FE, 0x22F7 },
+ { 0x2308, 0x2309 },
+ { 0x2309, 0x2308 },
+ { 0x230A, 0x230B },
+ { 0x230B, 0x230A },
+ { 0x2329, 0x232A },
+ { 0x232A, 0x2329 },
+ { 0x2768, 0x2769 },
+ { 0x2769, 0x2768 },
+ { 0x276A, 0x276B },
+ { 0x276B, 0x276A },
+ { 0x276C, 0x276D },
+ { 0x276D, 0x276C },
+ { 0x276E, 0x276F },
+ { 0x276F, 0x276E },
+ { 0x2770, 0x2771 },
+ { 0x2771, 0x2770 },
+ { 0x2772, 0x2773 },
+ { 0x2773, 0x2772 },
+ { 0x2774, 0x2775 },
+ { 0x2775, 0x2774 },
+ { 0x27C3, 0x27C4 },
+ { 0x27C4, 0x27C3 },
+ { 0x27C5, 0x27C6 },
+ { 0x27C6, 0x27C5 },
+ { 0x27C8, 0x27C9 },
+ { 0x27C9, 0x27C8 },
+ { 0x27D5, 0x27D6 },
+ { 0x27D6, 0x27D5 },
+ { 0x27DD, 0x27DE },
+ { 0x27DE, 0x27DD },
+ { 0x27E2, 0x27E3 },
+ { 0x27E3, 0x27E2 },
+ { 0x27E4, 0x27E5 },
+ { 0x27E5, 0x27E4 },
+ { 0x27E6, 0x27E7 },
+ { 0x27E7, 0x27E6 },
+ { 0x27E8, 0x27E9 },
+ { 0x27E9, 0x27E8 },
+ { 0x27EA, 0x27EB },
+ { 0x27EB, 0x27EA },
+ { 0x27EC, 0x27ED },
+ { 0x27ED, 0x27EC },
+ { 0x27EE, 0x27EF },
+ { 0x27EF, 0x27EE },
+ { 0x2983, 0x2984 },
+ { 0x2984, 0x2983 },
+ { 0x2985, 0x2986 },
+ { 0x2986, 0x2985 },
+ { 0x2987, 0x2988 },
+ { 0x2988, 0x2987 },
+ { 0x2989, 0x298A },
+ { 0x298A, 0x2989 },
+ { 0x298B, 0x298C },
+ { 0x298C, 0x298B },
+ { 0x298D, 0x2990 },
+ { 0x298E, 0x298F },
+ { 0x298F, 0x298E },
+ { 0x2990, 0x298D },
+ { 0x2991, 0x2992 },
+ { 0x2992, 0x2991 },
+ { 0x2993, 0x2994 },
+ { 0x2994, 0x2993 },
+ { 0x2995, 0x2996 },
+ { 0x2996, 0x2995 },
+ { 0x2997, 0x2998 },
+ { 0x2998, 0x2997 },
+ { 0x29B8, 0x2298 },
+ { 0x29C0, 0x29C1 },
+ { 0x29C1, 0x29C0 },
+ { 0x29C4, 0x29C5 },
+ { 0x29C5, 0x29C4 },
+ { 0x29CF, 0x29D0 },
+ { 0x29D0, 0x29CF },
+ { 0x29D1, 0x29D2 },
+ { 0x29D2, 0x29D1 },
+ { 0x29D4, 0x29D5 },
+ { 0x29D5, 0x29D4 },
+ { 0x29D8, 0x29D9 },
+ { 0x29D9, 0x29D8 },
+ { 0x29DA, 0x29DB },
+ { 0x29DB, 0x29DA },
+ { 0x29F5, 0x2215 },
+ { 0x29F8, 0x29F9 },
+ { 0x29F9, 0x29F8 },
+ { 0x29FC, 0x29FD },
+ { 0x29FD, 0x29FC },
+ { 0x2A2B, 0x2A2C },
+ { 0x2A2C, 0x2A2B },
+ { 0x2A2D, 0x2A2E },
+ { 0x2A2E, 0x2A2D },
+ { 0x2A34, 0x2A35 },
+ { 0x2A35, 0x2A34 },
+ { 0x2A3C, 0x2A3D },
+ { 0x2A3D, 0x2A3C },
+ { 0x2A64, 0x2A65 },
+ { 0x2A65, 0x2A64 },
+ { 0x2A79, 0x2A7A },
+ { 0x2A7A, 0x2A79 },
+ { 0x2A7D, 0x2A7E },
+ { 0x2A7E, 0x2A7D },
+ { 0x2A7F, 0x2A80 },
+ { 0x2A80, 0x2A7F },
+ { 0x2A81, 0x2A82 },
+ { 0x2A82, 0x2A81 },
+ { 0x2A83, 0x2A84 },
+ { 0x2A84, 0x2A83 },
+ { 0x2A8B, 0x2A8C },
+ { 0x2A8C, 0x2A8B },
+ { 0x2A91, 0x2A92 },
+ { 0x2A92, 0x2A91 },
+ { 0x2A93, 0x2A94 },
+ { 0x2A94, 0x2A93 },
+ { 0x2A95, 0x2A96 },
+ { 0x2A96, 0x2A95 },
+ { 0x2A97, 0x2A98 },
+ { 0x2A98, 0x2A97 },
+ { 0x2A99, 0x2A9A },
+ { 0x2A9A, 0x2A99 },
+ { 0x2A9B, 0x2A9C },
+ { 0x2A9C, 0x2A9B },
+ { 0x2AA1, 0x2AA2 },
+ { 0x2AA2, 0x2AA1 },
+ { 0x2AA6, 0x2AA7 },
+ { 0x2AA7, 0x2AA6 },
+ { 0x2AA8, 0x2AA9 },
+ { 0x2AA9, 0x2AA8 },
+ { 0x2AAA, 0x2AAB },
+ { 0x2AAB, 0x2AAA },
+ { 0x2AAC, 0x2AAD },
+ { 0x2AAD, 0x2AAC },
+ { 0x2AAF, 0x2AB0 },
+ { 0x2AB0, 0x2AAF },
+ { 0x2AB3, 0x2AB4 },
+ { 0x2AB4, 0x2AB3 },
+ { 0x2ABB, 0x2ABC },
+ { 0x2ABC, 0x2ABB },
+ { 0x2ABD, 0x2ABE },
+ { 0x2ABE, 0x2ABD },
+ { 0x2ABF, 0x2AC0 },
+ { 0x2AC0, 0x2ABF },
+ { 0x2AC1, 0x2AC2 },
+ { 0x2AC2, 0x2AC1 },
+ { 0x2AC3, 0x2AC4 },
+ { 0x2AC4, 0x2AC3 },
+ { 0x2AC5, 0x2AC6 },
+ { 0x2AC6, 0x2AC5 },
+ { 0x2ACD, 0x2ACE },
+ { 0x2ACE, 0x2ACD },
+ { 0x2ACF, 0x2AD0 },
+ { 0x2AD0, 0x2ACF },
+ { 0x2AD1, 0x2AD2 },
+ { 0x2AD2, 0x2AD1 },
+ { 0x2AD3, 0x2AD4 },
+ { 0x2AD4, 0x2AD3 },
+ { 0x2AD5, 0x2AD6 },
+ { 0x2AD6, 0x2AD5 },
+ { 0x2ADE, 0x22A6 },
+ { 0x2AE3, 0x22A9 },
+ { 0x2AE4, 0x22A8 },
+ { 0x2AE5, 0x22AB },
+ { 0x2AEC, 0x2AED },
+ { 0x2AED, 0x2AEC },
+ { 0x2AF7, 0x2AF8 },
+ { 0x2AF8, 0x2AF7 },
+ { 0x2AF9, 0x2AFA },
+ { 0x2AFA, 0x2AF9 },
+ { 0x2E02, 0x2E03 },
+ { 0x2E03, 0x2E02 },
+ { 0x2E04, 0x2E05 },
+ { 0x2E05, 0x2E04 },
+ { 0x2E09, 0x2E0A },
+ { 0x2E0A, 0x2E09 },
+ { 0x2E0C, 0x2E0D },
+ { 0x2E0D, 0x2E0C },
+ { 0x2E1C, 0x2E1D },
+ { 0x2E1D, 0x2E1C },
+ { 0x2E20, 0x2E21 },
+ { 0x2E21, 0x2E20 },
+ { 0x2E22, 0x2E23 },
+ { 0x2E23, 0x2E22 },
+ { 0x2E24, 0x2E25 },
+ { 0x2E25, 0x2E24 },
+ { 0x2E26, 0x2E27 },
+ { 0x2E27, 0x2E26 },
+ { 0x2E28, 0x2E29 },
+ { 0x2E29, 0x2E28 },
+ { 0x3008, 0x3009 },
+ { 0x3009, 0x3008 },
+ { 0x300A, 0x300B },
+ { 0x300B, 0x300A },
+ { 0x300C, 0x300D },
+ { 0x300D, 0x300C },
+ { 0x300E, 0x300F },
+ { 0x300F, 0x300E },
+ { 0x3010, 0x3011 },
+ { 0x3011, 0x3010 },
+ { 0x3014, 0x3015 },
+ { 0x3015, 0x3014 },
+ { 0x3016, 0x3017 },
+ { 0x3017, 0x3016 },
+ { 0x3018, 0x3019 },
+ { 0x3019, 0x3018 },
+ { 0x301A, 0x301B },
+ { 0x301B, 0x301A },
+ { 0xFE59, 0xFE5A },
+ { 0xFE5A, 0xFE59 },
+ { 0xFE5B, 0xFE5C },
+ { 0xFE5C, 0xFE5B },
+ { 0xFE5D, 0xFE5E },
+ { 0xFE5E, 0xFE5D },
+ { 0xFE64, 0xFE65 },
+ { 0xFE65, 0xFE64 },
+ { 0xFF08, 0xFF09 },
+ { 0xFF09, 0xFF08 },
+ { 0xFF1C, 0xFF1E },
+ { 0xFF1E, 0xFF1C },
+ { 0xFF3B, 0xFF3D },
+ { 0xFF3D, 0xFF3B },
+ { 0xFF5B, 0xFF5D },
+ { 0xFF5D, 0xFF5B },
+ { 0xFF5F, 0xFF60 },
+ { 0xFF60, 0xFF5F },
+ { 0xFF62, 0xFF63 },
+ { 0xFF63, 0xFF62 } };
diff --git a/src/biditype.h b/src/biditype.h
new file mode 100644
index 0000000000..60fc6374f3
--- /dev/null
+++ b/src/biditype.h
@@ -0,0 +1,446 @@
+ struct {
+ int from, to;
+ bidi_type_t type;
+ } bidi_type[] = {
+ { 0x0000, 0x0008, WEAK_BN },
+ { 0x0009, 0x0009, NEUTRAL_S },
+ { 0x000A, 0x000A, NEUTRAL_B },
+ { 0x000B, 0x000B, NEUTRAL_S },
+ { 0x000C, 0x000C, NEUTRAL_WS },
+ { 0x000D, 0x000D, NEUTRAL_B },
+ { 0x000E, 0x001B, WEAK_BN },
+ { 0x001C, 0x001E, NEUTRAL_B },
+ { 0x001F, 0x001F, NEUTRAL_S },
+ { 0x0020, 0x0020, NEUTRAL_WS },
+ { 0x0021, 0x0022, NEUTRAL_ON },
+ { 0x0023, 0x0025, WEAK_ET },
+ { 0x0026, 0x002A, NEUTRAL_ON },
+ { 0x002B, 0x002B, WEAK_ES },
+ { 0x002C, 0x002C, WEAK_CS },
+ { 0x002D, 0x002D, WEAK_ES },
+ { 0x002E, 0x002F, WEAK_CS },
+ { 0x0030, 0x0039, WEAK_EN },
+ { 0x003A, 0x003A, WEAK_CS },
+ { 0x003B, 0x0040, NEUTRAL_ON },
+ { 0x005B, 0x0060, NEUTRAL_ON },
+ { 0x007B, 0x007E, NEUTRAL_ON },
+ { 0x007F, 0x0084, WEAK_BN },
+ { 0x0085, 0x0085, NEUTRAL_B },
+ { 0x0086, 0x009F, WEAK_BN },
+ { 0x00A0, 0x00A0, WEAK_CS },
+ { 0x00A1, 0x00A1, NEUTRAL_ON },
+ { 0x00A2, 0x00A5, WEAK_ET },
+ { 0x00A6, 0x00A9, NEUTRAL_ON },
+ { 0x00AB, 0x00AC, NEUTRAL_ON },
+ { 0x00AD, 0x00AD, WEAK_BN },
+ { 0x00AE, 0x00AF, NEUTRAL_ON },
+ { 0x00B0, 0x00B1, WEAK_ET },
+ { 0x00B2, 0x00B3, WEAK_EN },
+ { 0x00B4, 0x00B4, NEUTRAL_ON },
+ { 0x00B6, 0x00B8, NEUTRAL_ON },
+ { 0x00B9, 0x00B9, WEAK_EN },
+ { 0x00BB, 0x00BF, NEUTRAL_ON },
+ { 0x00D7, 0x00D7, NEUTRAL_ON },
+ { 0x00F7, 0x00F7, NEUTRAL_ON },
+ { 0x02B9, 0x02BA, NEUTRAL_ON },
+ { 0x02C2, 0x02CF, NEUTRAL_ON },
+ { 0x02D2, 0x02DF, NEUTRAL_ON },
+ { 0x02E5, 0x02ED, NEUTRAL_ON },
+ { 0x02EF, 0x02FF, NEUTRAL_ON },
+ { 0x0300, 0x036F, WEAK_NSM },
+ { 0x0374, 0x0375, NEUTRAL_ON },
+ { 0x037E, 0x0385, NEUTRAL_ON },
+ { 0x0387, 0x0387, NEUTRAL_ON },
+ { 0x03F6, 0x03F6, NEUTRAL_ON },
+ { 0x0483, 0x0489, WEAK_NSM },
+ { 0x058A, 0x058A, NEUTRAL_ON },
+ { 0x0591, 0x05BD, WEAK_NSM },
+ { 0x05BE, 0x05BE, STRONG_R },
+ { 0x05BF, 0x05BF, WEAK_NSM },
+ { 0x05C0, 0x05C0, STRONG_R },
+ { 0x05C1, 0x05C2, WEAK_NSM },
+ { 0x05C3, 0x05C3, STRONG_R },
+ { 0x05C4, 0x05C5, WEAK_NSM },
+ { 0x05C6, 0x05C6, STRONG_R },
+ { 0x05C7, 0x05C7, WEAK_NSM },
+ { 0x05D0, 0x05F4, STRONG_R },
+ { 0x0600, 0x0603, WEAK_AN },
+ { 0x0606, 0x0607, NEUTRAL_ON },
+ { 0x0608, 0x0608, STRONG_AL },
+ { 0x0609, 0x060A, WEAK_ET },
+ { 0x060B, 0x060B, STRONG_AL },
+ { 0x060C, 0x060C, WEAK_CS },
+ { 0x060D, 0x060D, STRONG_AL },
+ { 0x060E, 0x060F, NEUTRAL_ON },
+ { 0x0610, 0x061A, WEAK_NSM },
+ { 0x061B, 0x064A, STRONG_AL },
+ { 0x064B, 0x065F, WEAK_NSM },
+ { 0x0660, 0x0669, WEAK_AN },
+ { 0x066A, 0x066A, WEAK_ET },
+ { 0x066B, 0x066C, WEAK_AN },
+ { 0x066D, 0x066F, STRONG_AL },
+ { 0x0670, 0x0670, WEAK_NSM },
+ { 0x0671, 0x06D5, STRONG_AL },
+ { 0x06D6, 0x06DC, WEAK_NSM },
+ { 0x06DD, 0x06DD, WEAK_AN },
+ { 0x06DE, 0x06E4, WEAK_NSM },
+ { 0x06E5, 0x06E6, STRONG_AL },
+ { 0x06E7, 0x06E8, WEAK_NSM },
+ { 0x06E9, 0x06E9, NEUTRAL_ON },
+ { 0x06EA, 0x06ED, WEAK_NSM },
+ { 0x06EE, 0x06EF, STRONG_AL },
+ { 0x06F0, 0x06F9, WEAK_EN },
+ { 0x06FA, 0x070D, STRONG_AL },
+ { 0x070F, 0x070F, WEAK_AN },
+ { 0x0710, 0x0710, STRONG_AL },
+ { 0x0711, 0x0711, WEAK_NSM },
+ { 0x0712, 0x072F, STRONG_AL },
+ { 0x0730, 0x074A, WEAK_NSM },
+ { 0x074D, 0x07A5, STRONG_AL },
+ { 0x07A6, 0x07B0, WEAK_NSM },
+ { 0x07B1, 0x07B1, STRONG_AL },
+ { 0x07C0, 0x07EA, STRONG_R },
+ { 0x07EB, 0x07F3, WEAK_NSM },
+ { 0x07F4, 0x07F5, STRONG_R },
+ { 0x07F6, 0x07F9, NEUTRAL_ON },
+ { 0x07FA, 0x0815, STRONG_R },
+ { 0x0816, 0x0819, WEAK_NSM },
+ { 0x081A, 0x081A, STRONG_R },
+ { 0x081B, 0x0823, WEAK_NSM },
+ { 0x0824, 0x0824, STRONG_R },
+ { 0x0825, 0x0827, WEAK_NSM },
+ { 0x0828, 0x0828, STRONG_R },
+ { 0x0829, 0x082D, WEAK_NSM },
+ { 0x0830, 0x0858, STRONG_R },
+ { 0x0859, 0x085B, WEAK_NSM },
+ { 0x085E, 0x085E, STRONG_R },
+ { 0x0900, 0x0902, WEAK_NSM },
+ { 0x093A, 0x093A, WEAK_NSM },
+ { 0x093C, 0x093C, WEAK_NSM },
+ { 0x0941, 0x0948, WEAK_NSM },
+ { 0x094D, 0x094D, WEAK_NSM },
+ { 0x0951, 0x0957, WEAK_NSM },
+ { 0x0962, 0x0963, WEAK_NSM },
+ { 0x0981, 0x0981, WEAK_NSM },
+ { 0x09BC, 0x09BC, WEAK_NSM },
+ { 0x09C1, 0x09C4, WEAK_NSM },
+ { 0x09CD, 0x09CD, WEAK_NSM },
+ { 0x09E2, 0x09E3, WEAK_NSM },
+ { 0x09F2, 0x09F3, WEAK_ET },
+ { 0x09FB, 0x09FB, WEAK_ET },
+ { 0x0A01, 0x0A02, WEAK_NSM },
+ { 0x0A3C, 0x0A3C, WEAK_NSM },
+ { 0x0A41, 0x0A51, WEAK_NSM },
+ { 0x0A70, 0x0A71, WEAK_NSM },
+ { 0x0A75, 0x0A82, WEAK_NSM },
+ { 0x0ABC, 0x0ABC, WEAK_NSM },
+ { 0x0AC1, 0x0AC8, WEAK_NSM },
+ { 0x0ACD, 0x0ACD, WEAK_NSM },
+ { 0x0AE2, 0x0AE3, WEAK_NSM },
+ { 0x0AF1, 0x0AF1, WEAK_ET },
+ { 0x0B01, 0x0B01, WEAK_NSM },
+ { 0x0B3C, 0x0B3C, WEAK_NSM },
+ { 0x0B3F, 0x0B3F, WEAK_NSM },
+ { 0x0B41, 0x0B44, WEAK_NSM },
+ { 0x0B4D, 0x0B56, WEAK_NSM },
+ { 0x0B62, 0x0B63, WEAK_NSM },
+ { 0x0B82, 0x0B82, WEAK_NSM },
+ { 0x0BC0, 0x0BC0, WEAK_NSM },
+ { 0x0BCD, 0x0BCD, WEAK_NSM },
+ { 0x0BF3, 0x0BF8, NEUTRAL_ON },
+ { 0x0BF9, 0x0BF9, WEAK_ET },
+ { 0x0BFA, 0x0BFA, NEUTRAL_ON },
+ { 0x0C3E, 0x0C40, WEAK_NSM },
+ { 0x0C46, 0x0C56, WEAK_NSM },
+ { 0x0C62, 0x0C63, WEAK_NSM },
+ { 0x0C78, 0x0C7E, NEUTRAL_ON },
+ { 0x0CBC, 0x0CBC, WEAK_NSM },
+ { 0x0CCC, 0x0CCD, WEAK_NSM },
+ { 0x0CE2, 0x0CE3, WEAK_NSM },
+ { 0x0D41, 0x0D44, WEAK_NSM },
+ { 0x0D4D, 0x0D4D, WEAK_NSM },
+ { 0x0D62, 0x0D63, WEAK_NSM },
+ { 0x0DCA, 0x0DCA, WEAK_NSM },
+ { 0x0DD2, 0x0DD6, WEAK_NSM },
+ { 0x0E31, 0x0E31, WEAK_NSM },
+ { 0x0E34, 0x0E3A, WEAK_NSM },
+ { 0x0E3F, 0x0E3F, WEAK_ET },
+ { 0x0E47, 0x0E4E, WEAK_NSM },
+ { 0x0EB1, 0x0EB1, WEAK_NSM },
+ { 0x0EB4, 0x0EBC, WEAK_NSM },
+ { 0x0EC8, 0x0ECD, WEAK_NSM },
+ { 0x0F18, 0x0F19, WEAK_NSM },
+ { 0x0F35, 0x0F35, WEAK_NSM },
+ { 0x0F37, 0x0F37, WEAK_NSM },
+ { 0x0F39, 0x0F39, WEAK_NSM },
+ { 0x0F3A, 0x0F3D, NEUTRAL_ON },
+ { 0x0F71, 0x0F7E, WEAK_NSM },
+ { 0x0F80, 0x0F84, WEAK_NSM },
+ { 0x0F86, 0x0F87, WEAK_NSM },
+ { 0x0F8D, 0x0FBC, WEAK_NSM },
+ { 0x0FC6, 0x0FC6, WEAK_NSM },
+ { 0x102D, 0x1030, WEAK_NSM },
+ { 0x1032, 0x1037, WEAK_NSM },
+ { 0x1039, 0x103A, WEAK_NSM },
+ { 0x103D, 0x103E, WEAK_NSM },
+ { 0x1058, 0x1059, WEAK_NSM },
+ { 0x105E, 0x1060, WEAK_NSM },
+ { 0x1071, 0x1074, WEAK_NSM },
+ { 0x1082, 0x1082, WEAK_NSM },
+ { 0x1085, 0x1086, WEAK_NSM },
+ { 0x108D, 0x108D, WEAK_NSM },
+ { 0x109D, 0x109D, WEAK_NSM },
+ { 0x135D, 0x135F, WEAK_NSM },
+ { 0x1390, 0x1399, NEUTRAL_ON },
+ { 0x1400, 0x1400, NEUTRAL_ON },
+ { 0x1680, 0x1680, NEUTRAL_WS },
+ { 0x169B, 0x169C, NEUTRAL_ON },
+ { 0x1712, 0x1714, WEAK_NSM },
+ { 0x1732, 0x1734, WEAK_NSM },
+ { 0x1752, 0x1753, WEAK_NSM },
+ { 0x1772, 0x1773, WEAK_NSM },
+ { 0x17B7, 0x17BD, WEAK_NSM },
+ { 0x17C6, 0x17C6, WEAK_NSM },
+ { 0x17C9, 0x17D3, WEAK_NSM },
+ { 0x17DB, 0x17DB, WEAK_ET },
+ { 0x17DD, 0x17DD, WEAK_NSM },
+ { 0x17F0, 0x180A, NEUTRAL_ON },
+ { 0x180B, 0x180D, WEAK_NSM },
+ { 0x180E, 0x180E, NEUTRAL_WS },
+ { 0x18A9, 0x18A9, WEAK_NSM },
+ { 0x1920, 0x1922, WEAK_NSM },
+ { 0x1927, 0x1928, WEAK_NSM },
+ { 0x1932, 0x1932, WEAK_NSM },
+ { 0x1939, 0x193B, WEAK_NSM },
+ { 0x1940, 0x1945, NEUTRAL_ON },
+ { 0x19DE, 0x19FF, NEUTRAL_ON },
+ { 0x1A17, 0x1A18, WEAK_NSM },
+ { 0x1A56, 0x1A56, WEAK_NSM },
+ { 0x1A58, 0x1A60, WEAK_NSM },
+ { 0x1A62, 0x1A62, WEAK_NSM },
+ { 0x1A65, 0x1A6C, WEAK_NSM },
+ { 0x1A73, 0x1A7F, WEAK_NSM },
+ { 0x1B00, 0x1B03, WEAK_NSM },
+ { 0x1B34, 0x1B34, WEAK_NSM },
+ { 0x1B36, 0x1B3A, WEAK_NSM },
+ { 0x1B3C, 0x1B3C, WEAK_NSM },
+ { 0x1B42, 0x1B42, WEAK_NSM },
+ { 0x1B6B, 0x1B73, WEAK_NSM },
+ { 0x1B80, 0x1B81, WEAK_NSM },
+ { 0x1BA2, 0x1BA5, WEAK_NSM },
+ { 0x1BA8, 0x1BA9, WEAK_NSM },
+ { 0x1BE6, 0x1BE6, WEAK_NSM },
+ { 0x1BE8, 0x1BE9, WEAK_NSM },
+ { 0x1BED, 0x1BED, WEAK_NSM },
+ { 0x1BEF, 0x1BF1, WEAK_NSM },
+ { 0x1C2C, 0x1C33, WEAK_NSM },
+ { 0x1C36, 0x1C37, WEAK_NSM },
+ { 0x1CD0, 0x1CD2, WEAK_NSM },
+ { 0x1CD4, 0x1CE0, WEAK_NSM },
+ { 0x1CE2, 0x1CE8, WEAK_NSM },
+ { 0x1CED, 0x1CED, WEAK_NSM },
+ { 0x1DC0, 0x1DFF, WEAK_NSM },
+ { 0x1FBD, 0x1FBD, NEUTRAL_ON },
+ { 0x1FBF, 0x1FC1, NEUTRAL_ON },
+ { 0x1FCD, 0x1FCF, NEUTRAL_ON },
+ { 0x1FDD, 0x1FDF, NEUTRAL_ON },
+ { 0x1FED, 0x1FEF, NEUTRAL_ON },
+ { 0x1FFD, 0x1FFE, NEUTRAL_ON },
+ { 0x2000, 0x200A, NEUTRAL_WS },
+ { 0x200B, 0x200D, WEAK_BN },
+ { 0x200F, 0x200F, STRONG_R },
+ { 0x2010, 0x2027, NEUTRAL_ON },
+ { 0x2028, 0x2028, NEUTRAL_WS },
+ { 0x2029, 0x2029, NEUTRAL_B },
+ { 0x202A, 0x202A, LRE },
+ { 0x202B, 0x202B, RLE },
+ { 0x202C, 0x202C, PDF },
+ { 0x202D, 0x202D, LRO },
+ { 0x202E, 0x202E, RLO },
+ { 0x202F, 0x202F, WEAK_CS },
+ { 0x2030, 0x2034, WEAK_ET },
+ { 0x2035, 0x2043, NEUTRAL_ON },
+ { 0x2044, 0x2044, WEAK_CS },
+ { 0x2045, 0x205E, NEUTRAL_ON },
+ { 0x205F, 0x205F, NEUTRAL_WS },
+ { 0x2060, 0x206F, WEAK_BN },
+ { 0x2070, 0x2070, WEAK_EN },
+ { 0x2074, 0x2079, WEAK_EN },
+ { 0x207A, 0x207B, WEAK_ES },
+ { 0x207C, 0x207E, NEUTRAL_ON },
+ { 0x2080, 0x2089, WEAK_EN },
+ { 0x208A, 0x208B, WEAK_ES },
+ { 0x208C, 0x208E, NEUTRAL_ON },
+ { 0x20A0, 0x20B8, WEAK_ET },
+ { 0x20D0, 0x20F0, WEAK_NSM },
+ { 0x2100, 0x2101, NEUTRAL_ON },
+ { 0x2103, 0x2106, NEUTRAL_ON },
+ { 0x2108, 0x2109, NEUTRAL_ON },
+ { 0x2114, 0x2114, NEUTRAL_ON },
+ { 0x2116, 0x2118, NEUTRAL_ON },
+ { 0x211E, 0x2123, NEUTRAL_ON },
+ { 0x2125, 0x2125, NEUTRAL_ON },
+ { 0x2127, 0x2127, NEUTRAL_ON },
+ { 0x2129, 0x2129, NEUTRAL_ON },
+ { 0x212E, 0x212E, WEAK_ET },
+ { 0x213A, 0x213B, NEUTRAL_ON },
+ { 0x2140, 0x2144, NEUTRAL_ON },
+ { 0x214A, 0x214D, NEUTRAL_ON },
+ { 0x2150, 0x215F, NEUTRAL_ON },
+ { 0x2189, 0x2211, NEUTRAL_ON },
+ { 0x2212, 0x2212, WEAK_ES },
+ { 0x2213, 0x2213, WEAK_ET },
+ { 0x2214, 0x2335, NEUTRAL_ON },
+ { 0x237B, 0x2394, NEUTRAL_ON },
+ { 0x2396, 0x2487, NEUTRAL_ON },
+ { 0x2488, 0x249B, WEAK_EN },
+ { 0x24EA, 0x26AB, NEUTRAL_ON },
+ { 0x26AD, 0x27FF, NEUTRAL_ON },
+ { 0x2900, 0x2B59, NEUTRAL_ON },
+ { 0x2CE5, 0x2CEA, NEUTRAL_ON },
+ { 0x2CEF, 0x2CF1, WEAK_NSM },
+ { 0x2CF9, 0x2CFF, NEUTRAL_ON },
+ { 0x2D7F, 0x2D7F, WEAK_NSM },
+ { 0x2DE0, 0x2DFF, WEAK_NSM },
+ { 0x2E00, 0x2FFB, NEUTRAL_ON },
+ { 0x3000, 0x3000, NEUTRAL_WS },
+ { 0x3001, 0x3004, NEUTRAL_ON },
+ { 0x3008, 0x3020, NEUTRAL_ON },
+ { 0x302A, 0x302F, WEAK_NSM },
+ { 0x3030, 0x3030, NEUTRAL_ON },
+ { 0x3036, 0x3037, NEUTRAL_ON },
+ { 0x303D, 0x303F, NEUTRAL_ON },
+ { 0x3099, 0x309A, WEAK_NSM },
+ { 0x309B, 0x309C, NEUTRAL_ON },
+ { 0x30A0, 0x30A0, NEUTRAL_ON },
+ { 0x30FB, 0x30FB, NEUTRAL_ON },
+ { 0x31C0, 0x31E3, NEUTRAL_ON },
+ { 0x321D, 0x321E, NEUTRAL_ON },
+ { 0x3250, 0x325F, NEUTRAL_ON },
+ { 0x327C, 0x327E, NEUTRAL_ON },
+ { 0x32B1, 0x32BF, NEUTRAL_ON },
+ { 0x32CC, 0x32CF, NEUTRAL_ON },
+ { 0x3377, 0x337A, NEUTRAL_ON },
+ { 0x33DE, 0x33DF, NEUTRAL_ON },
+ { 0x33FF, 0x33FF, NEUTRAL_ON },
+ { 0x4DC0, 0x4DFF, NEUTRAL_ON },
+ { 0xA490, 0xA4C6, NEUTRAL_ON },
+ { 0xA60D, 0xA60F, NEUTRAL_ON },
+ { 0xA66F, 0xA672, WEAK_NSM },
+ { 0xA673, 0xA673, NEUTRAL_ON },
+ { 0xA67C, 0xA67D, WEAK_NSM },
+ { 0xA67E, 0xA67F, NEUTRAL_ON },
+ { 0xA6F0, 0xA6F1, WEAK_NSM },
+ { 0xA700, 0xA721, NEUTRAL_ON },
+ { 0xA788, 0xA788, NEUTRAL_ON },
+ { 0xA802, 0xA802, WEAK_NSM },
+ { 0xA806, 0xA806, WEAK_NSM },
+ { 0xA80B, 0xA80B, WEAK_NSM },
+ { 0xA825, 0xA826, WEAK_NSM },
+ { 0xA828, 0xA82B, NEUTRAL_ON },
+ { 0xA838, 0xA839, WEAK_ET },
+ { 0xA874, 0xA877, NEUTRAL_ON },
+ { 0xA8C4, 0xA8C4, WEAK_NSM },
+ { 0xA8E0, 0xA8F1, WEAK_NSM },
+ { 0xA926, 0xA92D, WEAK_NSM },
+ { 0xA947, 0xA951, WEAK_NSM },
+ { 0xA980, 0xA982, WEAK_NSM },
+ { 0xA9B3, 0xA9B3, WEAK_NSM },
+ { 0xA9B6, 0xA9B9, WEAK_NSM },
+ { 0xA9BC, 0xA9BC, WEAK_NSM },
+ { 0xAA29, 0xAA2E, WEAK_NSM },
+ { 0xAA31, 0xAA32, WEAK_NSM },
+ { 0xAA35, 0xAA36, WEAK_NSM },
+ { 0xAA43, 0xAA43, WEAK_NSM },
+ { 0xAA4C, 0xAA4C, WEAK_NSM },
+ { 0xAAB0, 0xAAB0, WEAK_NSM },
+ { 0xAAB2, 0xAAB4, WEAK_NSM },
+ { 0xAAB7, 0xAAB8, WEAK_NSM },
+ { 0xAABE, 0xAABF, WEAK_NSM },
+ { 0xAAC1, 0xAAC1, WEAK_NSM },
+ { 0xABE5, 0xABE5, WEAK_NSM },
+ { 0xABE8, 0xABE8, WEAK_NSM },
+ { 0xABED, 0xABED, WEAK_NSM },
+ { 0xFB1D, 0xFB1D, STRONG_R },
+ { 0xFB1E, 0xFB1E, WEAK_NSM },
+ { 0xFB1F, 0xFB28, STRONG_R },
+ { 0xFB29, 0xFB29, WEAK_ES },
+ { 0xFB2A, 0xFB4F, STRONG_R },
+ { 0xFB50, 0xFD3D, STRONG_AL },
+ { 0xFD3E, 0xFD3F, NEUTRAL_ON },
+ { 0xFD50, 0xFDFC, STRONG_AL },
+ { 0xFDFD, 0xFDFD, NEUTRAL_ON },
+ { 0xFE00, 0xFE0F, WEAK_NSM },
+ { 0xFE10, 0xFE19, NEUTRAL_ON },
+ { 0xFE20, 0xFE26, WEAK_NSM },
+ { 0xFE30, 0xFE4F, NEUTRAL_ON },
+ { 0xFE50, 0xFE50, WEAK_CS },
+ { 0xFE51, 0xFE51, NEUTRAL_ON },
+ { 0xFE52, 0xFE52, WEAK_CS },
+ { 0xFE54, 0xFE54, NEUTRAL_ON },
+ { 0xFE55, 0xFE55, WEAK_CS },
+ { 0xFE56, 0xFE5E, NEUTRAL_ON },
+ { 0xFE5F, 0xFE5F, WEAK_ET },
+ { 0xFE60, 0xFE61, NEUTRAL_ON },
+ { 0xFE62, 0xFE63, WEAK_ES },
+ { 0xFE64, 0xFE68, NEUTRAL_ON },
+ { 0xFE69, 0xFE6A, WEAK_ET },
+ { 0xFE6B, 0xFE6B, NEUTRAL_ON },
+ { 0xFE70, 0xFEFC, STRONG_AL },
+ { 0xFEFF, 0xFEFF, WEAK_BN },
+ { 0xFF01, 0xFF02, NEUTRAL_ON },
+ { 0xFF03, 0xFF05, WEAK_ET },
+ { 0xFF06, 0xFF0A, NEUTRAL_ON },
+ { 0xFF0B, 0xFF0B, WEAK_ES },
+ { 0xFF0C, 0xFF0C, WEAK_CS },
+ { 0xFF0D, 0xFF0D, WEAK_ES },
+ { 0xFF0E, 0xFF0F, WEAK_CS },
+ { 0xFF10, 0xFF19, WEAK_EN },
+ { 0xFF1A, 0xFF1A, WEAK_CS },
+ { 0xFF1B, 0xFF20, NEUTRAL_ON },
+ { 0xFF3B, 0xFF40, NEUTRAL_ON },
+ { 0xFF5B, 0xFF65, NEUTRAL_ON },
+ { 0xFFE0, 0xFFE1, WEAK_ET },
+ { 0xFFE2, 0xFFE4, NEUTRAL_ON },
+ { 0xFFE5, 0xFFE6, WEAK_ET },
+ { 0xFFE8, 0xFFFD, NEUTRAL_ON },
+ { 0x10101, 0x10101, NEUTRAL_ON },
+ { 0x10140, 0x1019B, NEUTRAL_ON },
+ { 0x101FD, 0x101FD, WEAK_NSM },
+ { 0x10800, 0x1091B, STRONG_R },
+ { 0x1091F, 0x1091F, NEUTRAL_ON },
+ { 0x10920, 0x10A00, STRONG_R },
+ { 0x10A01, 0x10A0F, WEAK_NSM },
+ { 0x10A10, 0x10A33, STRONG_R },
+ { 0x10A38, 0x10A3F, WEAK_NSM },
+ { 0x10A40, 0x10B35, STRONG_R },
+ { 0x10B39, 0x10B3F, NEUTRAL_ON },
+ { 0x10B40, 0x10C48, STRONG_R },
+ { 0x10E60, 0x10E7E, WEAK_AN },
+ { 0x11001, 0x11001, WEAK_NSM },
+ { 0x11038, 0x11046, WEAK_NSM },
+ { 0x11052, 0x11065, NEUTRAL_ON },
+ { 0x11080, 0x11081, WEAK_NSM },
+ { 0x110B3, 0x110B6, WEAK_NSM },
+ { 0x110B9, 0x110BA, WEAK_NSM },
+ { 0x1D167, 0x1D169, WEAK_NSM },
+ { 0x1D173, 0x1D17A, WEAK_BN },
+ { 0x1D17B, 0x1D182, WEAK_NSM },
+ { 0x1D185, 0x1D18B, WEAK_NSM },
+ { 0x1D1AA, 0x1D1AD, WEAK_NSM },
+ { 0x1D200, 0x1D241, NEUTRAL_ON },
+ { 0x1D242, 0x1D244, WEAK_NSM },
+ { 0x1D245, 0x1D356, NEUTRAL_ON },
+ { 0x1D6DB, 0x1D6DB, NEUTRAL_ON },
+ { 0x1D715, 0x1D715, NEUTRAL_ON },
+ { 0x1D74F, 0x1D74F, NEUTRAL_ON },
+ { 0x1D789, 0x1D789, NEUTRAL_ON },
+ { 0x1D7C3, 0x1D7C3, NEUTRAL_ON },
+ { 0x1D7CE, 0x1D7FF, WEAK_EN },
+ { 0x1F000, 0x1F0DF, NEUTRAL_ON },
+ { 0x1F100, 0x1F10A, WEAK_EN },
+ { 0x1F300, 0x1F48B, NEUTRAL_ON },
+ { 0x1F48D, 0x1F523, NEUTRAL_ON },
+ { 0x1F525, 0x1F773, NEUTRAL_ON },
+ { 0xE0001, 0xE007F, WEAK_BN },
+ { 0xE0100, 0xE01EF, WEAK_NSM } };
diff --git a/src/buffer.c b/src/buffer.c
index 339bc99dcb..589266f40e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1300,6 +1300,8 @@ If BUFFER is omitted or nil, some interesting buffer is returned. */)
if (NILP (frame))
frame = selected_frame;
+ CHECK_FRAME (frame);
+
tail = Vbuffer_alist;
pred = frame_buffer_predicate (frame);
@@ -1547,7 +1549,7 @@ with SIGHUP. */)
Lisp_Object tem;
tem = Fsymbol_value (intern ("delete-auto-save-files"));
if (! NILP (tem))
- internal_delete_file (b->auto_save_file_name, Qt);
+ internal_delete_file (b->auto_save_file_name);
}
if (b->base_buffer)
@@ -1785,8 +1787,6 @@ messing with the window-buffer correspondences. */)
(buffer_or_name, norecord)
Lisp_Object buffer_or_name, norecord;
{
- char *err;
-
if (EQ (buffer_or_name, Fwindow_buffer (selected_window)))
{
/* Basically a NOP. Avoid signalling an error in the case where
@@ -2189,7 +2189,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
other_buffer = XBUFFER (buffer);
if (NILP (other_buffer->name))
- error ("Cannot swap a dead buffer's text");
+ error ("Cannot swap a dead buffer's text");
/* Actually, it probably works just fine.
* if (other_buffer == current_buffer)
@@ -2436,7 +2436,7 @@ current buffer is cleared. */)
unsigned char *p = GPT_ADDR - 1;
while (! CHAR_HEAD_P (*p) && p > BEG_ADDR) p--;
- if (BASE_LEADING_CODE_P (*p))
+ if (LEADING_CODE_P (*p))
{
int new_gpt = GPT_BYTE - (GPT_ADDR - p);
@@ -4339,7 +4339,7 @@ add_overlay_mod_hooklist (functionlist, overlay)
int oldsize = XVECTOR (last_overlay_modification_hooks)->size;
if (last_overlay_modification_hooks_used == oldsize)
- last_overlay_modification_hooks = larger_vector
+ last_overlay_modification_hooks = larger_vector
(last_overlay_modification_hooks, oldsize * 2, Qnil);
ASET (last_overlay_modification_hooks, last_overlay_modification_hooks_used,
functionlist); last_overlay_modification_hooks_used++;
diff --git a/src/callproc.c b/src/callproc.c
index 44dd6ed776..82a5ebb90d 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -39,7 +39,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/file.h>
#ifdef HAVE_FCNTL_H
-#define INCLUDED_FCNTL
#include <fcntl.h>
#endif
@@ -53,7 +52,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
-#define INCLUDED_FCNTL
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/param.h>
@@ -856,7 +854,7 @@ delete_temp_file (name)
/* Suppress jka-compr handling, etc. */
int count = SPECPDL_INDEX ();
specbind (intern ("file-name-handler-alist"), Qnil);
- internal_delete_file (name, Qt);
+ internal_delete_file (name);
unbind_to (count, Qnil);
return Qnil;
}
diff --git a/src/ccl.c b/src/ccl.c
index c5523c2d44..c33df9e56d 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1362,7 +1362,7 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
if (point >= size) continue;
map = AREF (Vcode_conversion_map_vector, point);
- /* Check map varidity. */
+ /* Check map validity. */
if (!CONSP (map)) continue;
map = XCDR (map);
if (!VECTORP (map)) continue;
@@ -1373,7 +1373,7 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
/* check map type,
[STARTPOINT VAL1 VAL2 ...] or
- [t ELELMENT STARTPOINT ENDPOINT] */
+ [t ELEMENT STARTPOINT ENDPOINT] */
if (NUMBERP (content))
{
point = XUINT (content);
@@ -1535,7 +1535,7 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
if (point >= map_vector_size) continue;
map = AREF (Vcode_conversion_map_vector, point);
- /* Check map varidity. */
+ /* Check map validity. */
if (!CONSP (map)) continue;
map = XCDR (map);
if (!VECTORP (map)) continue;
@@ -1977,7 +1977,7 @@ check_ccl_update (ccl)
DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0,
doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code.
-See the documentation of `define-ccl-program' for the detail of CCL program. */)
+See the documentation of `define-ccl-program' for the detail of CCL program. */)
(object)
Lisp_Object object;
{
@@ -2229,7 +2229,7 @@ Return index number of the registered CCL program. */)
slot = AREF (Vccl_program_table, idx);
if (!VECTORP (slot))
- /* This is the first unsed slot. Register NAME here. */
+ /* This is the first unused slot. Register NAME here. */
break;
if (EQ (name, AREF (slot, 0)))
diff --git a/src/character.c b/src/character.c
index 5912a70d0c..7cd1eedcef 100644
--- a/src/character.c
+++ b/src/character.c
@@ -961,10 +961,13 @@ usage: (string &rest CHARACTERS) */)
int n;
Lisp_Object *args;
{
- int i;
- unsigned char *buf = (unsigned char *) alloca (MAX_MULTIBYTE_LENGTH * n);
- unsigned char *p = buf;
- int c;
+ int i, c;
+ unsigned char *buf, *p;
+ Lisp_Object str;
+ USE_SAFE_ALLOCA;
+
+ SAFE_ALLOCA (buf, unsigned char *, MAX_MULTIBYTE_LENGTH * n);
+ p = buf;
for (i = 0; i < n; i++)
{
@@ -973,7 +976,9 @@ usage: (string &rest CHARACTERS) */)
p += CHAR_STRING (c, p);
}
- return make_string_from_bytes ((char *) buf, n, p - buf);
+ str = make_string_from_bytes ((char *) buf, n, p - buf);
+ SAFE_FREE ();
+ return str;
}
DEFUN ("unibyte-string", Funibyte_string, Sunibyte_string, 0, MANY, 0,
@@ -983,10 +988,13 @@ usage: (unibyte-string &rest BYTES) */)
int n;
Lisp_Object *args;
{
- int i;
- unsigned char *buf = (unsigned char *) alloca (n);
- unsigned char *p = buf;
- unsigned c;
+ int i, c;
+ unsigned char *buf, *p;
+ Lisp_Object str;
+ USE_SAFE_ALLOCA;
+
+ SAFE_ALLOCA (buf, unsigned char *, n);
+ p = buf;
for (i = 0; i < n; i++)
{
@@ -997,7 +1005,9 @@ usage: (unibyte-string &rest BYTES) */)
*p++ = c;
}
- return make_string_from_bytes ((char *) buf, n, p - buf);
+ str = make_string_from_bytes ((char *) buf, n, p - buf);
+ SAFE_FREE ();
+ return str;
}
DEFUN ("char-resolve-modifiers", Fchar_resolve_modifiers,
diff --git a/src/character.h b/src/character.h
index 41f47e4b17..429435e28d 100644
--- a/src/character.h
+++ b/src/character.h
@@ -221,10 +221,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
(ASCII_BYTE_P (byte) || LEADING_CODE_P (byte)) */
#define CHAR_HEAD_P(byte) (((byte) & 0xC0) != 0x80)
-/* Kept for backward compatibility. This macro will be removed in the
- future. */
-#define BASE_LEADING_CODE_P LEADING_CODE_P
-
/* How many bytes a character that starts with BYTE occupies in a
multibyte form. */
#define BYTES_BY_CHAR_HEAD(byte) \
@@ -235,23 +231,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
: 5)
-/* Return the length of the multi-byte form at string STR of length
- LEN while assuming that STR points a valid multi-byte form. As
- this macro isn't necessary anymore, all callers will be changed to
- use BYTES_BY_CHAR_HEAD directly in the future. */
-
-#define MULTIBYTE_FORM_LENGTH(str, len) \
- BYTES_BY_CHAR_HEAD (*(str))
-
-/* Parse multibyte string STR of length LENGTH and set BYTES to the
- byte length of a character at STR while assuming that STR points a
- valid multibyte form. As this macro isn't necessary anymore, all
- callers will be changed to use BYTES_BY_CHAR_HEAD directly in the
- future. */
-
-#define PARSE_MULTIBYTE_SEQ(str, length, bytes) \
- (bytes) = BYTES_BY_CHAR_HEAD (*(str))
-
/* The byte length of multibyte form at unibyte string P ending at
PEND. If STR doesn't point to a valid multibyte form, return 0. */
@@ -285,7 +264,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* If P is before LIMIT, advance P to the next character boundary.
Assumes that P is already at a character boundary of the same
- mulitbyte form whose end address is LIMIT. */
+ multibyte form whose end address is LIMIT. */
#define NEXT_CHAR_BOUNDARY(p, limit) \
do { \
@@ -608,7 +587,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
: 0)
/* If C is a high surrogate, return 1. If C is a low surrogate,
- return 0. Otherwise, return 0. */
+ return 0. Otherwise, return 0. */
#define CHAR_SURROGATE_PAIR_P(c) \
((c) < 0xD800 ? 0 \
diff --git a/src/charset.c b/src/charset.c
index 18c0bbb631..f83fa99453 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -567,7 +567,6 @@ load_charset_map_from_file (charset, mapfile, control_flag)
n_entries++;
}
fclose (fp);
- close (fd);
load_charset_map (charset, head, n_entries, control_flag);
SAFE_FREE ();
diff --git a/src/cmds.c b/src/cmds.c
index 5d450fe9a1..ba89c532be 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -57,8 +57,12 @@ DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0,
}
DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "^p",
- doc: /* Move point right N characters (left if N is negative).
-On reaching end of buffer, stop and signal error. */)
+ doc: /* Move point N characters forward (backward if N is negative).
+On reaching end or beginning of buffer, stop and signal error.
+
+Depending on the bidirectional context, the movement may be to the
+right or to the left on the screen. This is in contrast with
+\\[right-char], which see. */)
(n)
Lisp_Object n;
{
@@ -93,8 +97,12 @@ On reaching end of buffer, stop and signal error. */)
}
DEFUN ("backward-char", Fbackward_char, Sbackward_char, 0, 1, "^p",
- doc: /* Move point left N characters (right if N is negative).
-On attempt to pass beginning or end of buffer, stop and signal error. */)
+ doc: /* Move point N characters backward (forward if N is negative).
+On attempt to pass beginning or end of buffer, stop and signal error.
+
+Depending on the bidirectional context, the movement may be to the
+right or to the left on the screen. This is in contrast with
+\\[left-char], which see. */)
(n)
Lisp_Object n;
{
@@ -114,7 +122,7 @@ If there isn't room, go as far as possible (no error).
Returns the count of lines left to move. If moving forward,
that is N - number of lines moved; if backward, N + number moved.
With positive N, a non-empty line at the end counts as one line
- successfully moved (for the return value). */)
+successfully moved (for the return value). */)
(n)
Lisp_Object n;
{
@@ -159,8 +167,8 @@ With argument N not nil or 1, move forward N - 1 lines first.
If point reaches the beginning or end of buffer, it stops there.
This function constrains point to the current field unless this moves
-point to a different line than the original, unconstrained result. If
-N is nil or 1, and a front-sticky field starts at point, the point
+point to a different line than the original, unconstrained result.
+If N is nil or 1, and a front-sticky field starts at point, the point
does not move. To ignore field boundaries bind
`inhibit-field-text-motion' to t, or use the `forward-line' function
instead. For instance, `(forward-line 0)' does the same thing as
@@ -270,7 +278,9 @@ DEFUN ("delete-backward-char", Fdelete_backward_char, Sdelete_backward_char,
doc: /* Delete the previous N characters (following if N is negative).
Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).
Interactively, N is the prefix arg, and KILLFLAG is set if
-N was explicitly specified. */)
+N was explicitly specified.
+This is meant for interactive use only; from Lisp, better use `delete-char'
+with a negated argument. */)
(n, killflag)
Lisp_Object n, killflag;
{
diff --git a/src/composite.c b/src/composite.c
index 341eb37187..cab57e824a 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -915,15 +915,16 @@ fill_gstring_body (gstring)
}
-/* Try to compose the characters at CHARPOS according to CFT_ELEMENT
- which is an element of composition-function-table (which see).
- LIMIT limits the characters to compose. STRING, if not nil, is a
- target string. WIN is a window where the characters are being
- displayed. */
+/* Try to compose the characters at CHARPOS according to composition
+ rule RULE ([PATTERN PREV-CHARS FUNC]). LIMIT limits the characters
+ to compose. STRING, if not nil, is a target string. WIN is a
+ window where the characters are being displayed. If characters are
+ successfully composed, return the composition as a glyph-string
+ object. Otherwise return nil. */
static Lisp_Object
-autocmp_chars (cft_element, charpos, bytepos, limit, win, face, string)
- Lisp_Object cft_element;
+autocmp_chars (rule, charpos, bytepos, limit, win, face, string)
+ Lisp_Object rule;
EMACS_INT charpos, bytepos, limit;
struct window *win;
struct face *face;
@@ -932,98 +933,91 @@ autocmp_chars (cft_element, charpos, bytepos, limit, win, face, string)
int count = SPECPDL_INDEX ();
FRAME_PTR f = XFRAME (win->frame);
Lisp_Object pos = make_number (charpos);
+ EMACS_INT to;
EMACS_INT pt = PT, pt_byte = PT_BYTE;
- int lookback;
+ Lisp_Object re, font_object, lgstring;
+ int len;
record_unwind_save_match_data ();
- for (lookback = -1; CONSP (cft_element); cft_element = XCDR (cft_element))
+ re = AREF (rule, 0);
+ if (NILP (re))
+ len = 1;
+ else if (! STRINGP (re))
+ return unbind_to (count, Qnil);
+ else if ((len = fast_looking_at (re, charpos, bytepos, limit, -1, string))
+ > 0)
{
- Lisp_Object elt = XCAR (cft_element);
- Lisp_Object re;
- Lisp_Object font_object = Qnil, gstring;
- EMACS_INT len, to;
-
- if (! VECTORP (elt) || ASIZE (elt) != 3)
- continue;
- if (lookback < 0)
- {
- lookback = XFASTINT (AREF (elt, 1));
- if (limit > charpos + MAX_COMPOSITION_COMPONENTS)
- limit = charpos + MAX_COMPOSITION_COMPONENTS;
- }
- else if (lookback != XFASTINT (AREF (elt, 1)))
- break;
- re = AREF (elt, 0);
- if (NILP (re))
- len = 1;
- else if ((len = fast_looking_at (re, charpos, bytepos, limit, -1, string))
- > 0)
- {
- if (NILP (string))
- len = BYTE_TO_CHAR (bytepos + len) - charpos;
- else
- len = string_byte_to_char (string, bytepos + len) - charpos;
- }
- if (len > 0)
- {
- limit = to = charpos + len;
+ if (NILP (string))
+ len = BYTE_TO_CHAR (bytepos + len) - charpos;
+ else
+ len = string_byte_to_char (string, bytepos + len) - charpos;
+ }
+ if (len <= 0)
+ return unbind_to (count, Qnil);
+ to = limit = charpos + len;
#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (f))
- {
- font_object = font_range (charpos, &to, win, face, string);
- if (! FONT_OBJECT_P (font_object)
- || (! NILP (re)
- && to < limit
- && (fast_looking_at (re, charpos, bytepos, to, -1, string) <= 0)))
- {
- if (NILP (string))
- TEMP_SET_PT_BOTH (pt, pt_byte);
- return unbind_to (count, Qnil);
- }
- }
- else
+ if (FRAME_WINDOW_P (f))
+ {
+ font_object = font_range (charpos, &to, win, face, string);
+ if (! FONT_OBJECT_P (font_object)
+ || (! NILP (re)
+ && to < limit
+ && (fast_looking_at (re, charpos, bytepos, to, -1, string) <= 0)))
+ return unbind_to (count, Qnil);
+ }
+ else
#endif /* not HAVE_WINDOW_SYSTEM */
- font_object = win->frame;
- gstring = Fcomposition_get_gstring (pos, make_number (to),
- font_object, string);
- if (NILP (LGSTRING_ID (gstring)))
- {
- Lisp_Object args[6];
-
- /* Save point as marker before calling out to lisp. */
- if (NILP (string))
- {
- Lisp_Object m = Fmake_marker ();
- set_marker_both (m, Qnil, pt, pt_byte);
- record_unwind_protect (restore_point_unwind, m);
- }
+ font_object = win->frame;
+ lgstring = Fcomposition_get_gstring (pos, make_number (to), font_object,
+ string);
+ if (NILP (LGSTRING_ID (lgstring)))
+ {
+ Lisp_Object args[6];
- args[0] = Vauto_composition_function;
- args[1] = AREF (elt, 2);
- args[2] = pos;
- args[3] = make_number (to);
- args[4] = font_object;
- args[5] = string;
- gstring = safe_call (6, args);
- }
- else if (NILP (string))
- {
- TEMP_SET_PT_BOTH (pt, pt_byte);
- }
- return unbind_to (count, gstring);
+ /* Save point as marker before calling out to lisp. */
+ if (NILP (string))
+ {
+ Lisp_Object m = Fmake_marker ();
+ set_marker_both (m, Qnil, pt, pt_byte);
+ record_unwind_protect (restore_point_unwind, m);
}
+
+ args[0] = Vauto_composition_function;
+ args[1] = AREF (rule, 2);
+ args[2] = pos;
+ args[3] = make_number (to);
+ args[4] = font_object;
+ args[5] = string;
+ lgstring = safe_call (6, args);
+ if (NILP (string))
+ TEMP_SET_PT_BOTH (pt, pt_byte);
}
- if (NILP (string))
- TEMP_SET_PT_BOTH (pt, pt_byte);
- return unbind_to (count, Qnil);
+ return unbind_to (count, lgstring);
}
+static Lisp_Object _work_val;
+static int _work_char;
+
+/* 1 iff the character C is composable. */
+#define CHAR_COMPOSABLE_P(C) \
+ ((C) == 0x200C || (C) == 0x200D \
+ || (_work_val = CHAR_TABLE_REF (Vunicode_category_table, (C)), \
+ (SYMBOLP (_work_val) \
+ && (_work_char = SDATA (SYMBOL_NAME (_work_val))[0]) != 'C' \
+ && _work_char != 'Z')))
/* Update cmp_it->stop_pos to the next position after CHARPOS (and
BYTEPOS) where character composition may happen. If BYTEPOS is
- negative, compute it. If it is a static composition, set
- cmp_it->ch to -1. Otherwise, set cmp_it->ch to the character that
- triggers a automatic composition. */
+ negative, compute it. ENDPOS is a limit of searching. If it is
+ less than CHARPOS, search backward to ENDPOS+1 assuming that
+ set_iterator_to_next works in reverse order. In this case, if a
+ composition closest to CHARPOS is found, set cmp_it->stop_pos to
+ the last character of the composition.
+
+ If no composition is found, set cmp_it->ch to -2. If a static
+ composition is found, set cmp_it->ch to -1. Otherwise, set
+ cmp_it->ch to the character that triggers the automatic
+ composition. */
void
composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string)
@@ -1036,60 +1030,211 @@ composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string)
/* This is from forward_to_next_line_start in xdisp.c. */
const int MAX_NEWLINE_DISTANCE = 500;
- if (endpos > charpos + MAX_NEWLINE_DISTANCE)
- endpos = charpos + MAX_NEWLINE_DISTANCE;
- cmp_it->stop_pos = endpos;
+ if (charpos < endpos)
+ {
+ if (endpos > charpos + MAX_NEWLINE_DISTANCE)
+ endpos = charpos + MAX_NEWLINE_DISTANCE;
+ }
+ else if (endpos < charpos)
+ {
+ /* We search backward for a position to check composition. */
+ if (endpos < 0)
+ {
+ /* But we don't know where to stop the searching. */
+ endpos = NILP (string) ? BEGV - 1 : -1;
+ /* Usually we don't reach ENDPOS because we stop searching
+ at an uncomposable character (NL, LRE, etc). */
+ }
+ }
cmp_it->id = -1;
cmp_it->ch = -2;
- if (find_composition (charpos, endpos, &start, &end, &prop, string)
+ cmp_it->reversed_p = 0;
+ cmp_it->stop_pos = endpos;
+ if (charpos == endpos)
+ return;
+ /* FIXME: Bidi is not yet handled well in static composition. */
+ if (charpos < endpos
+ && find_composition (charpos, endpos, &start, &end, &prop, string)
&& COMPOSITION_VALID_P (start, end, prop))
{
cmp_it->stop_pos = endpos = start;
cmp_it->ch = -1;
}
- if (NILP (string) && PT > charpos && PT < endpos)
- cmp_it->stop_pos = PT;
+ if (NILP (string))
+ {
+ /* A composition never strides over PT. */
+ if (PT > charpos)
+ {
+ if (PT < endpos)
+ cmp_it->stop_pos = endpos = PT;
+ }
+ else if (PT < charpos && PT > endpos)
+ {
+ cmp_it->stop_pos = endpos = PT - 1;
+ }
+ }
if (NILP (current_buffer->enable_multibyte_characters)
|| NILP (Vauto_composition_mode))
return;
if (bytepos < 0)
{
- if (STRINGP (string))
- bytepos = string_char_to_byte (string, charpos);
- else
+ if (NILP (string))
bytepos = CHAR_TO_BYTE (charpos);
+ else
+ bytepos = string_char_to_byte (string, charpos);
}
start = charpos;
- while (charpos < endpos)
+ if (charpos < endpos)
{
- if (STRINGP (string))
- FETCH_STRING_CHAR_ADVANCE (c, string, charpos, bytepos);
- else
- FETCH_CHAR_ADVANCE (c, charpos, bytepos);
- if (c == '\n')
+ /* Forward search. */
+ while (charpos < endpos)
{
- cmp_it->ch = -2;
- break;
+ if (STRINGP (string))
+ FETCH_STRING_CHAR_ADVANCE (c, string, charpos, bytepos);
+ else
+ FETCH_CHAR_ADVANCE (c, charpos, bytepos);
+ if (c == '\n')
+ {
+ cmp_it->ch = -2;
+ break;
+ }
+ val = CHAR_TABLE_REF (Vcomposition_function_table, c);
+ if (! NILP (val))
+ {
+ Lisp_Object elt;
+ int ridx;
+
+ for (ridx = 0; CONSP (val); val = XCDR (val), ridx++)
+ {
+ elt = XCAR (val);
+ if (VECTORP (elt) && ASIZE (elt) == 3
+ && NATNUMP (AREF (elt, 1))
+ && charpos - 1 - XFASTINT (AREF (elt, 1)) >= start)
+ break;
+ }
+ if (CONSP (val))
+ {
+ cmp_it->rule_idx = ridx;
+ cmp_it->lookback = XFASTINT (AREF (elt, 1));
+ cmp_it->stop_pos = charpos - 1 - cmp_it->lookback;
+ cmp_it->ch = c;
+ return;
+ }
+ }
}
- val = CHAR_TABLE_REF (Vcomposition_function_table, c);
- if (! NILP (val))
+ }
+ else if (charpos > endpos)
+ {
+ /* Search backward for a pattern that may be composed and the
+ position of (possibly) the last character of the match is
+ closest to (but not after) START. The reason for the last
+ character is that set_iterator_to_next works in reverse order,
+ and thus we must stop at the last character for composition
+ check. */
+ unsigned char *p;
+ int len;
+ /* Limit byte position used in fast_looking_at. This is the
+ byte position of the character after START. */
+ EMACS_INT limit;
+
+ if (NILP (string))
+ p = BYTE_POS_ADDR (bytepos);
+ else
+ p = SDATA (string) + bytepos;
+ c = STRING_CHAR_AND_LENGTH (p, len);
+ limit = bytepos + len;
+ while (CHAR_COMPOSABLE_P (c))
{
- Lisp_Object elt;
+ val = CHAR_TABLE_REF (Vcomposition_function_table, c);
+ if (! NILP (val))
+ {
+ Lisp_Object elt;
+ int ridx, back, len;
- for (; CONSP (val); val = XCDR (val))
+ for (ridx = 0; CONSP (val); val = XCDR (val), ridx++)
+ {
+ elt = XCAR (val);
+ if (VECTORP (elt) && ASIZE (elt) == 3
+ && NATNUMP (AREF (elt, 1))
+ && charpos - (back = XFASTINT (AREF (elt, 1))) > endpos)
+ {
+ EMACS_INT cpos = charpos - back, bpos;
+
+ if (back == 0)
+ bpos = bytepos;
+ else
+ bpos = (NILP (string) ? CHAR_TO_BYTE (cpos)
+ : string_char_to_byte (string, cpos));
+ if (STRINGP (AREF (elt, 0)))
+ len = fast_looking_at (AREF (elt, 0), cpos, bpos,
+ start + 1, limit, string);
+ else
+ len = 1;
+ if (len > 0)
+ {
+ /* Make CPOS point to the last character of
+ match. Note that LEN is byte-length. */
+ if (len > 1)
+ {
+ bpos += len;
+ if (NILP (string))
+ cpos = BYTE_TO_CHAR (bpos) - 1;
+ else
+ cpos = string_byte_to_char (string, bpos) - 1;
+ }
+ back = cpos - (charpos - back);
+ if (cmp_it->stop_pos < cpos
+ || (cmp_it->stop_pos == cpos
+ && cmp_it->lookback < back))
+ {
+ cmp_it->rule_idx = ridx;
+ cmp_it->stop_pos = cpos;
+ cmp_it->ch = c;
+ cmp_it->lookback = back;
+ cmp_it->nchars = back + 1;
+ }
+ }
+ }
+ }
+ }
+ if (charpos - 1 == endpos)
+ break;
+ if (STRINGP (string))
{
- elt = XCAR (val);
- if (VECTORP (elt) && ASIZE (elt) == 3 && NATNUMP (AREF (elt, 1))
- && charpos - 1 - XFASTINT (AREF (elt, 1)) >= start)
- break;
+ p--, bytepos--;
+ while (! CHAR_HEAD_P (*p))
+ p--, bytepos--;
+ charpos--;
+ }
+ else
+ {
+ DEC_BOTH (charpos, bytepos);
+ p = BYTE_POS_ADDR (bytepos);
}
- if (CONSP (val))
+ c = STRING_CHAR (p);
+ }
+ if (cmp_it->ch >= 0)
+ /* We found a position to check. */
+ return;
+ /* Skip all uncomposable characters. */
+ if (NILP (string))
+ {
+ while (charpos - 1 > endpos && ! CHAR_COMPOSABLE_P (c))
{
- cmp_it->lookback = XFASTINT (AREF (elt, 1));
- cmp_it->stop_pos = charpos - 1 - cmp_it->lookback;
- cmp_it->ch = c;
- return;
+ DEC_BOTH (charpos, bytepos);
+ c = FETCH_MULTIBYTE_CHAR (bytepos);
+ }
+ }
+ else
+ {
+ while (charpos - 1 > endpos && ! CHAR_COMPOSABLE_P (c))
+ {
+ p--;
+ while (! CHAR_HEAD_P (*p))
+ p--;
+ charpos--;
+ c = STRING_CHAR (p);
}
}
}
@@ -1104,8 +1249,8 @@ composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string)
string. In that case, FACE must not be NULL.
If the character is composed, setup members of CMP_IT (id, nglyphs,
- and from), and return 1. Otherwise, update CMP_IT->stop_pos, and
- return 0. */
+ from, to, reversed_p), and return 1. Otherwise, update
+ CMP_IT->stop_pos, and return 0. */
int
composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string)
@@ -1115,13 +1260,29 @@ composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string)
struct face *face;
Lisp_Object string;
{
- if (NILP (string) && charpos < PT && PT < endpos)
- endpos = PT;
+ if (endpos <= charpos)
+ {
+ if (NILP (string))
+ {
+ if (endpos < 0)
+ endpos = BEGV;
+ if (endpos < PT && PT < charpos)
+ endpos = PT;
+ }
+ else if (endpos < 0)
+ endpos = 0;
+ }
+ else
+ {
+ if (NILP (string) && charpos < PT && PT < endpos)
+ endpos = PT;
+ }
if (cmp_it->ch == -2)
{
composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string);
- if (cmp_it->ch == -2)
+ if (cmp_it->ch == -2 || cmp_it->stop_pos != charpos)
+ /* The current position is not composed. */
return 0;
}
@@ -1141,45 +1302,120 @@ composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string)
}
else if (w)
{
- Lisp_Object val, elt;
- int i;
+ Lisp_Object lgstring = Qnil;
+ Lisp_Object val, elt, re;
+ int len, i;
val = CHAR_TABLE_REF (Vcomposition_function_table, cmp_it->ch);
- for (; CONSP (val); val = XCDR (val))
+ for (i = 0; i < cmp_it->rule_idx; i++, val = XCDR (val));
+ if (charpos < endpos)
{
- elt = XCAR (val);
- if (cmp_it->lookback == XFASTINT (AREF (elt, 1)))
- break;
+ for (; CONSP (val); val = XCDR (val))
+ {
+ elt = XCAR (val);
+ if (! VECTORP (elt) || ASIZE (elt) != 3
+ || ! INTEGERP (AREF (elt, 1)))
+ continue;
+ if (XFASTINT (AREF (elt, 1)) != cmp_it->lookback)
+ goto no_composition;
+ lgstring = autocmp_chars (elt, charpos, bytepos, endpos,
+ w, face, string);
+ if (composition_gstring_p (lgstring))
+ break;
+ lgstring = Qnil;
+ /* Composition failed perhaps because the font doesn't
+ support sufficient range of characters. Try the
+ other composition rules if any. */
+ }
+ cmp_it->reversed_p = 0;
}
- if (NILP (val))
- goto no_composition;
+ else
+ {
+ EMACS_INT cpos = charpos, bpos = bytepos;
- val = autocmp_chars (val, charpos, bytepos, endpos, w, face, string);
- if (! composition_gstring_p (val))
+ while (1)
+ {
+ elt = XCAR (val);
+ if (cmp_it->lookback > 0)
+ {
+ cpos -= cmp_it->lookback;
+ if (STRINGP (string))
+ bpos = string_char_to_byte (string, cpos);
+ else
+ bpos = CHAR_TO_BYTE (cpos);
+ }
+ lgstring = autocmp_chars (elt, cpos, bpos, charpos + 1, w, face,
+ string);
+ if (composition_gstring_p (lgstring)
+ && cpos + LGSTRING_CHAR_LEN (lgstring) - 1 == charpos)
+ break;
+ /* Composition failed or didn't cover the current
+ character. */
+ if (cmp_it->lookback == 0)
+ goto no_composition;
+ lgstring = Qnil;
+ /* Try to find a shorter compostion that starts after CPOS. */
+ composition_compute_stop_pos (cmp_it, charpos, bytepos, cpos,
+ string);
+ if (cmp_it->ch == -2 || cmp_it->stop_pos < charpos)
+ goto no_composition;
+ val = CHAR_TABLE_REF (Vcomposition_function_table, cmp_it->ch);
+ for (i = 0; i < cmp_it->rule_idx; i++, val = XCDR (val));
+ }
+ cmp_it->reversed_p = 1;
+ }
+ if (NILP (lgstring))
goto no_composition;
- if (NILP (LGSTRING_ID (val)))
- val = composition_gstring_put_cache (val, -1);
- cmp_it->id = XINT (LGSTRING_ID (val));
- for (i = 0; i < LGSTRING_GLYPH_LEN (val); i++)
- if (NILP (LGSTRING_GLYPH (val, i)))
+ if (NILP (LGSTRING_ID (lgstring)))
+ lgstring = composition_gstring_put_cache (lgstring, -1);
+ cmp_it->id = XINT (LGSTRING_ID (lgstring));
+ for (i = 0; i < LGSTRING_GLYPH_LEN (lgstring); i++)
+ if (NILP (LGSTRING_GLYPH (lgstring, i)))
break;
cmp_it->nglyphs = i;
+ cmp_it->from = 0;
+ cmp_it->to = i;
}
else
goto no_composition;
- cmp_it->from = 0;
return 1;
no_composition:
- charpos++;
- if (STRINGP (string))
- bytepos += MULTIBYTE_LENGTH_NO_CHECK (SDATA (string) + bytepos);
+ if (charpos == endpos)
+ return 0;
+ if (charpos < endpos)
+ {
+ charpos++;
+ if (NILP (string))
+ INC_POS (bytepos);
+ else
+ bytepos += BYTES_BY_CHAR_HEAD (*(SDATA (string) + bytepos));
+ }
else
- INC_POS (bytepos);
+ {
+ charpos--;
+ /* BYTEPOS is calculated in composition_compute_stop_pos */
+ bytepos = -1;
+ }
composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string);
return 0;
}
+/* Update charpos, nchars, nbytes, and width of the current grapheme
+ cluster.
+
+ If the composition is static or automatic in L2R context, the
+ cluster is identified by CMP_IT->from, and CHARPOS is the position
+ of the first character of the cluster. In this case, update
+ CMP_IT->to too.
+
+ If the composition is automatic in R2L context, the cluster is
+ identified by CMP_IT->to, and CHARPOS is the position of the last
+ character of the cluster. In this case, update CMP_IT->from too.
+
+ The return value is the character code of the first character of
+ the cluster, or -1 if the composition is somehow broken. */
+
int
composition_update_it (cmp_it, charpos, bytepos, string)
struct composition_it *cmp_it;
@@ -1190,8 +1426,10 @@ composition_update_it (cmp_it, charpos, bytepos, string)
if (cmp_it->ch < 0)
{
+ /* static composition */
struct composition *cmp = composition_table[cmp_it->id];
+ cmp_it->charpos = charpos;
cmp_it->to = cmp_it->nglyphs;
if (cmp_it->nglyphs == 0)
c = -1;
@@ -1204,43 +1442,64 @@ composition_update_it (cmp_it, charpos, bytepos, string)
c = ' ';
}
cmp_it->width = cmp->width;
+ charpos += cmp_it->nchars;
+ if (STRINGP (string))
+ cmp_it->nbytes = string_char_to_byte (string, charpos) - bytepos;
+ else
+ cmp_it->nbytes = CHAR_TO_BYTE (charpos) - bytepos;
}
else
{
+ /* automatic composition */
Lisp_Object gstring = composition_gstring_from_id (cmp_it->id);
+ Lisp_Object glyph;
+ int from, to;
if (cmp_it->nglyphs == 0)
{
- c = -1;
cmp_it->nchars = LGSTRING_CHAR_LEN (gstring);
cmp_it->width = 0;
+ cmp_it->from = cmp_it->to = 0;
+ return -1;
}
- else
+ if (! cmp_it->reversed_p)
{
- Lisp_Object glyph = LGSTRING_GLYPH (gstring, cmp_it->from);
- int from = LGLYPH_FROM (glyph);
-
- c = XINT (LGSTRING_CHAR (gstring, from));
- cmp_it->nchars = LGLYPH_TO (glyph) - from + 1;
- cmp_it->width = (LGLYPH_WIDTH (glyph) > 0
- ? CHAR_WIDTH (LGLYPH_CHAR (glyph)) : 0);
+ glyph = LGSTRING_GLYPH (gstring, cmp_it->from);
+ from = LGLYPH_FROM (glyph);
for (cmp_it->to = cmp_it->from + 1; cmp_it->to < cmp_it->nglyphs;
cmp_it->to++)
{
glyph = LGSTRING_GLYPH (gstring, cmp_it->to);
if (LGLYPH_FROM (glyph) != from)
break;
- if (LGLYPH_WIDTH (glyph) > 0)
- cmp_it->width += CHAR_WIDTH (LGLYPH_CHAR (glyph));
}
+ cmp_it->charpos = charpos;
+ }
+ else
+ {
+ glyph = LGSTRING_GLYPH (gstring, cmp_it->to - 1);
+ from = LGLYPH_FROM (glyph);
+ cmp_it->charpos = charpos - (LGLYPH_TO (glyph) - from);
+ for (cmp_it->from = cmp_it->to - 1; cmp_it->from > 0;
+ cmp_it->from--)
+ {
+ glyph = LGSTRING_GLYPH (gstring, cmp_it->from - 1);
+ if (LGLYPH_FROM (glyph) != from)
+ break;
+ }
+ }
+ glyph = LGSTRING_GLYPH (gstring, cmp_it->from);
+ cmp_it->nchars = LGLYPH_TO (glyph) + 1 - from;
+ cmp_it->nbytes = 0;
+ cmp_it->width = 0;
+ for (i = cmp_it->nchars - 1; i >= 0; i--)
+ {
+ c = XINT (LGSTRING_CHAR (gstring, i));
+ cmp_it->nbytes += CHAR_BYTES (c);
+ cmp_it->width = (LGLYPH_WIDTH (glyph) > 0
+ ? CHAR_WIDTH (LGLYPH_CHAR (glyph)) : 0);
}
}
-
- charpos += cmp_it->nchars;
- if (STRINGP (string))
- cmp_it->nbytes = string_char_to_byte (string, charpos) - bytepos;
- else
- cmp_it->nbytes = CHAR_TO_BYTE (charpos) - bytepos;
return c;
}
@@ -1279,17 +1538,6 @@ struct position_record
(POSITION).pos--; \
} while (0)
-static Lisp_Object _work_val;
-static int _work_char;
-
-/* 1 iff the character C is composable. */
-#define CHAR_COMPOSABLE_P(C) \
- ((C) == 0x200C || (C) == 0x200D \
- || (_work_val = CHAR_TABLE_REF (Vunicode_category_table, (C)), \
- (SYMBOLP (_work_val) \
- && (_work_char = SDATA (SYMBOL_NAME (_work_val))[0]) != 'C' \
- && _work_char != 'Z')))
-
/* This is like find_composition, but find an automatic composition
instead. If found, set *GSTRING to the glyph-string representing
the composition, and return 1. Otherwise, return 0. */
@@ -1420,7 +1668,7 @@ find_automatic_composition (pos, limit, start, end, gstring, string)
check.pos_byte = cur.pos_byte;
else
check.pos_byte = CHAR_TO_BYTE (check.pos);
- val = autocmp_chars (check_val, check.pos, check.pos_byte,
+ val = autocmp_chars (elt, check.pos, check.pos_byte,
tail, w, NULL, string);
need_adjustment = 1;
if (! NILP (val))
@@ -1824,7 +2072,7 @@ preceding and/or following characters, this char-table contains
a function to call to compose that character.
The element at index C in the table, if non-nil, is a list of
-this form: ([PATTERN PREV-CHARS FUNC] ...)
+composition rules of this form: ([PATTERN PREV-CHARS FUNC] ...)
PATTERN is a regular expression which C and the surrounding
characters must match.
diff --git a/src/config.in b/src/config.in
index 29b2a0b967..5fb9766258 100644
--- a/src/config.in
+++ b/src/config.in
@@ -27,9 +27,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define EMACS_CONFIG_H
-/* Generate dependencies with gcc. */
-#undef AUTO_DEPEND
-
/* Define to 1 if the mktime function is broken. */
#undef BROKEN_MKTIME
@@ -44,12 +41,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if using `getloadavg.c'. */
#undef C_GETLOADAVG
-/* Define C_SWITCH_X_SITE to contain any special flags your compiler may need
- to deal with X Windows. For instance, if you've defined HAVE_X_WINDOWS
- above and your X include files aren't in a place that your compiler can
- find on its own, you might want to add "-I/..." or something similar. */
-#undef C_SWITCH_X_SITE
-
/* Define to 1 for DGUX with <sys/dg_sys_info.h>. */
#undef DGUX
@@ -324,10 +315,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the <kerberos/krb.h> header file. */
#undef HAVE_KERBEROS_KRB_H
-/* Define to 1 if `e_text' is member of `krb5_error'. */
+/* Define to 1 if `e_text' is a member of `krb5_error'. */
#undef HAVE_KRB5_ERROR_E_TEXT
-/* Define to 1 if `text' is member of `krb5_error'. */
+/* Define to 1 if `text' is a member of `krb5_error'. */
#undef HAVE_KRB5_ERROR_TEXT
/* Define to 1 if you have the <krb5.h> header file. */
@@ -494,6 +485,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
+/* Define if you have mouse support. */
+#undef HAVE_MOUSE
+
/* Define to 1 if you have the `mremap' function. */
#undef HAVE_MREMAP
@@ -618,25 +612,25 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `strsignal' function. */
#undef HAVE_STRSIGNAL
-/* Define to 1 if `ifr_addr' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_addr' is a member of `struct ifreq'. */
#undef HAVE_STRUCT_IFREQ_IFR_ADDR
-/* Define to 1 if `ifr_broadaddr' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_broadaddr' is a member of `struct ifreq'. */
#undef HAVE_STRUCT_IFREQ_IFR_BROADADDR
-/* Define to 1 if `ifr_flags' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_flags' is a member of `struct ifreq'. */
#undef HAVE_STRUCT_IFREQ_IFR_FLAGS
-/* Define to 1 if `ifr_hwaddr' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_hwaddr' is a member of `struct ifreq'. */
#undef HAVE_STRUCT_IFREQ_IFR_HWADDR
-/* Define to 1 if `ifr_netmask' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_netmask' is a member of `struct ifreq'. */
#undef HAVE_STRUCT_IFREQ_IFR_NETMASK
-/* Define to 1 if `n_un.n_name' is member of `struct nlist'. */
+/* Define to 1 if `n_un.n_name' is a member of `struct nlist'. */
#undef HAVE_STRUCT_NLIST_N_UN_N_NAME
-/* Define to 1 if `tm_zone' is member of `struct tm'. */
+/* Define to 1 if `tm_zone' is a member of `struct tm'. */
#undef HAVE_STRUCT_TM_TM_ZONE
/* Define to 1 if `struct utimbuf' is declared by <utime.h>. */
@@ -749,6 +743,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H
+/* Define if you have a window system. */
+#undef HAVE_WINDOW_SYSTEM
+
/* Define to 1 if `fork' works. */
#undef HAVE_WORKING_FORK
@@ -810,12 +807,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to use Kerberos 5 instead of Kerberos 4. */
#undef KERBEROS5
-/* Define LD_SWITCH_X_SITE to contain any special flags your loader may need
- to deal with X Windows. For instance, if you've defined HAVE_X_WINDOWS
- above and your X libraries aren't in a place that your loader can find on
- its own, you might want to add "-L/..." or something similar. */
-#undef LD_SWITCH_X_SITE
-
/* Define to 1 if localtime caches TZ. */
#undef LOCALTIME_CACHE
@@ -853,6 +844,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you are using NS windowing under GNUstep. */
#undef NS_IMPL_GNUSTEP
+/* Define if the C compiler is the linker. */
+#undef ORDINARY_LINK
+
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
@@ -865,6 +859,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
/* Define to the version of this package. */
#undef PACKAGE_VERSION
@@ -1022,12 +1019,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#undef volatile
-/* If we're using X11/Carbon/GNUstep, define some consequences. */
-#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
-#define HAVE_WINDOW_SYSTEM
-#define HAVE_MOUSE
-#endif
-
/* Define AMPERSAND_FULL_NAME if you use the convention
that & in the full name stands for the login id. */
/* Turned on June 1996 supposing nobody will mind it. */
@@ -1052,7 +1043,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#endif /* __FreeBSD__ || __NetBSD__ || __linux__ */
-/* If using GNU, then support inline function declarations. */
+/* If using GNU, then support inline function declarations. */
/* Don't try to switch on inline handling as detected by AC_C_INLINE
generally, because even if non-gcc compilers accept `inline', they
may reject `extern inline'. */
@@ -1077,7 +1068,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Set up some defines, C and LD flags for NeXTstep interface on GNUstep.
(There is probably a better place to do this, but right now the Cocoa
side does this in s/darwin.h and we cannot
- parallel this exactly since GNUstep is multi-OS. */
+ parallel this exactly since GNUstep is multi-OS. */
#ifdef HAVE_NS
# ifdef NS_IMPL_GNUSTEP
/* GNUstep needs a bit more pure memory. Of the existing knobs,
@@ -1111,23 +1102,10 @@ SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */
#define my_strftime nstrftime /* for strftime.c */
-/* The rest of the code currently tests the CPP symbol BSTRING.
- Override any claims made by the system-description files.
- Note that on some SCO version it is possible to have bcopy and not bcmp. */
-#undef BSTRING
-#if defined (HAVE_BCOPY) && defined (HAVE_BCMP)
-#define BSTRING
-#endif
-
/* Some of the files of Emacs which are intended for use with other
programs assume that if you have a config.h file, you must declare
- the type of getenv.
-
- This declaration shouldn't appear when alloca.s or Makefile.in
- includes config.h. */
-#ifndef NOT_C_CODE
+ the type of getenv. */
extern char *getenv ();
-#endif
/* These default definitions are good for almost all machines.
The exceptions override them in m/MACHINE.h. */
@@ -1168,37 +1146,40 @@ extern char *getenv ();
# endif /* GCC. */
#endif /* __P */
-/* Don't include "string.h" or <stdlib.h> in non-C code. */
-#ifndef NOT_C_CODE
#ifdef HAVE_STRING_H
-#include "string.h"
+#include <string.h>
#endif
+
#ifdef HAVE_STRINGS_H
-#include "strings.h" /* May be needed for bcopy & al. */
+#include <strings.h> /* May be needed for bcopy & al. */
#endif
+
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#ifndef __GNUC__
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else /* AIX files deal with #pragma. */
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif /* HAVE_ALLOCA_H */
-#endif /* __GNUC__ */
+
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#else
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C"
+# endif
+void *alloca (size_t);
+#endif
+
#ifndef HAVE_SIZE_T
typedef unsigned size_t;
#endif
-#endif /* NOT_C_CODE */
/* Define HAVE_X_I18N if we have usable i18n support. */
#ifdef HAVE_X11R6
#define HAVE_X_I18N
-#elif !defined X11R5_INHIBIT_I18N
-#define HAVE_X_I18N
#endif
/* Define HAVE_X11R6_XIM if we have usable X11R6-style XIM support. */
@@ -1218,11 +1199,7 @@ typedef unsigned size_t;
that the stack is continuous. */
#ifdef __GNUC__
# ifndef GC_SETJMP_WORKS
- /* GC_SETJMP_WORKS is nearly always appropriate for GCC --
- see NON_SAVING_SETJMP in the target descriptions. */
- /* Exceptions (see NON_SAVING_SETJMP in target description) are
- SCO5 non-ELF (but Emacs specifies ELF) and SVR3 on x86.
- Fixme: Deal with SVR3. */
+ /* GC_SETJMP_WORKS is nearly always appropriate for GCC. */
# define GC_SETJMP_WORKS 1
# endif
# ifndef GC_LISP_OBJECT_ALIGNMENT
diff --git a/src/data.c b/src/data.c
index 2d71434cc7..93cc57e9f2 100644
--- a/src/data.c
+++ b/src/data.c
@@ -959,14 +959,14 @@ store_symval_forwarding (/* symbol, */ valcontents, newval, buf)
CHECK_NUMBER (newval);
*XINTFWD (valcontents)->intvar = XINT (newval);
break;
-
+
case Lisp_Fwd_Bool:
*XBOOLFWD (valcontents)->boolvar = !NILP (newval);
break;
-
+
case Lisp_Fwd_Obj:
*XOBJFWD (valcontents)->objvar = newval;
-
+
/* If this variable is a default for something stored
in the buffer itself, such as default-fill-column,
find the buffers that don't have local values for it
@@ -977,12 +977,12 @@ store_symval_forwarding (/* symbol, */ valcontents, newval, buf)
int offset = ((char *) XOBJFWD (valcontents)->objvar
- (char *) &buffer_defaults);
int idx = PER_BUFFER_IDX (offset);
-
+
Lisp_Object tail;
-
+
if (idx <= 0)
break;
-
+
for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object buf;
@@ -1943,7 +1943,7 @@ BUFFER defaults to the current buffer. */)
Lisp_Object tail, elt, tmp;
struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
XSETBUFFER (tmp, buf);
-
+
for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
{
elt = XCAR (tail);
@@ -2274,7 +2274,7 @@ bool-vector. IDX starts at 0. */)
idxval_byte = string_char_to_byte (array, idxval);
p1 = SDATA (array) + idxval_byte;
- PARSE_MULTIBYTE_SEQ (p1, nbytes - idxval_byte, prev_bytes);
+ prev_bytes = BYTES_BY_CHAR_HEAD (*p1);
new_bytes = CHAR_STRING (XINT (newelt), p0);
if (prev_bytes != new_bytes)
{
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 5cad182b52..e813d0b5ad 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -16,7 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+#include <config.h>
#ifdef HAVE_DBUS
#include <stdlib.h>
@@ -405,6 +405,7 @@ xd_append_arg (dtype, object, iter)
switch (dtype)
{
case DBUS_TYPE_BYTE:
+ CHECK_NUMBER (object);
{
unsigned char val = XUINT (object) & 0xFF;
XD_DEBUG_MESSAGE ("%c %d", dtype, val);
@@ -423,6 +424,7 @@ xd_append_arg (dtype, object, iter)
}
case DBUS_TYPE_INT16:
+ CHECK_NUMBER (object);
{
dbus_int16_t val = XINT (object);
XD_DEBUG_MESSAGE ("%c %d", dtype, (int) val);
@@ -432,6 +434,7 @@ xd_append_arg (dtype, object, iter)
}
case DBUS_TYPE_UINT16:
+ CHECK_NUMBER (object);
{
dbus_uint16_t val = XUINT (object);
XD_DEBUG_MESSAGE ("%c %u", dtype, (unsigned int) val);
@@ -441,6 +444,7 @@ xd_append_arg (dtype, object, iter)
}
case DBUS_TYPE_INT32:
+ CHECK_NUMBER (object);
{
dbus_int32_t val = XINT (object);
XD_DEBUG_MESSAGE ("%c %d", dtype, val);
@@ -450,6 +454,7 @@ xd_append_arg (dtype, object, iter)
}
case DBUS_TYPE_UINT32:
+ CHECK_NUMBER (object);
{
dbus_uint32_t val = XUINT (object);
XD_DEBUG_MESSAGE ("%c %u", dtype, val);
@@ -459,6 +464,7 @@ xd_append_arg (dtype, object, iter)
}
case DBUS_TYPE_INT64:
+ CHECK_NUMBER (object);
{
dbus_int64_t val = XINT (object);
XD_DEBUG_MESSAGE ("%c %d", dtype, (int) val);
@@ -468,6 +474,7 @@ xd_append_arg (dtype, object, iter)
}
case DBUS_TYPE_UINT64:
+ CHECK_NUMBER (object);
{
dbus_uint64_t val = XUINT (object);
XD_DEBUG_MESSAGE ("%c %u", dtype, (unsigned int) val);
@@ -477,6 +484,7 @@ xd_append_arg (dtype, object, iter)
}
case DBUS_TYPE_DOUBLE:
+ CHECK_FLOAT (object);
{
double val = XFLOAT_DATA (object);
XD_DEBUG_MESSAGE ("%c %f", dtype, val);
@@ -488,8 +496,13 @@ xd_append_arg (dtype, object, iter)
case DBUS_TYPE_STRING:
case DBUS_TYPE_OBJECT_PATH:
case DBUS_TYPE_SIGNATURE:
+ CHECK_STRING (object);
{
- char *val = SDATA (Fstring_make_unibyte (object));
+ /* We need to send a valid UTF-8 string. We could encode `object'
+ but by not encoding it, we guarantee it's valid utf-8, even if
+ it contains eight-bit-bytes. Of course, you can still send
+ manually-crafted junk by passing a unibyte string. */
+ char *val = SDATA (object);
XD_DEBUG_MESSAGE ("%c %s", dtype, val);
if (!dbus_message_iter_append_basic (iter, dtype, &val))
XD_SIGNAL2 (build_string ("Unable to append argument"), object);
diff --git a/src/deps.mk b/src/deps.mk
new file mode 100644
index 0000000000..e926939772
--- /dev/null
+++ b/src/deps.mk
@@ -0,0 +1,280 @@
+### deps.mk --- src/Makefile fragment for GNU Emacs
+
+## Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
+## 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+## Free Software Foundation, Inc.
+
+## This file is part of GNU Emacs.
+
+## GNU Emacs is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+##
+## GNU Emacs is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+## Commentary:
+##
+## This file is inserted in src/Makefile if AUTO_DEPEND=no.
+## It defines static dependencies between the various source files.
+
+## FIXME some of these dependencies are platform-specific.
+## Eg callproc.c only depends on w32.h for WINDOWSNT builds.
+## One way to fix this would be to replace w32.h (etc) by $(W32_H),
+## a variable set by configure. Does not seem worth the trouble.
+## Since the w32 build does not even use this file, you might ask
+## why these dependencies are here at all...
+
+## nsgui.h: In fact, every .o file depends directly or indirectly on
+## dispextern.h and hence nsgui.h under NS. But the ones that actually
+## use stuff there are more limited.
+
+### Code:
+
+atimer.o: atimer.c atimer.h syssignal.h systime.h lisp.h blockinput.h \
+ $(config_h)
+bidi.o: bidi.c buffer.h character.h dispextern.h lisp.h \
+ biditype.h bidimirror.h $(config_h)
+buffer.o: buffer.c buffer.h region-cache.h commands.h window.h \
+ $(INTERVALS_H) blockinput.h atimer.h systime.h character.h \
+ indent.h keyboard.h coding.h keymap.h frame.h lisp.h $(config_h)
+callint.o: callint.c window.h commands.h buffer.h keymap.h \
+ keyboard.h dispextern.h systime.h coding.h composite.h lisp.h $(config_h)
+callproc.o: callproc.c epaths.h buffer.h commands.h lisp.h $(config_h) \
+ process.h systty.h syssignal.h character.h coding.h ccl.h msdos.h \
+ composite.h w32.h blockinput.h atimer.h systime.h frame.h termhooks.h \
+ buffer.h
+casefiddle.o: casefiddle.c syntax.h commands.h buffer.h character.h \
+ composite.h keymap.h lisp.h $(config_h)
+casetab.o: casetab.c buffer.h character.h lisp.h $(config_h)
+category.o: category.c category.h buffer.h charset.h keymap.h \
+ character.h lisp.h $(config_h)
+ccl.o: ccl.c ccl.h charset.h character.h coding.h composite.h lisp.h $(config_h)
+character.o: character.c character.h buffer.h charset.h composite.h disptab.h \
+ lisp.h $(config_h)
+charset.o: charset.c charset.h character.h buffer.h coding.h composite.h \
+ disptab.h lisp.h $(config_h)
+chartab.o: charset.h character.h ccl.h lisp.h $(config_h)
+coding.o: coding.c coding.h ccl.h buffer.h character.h charset.h composite.h \
+ window.h dispextern.h frame.h termhooks.h lisp.h $(config_h)
+cm.o: cm.c frame.h cm.h termhooks.h termchar.h dispextern.h lisp.h $(config_h)
+cmds.o: cmds.c syntax.h buffer.h character.h commands.h window.h lisp.h \
+ $(config_h) msdos.h dispextern.h keyboard.h keymap.h systime.h \
+ coding.h frame.h composite.h
+pre-crt0.o: pre-crt0.c
+dbusbind.o: dbusbind.c termhooks.h frame.h keyboard.h lisp.h $(config_h)
+dired.o: dired.c commands.h buffer.h lisp.h $(config_h) character.h charset.h \
+ coding.h regex.h systime.h blockinput.h atimer.h composite.h
+dispnew.o: dispnew.c systime.h commands.h process.h frame.h coding.h \
+ window.h buffer.h termchar.h termopts.h termhooks.h cm.h \
+ disptab.h indent.h $(INTERVALS_H) nsgui.h \
+ xterm.h blockinput.h atimer.h character.h msdos.h keyboard.h \
+ syssignal.h lisp.h $(config_h)
+doc.o: doc.c lisp.h $(config_h) epaths.h buffer.h keyboard.h keymap.h \
+ character.h systime.h coding.h composite.h
+doprnt.o: doprnt.c character.h lisp.h $(config_h)
+dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \
+ msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \
+ lisp.h $(config_h)
+editfns.o: editfns.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
+ coding.h frame.h blockinput.h atimer.h lisp.h $(config_h)
+emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
+ termhooks.h buffer.h atimer.h systime.h $(INTERVALS_H) lisp.h $(config_h) \
+ window.h dispextern.h keyboard.h keymap.h frame.h coding.h
+fileio.o: fileio.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
+ coding.h msdos.h blockinput.h atimer.h lisp.h $(config_h) frame.h commands.h
+filelock.o: filelock.c buffer.h character.h coding.h systime.h composite.h \
+ lisp.h $(config_h)
+filemode.o: filemode.c $(config_h)
+frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \
+ blockinput.h atimer.h systime.h buffer.h character.h fontset.h font.h \
+ msdos.h dosfns.h dispextern.h w32term.h nsgui.h termchar.h coding.h \
+ composite.h lisp.h $(config_h) termhooks.h ccl.h
+fringe.o: fringe.c dispextern.h nsgui.h frame.h window.h buffer.h termhooks.h \
+ blockinput.h atimer.h systime.h lisp.h $(config_h)
+font.o: font.c dispextern.h frame.h window.h ccl.h character.h charset.h \
+ font.h lisp.h $(config_h) buffer.h composite.h fontset.h xterm.h nsgui.h
+ftfont.o: dispextern.h frame.h character.h charset.h composite.h font.h \
+ lisp.h $(config_h) blockinput.h atimer.h systime.h coding.h fontset.h \
+ ccl.h ftfont.h
+fontset.o: fontset.c fontset.h ccl.h buffer.h character.h \
+ charset.h frame.h keyboard.h termhooks.h font.h lisp.h $(config_h) \
+ blockinput.h atimer.h systime.h coding.h $(INTERVALS_H) nsgui.h \
+ window.h xterm.h
+getloadavg.o: getloadavg.c $(config_h)
+gtkutil.o: gtkutil.c gtkutil.h xterm.h lisp.h frame.h lisp.h $(config_h) \
+ blockinput.h window.h atimer.h systime.h termhooks.h keyboard.h \
+ charset.h coding.h syssignal.h dispextern.h composite.h
+image.o: image.c frame.h window.h dispextern.h blockinput.h atimer.h \
+ systime.h xterm.h w32term.h w32gui.h font.h epaths.h character.h coding.h \
+ nsterm.h nsgui.h lisp.h $(config_h) composite.h termhooks.h ccl.h
+indent.o: indent.c frame.h window.h indent.h buffer.h lisp.h $(config_h) \
+ termchar.h termopts.h disptab.h region-cache.h character.h category.h \
+ keyboard.h systime.h coding.h $(INTERVALS_H)
+insdel.o: insdel.c window.h buffer.h $(INTERVALS_H) blockinput.h character.h \
+ dispextern.h atimer.h systime.h region-cache.h lisp.h $(config_h)
+keyboard.o: keyboard.c termchar.h termhooks.h termopts.h buffer.h character.h \
+ commands.h frame.h window.h macros.h disptab.h keyboard.h syssignal.h \
+ systime.h syntax.h $(INTERVALS_H) blockinput.h atimer.h composite.h \
+ xterm.h puresize.h msdos.h keymap.h w32term.h nsterm.h nsgui.h coding.h \
+ lisp.h $(config_h)
+keymap.o: keymap.c buffer.h commands.h keyboard.h termhooks.h blockinput.h \
+ atimer.h systime.h puresize.h character.h charset.h $(INTERVALS_H) \
+ keymap.h window.h coding.h frame.h lisp.h $(config_h)
+lastfile.o: lastfile.c $(config_h)
+macros.o: macros.c window.h buffer.h commands.h macros.h keyboard.h \
+ dispextern.h lisp.h $(config_h) systime.h coding.h composite.h
+gmalloc.o: gmalloc.c $(config_h)
+ralloc.o: ralloc.c lisp.h $(config_h)
+vm-limit.o: vm-limit.c mem-limits.h lisp.h $(config_h)
+marker.o: marker.c buffer.h character.h lisp.h $(config_h)
+md5.o: md5.c md5.h $(config_h)
+minibuf.o: minibuf.c syntax.h frame.h window.h keyboard.h systime.h \
+ buffer.h commands.h character.h msdos.h $(INTERVALS_H) keymap.h \
+ termhooks.h lisp.h $(config_h) coding.h
+mktime.o: mktime.c $(config_h)
+msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \
+ termopts.h termchar.h character.h coding.h ccl.h disptab.h window.h \
+ keyboard.h $(INTERVALS_H) buffer.h commands.h blockinput.h atimer.h \
+ lisp.h $(config_h)
+nsfns.o: nsfns.m charset.h nsterm.h nsgui.h frame.h window.h buffer.h \
+ dispextern.h fontset.h $(INTERVALS_H) keyboard.h blockinput.h \
+ atimer.h systime.h epaths.h termhooks.h coding.h systime.h lisp.h $(config_h)
+nsfont.o: nsterm.h dispextern.h frame.h lisp.h lisp.h $(config_h)
+nsimage.o: nsimage.m nsterm.h lisp.h $(config_h)
+nsmenu.o: nsmenu.m termhooks.h frame.h window.h dispextern.h \
+ nsgui.h keyboard.h blockinput.h atimer.h systime.h buffer.h \
+ nsterm.h lisp.h $(config_h)
+nsterm.o: nsterm.m blockinput.h atimer.h systime.h syssignal.h nsterm.h \
+ nsgui.h frame.h charset.h ccl.h dispextern.h fontset.h termhooks.h \
+ termopts.h termchar.h disptab.h buffer.h window.h keyboard.h \
+ $(INTERVALS_H) process.h coding.h lisp.h $(config_h)
+nsselect.o: nsselect.m blockinput.h nsterm.h nsgui.h frame.h lisp.h $(config_h)
+process.o: process.c process.h buffer.h window.h termhooks.h termopts.h \
+ commands.h syssignal.h systime.h systty.h syswait.h frame.h dispextern.h \
+ blockinput.h atimer.h charset.h coding.h ccl.h msdos.h composite.h \
+ keyboard.h lisp.h $(config_h) character.h xgselect.h sysselect.h
+regex.o: regex.c syntax.h buffer.h lisp.h $(config_h) regex.h \
+ category.h character.h
+region-cache.o: region-cache.c buffer.h region-cache.h lisp.h $(config_h)
+scroll.o: scroll.c termchar.h dispextern.h frame.h msdos.h keyboard.h \
+ termhooks.h lisp.h $(config_h) systime.h coding.h composite.h window.h
+search.o: search.c regex.h commands.h buffer.h region-cache.h syntax.h \
+ blockinput.h atimer.h systime.h category.h character.h charset.h \
+ $(INTERVALS_H) \
+ lisp.h $(config_h)
+sound.o: sound.c dispextern.h syssignal.h lisp.h $(config_h) atimer.h systime.h
+strftime.o: strftime.c $(config_h)
+syntax.o: syntax.c syntax.h buffer.h commands.h category.h character.h \
+ keymap.h regex.h $(INTERVALS_H) lisp.h $(config_h)
+sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \
+ process.h dispextern.h termhooks.h termchar.h termopts.h coding.h \
+ frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h lisp.h \
+ $(config_h) composite.h
+term.o: term.c termchar.h termhooks.h termopts.h lisp.h $(config_h) \
+ cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \
+ xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \
+ systty.h syssignal.h $(INTERVALS_H) buffer.h
+termcap.o: termcap.c lisp.h $(config_h)
+terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
+ keyboard.h lisp.h $(config_h) dispextern.h composite.h systime.h
+terminfo.o: terminfo.c lisp.h $(config_h)
+tparam.o: tparam.c lisp.h $(config_h)
+undo.o: undo.c buffer.h commands.h window.h dispextern.h lisp.h $(config_h)
+unexaix.o: unexaix.c lisp.h $(config_h)
+unexalpha.o: unexalpha.c $(config_h)
+unexcw.o: unexcw.c lisp.h $(config_h)
+unexec.o: unexec.c lisp.h $(config_h)
+unexelf.o: unexelf.c $(config_h)
+unexhp9k800.o: unexhp9k800.c $(config_h)
+unexmacosx.o: unexmacosx.c $(config_h)
+unexsol.o: unexsol.c lisp.h $(config_h)
+unexw32.o: unexw32.c $(config_h)
+w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \
+ msdos.h buffer.h charset.h coding.h composite.h lisp.h $(config_h)
+widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \
+ $(srcdir)/../lwlib/lwlib.h lisp.h $(config_h)
+window.o: window.c indent.h commands.h frame.h window.h buffer.h termchar.h \
+ disptab.h keyboard.h msdos.h coding.h termhooks.h \
+ keymap.h blockinput.h atimer.h systime.h $(INTERVALS_H) \
+ xterm.h w32term.h nsterm.h nsgui.h lisp.h $(config_h)
+xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h \
+ coding.h termchar.h frame.h window.h disptab.h termhooks.h character.h \
+ charset.h lisp.h $(config_h) keyboard.h $(INTERVALS_H) region-cache.h \
+ xterm.h w32term.h nsterm.h nsgui.h msdos.h composite.h fontset.h ccl.h \
+ blockinput.h atimer.h systime.h keymap.h font.h
+xfaces.o: xfaces.c dispextern.h frame.h xterm.h buffer.h blockinput.h \
+ window.h character.h charset.h msdos.h dosfns.h composite.h atimer.h \
+ systime.h keyboard.h fontset.h w32term.h nsterm.h coding.h ccl.h \
+ $(INTERVALS_H) nsgui.h termchar.h termhooks.h font.h lisp.h $(config_h)
+xfns.o: xfns.c buffer.h frame.h window.h keyboard.h xterm.h dispextern.h \
+ $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h systime.h epaths.h \
+ character.h charset.h coding.h gtkutil.h lisp.h $(config_h) termhooks.h \
+ fontset.h termchar.h font.h xsettings.h $(INTERVALS_H) ccl.h
+xfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
+ font.h lisp.h $(config_h) atimer.h systime.h fontset.h ccl.h
+xftfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
+ font.h lisp.h $(config_h) atimer.h systime.h fontset.h ccl.h ftfont.h
+ftxfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
+ font.h lisp.h $(config_h) atimer.h systime.h fontset.h ccl.h
+menu.o: menu.c lisp.h keyboard.h keymap.h frame.h termhooks.h blockinput.h \
+ dispextern.h $(srcdir)/../lwlib/lwlib.h xterm.h gtkutil.h menu.h \
+ lisp.h $(config_h) systime.h coding.h composite.h window.h atimer.h nsgui.h
+xmenu.o: xmenu.c xterm.h termhooks.h window.h dispextern.h frame.h buffer.h \
+ charset.h keyboard.h $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h \
+ systime.h gtkutil.h msdos.h coding.h menu.h lisp.h $(config_h) composite.h \
+ keymap.h sysselect.h
+xterm.o: xterm.c xterm.h termhooks.h termopts.h termchar.h window.h buffer.h \
+ dispextern.h frame.h disptab.h blockinput.h atimer.h systime.h syssignal.h \
+ keyboard.h emacs-icon.h character.h charset.h ccl.h fontset.h composite.h \
+ coding.h process.h gtkutil.h font.h fontset.h lisp.h $(config_h) \
+ xsettings.h intervals.h keymap.h xgselect.h sysselect.h
+xselect.o: xselect.c process.h dispextern.h frame.h xterm.h blockinput.h \
+ buffer.h atimer.h systime.h termhooks.h lisp.h $(config_h) keyboard.h \
+ coding.h composite.h
+xgselect.o: xgselect.h systime.h sysselect.h lisp.h $(config_h)
+xrdb.o: xrdb.c lisp.h $(config_h) epaths.h
+xsmfns.o: xsmfns.c lisp.h $(config_h) systime.h sysselect.h termhooks.h \
+ xterm.h lisp.h termopts.h frame.h dispextern.h
+xsettings.o: xterm.h xsettings.h lisp.h frame.h termhooks.h $(config_h) \
+ dispextern.h keyboard.h systime.h coding.h composite.h blockinput.h \
+ atimer.h termopts.h
+
+## The files of Lisp proper.
+alloc.o: alloc.c process.h frame.h window.h buffer.h puresize.h syssignal.h \
+ keyboard.h blockinput.h atimer.h systime.h character.h lisp.h $(config_h) \
+ $(INTERVALS_H) termhooks.h
+bytecode.o: bytecode.c buffer.h syntax.h character.h window.h dispextern.h \
+ frame.h xterm.h lisp.h $(config_h)
+data.o: data.c buffer.h puresize.h character.h syssignal.h keyboard.h frame.h \
+ termhooks.h systime.h coding.h composite.h dispextern.h font.h ccl.h \
+ lisp.h $(config_h)
+eval.o: eval.c commands.h keyboard.h blockinput.h atimer.h systime.h \
+ dispextern.h lisp.h $(config_h) coding.h composite.h xterm.h
+floatfns.o: floatfns.c syssignal.h lisp.h $(config_h)
+fns.o: fns.c commands.h lisp.h $(config_h) frame.h buffer.h character.h \
+ keyboard.h keymap.h window.h dispextern.h $(INTERVALS_H) coding.h md5.h \
+ blockinput.h atimer.h systime.h xterm.h
+print.o: print.c process.h frame.h window.h buffer.h keyboard.h character.h \
+ lisp.h $(config_h) termchar.h $(INTERVALS_H) msdos.h termhooks.h \
+ blockinput.h atimer.h systime.h font.h charset.h coding.h ccl.h
+lread.o: lread.c commands.h keyboard.h buffer.h epaths.h character.h \
+ charset.h lisp.h $(config_h) $(INTERVALS_H) termhooks.h coding.h msdos.h \
+ systime.h frame.h blockinput.h atimer.h
+
+## Text properties support.
+composite.o: composite.c buffer.h character.h coding.h font.h ccl.h \
+ frame.h termhooks.h $(INTERVALS_H) window.h lisp.h $(config_h)
+intervals.o: intervals.c buffer.h $(INTERVALS_H) keyboard.h puresize.h \
+ keymap.h lisp.h $(config_h) systime.h coding.h
+textprop.o: textprop.c buffer.h window.h $(INTERVALS_H) \
+ lisp.h $(config_h)
+
+
+### deps.mk ends here
diff --git a/src/dispextern.h b/src/dispextern.h
index 72c0b2ef41..f0d14c0e48 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -748,21 +748,29 @@ struct glyph_row
/* First position in this row. This is the text position, including
overlay position information etc, where the display of this row
- started, and can thus be less the position of the first glyph
- (e.g. due to invisible text or horizontal scrolling). BIDI Note:
- This is the smallest character position in the row, but not
- necessarily the character that is the leftmost on the display. */
+ started, and can thus be less than the position of the first
+ glyph (e.g. due to invisible text or horizontal scrolling).
+ BIDI Note: In R2L rows, that have its reversed_p flag set, this
+ position is at or beyond the right edge of the row. */
struct display_pos start;
/* Text position at the end of this row. This is the position after
the last glyph on this row. It can be greater than the last
- glyph position + 1, due to truncation, invisible text etc. In an
- up-to-date display, this should always be equal to the start
- position of the next row. BIDI Note: this is the character whose
- buffer position is the largest, but not necessarily the rightmost
- one on the display. */
+ glyph position + 1, due to a newline that ends the line,
+ truncation, invisible text etc. In an up-to-date display, this
+ should always be equal to the start position of the next row.
+ BIDI Note: In R2L rows, this position is at or beyond the left
+ edge of the row. */
struct display_pos end;
+ /* The smallest and the largest buffer positions that contributed to
+ glyphs in this row. Note that due to bidi reordering, these are
+ in general different from the text positions stored in `start'
+ and `end' members above, and also different from the buffer
+ positions recorded in the glyphs displayed the leftmost and
+ rightmost on the screen. */
+ struct text_pos minpos, maxpos;
+
/* Non-zero means the overlay arrow bitmap is on this line.
-1 means use default overlay arrow bitmap, else
it specifies actual fringe bitmap number. */
@@ -947,16 +955,16 @@ struct glyph_row *matrix_row P_ ((struct glyph_matrix *, int));
displayed by ROW, which is not necessarily the smallest horizontal
position. */
-#define MATRIX_ROW_START_CHARPOS(ROW) ((ROW)->start.pos.charpos)
-#define MATRIX_ROW_START_BYTEPOS(ROW) ((ROW)->start.pos.bytepos)
+#define MATRIX_ROW_START_CHARPOS(ROW) ((ROW)->minpos.charpos)
+#define MATRIX_ROW_START_BYTEPOS(ROW) ((ROW)->minpos.bytepos)
/* Return the character/ byte position at which ROW ends. BIDI Note:
this is the largest character/byte position among characters in
ROW, i.e. the last logical-order character displayed by ROW, which
is not necessarily the largest horizontal position. */
-#define MATRIX_ROW_END_CHARPOS(ROW) ((ROW)->end.pos.charpos)
-#define MATRIX_ROW_END_BYTEPOS(ROW) ((ROW)->end.pos.bytepos)
+#define MATRIX_ROW_END_CHARPOS(ROW) ((ROW)->maxpos.charpos)
+#define MATRIX_ROW_END_BYTEPOS(ROW) ((ROW)->maxpos.bytepos)
/* Return the vertical position of ROW in MATRIX. */
@@ -1789,7 +1797,7 @@ struct bidi_it {
EMACS_INT next_en_pos; /* position of next EN char for ET */
EMACS_INT ignore_bn_limit; /* position until which to ignore BNs */
bidi_dir_t sor; /* direction of start-of-run in effect */
- int scan_dir; /* direction of text scan */
+ int scan_dir; /* direction of text scan, 1: forw, -1: back */
int stack_idx; /* index of current data on the stack */
/* Note: Everything from here on is not copied/saved when the bidi
iterator state is saved, pushed, or popped. So only put here
@@ -1968,17 +1976,31 @@ struct composition_it
are not iterating over a composition now. */
int id;
/* If non-negative, character that triggers the automatic
- composition at `stop_pos', and this is an automatic compositoin.
+ composition at `stop_pos', and this is an automatic composition.
If negative, this is a static composition. This is set to -2
temporarily if searching of composition reach a limit or a
newline. */
int ch;
- /* If this an automatic composition, how many characters to look back
- from the position where a character triggering the composition
- exists. */
+ /* If this is an automatic composition, index of a rule for making
+ the automatic composition. Provided that ELT is an element of
+ Vcomposition_function_table for CH, (nth ELT RULE_IDX) is the
+ rule for the composition. */
+ int rule_idx;
+ /* If this is an automatic composition, how many characters to look
+ back from the position where a character triggering the
+ composition exists. */
int lookback;
/* If non-negative, number of glyphs of the glyph-string. */
int nglyphs;
+ /* Nonzero iff the composition is created while buffer is scanned in
+ reverse order, and thus the grapheme clusters must be rendered
+ from the last to the first. */
+ int reversed_p;
+
+ /** The following members contain information about the current
+ grapheme cluster. */
+ /* Position of the first character of the current grapheme cluster. */
+ EMACS_INT charpos;
/* Number of characters and bytes of the current grapheme cluster. */
int nchars, nbytes;
/* Indices of the glyphs for the current grapheme cluster. */
@@ -2864,7 +2886,7 @@ extern EMACS_INT tool_bar_button_relief;
/* Defined in bidi.c */
extern void bidi_init_it P_ ((EMACS_INT, EMACS_INT, struct bidi_it *));
-extern void bidi_get_next_char_visually P_ ((struct bidi_it *));
+extern void bidi_move_to_visually_next P_ ((struct bidi_it *));
extern void bidi_paragraph_init P_ ((bidi_dir_t, struct bidi_it *));
extern int bidi_mirror_char P_ ((int));
@@ -2899,8 +2921,8 @@ void mark_window_display_accurate P_ ((Lisp_Object, int));
void redisplay_preserve_echo_area P_ ((int));
int set_cursor_from_row P_ ((struct window *, struct glyph_row *,
struct glyph_matrix *, int, int, int, int));
-void init_iterator P_ ((struct it *, struct window *, int,
- int, struct glyph_row *, enum face_id));
+void init_iterator P_ ((struct it *, struct window *, EMACS_INT,
+ EMACS_INT, struct glyph_row *, enum face_id));
void init_iterator_to_row_start P_ ((struct it *, struct window *,
struct glyph_row *));
int get_next_display_element P_ ((struct it *));
diff --git a/src/dispnew.c b/src/dispnew.c
index 7ab2bf3581..a8ba199543 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -47,9 +47,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "blockinput.h"
#include "process.h"
-/* I don't know why DEC Alpha OSF1 fail to compile this file if we
- include the following file. */
-/* #include "systty.h" */
#include "syssignal.h"
#ifdef HAVE_X_WINDOWS
@@ -1188,6 +1185,10 @@ increment_row_positions (row, delta, delta_bytes)
MATRIX_ROW_START_BYTEPOS (row) += delta_bytes;
MATRIX_ROW_END_CHARPOS (row) += delta;
MATRIX_ROW_END_BYTEPOS (row) += delta_bytes;
+ CHARPOS (row->start.pos) += delta;
+ BYTEPOS (row->start.pos) += delta_bytes;
+ CHARPOS (row->end.pos) += delta;
+ BYTEPOS (row->end.pos) += delta_bytes;
if (!row->enabled_p)
return;
@@ -1748,13 +1749,19 @@ check_matrix_invariants (w)
/* Check that character and byte positions are in sync. */
xassert (MATRIX_ROW_START_BYTEPOS (row)
== CHAR_TO_BYTE (MATRIX_ROW_START_CHARPOS (row)));
+ xassert (BYTEPOS (row->start.pos)
+ == CHAR_TO_BYTE (CHARPOS (row->start.pos)));
/* CHAR_TO_BYTE aborts when invoked for a position > Z. We can
have such a position temporarily in case of a minibuffer
displaying something like `[Sole completion]' at its end. */
if (MATRIX_ROW_END_CHARPOS (row) < BUF_ZV (current_buffer))
- xassert (MATRIX_ROW_END_BYTEPOS (row)
- == CHAR_TO_BYTE (MATRIX_ROW_END_CHARPOS (row)));
+ {
+ xassert (MATRIX_ROW_END_BYTEPOS (row)
+ == CHAR_TO_BYTE (MATRIX_ROW_END_CHARPOS (row)));
+ xassert (BYTEPOS (row->end.pos)
+ == CHAR_TO_BYTE (CHARPOS (row->end.pos)));
+ }
/* Check that end position of `row' is equal to start position
of next row. */
@@ -1764,6 +1771,8 @@ check_matrix_invariants (w)
== MATRIX_ROW_START_CHARPOS (next));
xassert (MATRIX_ROW_END_BYTEPOS (row)
== MATRIX_ROW_START_BYTEPOS (next));
+ xassert (CHARPOS (row->end.pos) == CHARPOS (next->start.pos));
+ xassert (BYTEPOS (row->end.pos) == BYTEPOS (next->start.pos));
}
row = next;
}
diff --git a/src/editfns.c b/src/editfns.c
index 9f30ea0641..ea279a462f 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1,7 +1,8 @@
/* Lisp functions pertaining to editing.
- Copyright (C) 1985, 1986, 1987, 1989, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1986, 1987, 1989, 1993, 1994, 1995, 1996, 1997,
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -220,6 +221,17 @@ usage: (char-to-string CHAR) */)
return make_string_from_bytes (str, 1, len);
}
+DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0,
+ doc: /* Convert arg BYTE to a string containing that byte. */)
+ (byte)
+ Lisp_Object byte;
+{
+ unsigned char b;
+ CHECK_NUMBER (byte);
+ b = XINT (byte);
+ return make_string_from_bytes (&b, 1, 1);
+}
+
DEFUN ("string-to-char", Fstring_to_char, Sstring_to_char, 1, 1, 0,
doc: /* Convert arg STRING to a character, the first character of that string.
A multibyte character is handled correctly. */)
@@ -4686,6 +4698,7 @@ functions if all the text being accessed has this property. */);
defsubr (&Sgoto_char);
defsubr (&Sstring_to_char);
defsubr (&Schar_to_string);
+ defsubr (&Sbyte_to_string);
defsubr (&Sbuffer_substring);
defsubr (&Sbuffer_substring_no_properties);
defsubr (&Sbuffer_string);
diff --git a/src/emacs.c b/src/emacs.c
index 6b19b45d0b..7e778e2e5f 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -87,6 +87,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#endif
+const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
+const char emacs_version[] = "24.0.50";
+
extern void malloc_warning P_ ((char *));
extern void set_time_zone_rule P_ ((char *));
#ifdef HAVE_INDEX
@@ -180,6 +183,10 @@ Lisp_Object Vprevious_system_messages_locale;
Lisp_Object Vsystem_time_locale;
Lisp_Object Vprevious_system_time_locale;
+/* Copyright and version info. The version number may be updated by
+ Lisp code. */
+Lisp_Object Vemacs_copyright, Vemacs_version;
+
/* If non-zero, emacs should not attempt to use a window-specific code,
but instead should use the virtual terminal under which it was started. */
int inhibit_window_system;
@@ -802,35 +809,43 @@ main (int argc, char **argv)
argc = 0;
while (argv[argc]) argc++;
- if (argmatch (argv, argc, "-version", "--version", 3, NULL, &skip_args)
- /* We don't know the version number unless this is a dumped Emacs.
- So ignore --version otherwise. */
- && initialized)
+ if (argmatch (argv, argc, "-version", "--version", 3, NULL, &skip_args))
{
- Lisp_Object tem, tem2;
- tem = Fsymbol_value (intern_c_string ("emacs-version"));
- tem2 = Fsymbol_value (intern_c_string ("emacs-copyright"));
- if (!STRINGP (tem))
- {
- fprintf (stderr, "Invalid value of `emacs-version'\n");
- exit (1);
- }
- if (!STRINGP (tem2))
+ const char *version, *copyright;
+ if (initialized)
{
- fprintf (stderr, "Invalid value of `emacs-copyright'\n");
- exit (1);
+ Lisp_Object tem, tem2;
+ tem = Fsymbol_value (intern_c_string ("emacs-version"));
+ tem2 = Fsymbol_value (intern_c_string ("emacs-copyright"));
+ if (!STRINGP (tem))
+ {
+ fprintf (stderr, "Invalid value of `emacs-version'\n");
+ exit (1);
+ }
+ if (!STRINGP (tem2))
+ {
+ fprintf (stderr, "Invalid value of `emacs-copyright'\n");
+ exit (1);
+ }
+ else
+ {
+ version = SDATA (tem);
+ copyright = SDATA (tem2);
+ }
}
else
{
- printf ("GNU Emacs %s\n", SDATA (tem));
- printf ("%s\n", SDATA(tem2));
- printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");
- printf ("You may redistribute copies of Emacs\n");
- printf ("under the terms of the GNU General Public License.\n");
- printf ("For more information about these matters, ");
- printf ("see the file named COPYING.\n");
- exit (0);
+ version = emacs_version;
+ copyright = emacs_copyright;
}
+ printf ("GNU Emacs %s\n", version);
+ printf ("%s\n", copyright);
+ printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");
+ printf ("You may redistribute copies of Emacs\n");
+ printf ("under the terms of the GNU General Public License.\n");
+ printf ("For more information about these matters, ");
+ printf ("see the file named COPYING.\n");
+ exit (0);
}
if (argmatch (argv, argc, "-chdir", "--chdir", 2, &ch_to_dir, &skip_args))
if (chdir (ch_to_dir) == -1)
@@ -1528,6 +1543,11 @@ main (int argc, char **argv)
ns_init_paths ();
#endif
+ /* Initialize and GC-protect Vinitial_environment and
+ Vprocess_environment before set_initial_environment fills them
+ in. */
+ if (!initialized)
+ syms_of_callproc ();
/* egetenv is a pretty low-level facility, which may get called in
many circumstances; it seems flimsy to put off initializing it
until calling init_callproc. */
@@ -1577,7 +1597,6 @@ main (int argc, char **argv)
syms_of_callint ();
syms_of_casefiddle ();
syms_of_casetab ();
- syms_of_callproc ();
syms_of_category ();
syms_of_ccl ();
syms_of_character ();
@@ -1704,7 +1723,7 @@ main (int argc, char **argv)
#endif
init_window ();
init_font ();
-
+
if (!initialized)
{
char *file;
@@ -2365,10 +2384,7 @@ decode_env_path (evarname, defalt)
strcpy (p, path);
path = p;
- if ('/' == DIRECTORY_SEP)
- dostounix_filename (path);
- else
- unixtodos_filename (path);
+ dostounix_filename (path);
}
#endif
lpath = Qnil;
@@ -2577,6 +2593,14 @@ This is nil during initialization. */);
doc: /* If non-nil, X resources, Windows Registry settings, and NS defaults are not used. */);
inhibit_x_resources = 0;
+ DEFVAR_LISP ("emacs-copyright", &Vemacs_copyright,
+ doc: /* Short copyright string for this version of Emacs. */);
+ Vemacs_copyright = build_string (emacs_copyright);
+
+ DEFVAR_LISP ("emacs-version", &Vemacs_version,
+ doc: /* Version numbers of this version of Emacs. */);
+ Vemacs_version = build_string (emacs_version);
+
/* Make sure IS_DAEMON starts up as false. */
daemon_pipe[1] = 0;
}
diff --git a/src/eval.c b/src/eval.c
index 2a0330acc3..199c470573 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -3308,6 +3308,21 @@ grow_specpdl ()
specpdl_ptr = specpdl + count;
}
+/* specpdl_ptr->symbol is a field which describes which variable is
+ let-bound, so it can be properly undone when we unbind_to.
+ It can have the following two shapes:
+ - SYMBOL : if it's a plain symbol, it means that we have let-bound
+ a symbol that is not buffer-local (at least at the time
+ the let binding started). Note also that it should not be
+ aliased (i.e. when let-binding V1 that's aliased to V2, we want
+ to record V2 here).
+ - (SYMBOL WHERE . BUFFER) : this means that it is a let-binding for
+ variable SYMBOL which can be buffer-local. WHERE tells us
+ which buffer is affected (or nil if the let-binding affects the
+ global value of the variable) and BUFFER tells us which buffer was
+ current (i.e. if WHERE is non-nil, then BUFFER==WHERE, otherwise
+ BUFFER did not yet have a buffer-local value). */
+
void
specbind (symbol, value)
Lisp_Object symbol, value;
@@ -3339,7 +3354,10 @@ specbind (symbol, value)
set_internal (symbol, value, Qnil, 1);
break;
}
- case SYMBOL_LOCALIZED: case SYMBOL_FORWARDED:
+ case SYMBOL_LOCALIZED:
+ if (SYMBOL_BLV (sym)->frame_local)
+ error ("Frame-local vars cannot be let-bound");
+ case SYMBOL_FORWARDED:
{
Lisp_Object ovalue = find_symbol_value (symbol);
specpdl_ptr->func = 0;
@@ -3376,6 +3394,7 @@ specbind (symbol, value)
/* FIXME: The third value `current_buffer' is only used in
let_shadows_buffer_binding_p which is itself only used
in set_internal for local_if_set. */
+ eassert (NILP (where) || EQ (where, cur_buf));
specpdl_ptr->symbol = Fcons (symbol, Fcons (where, cur_buf));
/* If SYMBOL is a per-buffer variable which doesn't have a
@@ -3460,13 +3479,10 @@ unbind_to (count, value)
Fset_default (symbol, this_binding.old_value);
/* If `where' is non-nil, reset the value in the appropriate
local binding, but only if that binding still exists. */
- else if (BUFFERP (where))
- {
- if (BUFFERP (where)
- ? !NILP (Flocal_variable_p (symbol, where))
- : !NILP (Fassq (symbol, XFRAME (where)->param_alist)))
- set_internal (symbol, this_binding.old_value, where, 1);
- }
+ else if (BUFFERP (where)
+ ? !NILP (Flocal_variable_p (symbol, where))
+ : !NILP (Fassq (symbol, XFRAME (where)->param_alist)))
+ set_internal (symbol, this_binding.old_value, where, 1);
}
/* If variable has a trivial value (no forwarding), we can
just set it. No need to check for constant symbols here,
diff --git a/src/fileio.c b/src/fileio.c
index 85685ebc9c..8c2ee45c07 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -83,10 +83,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#ifdef DOS_NT
-#define CORRECT_DIR_SEPS(s) \
- do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \
- else unixtodos_filename (s); \
- } while (0)
/* On Windows, drive letters must be alphabetic - on DOS, the Netware
redirector allows the six letters between 'Z' and 'a' as well. */
#ifdef MSDOS
@@ -474,7 +470,7 @@ Given a Unix syntax file name, returns a string ending in slash. */)
p = beg + strlen (beg);
}
}
- CORRECT_DIR_SEPS (beg);
+ dostounix_filename (beg);
#endif /* DOS_NT */
return make_specified_string (beg, -1, p - beg, STRING_MULTIBYTE (filename));
@@ -561,12 +557,11 @@ file_name_as_directory (out, in)
/* For Unix syntax, Append a slash if necessary */
if (!IS_DIRECTORY_SEP (out[size]))
{
- /* Cannot use DIRECTORY_SEP, which could have any value */
- out[size + 1] = '/';
+ out[size + 1] = DIRECTORY_SEP;
out[size + 2] = '\0';
}
#ifdef DOS_NT
- CORRECT_DIR_SEPS (out);
+ dostounix_filename (out);
#endif
return out;
}
@@ -627,7 +622,7 @@ directory_file_name (src, dst)
)
dst[slen - 1] = 0;
#ifdef DOS_NT
- CORRECT_DIR_SEPS (dst);
+ dostounix_filename (dst);
#endif
return 1;
}
@@ -1032,10 +1027,9 @@ filesystem tree, not (expand-file-name ".." dirname). */)
if (!lose)
{
#ifdef DOS_NT
- /* Make sure directories are all separated with / or \ as
- desired, but avoid allocation of a new string when not
- required. */
- CORRECT_DIR_SEPS (nm);
+ /* Make sure directories are all separated with /, but
+ avoid allocation of a new string when not required. */
+ dostounix_filename (nm);
#ifdef WINDOWSNT
if (IS_DIRECTORY_SEP (nm[1]))
{
@@ -1381,7 +1375,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
target[0] = '/';
target[1] = ':';
}
- CORRECT_DIR_SEPS (target);
+ dostounix_filename (target);
#endif /* DOS_NT */
result = make_specified_string (target, -1, o - target, multibyte);
@@ -1659,7 +1653,7 @@ those `/' is discarded. */)
bcopy (SDATA (filename), nm, SBYTES (filename) + 1);
#ifdef DOS_NT
- CORRECT_DIR_SEPS (nm);
+ dostounix_filename (nm);
substituted = (strcmp (nm, SDATA (filename)) != 0);
#endif
endp = nm + SBYTES (filename);
@@ -1925,7 +1919,7 @@ A prefix arg makes KEEP-TIME non-nil.
If PRESERVE-UID-GID is non-nil, we try to transfer the
uid and gid of FILE to NEWNAME.
-If PRESERVE-SELINUX-CONTEXT is non-nil and SELinux is enabled
+If PRESERVE-SELINUX-CONTEXT is non-nil and SELinux is enabled
on the system, we copy the SELinux context of FILE to NEWNAME. */)
(file, newname, ok_if_already_exists, keep_time, preserve_uid_gid, preserve_selinux_context)
Lisp_Object file, newname, ok_if_already_exists, keep_time;
@@ -2180,12 +2174,7 @@ DEFUN ("delete-directory-internal", Fdelete_directory_internal,
CHECK_STRING (directory);
directory = Fdirectory_file_name (Fexpand_file_name (directory, Qnil));
-
- if (delete_by_moving_to_trash)
- return call1 (Qmove_file_to_trash, directory);
-
encoded_dir = ENCODE_FILE (directory);
-
dir = SDATA (encoded_dir);
if (rmdir (dir) != 0)
@@ -2194,17 +2183,22 @@ DEFUN ("delete-directory-internal", Fdelete_directory_internal,
return Qnil;
}
-DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 2, "fDelete file: \nP",
+DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 2,
+ "(list (read-file-name \
+ (if (and delete-by-moving-to-trash (null current-prefix-arg)) \
+ \"Move file to trash: \" \"Delete file: \") \
+ nil default-directory (confirm-nonexistent-file-or-buffer)) \
+ (null current-prefix-arg))",
doc: /* Delete file named FILENAME. If it is a symlink, remove the symlink.
If file has multiple names, it continues to exist with the other names.
+TRASH non-nil means to trash the file instead of deleting, provided
+`delete-by-moving-to-trash' is non-nil.
-If optional arg FORCE is non-nil, really delete the file regardless of
-`delete-by-moving-to-trash'. Otherwise, \"deleting\" actually moves
-it to the system's trash can if `delete-by-moving-to-trash' is non-nil.
-Interactively, FORCE is non-nil if called with a prefix arg. */)
- (filename, force)
+When called interactively, TRASH is t if no prefix argument is given.
+With a prefix argument, TRASH is nil. */)
+ (filename, trash)
Lisp_Object filename;
- Lisp_Object force;
+ Lisp_Object trash;
{
Lisp_Object handler;
Lisp_Object encoded_file;
@@ -2221,9 +2215,9 @@ Interactively, FORCE is non-nil if called with a prefix arg. */)
handler = Ffind_file_name_handler (filename, Qdelete_file);
if (!NILP (handler))
- return call2 (handler, Qdelete_file, filename);
+ return call3 (handler, Qdelete_file, filename, trash);
- if (delete_by_moving_to_trash && NILP (force))
+ if (delete_by_moving_to_trash && !NILP (trash))
return call1 (Qmove_file_to_trash, filename);
encoded_file = ENCODE_FILE (filename);
@@ -2241,14 +2235,14 @@ internal_delete_file_1 (ignore)
}
/* Delete file FILENAME, returning 1 if successful and 0 if failed.
- FORCE means to ignore `delete-by-moving-to-trash'. */
+ This ignores `delete-by-moving-to-trash'. */
int
-internal_delete_file (Lisp_Object filename, Lisp_Object force)
+internal_delete_file (Lisp_Object filename)
{
Lisp_Object tem;
- tem = internal_condition_case_2 (Fdelete_file, filename, force,
+ tem = internal_condition_case_2 (Fdelete_file, filename, Qnil,
Qt, internal_delete_file_1);
return NILP (tem);
}
@@ -2342,7 +2336,7 @@ This is what happens in interactive use with M-x. */)
)
call2 (Qdelete_directory, file, Qt);
else
- Fdelete_file (file, Qt);
+ Fdelete_file (file, Qnil);
unbind_to (count, Qnil);
}
else
@@ -5787,11 +5781,6 @@ of file names regardless of the current language environment. */);
Fput (Qfile_date_error, Qerror_message,
make_pure_c_string ("Cannot set file date"));
- DEFVAR_LISP ("directory-sep-char", &Vdirectory_sep_char,
- doc: /* Directory separator character for built-in functions that return file names.
-The value is always ?/. Don't use this variable, just use `/'. */);
- XSETFASTINT (Vdirectory_sep_char, '/');
-
DEFVAR_LISP ("file-name-handler-alist", &Vfile_name_handler_alist,
doc: /* *Alist of elements (REGEXP . HANDLER) for file names handled specially.
If a file name matches REGEXP, then all I/O on that file is done by calling
@@ -5914,8 +5903,10 @@ A non-nil value may result in data loss! */);
DEFVAR_BOOL ("delete-by-moving-to-trash", &delete_by_moving_to_trash,
doc: /* Specifies whether to use the system's trash can.
-When non-nil, the function `move-file-to-trash' will be used by
-`delete-file' and `delete-directory'. */);
+When non-nil, certain file deletion commands use the function
+`move-file-to-trash' instead of deleting files outright.
+This includes interactive calls to `delete-file' and
+`delete-directory' and the Dired deletion commands. */);
delete_by_moving_to_trash = 0;
Qdelete_by_moving_to_trash = intern_c_string ("delete-by-moving-to-trash");
Qmove_file_to_trash = intern_c_string ("move-file-to-trash");
diff --git a/src/fns.c b/src/fns.c
index b4d132ea0c..3f984905d1 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1,7 +1,8 @@
/* Random utility Lisp functions.
Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -514,7 +515,7 @@ concat (nargs, args, target_type, last_special)
So, we record strings that have text properties to be copied
here, and copy the text properties after the concatination. */
struct textprop_rec *textprops = NULL;
- /* Number of elments in textprops. */
+ /* Number of elements in textprops. */
int num_textprops = 0;
USE_SAFE_ALLOCA;
@@ -2280,7 +2281,7 @@ ARRAY is a vector, string, char-table, or bool-vector. */)
if (size != size_byte)
while (p1 < endp)
{
- int this_len = MULTIBYTE_FORM_LENGTH (p1, endp - p1);
+ int this_len = BYTES_BY_CHAR_HEAD (*p1);
if (len != this_len)
error ("Attempt to change byte length of a string");
p1 += this_len;
diff --git a/src/font.c b/src/font.c
index 2d55065e9c..e07dbc5dd1 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2821,6 +2821,14 @@ font_clear_cache (f, cache, driver)
static Lisp_Object scratch_font_spec, scratch_font_prefer;
+/* Check each font-entity in VEC, and return a list of font-entities
+ that satisfy this condition:
+ (1) matches with SPEC and SIZE if SPEC is not nil, and
+ (2) doesn't match with any regexps in Vface_ignored_fonts (if non-nil).
+*/
+
+extern Lisp_Object Vface_ignored_fonts;
+
Lisp_Object
font_delete_unmatched (vec, spec, size)
Lisp_Object vec, spec;
@@ -2833,6 +2841,29 @@ font_delete_unmatched (vec, spec, size)
for (val = Qnil, i = ASIZE (vec) - 1; i >= 0; i--)
{
entity = AREF (vec, i);
+ if (! NILP (Vface_ignored_fonts))
+ {
+ char name[256];
+ Lisp_Object tail, regexp;
+
+ if (font_unparse_xlfd (entity, 0, name, 256) >= 0)
+ {
+ for (tail = Vface_ignored_fonts; CONSP (tail); tail = XCDR (tail))
+ {
+ regexp = XCAR (tail);
+ if (STRINGP (regexp)
+ && fast_c_string_match_ignore_case (regexp, name) >= 0)
+ break;
+ }
+ if (CONSP (tail))
+ continue;
+ }
+ }
+ if (NILP (spec))
+ {
+ val = Fcons (entity, val);
+ continue;
+ }
for (prop = FONT_WEIGHT_INDEX; prop < FONT_SIZE_INDEX; prop++)
if (INTEGERP (AREF (spec, prop))
&& ((XINT (AREF (spec, prop)) >> 8)
@@ -2932,8 +2963,10 @@ font_list_entities (frame, spec)
ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache)));
}
- if (ASIZE (val) > 0 && need_filtering)
- val = font_delete_unmatched (val, spec, size);
+ if (ASIZE (val) > 0
+ && (need_filtering
+ || ! NILP (Vface_ignored_fonts)))
+ val = font_delete_unmatched (val, need_filtering ? spec : Qnil, size);
if (ASIZE (val) > 0)
list = Fcons (val, list);
}
@@ -3961,7 +3994,7 @@ font_range (pos, limit, w, face, string)
struct face *face;
Lisp_Object string;
{
- EMACS_INT pos_byte, ignore, start, start_byte;
+ EMACS_INT pos_byte, ignore;
int c;
Lisp_Object font_object = Qnil;
@@ -3983,7 +4016,6 @@ font_range (pos, limit, w, face, string)
pos_byte = string_char_to_byte (string, pos);
}
- start = pos, start_byte = pos_byte;
while (pos < *limit)
{
Lisp_Object category;
@@ -3992,6 +4024,10 @@ font_range (pos, limit, w, face, string)
FETCH_CHAR_ADVANCE_NO_CHECK (c, pos, pos_byte);
else
FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string, pos, pos_byte);
+ category = CHAR_TABLE_REF (Vunicode_category_table, c);
+ if (EQ (category, QCf)
+ || CHAR_VARIATION_SELECTOR_P (c))
+ continue;
if (NILP (font_object))
{
font_object = font_for_char (face, c, pos - 1, string);
@@ -3999,40 +4035,8 @@ font_range (pos, limit, w, face, string)
return Qnil;
continue;
}
-
- category = CHAR_TABLE_REF (Vunicode_category_table, c);
- if (! EQ (category, QCf)
- && ! CHAR_VARIATION_SELECTOR_P (c)
- && font_encode_char (font_object, c) == FONT_INVALID_CODE)
- {
- Lisp_Object f = font_for_char (face, c, pos - 1, string);
- EMACS_INT i, i_byte;
-
-
- if (NILP (f))
- {
- *limit = pos - 1;
- return font_object;
- }
- i = start, i_byte = start_byte;
- while (i < pos - 1)
- {
-
- if (NILP (string))
- FETCH_CHAR_ADVANCE_NO_CHECK (c, i, i_byte);
- else
- FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string, i, i_byte);
- category = CHAR_TABLE_REF (Vunicode_category_table, c);
- if (! EQ (category, QCf)
- && ! CHAR_VARIATION_SELECTOR_P (c)
- && font_encode_char (f, c) == FONT_INVALID_CODE)
- {
- *limit = pos - 1;
- return font_object;
- }
- }
- font_object = f;
- }
+ if (font_encode_char (font_object, c) == FONT_INVALID_CODE)
+ *limit = pos - 1;
}
return font_object;
}
diff --git a/src/fringe.c b/src/fringe.c
index 6dcacbbcd3..dcb4705e2e 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -730,7 +730,7 @@ get_logical_fringe_bitmap (w, bitmap, right_p, partial_p)
Elements are:
BITMAP -- use for all
(L R) -- use for left right (whether partial or not)
- (L R PL PR) -- use for left rigth partial-left partial-right
+ (L R PL PR) -- use for left right partial-left partial-right
If any value in local binding is not present or t, use global value.
If partial, lookup partial bitmap in default value if not found here.
diff --git a/src/gmalloc.c b/src/gmalloc.c
index 6445c56e6d..a3f533bd5e 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -42,8 +42,7 @@ Fifth Floor, Boston, MA 02110-1301, USA.
#endif
#if ((defined __cplusplus || (defined (__STDC__) && __STDC__) \
- || defined STDC_HEADERS || defined PROTOTYPES) \
- && ! defined (BROKEN_PROTOTYPES))
+ || defined STDC_HEADERS || defined PROTOTYPES))
#undef PP
#define PP(args) args
#undef __ptr_t
diff --git a/src/image.c b/src/image.c
index 3ba3655983..1ed2fc84af 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1582,29 +1582,56 @@ clear_image_cache (struct frame *f, Lisp_Object filter)
{
struct image_cache *c = FRAME_IMAGE_CACHE (f);
- if (c && (!NILP (filter) || INTEGERP (Vimage_cache_eviction_delay)))
+ if (c)
{
- EMACS_TIME t;
- unsigned long old;
- int i, nfreed;
-
- EMACS_GET_TIME (t);
- old = EMACS_SECS (t) - XFASTINT (Vimage_cache_eviction_delay);
+ int i, nfreed = 0;
/* Block input so that we won't be interrupted by a SIGIO
while being in an inconsistent state. */
BLOCK_INPUT;
- for (i = nfreed = 0; i < c->used; ++i)
+ if (!NILP (filter))
{
- struct image *img = c->images[i];
- if (img != NULL
- && (NILP (filter) ? img->timestamp < old
- : (EQ (Qt, filter)
- || !NILP (Fmember (filter, img->dependencies)))))
+ /* Filter image cache. */
+ for (i = 0; i < c->used; ++i)
{
- free_image (f, img);
- ++nfreed;
+ struct image *img = c->images[i];
+ if (img && (EQ (Qt, filter)
+ || !NILP (Fmember (filter, img->dependencies))))
+ {
+ free_image (f, img);
+ ++nfreed;
+ }
+ }
+ }
+ else if (INTEGERP (Vimage_cache_eviction_delay))
+ {
+ /* Free cache based on timestamp. */
+ EMACS_TIME t;
+ unsigned long old;
+ int delay, nimages = 0;
+
+ for (i = 0; i < c->used; ++i)
+ if (c->images[i])
+ nimages++;
+
+ /* If the number of cached images has grown unusually large,
+ decrease the cache eviction delay (Bug#6230). */
+ delay = XFASTINT (Vimage_cache_eviction_delay);
+ if (nimages > 40)
+ delay = max (1, 1600 * delay / (nimages*nimages));
+
+ EMACS_GET_TIME (t);
+ old = EMACS_SECS (t) - delay;
+
+ for (i = 0; i < c->used; ++i)
+ {
+ struct image *img = c->images[i];
+ if (img && img->timestamp < old)
+ {
+ free_image (f, img);
+ ++nfreed;
+ }
}
}
@@ -1662,11 +1689,13 @@ which is then usually a filename. */)
}
-DEFUN ("image-refresh", Fimage_refresh, Simage_refresh,
+DEFUN ("image-flush", Fimage_flush, Simage_flush,
1, 2, 0,
- doc: /* Refresh the image with specification SPEC on frame FRAME.
-If SPEC specifies an image file, the displayed image is updated with
-the current contents of that file.
+ doc: /* Fush the image with specification SPEC on frame FRAME.
+This removes the image from the Emacs image cache. If SPEC specifies
+an image file, the next redisplay of this image will read from the
+current contents of that file.
+
FRAME nil or omitted means use the selected frame.
FRAME t means refresh the image on all frames. */)
(spec, frame)
@@ -8979,7 +9008,7 @@ non-numeric, there is no explicit limit on the size of images. */);
defsubr (&Simagemagick_types);
#endif
defsubr (&Sclear_image_cache);
- defsubr (&Simage_refresh);
+ defsubr (&Simage_flush);
defsubr (&Simage_size);
defsubr (&Simage_mask_p);
defsubr (&Simage_metadata);
@@ -9000,17 +9029,19 @@ A cross is always drawn on black & white displays. */);
Vx_bitmap_file_path = decode_env_path ((char *) 0, PATH_BITMAPS);
DEFVAR_LISP ("image-cache-eviction-delay", &Vimage_cache_eviction_delay,
- doc: /* Time after which cached images are removed from the cache.
-When an image has not been displayed this many seconds, remove it
-from the image cache. Value must be an integer or nil with nil
-meaning don't clear the cache. */);
- Vimage_cache_eviction_delay = make_number (30 * 60);
+ doc: /* Maximum time after which images are removed from the cache.
+When an image has not been displayed this many seconds, Emacs
+automatically removes it from the image cache. If the cache contains
+a large number of images, the actual eviction time may be shorter.
+The value can also be nil, meaning the cache is never cleared.
+The function `clear-image-cache' disregards this variable. */);
+ Vimage_cache_eviction_delay = make_number (300);
+}
#ifdef HAVE_IMAGEMAGICK
DEFVAR_LISP ("imagemagick-render-type", &Vimagemagick_render_type,
doc: /* */);
#endif
-}
void
init_image ()
diff --git a/src/indent.c b/src/indent.c
index a7f41f7e8e..b64eae1c42 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -506,7 +506,7 @@ check_display_width (EMACS_INT pos, EMACS_INT col, EMACS_INT *endpos)
width = XINT (prop) - col;
else if (FLOATP (prop))
width = (int)(XFLOAT_DATA (prop) + 0.5) - col;
-
+
if (width >= 0)
{
EMACS_INT start;
@@ -628,7 +628,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
to this character. */
if (dp != 0
- && ! (multibyte && BASE_LEADING_CODE_P (c))
+ && ! (multibyte && LEADING_CODE_P (c))
&& VECTORP (DISP_CHAR_VECTOR (dp, c)))
{
Lisp_Object charvec;
@@ -679,7 +679,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
col += tab_width;
col = col / tab_width * tab_width;
}
- else if (multibyte && BASE_LEADING_CODE_P (c))
+ else if (multibyte && LEADING_CODE_P (c))
{
/* Start of multi-byte form. */
unsigned char *ptr;
@@ -1577,7 +1577,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
}
if (dp != 0
- && ! (multibyte && BASE_LEADING_CODE_P (c))
+ && ! (multibyte && LEADING_CODE_P (c))
&& VECTORP (DISP_CHAR_VECTOR (dp, c)))
{
charvec = DISP_CHAR_VECTOR (dp, c);
@@ -1683,7 +1683,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
hpos = width;
}
}
- else if (multibyte && BASE_LEADING_CODE_P (c))
+ else if (multibyte && LEADING_CODE_P (c))
{
/* Start of multi-byte form. */
unsigned char *ptr;
diff --git a/src/insdel.c b/src/insdel.c
index 6cc797a12f..2b00de8871 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -437,7 +437,7 @@ adjust_markers_for_insert (EMACS_INT from, EMACS_INT from_byte,
}
/* Adjusting only markers whose insertion-type is t may result in
- - disordered start and end in overlays, and
+ - disordered start and end in overlays, and
- disordered overlays in the slot `overlays_before' of current_buffer. */
if (adjusted)
{
@@ -843,7 +843,7 @@ count_combining_before (const unsigned char *string, EMACS_INT length,
len = 1;
p = BYTE_POS_ADDR (pos_byte - 1);
while (! CHAR_HEAD_P (*p)) p--, len++;
- if (! BASE_LEADING_CODE_P (*p)) /* case (3) */
+ if (! LEADING_CODE_P (*p)) /* case (3) */
return 0;
combining_bytes = BYTES_BY_CHAR_HEAD (*p) - len;
@@ -906,7 +906,7 @@ count_combining_after (const unsigned char *string,
i = pos_byte - 2;
while (i >= 0 && ! CHAR_HEAD_P (p[i]))
i--;
- if (i < 0 || !BASE_LEADING_CODE_P (p[i]))
+ if (i < 0 || !LEADING_CODE_P (p[i]))
return 0;
bytes = BYTES_BY_CHAR_HEAD (p[i]);
@@ -914,7 +914,7 @@ count_combining_after (const unsigned char *string,
? 0
: bytes - (pos_byte - 1 - i + length));
}
- if (!BASE_LEADING_CODE_P (string[i]))
+ if (!LEADING_CODE_P (string[i]))
return 0;
bytes = BYTES_BY_CHAR_HEAD (string[i]) - (length - i);
diff --git a/src/keyboard.c b/src/keyboard.c
index 74efb85685..63372d600e 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11985,7 +11985,7 @@ The value `kill-region' is special; it means that the previous command
was a kill command.
`last-command' has a separate binding for each terminal device.
-See Info node `(elisp)Multiple displays'. */);
+See Info node `(elisp)Multiple Terminals'. */);
DEFVAR_KBOARD ("real-last-command", Vreal_last_command,
doc: /* Same as `last-command', but never altered by Lisp code. */);
@@ -12123,8 +12123,8 @@ untranslated. In a vector, an element which is nil means "no translation".
This is applied to the characters supplied to input methods, not their
output. See also `translation-table-for-input'.
-This variable has a separate binding for each terminal. See Info node
-`(elisp)Multiple displays'. */);
+This variable has a separate binding for each terminal.
+See Info node `(elisp)Multiple Terminals'. */);
DEFVAR_BOOL ("cannot-suspend", &cannot_suspend,
doc: /* Non-nil means to always spawn a subshell instead of suspending.
@@ -12215,7 +12215,7 @@ set up a different keymap for reading the next command.
`overriding-terminal-local-map' has a separate binding for each
terminal device.
-See Info node `(elisp)Multiple displays'. */);
+See Info node `(elisp)Multiple Terminals'. */);
DEFVAR_LISP ("overriding-local-map", &Voverriding_local_map,
doc: /* Keymap that overrides all other local keymaps.
@@ -12243,7 +12243,7 @@ numeric keysym code (sans the \"system-specific\" bit 1<<28)
and SYMBOL is its name.
`system-key-alist' has a separate binding for each terminal device.
-See Info node `(elisp)Multiple displays'. */);
+See Info node `(elisp)Multiple Terminals'. */);
DEFVAR_KBOARD ("local-function-key-map", Vlocal_function_key_map,
doc: /* Keymap that translates key sequences to key sequences during input.
@@ -12269,7 +12269,7 @@ Typing `ESC O P' to `read-key-sequence' would return [f1]. Typing
typing `ESC O P x' would return [f1 x].
`local-function-key-map' has a separate binding for each terminal
-device. See Info node `(elisp)Multiple displays'. If you need to
+device. See Info node `(elisp)Multiple Terminals'. If you need to
define a binding on all terminals, change `function-key-map'
instead. Initially, `local-function-key-map' is an empty keymap that
has `function-key-map' as its parent on all terminal devices. */);
diff --git a/src/keymap.c b/src/keymap.c
index 88e0687272..c3a9d9e5cc 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -22,9 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <setjmp.h>
-#if HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
#include "lisp.h"
#include "commands.h"
#include "buffer.h"
@@ -2829,16 +2826,16 @@ remapped command in the returned list. */)
Lisp_Object found = Qnil;
/* 1 means ignore all menu bindings entirely. */
int nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii);
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
+ struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
/* List of sequences found via remapping. Keep them in a separate
variable, so as to push them later, since we prefer
non-remapped binding. */
Lisp_Object remapped_sequences = Qnil;
/* Whether or not we're handling remapped sequences. This is needed
because remapping is not done recursively by Fcommand_remapping: you
- can't remap and remapped command. */
+ can't remap a remapped command. */
int remapped = 0;
- Lisp_Object tem;
+ Lisp_Object tem = Qnil;
/* Refresh the C version of the modifier preference. */
where_is_preferred_modifier
@@ -2852,17 +2849,25 @@ remapped command in the returned list. */)
else
keymaps = Fcurrent_active_maps (Qnil, Qnil);
- GCPRO5 (definition, keymaps, found, sequences, remapped_sequences);
-
- /* If this command is remapped, then it has no key bindings of its own.
- FIXME: Actually, this is not quite right: if A is remapped to
- `definition', then bindings to A will actually bind the key to
- `definition' despite the remapping from `definition' to something else.
- Another corner case is if `definition' is remapped to itself. */
- if (NILP (no_remap)
- && SYMBOLP (definition)
- && !NILP (Fcommand_remapping (definition, Qnil, keymaps)))
- RETURN_UNGCPRO (Qnil);
+ GCPRO6 (definition, keymaps, found, sequences, remapped_sequences, tem);
+
+ tem = Fcommand_remapping (definition, Qnil, keymaps);
+ /* If `definition' is remapped to tem', then OT1H no key will run
+ that command (since they will run `tem' instead), so we should
+ return nil; but OTOH all keys bound to `definition' (or to `tem')
+ will run the same command.
+ So for menu-shortcut purposes, we want to find all the keys bound (maybe
+ via remapping) to `tem'. But for the purpose of finding the keys that
+ run `definition', then we'd want to just return nil.
+ We choose to make it work right for menu-shortcuts, since it's the most
+ common use.
+ Known bugs: if you remap switch-to-buffer to toto, C-h f switch-to-buffer
+ will tell you that switch-to-buffer is bound to C-x b even though C-x b
+ will run toto instead. And if `toto' is itself remapped to forward-char,
+ then C-h f toto will tell you that it's bound to C-f even though C-f does
+ not run toto and it won't tell you that C-x b does run toto. */
+ if (NILP (no_remap) && !NILP (tem))
+ definition = tem;
if (SYMBOLP (definition)
&& !NILP (firstonly)
diff --git a/src/lisp.h b/src/lisp.h
index 7d329cc754..1941a2471a 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -310,11 +310,10 @@ LISP_MAKE_RVALUE (Lisp_Object o)
return o;
}
#else
-/* This isn't quite right - it keeps the argument as an lvalue.
- Making it const via casting would help avoid code actually
- modifying the location in question, but the casting could cover
- other type-related bugs. */
-#define LISP_MAKE_RVALUE(o) (o)
+/* This is more portable to pre-C99 non-GCC compilers, but for
+ backwards compatibility GCC still accepts an old GNU extension
+ which caused this to only generate a warning. */
+#define LISP_MAKE_RVALUE(o) (0 ? (o) : (o))
#endif
#else /* USE_LISP_UNION_TYPE */
@@ -933,7 +932,7 @@ struct Lisp_Sub_Char_Table
struct Lisp_Vector *next;
/* Depth of this sub char-table. It should be 1, 2, or 3. A sub
- char-table of depth 1 contains 16 elments, and each element
+ char-table of depth 1 contains 16 elements, and each element
covers 4096 (128*32) characters. A sub char-table of depth 2
contains 32 elements, and each element covers 128 characters. A
sub char-table of depth 3 contains 128 elements, and each element
@@ -1140,7 +1139,7 @@ struct Lisp_Hash_Table
Lisp_Object user_cmp_function;
/* Only the fields above are traced normally by the GC. The ones below
- `count'. are special and are either ignored by the GC or traced in
+ `count' are special and are either ignored by the GC or traced in
a special way (e.g. because of weakness). */
/* Number of key/value entries in the table. */
@@ -1327,9 +1326,9 @@ struct Lisp_Buffer_Objfwd
binding into `realvalue' (or through it). Also update
LOADED-BINDING to point to the newly loaded binding.
- `local_if_set' indicates that merely setting the variable creates a local
- binding for the current buffer. Otherwise the latter, setting the
- variable does not do that; only make-local-variable does that. */
+ `local_if_set' indicates that merely setting the variable creates a
+ local binding for the current buffer. Otherwise the latter, setting
+ the variable does not do that; only make-local-variable does that. */
struct Lisp_Buffer_Local_Value
{
@@ -1461,9 +1460,9 @@ struct Lisp_Float
};
#ifdef HIDE_LISP_IMPLEMENTATION
-#define XFLOAT_DATA(f) (XFLOAT (f)->u.data_ + 0)
+#define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data_ : XFLOAT (f)->u.data_)
#else
-#define XFLOAT_DATA(f) (XFLOAT (f)->u.data + 0)
+#define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data : XFLOAT (f)->u.data)
/* This should be used only in alloc.c, which always disables
HIDE_LISP_IMPLEMENTATION. */
#define XFLOAT_INIT(f,n) (XFLOAT (f)->u.data = (n))
@@ -1650,7 +1649,7 @@ typedef struct {
#define CHECK_VECTOR_OR_STRING(x) \
CHECK_TYPE (VECTORP (x) || STRINGP (x), Qarrayp, x)
-#define CHECK_ARRAY(x, Qxxxp) \
+#define CHECK_ARRAY(x, Qxxxp) \
CHECK_TYPE (ARRAYP (x), Qxxxp, x)
#define CHECK_VECTOR_OR_CHAR_TABLE(x) \
@@ -1696,14 +1695,14 @@ typedef struct {
#define XFLOATINT(n) extract_float((n))
-#define CHECK_FLOAT(x) \
+#define CHECK_FLOAT(x) \
CHECK_TYPE (FLOATP (x), Qfloatp, x)
-#define CHECK_NUMBER_OR_FLOAT(x) \
+#define CHECK_NUMBER_OR_FLOAT(x) \
CHECK_TYPE (FLOATP (x) || INTEGERP (x), Qnumberp, x)
#define CHECK_NUMBER_OR_FLOAT_COERCE_MARKER(x) \
- do { if (MARKERP (x)) XSETFASTINT (x, marker_position (x)); \
+ do { if (MARKERP (x)) XSETFASTINT (x, marker_position (x)); \
else CHECK_TYPE (INTEGERP (x) || FLOATP (x), Qnumber_or_marker_p, x); } while (0)
#define CHECK_OVERLAY(x) \
@@ -1793,8 +1792,8 @@ typedef struct {
Lisp_Object, Lisp_Object, Lisp_Object)
#define DEFUN_ARGS_8 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, \
Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object)
-/* Non-zero if OBJ is a Lisp function. */
+/* Non-zero if OBJ is a Lisp function. */
#define FUNCTIONP(OBJ) \
((CONSP (OBJ) && EQ (XCAR (OBJ), Qlambda)) \
|| (SYMBOLP (OBJ) && !NILP (Ffboundp (OBJ))) \
@@ -1863,12 +1862,11 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
If the symbol field is a symbol, it is an ordinary variable binding.
- Otherwise, it should be a structure (SYMBOL WHERE
- . CURRENT-BUFFER), which means having bound a local value while
- CURRENT-BUFFER was active. If WHERE is nil this means we saw the
- default value when binding SYMBOL. WHERE being a buffer or frame
- means we saw a buffer-local or frame-local value. Other values of
- WHERE mean an internal error. */
+ Otherwise, it should be a structure (SYMBOL WHERE . CURRENT-BUFFER),
+ which means having bound a local value while CURRENT-BUFFER was active.
+ If WHERE is nil this means we saw the default value when binding SYMBOL.
+ WHERE being a buffer or frame means we saw a buffer-local or frame-local
+ value. Other values of WHERE mean an internal error. */
typedef Lisp_Object (*specbinding_func) P_ ((Lisp_Object));
@@ -2058,16 +2056,16 @@ extern EMACS_INT memory_full_cons_threshold;
/* Structure for recording stack slots that need marking. */
-/* This is a chain of structures, each of which points at a Lisp_Object variable
- whose value should be marked in garbage collection.
- Normally every link of the chain is an automatic variable of a function,
- and its `val' points to some argument or local variable of the function.
- On exit to the function, the chain is set back to the value it had on entry.
- This way, no link remains in the chain when the stack frame containing the
- link disappears.
+/* This is a chain of structures, each of which points at a Lisp_Object
+ variable whose value should be marked in garbage collection.
+ Normally every link of the chain is an automatic variable of a function,
+ and its `val' points to some argument or local variable of the function.
+ On exit to the function, the chain is set back to the value it had on entry.
+ This way, no link remains in the chain when the stack frame containing the
+ link disappears.
- Every function that can call Feval must protect in this fashion all
- Lisp_Object variables whose contents will be used again. */
+ Every function that can call Feval must protect in this fashion all
+ Lisp_Object variables whose contents will be used again. */
extern struct gcpro *gcprolist;
@@ -2973,7 +2971,7 @@ EXFUN (Ffield_end, 3);
EXFUN (Ffield_string_no_properties, 1);
extern void set_time_zone_rule P_ ((char *));
-/* defined in buffer.c */
+/* Defined in buffer.c */
extern int mouse_face_overlay_overlaps P_ ((Lisp_Object));
extern void nsberror P_ ((Lisp_Object)) NO_RETURN;
EXFUN (Fset_buffer_multibyte, 1);
@@ -3016,7 +3014,7 @@ extern void init_buffer P_ ((void));
extern void syms_of_buffer P_ ((void));
extern void keys_of_buffer P_ ((void));
-/* defined in marker.c */
+/* Defined in marker.c */
EXFUN (Fmarker_position, 1);
EXFUN (Fmarker_buffer, 1);
@@ -3061,7 +3059,7 @@ EXFUN (Fread_file_name, 6);
extern Lisp_Object close_file_unwind P_ ((Lisp_Object));
extern Lisp_Object restore_point_unwind P_ ((Lisp_Object));
extern void report_file_error P_ ((const char *, Lisp_Object)) NO_RETURN;
-extern int internal_delete_file P_ ((Lisp_Object, Lisp_Object));
+extern int internal_delete_file P_ ((Lisp_Object));
extern void syms_of_fileio P_ ((void));
extern Lisp_Object make_temp_name P_ ((Lisp_Object, int));
EXFUN (Fmake_symbolic_link, 3);
@@ -3071,7 +3069,7 @@ extern Lisp_Object Qdelete_file;
extern void syms_of_abbrev P_ ((void));
-/* defined in search.c */
+/* Defined in search.c */
extern void shrink_regexp_cache P_ ((void));
EXFUN (Fstring_match, 3);
extern void restore_search_regs P_ ((void));
@@ -3095,7 +3093,7 @@ extern int find_before_next_newline P_ ((EMACS_INT, EMACS_INT, int));
extern void syms_of_search P_ ((void));
extern void clear_regexp_cache P_ ((void));
-/* defined in minibuf.c */
+/* Defined in minibuf.c */
extern Lisp_Object last_minibuf_string;
extern void choose_minibuf_frame P_ ((void));
@@ -3122,7 +3120,7 @@ EXFUN (Fcall_interactively, 3);
EXFUN (Fprefix_numeric_value, 1);
extern void syms_of_callint P_ ((void));
-/* defined in casefiddle.c */
+/* Defined in casefiddle.c */
EXFUN (Fdowncase, 1);
EXFUN (Fupcase, 1);
@@ -3133,14 +3131,14 @@ EXFUN (Fupcase_initials_region, 2);
extern void syms_of_casefiddle P_ ((void));
extern void keys_of_casefiddle P_ ((void));
-/* defined in casetab.c */
+/* Defined in casetab.c */
EXFUN (Fset_case_table, 1);
EXFUN (Fset_standard_case_table, 1);
extern void init_casetab_once P_ ((void));
extern void syms_of_casetab P_ ((void));
-/* defined in keyboard.c */
+/* Defined in keyboard.c */
extern int echoing;
extern Lisp_Object echo_message_buffer;
@@ -3181,7 +3179,7 @@ extern void keys_of_keyboard P_ ((void));
extern char *push_key_description P_ ((unsigned int, char *, int));
-/* defined in indent.c */
+/* Defined in indent.c */
EXFUN (Fvertical_motion, 2);
EXFUN (Findent_to, 2);
EXFUN (Fcurrent_column, 0);
@@ -3191,7 +3189,7 @@ extern void invalidate_current_column P_ ((void));
extern int indented_beyond_p P_ ((int, int, double));
extern void syms_of_indent P_ ((void));
-/* defined in frame.c */
+/* Defined in frame.c */
#ifdef HAVE_WINDOW_SYSTEM
extern Lisp_Object Vx_resource_name;
extern Lisp_Object Vx_resource_class;
@@ -3234,7 +3232,7 @@ extern void set_frame_buffer_list P_ ((Lisp_Object, Lisp_Object));
extern void frames_bury_buffer P_ ((Lisp_Object));
extern void syms_of_frame P_ ((void));
-/* defined in emacs.c */
+/* Defined in emacs.c */
extern Lisp_Object decode_env_path P_ ((char *, char *));
extern Lisp_Object Vinvocation_name, Vinvocation_directory;
extern Lisp_Object Vbefore_init_time, Vafter_init_time;
@@ -3252,7 +3250,7 @@ void synchronize_system_time_locale P_ ((void));
#define synchronize_system_time_locale()
#endif
void shut_down_emacs P_ ((int, int, Lisp_Object));
-/* Nonzero means don't do interactive redisplay and don't change tty modes */
+/* Nonzero means don't do interactive redisplay and don't change tty modes. */
extern int noninteractive;
/* Nonzero means don't load X resources or Windows Registry settings. */
@@ -3263,12 +3261,12 @@ extern int inhibit_x_resources;
extern int daemon_pipe[2];
#define IS_DAEMON (daemon_pipe[1] != 0)
-/* Nonzero means don't do use window-system-specific display code */
+/* Nonzero means don't do use window-system-specific display code. */
extern int inhibit_window_system;
/* Nonzero means that a filter or a sentinel is running. */
extern int running_asynch_code;
-/* defined in process.c */
+/* Defined in process.c */
EXFUN (Fget_process, 1);
EXFUN (Fget_buffer_process, 1);
EXFUN (Fprocessp, 1);
@@ -3291,7 +3289,7 @@ extern void init_process P_ ((void));
extern void syms_of_process P_ ((void));
extern void setup_process_coding_systems P_ ((Lisp_Object));
-/* defined in callproc.c */
+/* Defined in callproc.c */
extern Lisp_Object Vexec_path, Vexec_suffixes,
Vexec_directory, Vdata_directory;
extern Lisp_Object Vdoc_directory;
@@ -3302,7 +3300,7 @@ extern void init_callproc P_ ((void));
extern void set_initial_environment P_ ((void));
extern void syms_of_callproc P_ ((void));
-/* defined in doc.c */
+/* Defined in doc.c */
extern Lisp_Object Vdoc_file_name;
EXFUN (Fsubstitute_command_keys, 1);
EXFUN (Fdocumentation, 2);
@@ -3312,7 +3310,7 @@ extern Lisp_Object get_doc_string P_ ((Lisp_Object, int, int));
extern void syms_of_doc P_ ((void));
extern int read_bytecode_char P_ ((int));
-/* defined in bytecode.c */
+/* Defined in bytecode.c */
extern Lisp_Object Qbytecode;
EXFUN (Fbyte_code, 3);
extern void syms_of_bytecode P_ ((void));
@@ -3320,14 +3318,14 @@ extern struct byte_stack *byte_stack_list;
extern void mark_byte_stack P_ ((void));
extern void unmark_byte_stack P_ ((void));
-/* defined in macros.c */
+/* Defined in macros.c */
extern Lisp_Object Qexecute_kbd_macro;
EXFUN (Fexecute_kbd_macro, 3);
EXFUN (Fcancel_kbd_macro_events, 0);
extern void init_macros P_ ((void));
extern void syms_of_macros P_ ((void));
-/* defined in undo.c */
+/* Defined in undo.c */
extern Lisp_Object Qinhibit_read_only;
EXFUN (Fundo_boundary, 0);
extern void truncate_undo_list P_ ((struct buffer *));
@@ -3341,7 +3339,7 @@ extern void record_property_change P_ ((int, int, Lisp_Object, Lisp_Object,
extern void syms_of_undo P_ ((void));
extern Lisp_Object Vundo_outer_limit;
-/* defined in textprop.c */
+/* Defined in textprop.c */
extern Lisp_Object Qfont, Qmouse_face;
extern Lisp_Object Qinsert_in_front_hooks, Qinsert_behind_hooks;
EXFUN (Fnext_single_property_change, 4);
@@ -3358,21 +3356,21 @@ extern Lisp_Object next_single_char_property_change P_ ((Lisp_Object,
Lisp_Object,
Lisp_Object));
-/* defined in menu.c */
+/* Defined in menu.c */
extern void syms_of_menu P_ ((void));
-/* defined in xmenu.c */
+/* Defined in xmenu.c */
EXFUN (Fx_popup_menu, 2);
EXFUN (Fx_popup_dialog, 3);
extern void syms_of_xmenu P_ ((void));
-/* defined in termchar.h */
+/* Defined in termchar.h */
struct tty_display_info;
-/* defined in termhooks.h */
+/* Defined in termhooks.h */
struct terminal;
-/* defined in sysdep.c */
+/* Defined in sysdep.c */
#ifndef HAVE_GET_CURRENT_DIR_NAME
extern char *get_current_dir_name P_ ((void));
#endif
@@ -3396,7 +3394,7 @@ extern int emacs_close P_ ((int));
extern int emacs_read P_ ((int, char *, unsigned int));
extern int emacs_write P_ ((int, const char *, unsigned int));
-/* defined in filelock.c */
+/* Defined in filelock.c */
EXFUN (Funlock_buffer, 0);
EXFUN (Ffile_locked_p, 1);
extern void unlock_all_files P_ ((void));
@@ -3510,16 +3508,10 @@ extern char *egetenv P_ ((char *));
extern void init_system_name P_ ((void));
/* Some systems (e.g., NT) use a different path separator than Unix,
- in addition to a device separator. Default the path separator
+ in addition to a device separator. Set the path separator
to '/', and don't test for a device separator in IS_ANY_SEP. */
-#ifdef WINDOWSNT
-extern Lisp_Object Vdirectory_sep_char;
-#endif
-
-#ifndef DIRECTORY_SEP
#define DIRECTORY_SEP '/'
-#endif
#ifndef IS_DIRECTORY_SEP
#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
#endif
diff --git a/src/lread.c b/src/lread.c
index a04b9679d8..3a77a62b27 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -48,10 +48,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#endif
-#ifndef X_OK
-#define X_OK 01
-#endif
-
#include <math.h>
#ifdef HAVE_SETLOCALE
diff --git a/src/m/alpha.h b/src/m/alpha.h
index 04ad9eaaf8..c57fd0d982 100644
--- a/src/m/alpha.h
+++ b/src/m/alpha.h
@@ -62,8 +62,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef __ELF__
-#undef UNEXEC
-#define UNEXEC unexelf.o
#if !defined(GNU_LINUX) && !defined(__NetBSD__)
#define DATA_START 0x140000000
#endif
@@ -78,9 +76,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define TEXT_START 0x120000000
#define DATA_START 0x140000000
-/* The program to be used for unexec. */
-#define UNEXEC unexalpha.o
-
#endif /* __ELF__ */
/* On the Alpha it's best to avoid including TERMIO since struct
diff --git a/src/m/hp800.h b/src/m/hp800.h
index 9bc361e3cc..3889a1a3e6 100644
--- a/src/m/hp800.h
+++ b/src/m/hp800.h
@@ -29,13 +29,5 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
This flag only matters if you use USE_LISP_UNION_TYPE. */
#define EXPLICIT_SIGN_EXTEND
-/* Systems with GCC don't need to lose. */
-#ifdef __NetBSD__
-# ifdef __GNUC__
-# define alloca __builtin_alloca
-# define HAVE_ALLOCA
-# endif /* __GNUC__ */
-#endif /* __NetBSD__ */
-
/* arch-tag: 809436e6-1645-4b92-b40d-2de5d6e7227c
(do not change this comment) */
diff --git a/src/m/ia64.h b/src/m/ia64.h
index acf6c25844..76e2bb87d8 100644
--- a/src/m/ia64.h
+++ b/src/m/ia64.h
@@ -48,13 +48,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Convert that into an integer that is 100 for a load average of 1.0 */
#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
-#ifdef __ELF__
-#undef UNEXEC
-#define UNEXEC unexelf.o
-#endif
-
-#ifndef NOT_C_CODE
-
#ifdef REL_ALLOC
#ifndef _MALLOC_INTERNAL
/* "char *" because ralloc.c defines it that way. gmalloc.c thinks it
@@ -65,8 +58,6 @@ extern void r_alloc_free ();
#endif /* not _MALLOC_INTERNAL */
#endif /* REL_ALLOC */
-#endif /* not NOT_C_CODE */
-
#define HAVE_TEXT_START
/* arch-tag: 9b8e9fb2-2e49-4c22-b68f-11a488e77c66
diff --git a/src/m/ibms390.h b/src/m/ibms390.h
index 1dce4ffbf4..087607b547 100644
--- a/src/m/ibms390.h
+++ b/src/m/ibms390.h
@@ -1,4 +1,4 @@
-/* machine description file template.
+/* Machine description file for IBM S390 in 32-bit mode
Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010 Free Software Foundation, Inc.
diff --git a/src/m/ibms390x.h b/src/m/ibms390x.h
index fda3007cb7..6cbfbbcdbd 100644
--- a/src/m/ibms390x.h
+++ b/src/m/ibms390x.h
@@ -1,4 +1,4 @@
-/* machine description file for IBM S390 in 64-bit mode
+/* Machine description file for IBM S390 in 64-bit mode
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
@@ -18,17 +18,11 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* This file was made by copying the significant parts of amdx86-64.h
- into ibms390.h. */
+#include "ibms390.h"
-/* Used for machine IBM s390 64 bits with opsys gnu-linux. */
#define BITS_PER_LONG 64
#define BITS_PER_EMACS_INT 64
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#define WORDS_BIG_ENDIAN
-
/* Define the type to use. */
#define EMACS_INT long
#define EMACS_UINT unsigned long
@@ -40,30 +34,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
This flag only matters if you use USE_LISP_UNION_TYPE. */
#undef EXPLICIT_SIGN_EXTEND
-/* Data type of load average, as read out of kmem. */
-#define LOAD_AVE_TYPE long
-
-/* Convert that into an integer that is 100 for a load average of 1.0 */
-#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
-
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
- pure and impure space as loaded can vary, and even their
- relative order cannot be relied on.
-
- Otherwise Emacs assumes that text space precedes data space,
- numerically. */
-#define VIRT_ADDR_VARIES
-
-/* Define HAVE_ALLOCA to say that the system provides a properly
- working alloca function and it should be used. Undefine it if an
- assembler-language alloca in the file alloca.s should be used. */
-#define HAVE_ALLOCA
-
/* On the 64 bit architecture, we can use 60 bits for addresses */
#define VALBITS 60
-#define LINKER $(CC) -nostdlib
-
/* Define XPNTR to avoid or'ing with DATA_SEG_BITS */
#define XPNTR(a) XUINT (a)
diff --git a/src/m/macppc.h b/src/m/macppc.h
index b9dcf3bdc9..f348286030 100644
--- a/src/m/macppc.h
+++ b/src/m/macppc.h
@@ -32,12 +32,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define HAVE_TEXT_START
#endif
-/* NAKAJI Hiroyuki <[email protected]> says this is needed
- For MkLinux/LinuxPPC. */
-#ifdef GNU_LINUX
-#define LINKER $(CC) -nostdlib
-#endif
-
#ifdef _ARCH_PPC64
#ifndef _LP64
#define _LP64
diff --git a/src/m/template.h b/src/m/template.h
index 9b8d2d6305..3beac1a780 100644
--- a/src/m/template.h
+++ b/src/m/template.h
@@ -58,22 +58,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
code will not be sharable; but that's better than failing completely. */
#define NO_REMAP
-/* Some really obscure 4.2-based systems (like Sequent DYNIX)
- do not support asynchronous I/O (using SIGIO) on sockets,
- even though it works fine on tty's. If you have one of
- these systems, define the following, and then use it in
- config.h (or elsewhere) to decide when (not) to use SIGIO.
-
- You'd think this would go in an operating-system description file,
- but since it only occurs on some, but not all, BSD systems, the
- reasonable place to select for it is in the machine description file. */
-#define NO_SOCK_SIGIO
-
-/* After adding support for a new system, modify the large case
- statement in the `configure' script to recognize reasonable
+/* After adding support for a new machine, modify the large case
+ statement in configure.in to recognize reasonable
configuration names, and add a description of the system to
`etc/MACHINES'.
+ Check for any tests of $machine in configure.in, and add an entry
+ for the new machine if needed.
+
If you've just fixed a problem in an existing configuration file,
you should also check `etc/MACHINES' to make sure its descriptions
of known problems in that configuration should be updated. */
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index 34af372dc5..e8d0872791 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -341,6 +341,8 @@ $(BLD)/bidi.$(O) : \
$(SRC)/bidi.c \
$(CONFIG_H) \
$(SRC)/lisp.h \
+ $(SRC)/bidimirror.h \
+ $(SRC)/biditype.h \
$(SRC)/buffer.h \
$(SRC)/character.h \
$(SRC)/dispextern.h \
diff --git a/src/minibuf.c b/src/minibuf.c
index ad81bfdd0b..539a953f7e 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1589,6 +1589,7 @@ with a space are ignored unless STRING itself starts with a space. */)
tail = collection;
if (type == 2)
{
+ collection = check_obarray (collection);
obsize = XVECTOR (collection)->size;
bucket = XVECTOR (collection)->contents[index];
}
@@ -1612,6 +1613,8 @@ with a space are ignored unless STRING itself starts with a space. */)
{
if (!EQ (bucket, zero))
{
+ if (!SYMBOLP (bucket))
+ error ("Bad data in guts of obarray");
elt = bucket;
eltstring = elt;
if (XSYMBOL (bucket)->next)
diff --git a/src/ns.mk b/src/ns.mk
new file mode 100644
index 0000000000..d674466a40
--- /dev/null
+++ b/src/ns.mk
@@ -0,0 +1,39 @@
+### autodeps.mk --- src/Makefile fragment for GNU Emacs
+
+## Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+
+## This file is part of GNU Emacs.
+
+## GNU Emacs is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+##
+## GNU Emacs is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+### Commentary:
+
+## This is inserted in src/Makefile if HAVE_NS.
+
+## The only reason this is in a separate file is because $ns_appdir,
+## which appears as a target, is empty on non-NS builds. Some makes
+## do not like empty targets, even if they are never used.
+
+${ns_appdir}: ${ns_appsrc}
+ rm -fr ${ns_appdir}
+ mkdir -p ${ns_appdir}
+ ( cd ${ns_appsrc} ; tar cfh - . ) | ( cd ${ns_appdir} ; umask 022; tar xf - )
+
+${ns_appbindir}Emacs: emacs${EXEEXT}
+ mkdir -p ${ns_appbindir}
+ cp -f emacs${EXEEXT} ${ns_appbindir}Emacs
+
+ns-app: ${ns_appdir} ${ns_appbindir}Emacs
+
+### ns.mk ends here
diff --git a/src/nsfns.m b/src/nsfns.m
index 7e7fd48caf..53264a5f59 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -27,7 +27,7 @@ GNUstep port and post-20 update by Adrian Robert ([email protected])
/* This should be the first include, as it may set up #defines affecting
interpretation of even the system includes. */
-#include "config.h"
+#include <config.h>
#include <signal.h>
#include <math.h>
diff --git a/src/nsfont.m b/src/nsfont.m
index 59d5ee73db..db2399a7fa 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -22,7 +22,7 @@ Author: Adrian Robert ([email protected])
/* This should be the first include, as it may set up #defines affecting
interpretation of even the system includes. */
-#include "config.h"
+#include <config.h>
#include <setjmp.h>
#include "lisp.h"
diff --git a/src/nsimage.m b/src/nsimage.m
index 09a78e2080..3e6a8c77ed 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -27,7 +27,7 @@ GNUstep port and post-20 update by Adrian Robert ([email protected])
/* This should be the first include, as it may set up #defines affecting
interpretation of even the system includes. */
-#include "config.h"
+#include <config.h>
#include <setjmp.h>
#include "lisp.h"
diff --git a/src/nsselect.m b/src/nsselect.m
index e4f5f0c613..b034eacf77 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -27,7 +27,7 @@ GNUstep port and post-20 update by Adrian Robert ([email protected])
/* This should be the first include, as it may set up #defines affecting
interpretation of even the system includes. */
-#include "config.h"
+#include <config.h>
#include <setjmp.h>
#include "lisp.h"
diff --git a/src/nsterm.m b/src/nsterm.m
index 7bc82e9610..14b824057d 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -27,7 +27,7 @@ GNUstep port and post-20 update by Adrian Robert ([email protected])
/* This should be the first include, as it may set up #defines affecting
interpretation of even the system includes. */
-#include "config.h"
+#include <config.h>
#include <math.h>
#include <sys/types.h>
diff --git a/src/process.c b/src/process.c
index a09ac297a2..22b85ff591 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2487,9 +2487,11 @@ conv_lisp_to_sockaddr (family, address, sa, len)
ip6[i] = ntohs (j);
}
sa->sa_family = family;
+ return;
}
#endif
- return;
+ else
+ return;
}
else if (STRINGP (address))
{
@@ -3347,11 +3349,25 @@ usage: (make-network-process &rest ARGS) */)
/* :service SERVICE -- string, integer (port number), or t (random port). */
service = Fplist_get (contact, QCservice);
+ /* :host HOST -- hostname, ip address, or 'local for localhost. */
+ host = Fplist_get (contact, QChost);
+ if (!NILP (host))
+ {
+ if (EQ (host, Qlocal))
+ host = build_string ("localhost");
+ CHECK_STRING (host);
+ }
+
#ifdef HAVE_LOCAL_SOCKETS
if (family == AF_LOCAL)
{
- /* Host is not used. */
- host = Qnil;
+ if (!NILP (host))
+ {
+ message (":family local ignores the :host \"%s\" property",
+ SDATA (host));
+ contact = Fplist_put (contact, QChost, Qnil);
+ host = Qnil;
+ }
CHECK_STRING (service);
bzero (&address_un, sizeof address_un);
address_un.sun_family = AF_LOCAL;
@@ -3362,15 +3378,6 @@ usage: (make-network-process &rest ARGS) */)
}
#endif
- /* :host HOST -- hostname, ip address, or 'local for localhost. */
- host = Fplist_get (contact, QChost);
- if (!NILP (host))
- {
- if (EQ (host, Qlocal))
- host = build_string ("localhost");
- CHECK_STRING (host);
- }
-
/* Slow down polling to every ten seconds.
Some kernels have a bug which causes retrying connect to fail
after a connect. Polling can interfere with gethostbyname too. */
diff --git a/src/regex.c b/src/regex.c
index e59c48aad7..46065dda9e 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -290,7 +290,6 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
# define SWITCH_ENUM_CAST(x) (x)
/* Dummy macros for non-Emacs environments. */
-# define BASE_LEADING_CODE_P(c) (0)
# define CHAR_CHARSET(c) 0
# define CHARSET_LEADING_CODE_BASE(c) 0
# define MAX_MULTIBYTE_LENGTH 1
@@ -300,7 +299,7 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
# define CHAR_HEAD_P(p) (1)
# define SINGLE_BYTE_CHAR_P(c) (1)
# define SAME_CHARSET_P(c1, c2) (1)
-# define MULTIBYTE_FORM_LENGTH(p, s) (1)
+# define BYTES_BY_CHAR_HEAD(p) (1)
# define PREV_CHAR_BOUNDARY(p, limit) ((p)--)
# define STRING_CHAR(p) (*(p))
# define RE_STRING_CHAR(p, multibyte) STRING_CHAR (p)
@@ -2086,7 +2085,7 @@ struct range_table_work_area
} while (0)
-/* Both FROM and TO are mulitbyte characters. */
+/* Both FROM and TO are multibyte characters. */
#define SETUP_MULTIBYTE_RANGE(work_area, FROM, TO) \
do { \
@@ -3805,7 +3804,7 @@ regex_compile (pattern, size, syntax, bufp)
if (c1 != c2 && (c1 = RE_CHAR_TO_UNIBYTE (c2)) >= 0)
c = c1;
- }
+ }
*b++ = c;
len = 1;
}
@@ -4125,7 +4124,7 @@ analyse_first (p, pend, fastmap, multibyte)
if (/* Any leading code can possibly start a character
which doesn't match the specified set of characters. */
not
- ||
+ ||
/* If we can match a character class, we can match any
multibyte characters. */
(CHARSET_RANGE_TABLE_EXISTS_P (&p[-2])
@@ -4643,7 +4642,7 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
{
re_char *p = POS_ADDR_VSTRING (startpos);
re_char *pend = STOP_ADDR_VSTRING (startpos);
- int len = MULTIBYTE_FORM_LENGTH (p, pend - p);
+ int len = BYTES_BY_CHAR_HEAD (*p);
range -= len;
if (range < 0)
diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h
index cdb97b7f9f..48f43126fd 100644
--- a/src/s/aix4-2.h
+++ b/src/s/aix4-2.h
@@ -52,20 +52,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
functions. Almost, but not quite the same as the 4.2 functions. */
#define SYSV_SYSTEM_DIR
-/* Define this symbol if your system has the functions bcopy, etc. */
-#define BSTRING
-
/* The file containing the kernel's symbol table is called /unix. */
#define KERNEL_FILE "/unix"
/* The kernel symbol where the load average is found is named avenrun. */
#define LDAV_SYMBOL "avenrun"
-/* Special itemss needed to make Emacs run on this system. */
-
-#ifndef __GNUC__
-#define LINKER cc
-#endif
+/* Special items needed to make Emacs run on this system. */
/* The following definition seems to be needed in AIX version 3.1.6.8.
It may not have been needed in certain earlier versions. */
@@ -108,9 +101,5 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
to avoid a crash just use the Emacs implementation for that function. */
#define BROKEN_GET_CURRENT_DIR_NAME 1
-#define UNEXEC unexaix.o
-
-#define ORDINARY_LINK
-
/* arch-tag: 38fe75ea-6aef-42bd-8449-bc34d921a562
(do not change this comment) */
diff --git a/src/s/bsd-common.h b/src/s/bsd-common.h
index 2a8934d7f5..ffb7a63748 100644
--- a/src/s/bsd-common.h
+++ b/src/s/bsd-common.h
@@ -47,8 +47,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define SYSV_SYSTEM_DIR
-#define UNEXEC unexelf.o
-
/* If the system's imake configuration file defines `NeedWidePrototypes'
as `NO', we must define NARROWPROTO manually. Such a define is
generated in the Makefile generated by `xmkmf'. If we don't
@@ -73,9 +71,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
#define HAVE_SOCKETS
-/* Define this symbol if your system has the functions bcopy, etc. */
-#define BSTRING
-
/* Define CLASH_DETECTION if you want lock files to be written
so that Emacs can tell instantly when you try to modify
a file that someone else has modified in his Emacs. */
diff --git a/src/s/cygwin.h b/src/s/cygwin.h
index e2afb7ddc4..93df925fca 100644
--- a/src/s/cygwin.h
+++ b/src/s/cygwin.h
@@ -1,7 +1,7 @@
/* System description header file for Cygwin.
Copyright (C) 1985, 1986, 1992, 1999, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* SYSTEM_TYPE should indicate the kind of system you are using.
- It sets the Lisp variable system-type. */
+ It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "cygwin"
/* Emacs can read input using SIGIO and buffering characters itself,
@@ -73,9 +73,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
} \
while (0)
-/* Define this symbol if your system has the functions bcopy, etc. */
-#define BSTRING
-
/* Define CLASH_DETECTION if you want lock files to be written
so that Emacs can tell instantly when you try to modify
a file that someone else has modified in his Emacs. */
@@ -93,8 +90,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
#define SYSV_SYSTEM_DIR 1
-#define UNEXEC unexcw.o
-#define LINKER $(CC)
#define HAVE_SOCKETS
diff --git a/src/s/darwin.h b/src/s/darwin.h
index 76c0054cd3..5c8db1242e 100644
--- a/src/s/darwin.h
+++ b/src/s/darwin.h
@@ -99,9 +99,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
for process-connection-type dependent on the kernel version. */
#define MIN_PTY_KERNEL_VERSION '7'
-/* Define this symbol if your system has the functions bcopy, etc. */
-#define BSTRING
-
/* Define CLASH_DETECTION if you want lock files to be written
so that Emacs can tell instantly when you try to modify
a file that someone else has modified in his Emacs. */
@@ -123,9 +120,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
#define HAVE_SOCKETS
-/* Definitions for how to dump. Copied from nextstep.h. */
-#define UNEXEC unexmacosx.o
-
/* start_of_text isn't actually used, so make it compile without error. */
#define TEXT_START (0)
@@ -147,9 +141,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#undef HAVE_POSIX_MEMALIGN
#endif
-/* Link this program just by running cc. */
-#define ORDINARY_LINK
-
/* Define the following so emacs symbols will not conflict with those
in the System framework. Otherwise -prebind will not work. */
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h
index 3aa2dc16f4..80092f725f 100644
--- a/src/s/gnu-linux.h
+++ b/src/s/gnu-linux.h
@@ -29,7 +29,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */
-#ifndef NOT_C_CODE
#ifdef emacs
#ifdef HAVE_LINUX_VERSION_H
#include <linux/version.h>
@@ -40,7 +39,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif /* LINUX_VERSION_CODE >= 0x20400 */
#endif /* HAVE_LINUX_VERSION_H */
#endif /* emacs */
-#endif /* NOT_C_CODE */
#if defined HAVE_GRANTPT
#define UNIX98_PTYS
@@ -91,13 +89,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define HAVE_SOCKETS
-/* Define this symbol if your system has the functions bcopy, etc. */
-#define BSTRING
-
/* This is used in list_system_processes. */
#define HAVE_PROCFS 1
-
/* Define CLASH_DETECTION if you want lock files to be written
so that Emacs can tell instantly when you try to modify
a file that someone else has modified in his Emacs. */
@@ -126,18 +120,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
((FILE)->_pptr - (FILE)->_pbase)
#endif /* !_IO_STDIO_H && ! __UCLIBC__ */
-#endif /* emacs */
-#ifdef emacs
#define INTERRUPT_INPUT
-#endif
+#endif /* emacs */
#define SYSV_SYSTEM_DIR /* use dirent.h */
#define POSIX /* affects getpagesize.h and systty.h */
-#define UNEXEC unexelf.o
-
/* This is to work around mysterious gcc failures in some system versions.
It is unlikely that Emacs changes will work around this problem;
therefore, this should remain permanently. */
@@ -147,11 +137,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define NARROWPROTO 1
-/* Use mmap directly for allocating larger buffers. */
-#ifdef DOUG_LEA_MALLOC
-#undef REL_ALLOC
-#endif
-
/* Tell that garbage collector that setjmp is known to save all
registers relevant for conservative garbage collection in the jmp_buf. */
/* Not all the architectures are tested, but there are Debian packages
diff --git a/src/s/gnu.h b/src/s/gnu.h
index 9f6fe52a5d..95b8017ddc 100644
--- a/src/s/gnu.h
+++ b/src/s/gnu.h
@@ -1,6 +1,7 @@
/* Definitions file for GNU Emacs running on the GNU Hurd.
- Copyright (C) 1994, 1995, 1996, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1994, 1995, 1996, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -28,20 +29,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define SIGNALS_VIA_CHARACTERS
-/* Use mmap directly for allocating larger buffers. */
-#ifdef DOUG_LEA_MALLOC
-#undef REL_ALLOC
-#endif
-
-/* GNU needs its own crt0, and libc defines data_start. */
-#define ORDINARY_LINK
+/* libc defines data_start. */
#define DATA_START ({ extern int data_start; (char *) &data_start; })
/* Some losing code fails to include this and then assumes
that because it is braindead that O_RDONLY==0. */
-#ifndef NOT_C_CODE
#include <fcntl.h>
-#endif
#ifdef emacs
#include <stdio.h> /* Get the definition of _IO_STDIO_H. */
diff --git a/src/s/hpux10-20.h b/src/s/hpux10-20.h
index 91988ef672..8d9c73e236 100644
--- a/src/s/hpux10-20.h
+++ b/src/s/hpux10-20.h
@@ -45,12 +45,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
#define HAVE_SOCKETS
-/* Define this symbol if your system has the functions bcopy, etc.
- s800 and later versions of s300 (s200) kernels have equivalents
- of the BSTRING functions of BSD. If your s200 kernel doesn't have
- em comment out this section. */
-#define BSTRING
-
/* Define CLASH_DETECTION if you want lock files to be written
so that Emacs can tell instantly when you try to modify
a file that someone else has modified in his Emacs. */
@@ -68,8 +62,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Some additional system facilities exist. */
#define HAVE_PERROR /* Delete this line for version 6. */
-#define UNEXEC unexhp9k800.o
-
/* This is how to get the device name of the tty end of a pty. */
#define PTY_TTY_NAME_SPRINTF \
sprintf (pty_name, "/dev/pty/tty%c%x", c, i);
diff --git a/src/s/irix6-5.h b/src/s/irix6-5.h
index e9e14f0cf3..1691daa661 100644
--- a/src/s/irix6-5.h
+++ b/src/s/irix6-5.h
@@ -83,8 +83,6 @@ char *_getpty();
/* Tell process_send_signal to use VSUSP instead of VSWTCH. */
#define PREFER_VSUSP
-#define UNEXEC unexelf.o
-
#define NARROWPROTO 1
#define USE_MMAP_FOR_BUFFERS 1
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 2d6cc2f4bd..ea32373e02 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -63,8 +63,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
for received packets, so datagrams are broken too. */
#define BROKEN_DATAGRAM_SOCKETS 1
-/* Define this symbol if your system has the functions bcopy, etc. */
-#define BSTRING
#define bzero(b, l) memset(b, 0, l)
#define bcopy(s, d, l) memmove(d, s, l)
#define bcmp(a, b, l) memcmp(a, b, l)
@@ -95,9 +93,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
your system and must be used only through an encapsulation (which
you should place, by convention, in sysdep.c). */
-/* Define this to be the separator between path elements. */
-#define DIRECTORY_SEP XINT (Vdirectory_sep_char)
-
/* Define this to be the separator between devices and paths. */
#define DEVICE_SEP ':'
diff --git a/src/s/msdos.h b/src/s/msdos.h
index 90f630c862..af27263596 100644
--- a/src/s/msdos.h
+++ b/src/s/msdos.h
@@ -42,9 +42,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
#define SYSV_SYSTEM_DIR
-/* Define this symbol if your system has the functions bcopy, etc. */
-#define BSTRING
-
/* Define this is the compiler understands `volatile'. */
#define HAVE_VOLATILE
@@ -82,8 +79,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
#define _NAIVE_DOS_REGS
-#define ORDINARY_LINK
-
/* command.com does not understand `...` so we define this. */
#define SEPCHAR ';'
diff --git a/src/s/netbsd.h b/src/s/netbsd.h
index b8df9014ec..6f5b24bcfa 100644
--- a/src/s/netbsd.h
+++ b/src/s/netbsd.h
@@ -26,22 +26,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
-#define AMPERSAND_FULL_NAME
-
-/* On post 1.3 releases of NetBSD, gcc -nostdlib also clears
- the library search parth, i.e. it won't search /usr/lib
- for libc and friends. Using -nostartfiles instead avoids
- this problem, and will also work on earlier NetBSD releases. */
-#define LINKER $(CC) -nostartfiles
-
#define DEFAULT_SOUND_DEVICE "/dev/audio"
/* Greg A. Woods <[email protected]> says we must include signal.h
before syssignal.h is included, to work around interface conflicts
that are handled with CPP __RENAME() macro in signal.h. */
-#ifndef NOT_C_CODE
#include <signal.h>
-#endif
/* Don't close pty in process.c to make it as controlling terminal.
It is already a controlling terminal of subprocess, because we did
diff --git a/src/s/sol2-10.h b/src/s/sol2-10.h
index fd74ae798c..7441eaa021 100644
--- a/src/s/sol2-10.h
+++ b/src/s/sol2-10.h
@@ -4,21 +4,6 @@
#define SYSTEM_MALLOC
-/* Use the Solaris dldump() function, called from unexsol.c, to dump
- emacs, instead of the generic ELF dump code found in unexelf.c.
- The resulting binary has a complete symbol table, and is better
- for debugging and other observabilty tools (debuggers, pstack, etc).
-
- If you encounter a problem using dldump(), please consider sending
- a message to the OpenSolaris tools-linking mailing list:
- http://mail.opensolaris.org/mailman/listinfo/tools-linking
-
- It is likely that dldump() works with older Solaris too,
- but this has not been tested, and so, this change is for
- Solaris 10 and newer only at this time. */
-#undef UNEXEC
-#define UNEXEC unexsol.o
-
/* This is used in list_system_processes. */
#define HAVE_PROCFS 1
diff --git a/src/s/sol2-6.h b/src/s/sol2-6.h
index f9a4c44d74..0c30b3d81f 100644
--- a/src/s/sol2-6.h
+++ b/src/s/sol2-6.h
@@ -63,18 +63,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
pty_name[sizeof (pty_name) - 1] = 0; \
}
-/* This is the only known way to avoid some crashes
- that seem to relate to screwed up malloc data
- after deleting a frame. */
-/* rms: I think the problems using ralloc had to do with system
- libraries that called the system malloc even if we linked in the
- GNU malloc. I could not see any way to fix the problem except to
- have just one malloc and that had to be the system one. */
-/* This is not always necessary. Turned off at present for testers to
- identify any problems with gmalloc more accurately. */
-/* #define SYSTEM_MALLOC */
-
-/* Probably OK also on earlier versions. */
#define GC_SETJMP_WORKS 1
#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
diff --git a/src/s/template.h b/src/s/template.h
index 16df03092d..694a104656 100644
--- a/src/s/template.h
+++ b/src/s/template.h
@@ -78,9 +78,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define HAVE_PTYS if the system supports pty devices. */
#define HAVE_PTYS
-/* Define this symbol if your system has the functions bcopy, etc. */
-#define BSTRING
-
/* subprocesses should be undefined if you do NOT want to
have code for asynchronous subprocesses
(as used in M-x compile and M-x shell).
@@ -133,10 +130,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* ============================================================ */
/* After adding support for a new system, modify the large case
- statement in the `configure' script to recognize reasonable
+ statement in configure.in to recognize reasonable
configuration names, and add a description of the system to
`etc/MACHINES'.
+ Check for any tests of $opsys in configure.in, and add an entry
+ for the new system if needed.
+
If you've just fixed a problem in an existing configuration file,
you should also check `etc/MACHINES' to make sure its descriptions
of known problems in that configuration should be updated. */
diff --git a/src/s/usg5-4.h b/src/s/usg5-4.h
index f870086368..e667ffdc10 100644
--- a/src/s/usg5-4.h
+++ b/src/s/usg5-4.h
@@ -61,27 +61,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* The docs for system V/386 suggest v.3 has sigpause, so let's try it. */
#define HAVE_SYSV_SIGPAUSE
-/* If we're using the System V X port, BSD bstring functions will be handy. */
-#ifdef HAVE_X_WINDOWS
-#define BSTRING
-#endif /* HAVE_X_WINDOWS */
-
/* On USG systems signal handlers return void. */
#define SIGTYPE void
-#define ORDINARY_LINK
-
-/* Undump with ELF. */
#undef COFF
-#define UNEXEC unexelf.o
-
/* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct tchars.
But get <termio.h> first to make sure ttold.h doesn't interfere.
And don't try to use SIGIO yet. */
-#ifndef NOT_C_CODE
#include <sys/wait.h>
-#endif
#ifdef emacs
#include <sys/filio.h>
diff --git a/src/search.c b/src/search.c
index 2269afc6d8..736a89258f 100644
--- a/src/search.c
+++ b/src/search.c
@@ -100,10 +100,10 @@ Lisp_Object Vinhibit_changing_match_data;
static void set_search_regs P_ ((EMACS_INT, EMACS_INT));
static void save_search_regs P_ ((void));
-static EMACS_INT simple_search P_ ((int, unsigned char *, int, int,
+static EMACS_INT simple_search P_ ((int, unsigned char *, int, int,
Lisp_Object, EMACS_INT, EMACS_INT,
EMACS_INT, EMACS_INT));
-static EMACS_INT boyer_moore P_ ((int, unsigned char *, int, int,
+static EMACS_INT boyer_moore P_ ((int, unsigned char *, int, int,
Lisp_Object, Lisp_Object,
EMACS_INT, EMACS_INT,
EMACS_INT, EMACS_INT, int));
@@ -281,7 +281,7 @@ compile_pattern (pattern, regp, translate, posix, multibyte)
if (regp)
re_set_registers (&cp->buf, regp, regp->num_regs, regp->start, regp->end);
- /* The compiled pattern can be used both for mulitbyte and unibyte
+ /* The compiled pattern can be used both for multibyte and unibyte
target. But, we have to tell which the pattern is used for. */
cp->buf.target_multibyte = multibyte;
@@ -582,7 +582,7 @@ fast_looking_at (regexp, pos, pos_byte, limit, limit_byte, string)
unsigned char *p1, *p2;
EMACS_INT s1, s2;
EMACS_INT len;
-
+
if (STRINGP (string))
{
if (pos_byte < 0)
diff --git a/src/sysdep.c b/src/sysdep.c
index 1e114655b4..e311d181c9 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -36,9 +36,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif /* HAVE_ALLOCA_H */
#include "lisp.h"
/* Including stdlib.h isn't necessarily enough to get srandom
@@ -61,13 +58,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#endif /* not WINDOWSNT */
-/* Does anyone other than VMS need this? */
-#ifndef fwrite
-#define sys_fwrite fwrite
-#else
-#undef fwrite
-#endif
-
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
@@ -537,15 +527,6 @@ child_setup_tty (out)
s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */
#endif /* AIX */
-#else /* not HAVE_TERMIO */
-
- s.main.sg_flags &= ~(ECHO | CRMOD | ANYP | ALLDELAY | RAW | LCASE
- | CBREAK | TANDEM);
- s.main.sg_flags |= LPASS8;
- s.main.sg_erase = 0377;
- s.main.sg_kill = 0377;
- s.lmode = LLITOUT | s.lmode; /* Don't strip 8th bit */
-
/* We used to enable ICANON (and set VEOF to 04), but this leads to
problems where process.c wants to send EOFs every once in a while
to force the output, which leads to weird effects when the
@@ -558,6 +539,15 @@ child_setup_tty (out)
s.main.c_cc[VMIN] = 1;
s.main.c_cc[VTIME] = 0;
+#else /* not HAVE_TERMIO */
+
+ s.main.sg_flags &= ~(ECHO | CRMOD | ANYP | ALLDELAY | RAW | LCASE
+ | CBREAK | TANDEM);
+ s.main.sg_flags |= LPASS8;
+ s.main.sg_erase = 0377;
+ s.main.sg_kill = 0377;
+ s.lmode = LLITOUT | s.lmode; /* Don't strip 8th bit */
+
#endif /* not HAVE_TERMIO */
EMACS_SET_TTY (out, &s, 0);
@@ -2762,54 +2752,6 @@ rmdir (dpath)
#endif /* !HAVE_RMDIR */
-#ifndef BSTRING
-
-#ifndef bzero
-
-void
-bzero (b, length)
- register char *b;
- register int length;
-{
- while (length-- > 0)
- *b++ = 0;
-}
-
-#endif /* no bzero */
-#endif /* BSTRING */
-
-#if (!defined (BSTRING) && !defined (bcopy)) || defined (NEED_BCOPY)
-#undef bcopy
-
-/* Saying `void' requires a declaration, above, where bcopy is used
- and that declaration causes pain for systems where bcopy is a macro. */
-bcopy (b1, b2, length)
- register char *b1;
- register char *b2;
- register int length;
-{
- while (length-- > 0)
- *b2++ = *b1++;
-}
-#endif /* (!defined (BSTRING) && !defined (bcopy)) || defined (NEED_BCOPY) */
-
-#ifndef BSTRING
-#ifndef bcmp
-int
-bcmp (b1, b2, length) /* This could be a macro! */
- register char *b1;
- register char *b2;
- register int length;
-{
- while (length-- > 0)
- if (*b1++ != *b2++)
- return 1;
-
- return 0;
-}
-#endif /* no bcmp */
-#endif /* not BSTRING */
-
#ifndef HAVE_STRSIGNAL
char *
strsignal (code)
diff --git a/src/systty.h b/src/systty.h
index fcc6cf81e5..39feef9c3d 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -27,17 +27,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef NO_TERMIO
#include <termio.h>
#endif /* not NO_TERMIO */
-#ifndef INCLUDED_FCNTL
-#define INCLUDED_FCNTL
#include <fcntl.h>
-#endif
#else /* not HAVE_TERMIO */
#ifdef HAVE_TERMIOS
#ifndef NO_TERMIO
#include <termio.h>
#endif
#include <termios.h>
-#define INCLUDED_FCNTL
#include <fcntl.h>
#else /* neither HAVE_TERMIO nor HAVE_TERMIOS */
#ifndef DOS_NT
@@ -247,10 +243,8 @@ struct emacs_tty {
expression, so we moved them out to their own functions in sysdep.c. */
#define EMACS_GET_TTY(fd, p) (emacs_get_tty ((fd), (p)))
#define EMACS_SET_TTY(fd, p, waitp) (emacs_set_tty ((fd), (p), (waitp)))
-#ifdef P_ /* Unfortunately this file is sometimes included before lisp.h */
-extern int emacs_get_tty P_ ((int, struct emacs_tty *));
-extern int emacs_set_tty P_ ((int, struct emacs_tty *, int));
-#endif
+extern int emacs_get_tty (int, struct emacs_tty *);
+extern int emacs_set_tty (int, struct emacs_tty *, int);
/* Define EMACS_TTY_TABS_OK. */
diff --git a/src/w32.c b/src/w32.c
index 0f2d8b54e6..0560ce4a6b 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -5700,7 +5700,34 @@ sys_write (int fd, const void * buffer, unsigned int count)
}
else
#endif
- nchars = _write (fd, buffer, count);
+ {
+ /* Some networked filesystems don't like too large writes, so
+ break them into smaller chunks. See the Comments section of
+ the MSDN documentation of WriteFile for details behind the
+ choice of the value of CHUNK below. See also the thread
+ http://thread.gmane.org/gmane.comp.version-control.git/145294
+ in the git mailing list. */
+ const unsigned char *p = buffer;
+ const unsigned chunk = 30 * 1024 * 1024;
+
+ nchars = 0;
+ while (count > 0)
+ {
+ unsigned this_chunk = count < chunk ? count : chunk;
+ int n = _write (fd, p, this_chunk);
+
+ nchars += n;
+ if (n < 0)
+ {
+ nchars = n;
+ break;
+ }
+ else if (n < this_chunk)
+ break;
+ count -= n;
+ p += n;
+ }
+ }
return nchars;
}
diff --git a/src/w32proc.c b/src/w32proc.c
index 9d4d58f123..b8443e5a75 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1762,12 +1762,6 @@ socket connections still exist. */)
/* Some miscellaneous functions that are Windows specific, but not GUI
specific (ie. are applicable in terminal or batch mode as well). */
-/* lifted from fileio.c */
-#define CORRECT_DIR_SEPS(s) \
- do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \
- else unixtodos_filename (s); \
- } while (0)
-
DEFUN ("w32-short-file-name", Fw32_short_file_name, Sw32_short_file_name, 1, 1, 0,
doc: /* Return the short file name version (8.3) of the full path of FILENAME.
If FILENAME does not exist, return nil.
@@ -1786,7 +1780,7 @@ All path elements in FILENAME are converted to their short names. */)
if (GetShortPathName (SDATA (ENCODE_FILE (filename)), shortname, MAX_PATH) == 0)
return Qnil;
- CORRECT_DIR_SEPS (shortname);
+ dostounix_filename (shortname);
return build_string (shortname);
}
@@ -1815,7 +1809,7 @@ All path elements in FILENAME are converted to their long names. */)
if (!w32_get_long_filename (SDATA (ENCODE_FILE (filename)), longname, MAX_PATH))
return Qnil;
- CORRECT_DIR_SEPS (longname);
+ dostounix_filename (longname);
/* If we were passed only a drive, make sure that a slash is not appended
for consistency with directories. Allow for drive mapping via SUBST
diff --git a/src/window.c b/src/window.c
index 882f76d975..c105e37c46 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3611,6 +3611,7 @@ selected window before each command. */)
{
++window_select_count;
XSETFASTINT (w->use_time, window_select_count);
+ record_buffer (w->buffer);
}
if (EQ (window, selected_window))
@@ -3646,8 +3647,6 @@ selected window before each command. */)
selected_window = window;
- if (NILP (norecord))
- record_buffer (w->buffer);
Fset_buffer (w->buffer);
XBUFFER (w->buffer)->last_selected_window = window;
@@ -7291,7 +7290,7 @@ with the relevant frame selected. */);
DEFVAR_LISP ("recenter-redisplay", &Vrecenter_redisplay,
doc: /* If non-nil, then the `recenter' command with a nil argument
-the entire frame to be redrawn; the special value `tty' causes the
+will redraw the entire frame; the special value `tty' causes the
frame to be redrawn only if it is a tty frame. */);
Vrecenter_redisplay = Qtty;
diff --git a/src/xdisp.c b/src/xdisp.c
index cd8ad7bec8..c8043308ec 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -184,7 +184,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
reordering engine which is called by set_iterator_to_next and
returns the next character to display in the visual order. See
commentary on bidi.c for more details. As far as redisplay is
- concerned, the effect of calling bidi_get_next_char_visually, the
+ concerned, the effect of calling bidi_move_to_visually_next, the
main interface of the reordering engine, is that the iterator gets
magically placed on the buffer or string position that is to be
displayed next. In other words, a linear iteration through the
@@ -2598,7 +2598,7 @@ void
init_iterator (it, w, charpos, bytepos, row, base_face_id)
struct it *it;
struct window *w;
- int charpos, bytepos;
+ EMACS_INT charpos, bytepos;
struct glyph_row *row;
enum face_id base_face_id;
{
@@ -3012,7 +3012,7 @@ init_from_display_pos (it, w, pos)
struct window *w;
struct display_pos *pos;
{
- int charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos);
+ EMACS_INT charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos);
int i, overlay_strings_with_newlines = 0;
/* If POS specifies a position in a display vector, this might
@@ -3918,7 +3918,7 @@ handle_invisible_prop (it)
}
do
{
- bidi_get_next_char_visually (&it->bidi_it);
+ bidi_move_to_visually_next (&it->bidi_it);
}
while (it->stop_charpos <= it->bidi_it.charpos
&& it->bidi_it.charpos < newpos);
@@ -5276,7 +5276,7 @@ iterate_out_of_display_property (it)
while (it->bidi_it.charpos >= BEGV
&& it->prev_stop <= it->bidi_it.charpos
&& it->bidi_it.charpos < CHARPOS (it->position))
- bidi_get_next_char_visually (&it->bidi_it);
+ bidi_move_to_visually_next (&it->bidi_it);
/* Record the stop_pos we just crossed, for when we cross it
back, maybe. */
if (it->bidi_it.charpos > CHARPOS (it->position))
@@ -6285,25 +6285,81 @@ set_iterator_to_next (it, reseat_p)
reseat_at_next_visible_line_start (it, 0);
else if (it->cmp_it.id >= 0)
{
- IT_CHARPOS (*it) += it->cmp_it.nchars;
- IT_BYTEPOS (*it) += it->cmp_it.nbytes;
- if (it->bidi_p)
+ /* We are currently getting glyphs from a composition. */
+ int i;
+
+ if (! it->bidi_p)
{
- if (it->bidi_it.new_paragraph)
- bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
- /* Resync the bidi iterator with IT's new position.
- FIXME: this doesn't support bidirectional text. */
- while (it->bidi_it.charpos < IT_CHARPOS (*it))
- bidi_get_next_char_visually (&it->bidi_it);
+ IT_CHARPOS (*it) += it->cmp_it.nchars;
+ IT_BYTEPOS (*it) += it->cmp_it.nbytes;
+ if (it->cmp_it.to < it->cmp_it.nglyphs)
+ {
+ it->cmp_it.from = it->cmp_it.to;
+ }
+ else
+ {
+ it->cmp_it.id = -1;
+ composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
+ IT_BYTEPOS (*it),
+ it->stop_charpos, Qnil);
+ }
+ }
+ else if (! it->cmp_it.reversed_p)
+ {
+ /* Composition created while scanning forward. */
+ /* Update IT's char/byte positions to point to the first
+ character of the next grapheme cluster, or to the
+ character visually after the current composition. */
+ for (i = 0; i < it->cmp_it.nchars; i++)
+ bidi_move_to_visually_next (&it->bidi_it);
+ IT_BYTEPOS (*it) = it->bidi_it.bytepos;
+ IT_CHARPOS (*it) = it->bidi_it.charpos;
+
+ if (it->cmp_it.to < it->cmp_it.nglyphs)
+ {
+ /* Proceed to the next grapheme cluster. */
+ it->cmp_it.from = it->cmp_it.to;
+ }
+ else
+ {
+ /* No more grapheme clusters in this composition.
+ Find the next stop position. */
+ EMACS_INT stop = it->stop_charpos;
+ if (it->bidi_it.scan_dir < 0)
+ /* Now we are scanning backward and don't know
+ where to stop. */
+ stop = -1;
+ composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
+ IT_BYTEPOS (*it), stop, Qnil);
+ }
}
- if (it->cmp_it.to < it->cmp_it.nglyphs)
- it->cmp_it.from = it->cmp_it.to;
else
{
- it->cmp_it.id = -1;
- composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
- IT_BYTEPOS (*it), it->stop_charpos,
- Qnil);
+ /* Composition created while scanning backward. */
+ /* Update IT's char/byte positions to point to the last
+ character of the previous grapheme cluster, or the
+ character visually after the current composition. */
+ for (i = 0; i < it->cmp_it.nchars; i++)
+ bidi_move_to_visually_next (&it->bidi_it);
+ IT_BYTEPOS (*it) = it->bidi_it.bytepos;
+ IT_CHARPOS (*it) = it->bidi_it.charpos;
+ if (it->cmp_it.from > 0)
+ {
+ /* Proceed to the previous grapheme cluster. */
+ it->cmp_it.to = it->cmp_it.from;
+ }
+ else
+ {
+ /* No more grapheme clusters in this composition.
+ Find the next stop position. */
+ EMACS_INT stop = it->stop_charpos;
+ if (it->bidi_it.scan_dir < 0)
+ /* Now we are scanning backward and don't know
+ where to stop. */
+ stop = -1;
+ composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
+ IT_BYTEPOS (*it), stop, Qnil);
+ }
}
}
else
@@ -6317,13 +6373,24 @@ set_iterator_to_next (it, reseat_p)
}
else
{
+ int prev_scan_dir = it->bidi_it.scan_dir;
/* If this is a new paragraph, determine its base
direction (a.k.a. its base embedding level). */
if (it->bidi_it.new_paragraph)
bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
- bidi_get_next_char_visually (&it->bidi_it);
+ bidi_move_to_visually_next (&it->bidi_it);
IT_BYTEPOS (*it) = it->bidi_it.bytepos;
IT_CHARPOS (*it) = it->bidi_it.charpos;
+ if (prev_scan_dir != it->bidi_it.scan_dir)
+ {
+ /* As the scan direction was changed, we must
+ re-compute the stop position for composition. */
+ EMACS_INT stop = it->stop_charpos;
+ if (it->bidi_it.scan_dir < 0)
+ stop = -1;
+ composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
+ IT_BYTEPOS (*it), stop, Qnil);
+ }
}
xassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it)));
}
@@ -6791,7 +6858,7 @@ next_element_from_buffer (it)
/* If we are at the beginning of a line, we can produce the
next element right away. */
bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
- bidi_get_next_char_visually (&it->bidi_it);
+ bidi_move_to_visually_next (&it->bidi_it);
}
else
{
@@ -6809,7 +6876,7 @@ next_element_from_buffer (it)
{
/* Now return to buffer position where we were asked to
get the next display element, and produce that. */
- bidi_get_next_char_visually (&it->bidi_it);
+ bidi_move_to_visually_next (&it->bidi_it);
}
while (it->bidi_it.bytepos != orig_bytepos
&& it->bidi_it.bytepos < ZV_BYTE);
@@ -6820,6 +6887,13 @@ next_element_from_buffer (it)
IT_CHARPOS (*it) = it->bidi_it.charpos;
IT_BYTEPOS (*it) = it->bidi_it.bytepos;
SET_TEXT_POS (it->position, IT_CHARPOS (*it), IT_BYTEPOS (*it));
+ {
+ EMACS_INT stop = it->stop_charpos;
+ if (it->bidi_it.scan_dir < 0)
+ stop = -1;
+ composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
+ IT_BYTEPOS (*it), stop, Qnil);
+ }
}
if (IT_CHARPOS (*it) >= it->stop_charpos)
@@ -6897,6 +6971,7 @@ next_element_from_buffer (it)
/* No face changes, overlays etc. in sight, so just return a
character from current_buffer. */
unsigned char *p;
+ EMACS_INT stop;
/* Maybe run the redisplay end trigger hook. Performance note:
This doesn't seem to cost measurable time. */
@@ -6905,8 +6980,9 @@ next_element_from_buffer (it)
&& IT_CHARPOS (*it) >= it->redisplay_end_trigger_charpos)
run_redisplay_end_trigger_hook (it);
+ stop = it->bidi_it.scan_dir < 0 ? -1 : it->end_charpos;
if (CHAR_COMPOSED_P (it, IT_CHARPOS (*it), IT_BYTEPOS (*it),
- it->end_charpos)
+ stop)
&& next_element_from_composition (it))
{
return 1;
@@ -7024,7 +7100,7 @@ next_element_from_composition (it)
/* Resync the bidi iterator with IT's new position.
FIXME: this doesn't support bidirectional text. */
while (it->bidi_it.charpos < IT_CHARPOS (*it))
- bidi_get_next_char_visually (&it->bidi_it);
+ bidi_move_to_visually_next (&it->bidi_it);
}
return 0;
}
@@ -12410,22 +12486,25 @@ redisplay_internal (preserve_echo_area)
if (windows_or_buffers_changed && !pause)
goto retry;
- /* Clear the face cache eventually. */
- if (consider_all_windows_p)
+ /* Clear the face and image caches.
+
+ We used to do this only if consider_all_windows_p. But the cache
+ needs to be cleared if a timer creates images in the current
+ buffer (e.g. the test case in Bug#6230). */
+
+ if (clear_face_cache_count > CLEAR_FACE_CACHE_COUNT)
{
- if (clear_face_cache_count > CLEAR_FACE_CACHE_COUNT)
- {
- clear_face_cache (0);
- clear_face_cache_count = 0;
- }
+ clear_face_cache (0);
+ clear_face_cache_count = 0;
+ }
+
#ifdef HAVE_WINDOW_SYSTEM
- if (clear_image_cache_count > CLEAR_IMAGE_CACHE_COUNT)
- {
- clear_image_caches (Qnil);
- clear_image_cache_count = 0;
- }
-#endif /* HAVE_WINDOW_SYSTEM */
+ if (clear_image_cache_count > CLEAR_IMAGE_CACHE_COUNT)
+ {
+ clear_image_caches (Qnil);
+ clear_image_cache_count = 0;
}
+#endif /* HAVE_WINDOW_SYSTEM */
end_of_redisplay:
unbind_to (count, Qnil);
@@ -13684,37 +13763,11 @@ try_cursor_movement (window, startp, scroll_step)
++row;
if (!row->enabled_p)
rc = CURSOR_MOVEMENT_MUST_SCROLL;
- /* If rows are bidi-reordered, back up until we find a row
- that does not belong to a continuation line. This is
- because we must consider all rows of a continued line as
- candidates for cursor positioning, since row start and
- end positions change non-linearly with vertical position
- in such rows. */
- /* FIXME: Revisit this when glyph ``spilling'' in
- continuation lines' rows is implemented for
- bidi-reordered rows. */
- if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering))
- {
- while (MATRIX_ROW_CONTINUATION_LINE_P (row))
- {
- xassert (row->enabled_p);
- --row;
- /* If we hit the beginning of the displayed portion
- without finding the first row of a continued
- line, give up. */
- if (row <= w->current_matrix->rows)
- {
- rc = CURSOR_MOVEMENT_MUST_SCROLL;
- break;
- }
-
- }
- }
}
if (rc == CURSOR_MOVEMENT_CANNOT_BE_USED)
{
- int scroll_p = 0;
+ int scroll_p = 0, must_scroll = 0;
int last_y = window_text_bottom_y (w) - this_scroll_margin;
if (PT > XFASTINT (w->last_point))
@@ -13807,10 +13860,41 @@ try_cursor_movement (window, startp, scroll_step)
{
/* if PT is not in the glyph row, give up. */
rc = CURSOR_MOVEMENT_MUST_SCROLL;
+ must_scroll = 1;
+ }
+ else if (rc != CURSOR_MOVEMENT_SUCCESS
+ && !NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+ {
+ /* If rows are bidi-reordered and point moved, back up
+ until we find a row that does not belong to a
+ continuation line. This is because we must consider
+ all rows of a continued line as candidates for the
+ new cursor positioning, since row start and end
+ positions change non-linearly with vertical position
+ in such rows. */
+ /* FIXME: Revisit this when glyph ``spilling'' in
+ continuation lines' rows is implemented for
+ bidi-reordered rows. */
+ while (MATRIX_ROW_CONTINUATION_LINE_P (row))
+ {
+ xassert (row->enabled_p);
+ --row;
+ /* If we hit the beginning of the displayed portion
+ without finding the first row of a continued
+ line, give up. */
+ if (row <= w->current_matrix->rows)
+ {
+ rc = CURSOR_MOVEMENT_MUST_SCROLL;
+ break;
+ }
+
+ }
}
+ if (must_scroll)
+ ;
else if (rc != CURSOR_MOVEMENT_SUCCESS
- && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
- && make_cursor_line_fully_visible_p)
+ && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
+ && make_cursor_line_fully_visible_p)
{
if (PT == MATRIX_ROW_END_CHARPOS (row)
&& !row->ends_at_zv_p
@@ -13836,7 +13920,8 @@ try_cursor_movement (window, startp, scroll_step)
}
else if (scroll_p)
rc = CURSOR_MOVEMENT_MUST_SCROLL;
- else if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+ else if (rc != CURSOR_MOVEMENT_SUCCESS
+ && !NILP (XBUFFER (w->buffer)->bidi_display_reordering))
{
/* With bidi-reordered rows, there could be more than
one candidate row whose start and end positions
@@ -13849,8 +13934,11 @@ try_cursor_movement (window, startp, scroll_step)
do
{
- rv |= set_cursor_from_row (w, row, w->current_matrix,
- 0, 0, 0, 0);
+ if (MATRIX_ROW_START_CHARPOS (row) <= PT
+ && PT <= MATRIX_ROW_END_CHARPOS (row)
+ && cursor_row_p (w, row))
+ rv |= set_cursor_from_row (w, row, w->current_matrix,
+ 0, 0, 0, 0);
/* As soon as we've found the first suitable row
whose ends_at_zv_p flag is set, we are done. */
if (rv
@@ -13861,19 +13949,17 @@ try_cursor_movement (window, startp, scroll_step)
}
++row;
}
- while (MATRIX_ROW_BOTTOM_Y (row) < last_y
- && MATRIX_ROW_START_CHARPOS (row) <= PT
- && PT <= MATRIX_ROW_END_CHARPOS (row)
- && cursor_row_p (w, row));
+ while ((MATRIX_ROW_CONTINUATION_LINE_P (row)
+ && MATRIX_ROW_BOTTOM_Y (row) <= last_y)
+ || (MATRIX_ROW_START_CHARPOS (row) == PT
+ && MATRIX_ROW_BOTTOM_Y (row) < last_y));
/* If we didn't find any candidate rows, or exited the
loop before all the candidates were examined, signal
to the caller that this method failed. */
if (rc != CURSOR_MOVEMENT_SUCCESS
- && (!rv
- || (MATRIX_ROW_START_CHARPOS (row) <= PT
- && PT <= MATRIX_ROW_END_CHARPOS (row))))
- rc = CURSOR_MOVEMENT_CANNOT_BE_USED;
- else
+ && (!rv || MATRIX_ROW_CONTINUATION_LINE_P (row)))
+ rc = CURSOR_MOVEMENT_MUST_SCROLL;
+ else if (rv)
rc = CURSOR_MOVEMENT_SUCCESS;
}
else
@@ -14709,8 +14795,16 @@ redisplay_window (window, just_this_one_p)
(*FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (w);
}
- /* Restore current_buffer and value of point in it. */
- TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint));
+ /* Restore current_buffer and value of point in it. The window
+ update may have changed the buffer, so first make sure `opoint'
+ is still valid (Bug#6177). */
+ if (CHARPOS (opoint) < BEGV)
+ TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
+ else if (CHARPOS (opoint) > ZV)
+ TEMP_SET_PT_BOTH (Z, Z_BYTE);
+ else
+ TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint));
+
set_buffer_internal_1 (old);
/* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become
shorter. This can be caused by log truncation in *Messages*. */
@@ -14883,7 +14977,7 @@ try_window_reusing_current_matrix (w)
/* The variable new_start now holds the new window start. The old
start `start' can be determined from the current matrix. */
SET_TEXT_POS_FROM_MARKER (new_start, w->start);
- start = start_row->start.pos;
+ start = start_row->minpos;
start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix);
/* Clear the desired matrix for the display below. */
@@ -14922,7 +15016,7 @@ try_window_reusing_current_matrix (w)
{
/* Advance to the next row as the "start". */
start_row++;
- start = start_row->start.pos;
+ start = start_row->minpos;
/* If there are no more rows to try, or just one, give up. */
if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1
|| w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row)
@@ -15204,39 +15298,26 @@ try_window_reusing_current_matrix (w)
{
struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos;
struct glyph *end = glyph + row->used[TEXT_AREA];
- struct glyph *orig_glyph = glyph;
- struct cursor_pos orig_cursor = w->cursor;
- for (; glyph < end
- && (!BUFFERP (glyph->object)
- || glyph->charpos != PT);
- glyph++)
+ /* Can't use this optimization with bidi-reordered glyph
+ rows, unless cursor is already at point. */
+ if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering))
{
- w->cursor.hpos++;
- w->cursor.x += glyph->pixel_width;
- }
- /* With bidi reordering, charpos changes non-linearly
- with hpos, so the right glyph could be to the
- left. */
- if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)
- && (!BUFFERP (glyph->object) || glyph->charpos != PT))
- {
- struct glyph *start_glyph = row->glyphs[TEXT_AREA];
-
- glyph = orig_glyph - 1;
- orig_cursor.hpos--;
- orig_cursor.x -= glyph->pixel_width;
- for (; glyph >= start_glyph
- && (!BUFFERP (glyph->object)
- || glyph->charpos != PT);
- glyph--)
- {
- w->cursor.hpos--;
- w->cursor.x -= glyph->pixel_width;
- }
- if (BUFFERP (glyph->object) && glyph->charpos == PT)
- w->cursor = orig_cursor;
+ if (!(w->cursor.hpos >= 0
+ && w->cursor.hpos < row->used[TEXT_AREA]
+ && BUFFERP (glyph->object)
+ && glyph->charpos == PT))
+ return 0;
}
+ else
+ for (; glyph < end
+ && (!BUFFERP (glyph->object)
+ || glyph->charpos < PT);
+ glyph++)
+ {
+ w->cursor.hpos++;
+ w->cursor.x += glyph->pixel_width;
+ }
}
}
@@ -15816,13 +15897,13 @@ try_window_id (w)
as is, without changing glyph positions since no text has
been added/removed in front of the window end. */
r0 = MATRIX_FIRST_TEXT_ROW (current_matrix);
- if (TEXT_POS_EQUAL_P (start, r0->start.pos)
+ if (TEXT_POS_EQUAL_P (start, r0->minpos)
/* PT must not be in a partially visible line. */
&& !(PT >= MATRIX_ROW_START_CHARPOS (row)
&& MATRIX_ROW_BOTTOM_Y (row) > window_text_bottom_y (w)))
{
/* We have to compute the window end anew since text
- can have been added/removed after it. */
+ could have been added/removed after it. */
w->window_end_pos
= make_number (Z - MATRIX_ROW_END_CHARPOS (row));
w->window_end_bytepos
@@ -15854,7 +15935,7 @@ try_window_id (w)
start is not in changed text, otherwise positions would not be
comparable. */
row = MATRIX_FIRST_TEXT_ROW (current_matrix);
- if (!TEXT_POS_EQUAL_P (start, row->start.pos))
+ if (!TEXT_POS_EQUAL_P (start, row->minpos))
GIVE_UP (16);
/* Give up if the window ends in strings. Overlay strings
@@ -17246,7 +17327,7 @@ cursor_row_p (w, row)
{
int cursor_row_p = 1;
- if (PT == MATRIX_ROW_END_CHARPOS (row))
+ if (PT == CHARPOS (row->end.pos))
{
/* Suppose the row ends on a string.
Unless the row is continued, that means it ends on a newline
@@ -17283,14 +17364,15 @@ cursor_row_p (w, row)
{
/* If the row ends in middle of a real character,
and the line is continued, we want the cursor here.
- That's because MATRIX_ROW_END_CHARPOS would equal
+ That's because CHARPOS (ROW->end.pos) would equal
PT if PT is before the character. */
if (!row->ends_in_ellipsis_p)
cursor_row_p = row->continued_p;
else
/* If the row ends in an ellipsis, then
- MATRIX_ROW_END_CHARPOS will equal point after the invisible text.
- We want that position to be displayed after the ellipsis. */
+ CHARPOS (ROW->end.pos) will equal point after the
+ invisible text. We want that position to be displayed
+ after the ellipsis. */
cursor_row_p = 0;
}
/* If the row ends at ZV, display the cursor at the end of that
@@ -17426,122 +17508,87 @@ unproduce_glyphs (it, n)
glyph[-n] = *glyph;
}
-/* Find the positions in a bidi-reordered ROW to serve as ROW->start
- and ROW->end. */
-static struct display_pos
-find_row_end (it, row)
+/* Find the positions in a bidi-reordered ROW to serve as ROW->minpos
+ and ROW->maxpos. */
+static void
+find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos)
struct it *it;
struct glyph_row *row;
+ EMACS_INT min_pos, min_bpos, max_pos, max_bpos;
{
/* FIXME: Revisit this when glyph ``spilling'' in continuation
lines' rows is implemented for bidi-reordered rows. */
- EMACS_INT min_pos = ZV + 1, max_pos = 0;
- struct glyph *g;
- struct it save_it;
- struct text_pos tpos;
- struct display_pos row_end = it->current;
- for (g = row->glyphs[TEXT_AREA];
- g < row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
- g++)
- {
- if (BUFFERP (g->object))
- {
- if (g->charpos > 0 && g->charpos < min_pos)
- min_pos = g->charpos;
- if (g->charpos > max_pos)
- max_pos = g->charpos;
- }
- }
- /* Empty lines have a valid buffer position at their first
- glyph, but that glyph's OBJECT is zero, as if it didn't come
- from a buffer. If we didn't find any valid buffer positions
- in this row, maybe we have such an empty line. */
- if (max_pos == 0 && row->used[TEXT_AREA])
- {
- for (g = row->glyphs[TEXT_AREA];
- g < row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
- g++)
- {
- if (INTEGERP (g->object))
- {
- if (g->charpos > 0 && g->charpos < min_pos)
- min_pos = g->charpos;
- if (g->charpos > max_pos)
- max_pos = g->charpos;
- }
- }
- }
-
- /* ROW->start is the value of min_pos, the minimal buffer position
+ /* ROW->minpos is the value of min_pos, the minimal buffer position
we have in ROW. */
if (min_pos <= ZV)
+ SET_TEXT_POS (row->minpos, min_pos, min_bpos);
+ else
{
- /* Avoid calling the costly CHAR_TO_BYTE if possible. */
- if (min_pos != row->start.pos.charpos)
- SET_TEXT_POS (row->start.pos, min_pos, CHAR_TO_BYTE (min_pos));
- if (max_pos == 0)
- max_pos = min_pos;
+ /* We didn't find _any_ valid buffer positions in any of the
+ glyphs, so we must trust the iterator's computed
+ positions. */
+ row->minpos = row->start.pos;
+ max_pos = CHARPOS (it->current.pos);
+ max_bpos = BYTEPOS (it->current.pos);
}
- /* For ROW->end, we need the position that is _after_ max_pos, in
- the logical order, unless we are at ZV. */
- if (row->ends_at_zv_p)
- {
- if (!row->used[TEXT_AREA])
- row->start.pos = row_end.pos;
- }
- else if (row->used[TEXT_AREA] && max_pos)
- {
- int at_eol_p;
+ if (!max_pos)
+ abort ();
- SET_TEXT_POS (tpos, max_pos, CHAR_TO_BYTE (max_pos));
- save_it = *it;
- it->bidi_p = 0;
- reseat (it, tpos, 0);
- if (!get_next_display_element (it))
- abort (); /* this row cannot be at ZV, see above */
- at_eol_p = ITERATOR_AT_END_OF_LINE_P (it);
- set_iterator_to_next (it, 1);
- row_end = it->current;
- /* If the character at max_pos is not a newline and the
- characters at max_pos+1 is a newline, skip that newline as
- well. Note that this may skip some invisible text. */
- if (!at_eol_p
- && get_next_display_element (it)
- && ITERATOR_AT_END_OF_LINE_P (it))
- {
- set_iterator_to_next (it, 1);
- /* Record the position after the newline of a continued row.
- We will need that to set ROW->end of the last row
- produced for a continued line. */
- if (row->continued_p)
- save_it.eol_pos = it->current.pos;
+ /* Here are the various use-cases for ending the row, and the
+ corresponding values for ROW->maxpos:
+
+ Line ends in a newline from buffer eol_pos + 1
+ Line is continued from buffer max_pos + 1
+ Line is truncated on right it->current.pos
+ Line ends in a newline from string max_pos
+ Line is continued from string max_pos
+ Line is continued from display vector max_pos
+ Line is entirely from a string min_pos == max_pos
+ Line is entirely from a display vector min_pos == max_pos
+ Line that ends at ZV ZV
+
+ If you discover other use-cases, please add them here as
+ appropriate. */
+ if (row->ends_at_zv_p)
+ row->maxpos = it->current.pos;
+ else if (row->used[TEXT_AREA])
+ {
+ if (row->ends_in_newline_from_string_p)
+ SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
+ else if (CHARPOS (it->eol_pos) > 0)
+ SET_TEXT_POS (row->maxpos,
+ CHARPOS (it->eol_pos) + 1, BYTEPOS (it->eol_pos) + 1);
+ else if (row->continued_p)
+ {
+ /* If max_pos is different from IT's current position, it
+ means IT->method does not belong to the display element
+ at max_pos. However, it also means that the display
+ element at max_pos was displayed in its entirety on this
+ line, which is equivalent to saying that the next line
+ starts at the next buffer position. */
+ if (IT_CHARPOS (*it) == max_pos && it->method != GET_FROM_BUFFER)
+ SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
else
{
- row_end = it->current;
- save_it.eol_pos.charpos = save_it.eol_pos.bytepos = 0;
+ INC_BOTH (max_pos, max_bpos);
+ SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
}
}
- else if (!row->continued_p
- && MATRIX_ROW_CONTINUATION_LINE_P (row)
- && it->eol_pos.charpos > 0)
- {
- /* Last row of a continued line. Use the position recorded
- in IT->eol_pos, to the effect that the newline belongs to
- this row, not to the row which displays the character
- with the largest buffer position before the newline. */
- row_end.pos = it->eol_pos;
- it->eol_pos.charpos = it->eol_pos.bytepos = 0;
- }
- *it = save_it;
- /* The members of ROW->end that are not taken from buffer
- positions are copied from IT->current. */
- row_end.string_pos = it->current.string_pos;
- row_end.overlay_string_index = it->current.overlay_string_index;
- row_end.dpvec_index = it->current.dpvec_index;
+ else if (row->truncated_on_right_p)
+ /* display_line already called reseat_at_next_visible_line_start,
+ which puts the iterator at the beginning of the next line, in
+ the logical order. */
+ row->maxpos = it->current.pos;
+ else if (max_pos == min_pos && it->method != GET_FROM_BUFFER)
+ /* A line that is entirely from a string/image/stretch... */
+ row->maxpos = row->minpos;
+ else
+ abort ();
}
- return row_end;
+ else
+ row->maxpos = it->current.pos;
}
/* Construct the glyph row IT->glyph_row in the desired matrix of
@@ -17561,7 +17608,10 @@ display_line (it)
int wrap_row_used = -1, wrap_row_ascent, wrap_row_height;
int wrap_row_phys_ascent, wrap_row_phys_height;
int wrap_row_extra_line_spacing;
+ EMACS_INT wrap_row_min_pos, wrap_row_min_bpos;
+ EMACS_INT wrap_row_max_pos, wrap_row_max_bpos;
int cvpos;
+ EMACS_INT min_pos = ZV + 1, min_bpos, max_pos = 0, max_bpos;
/* We always start displaying at hpos zero even if hscrolled. */
xassert (it->hpos == 0 && it->current_x == 0);
@@ -17618,6 +17668,23 @@ display_line (it)
row->phys_height = it->max_phys_ascent + it->max_phys_descent;
row->extra_line_spacing = it->max_extra_line_spacing;
+/* Utility macro to record max and min buffer positions seen until now. */
+#define RECORD_MAX_MIN_POS(IT) \
+ do \
+ { \
+ if (IT_CHARPOS (*(IT)) < min_pos) \
+ { \
+ min_pos = IT_CHARPOS (*(IT)); \
+ min_bpos = IT_BYTEPOS (*(IT)); \
+ } \
+ if (IT_CHARPOS (*(IT)) > max_pos) \
+ { \
+ max_pos = IT_CHARPOS (*(IT)); \
+ max_bpos = IT_BYTEPOS (*(IT)); \
+ } \
+ } \
+ while (0)
+
/* Loop generating characters. The loop is left with IT on the next
character to display. */
while (1)
@@ -17652,7 +17719,8 @@ display_line (it)
row->ends_at_zv_p = 1;
/* A row that displays right-to-left text must always have
its last face extended all the way to the end of line,
- even if this row ends in ZV. */
+ even if this row ends in ZV, because we still write to th
+ screen left to right. */
if (row->reversed_p)
extend_face_to_end_of_line (it);
break;
@@ -17686,6 +17754,10 @@ display_line (it)
wrap_row_phys_ascent = row->phys_ascent;
wrap_row_phys_height = row->phys_height;
wrap_row_extra_line_spacing = row->extra_line_spacing;
+ wrap_row_min_pos = min_pos;
+ wrap_row_min_bpos = min_bpos;
+ wrap_row_max_pos = max_pos;
+ wrap_row_max_bpos = max_bpos;
may_wrap = 0;
}
}
@@ -17736,6 +17808,10 @@ display_line (it)
it->max_extra_line_spacing);
if (it->current_x - it->pixel_width < it->first_visible_x)
row->x = x - it->first_visible_x;
+ /* Record the maximum and minimum buffer positions seen so
+ far in glyphs that will be displayed by this row. */
+ if (it->bidi_p)
+ RECORD_MAX_MIN_POS (it);
}
else
{
@@ -17769,6 +17845,11 @@ display_line (it)
it->current_x = new_x;
it->continuation_lines_width += new_x;
++it->hpos;
+ /* Record the maximum and minimum buffer
+ positions seen so far in glyphs that will be
+ displayed by this row. */
+ if (it->bidi_p)
+ RECORD_MAX_MIN_POS (it);
if (i == nglyphs - 1)
{
/* If line-wrap is on, check if a previous
@@ -17843,6 +17924,10 @@ display_line (it)
row->phys_ascent = wrap_row_phys_ascent;
row->phys_height = wrap_row_phys_height;
row->extra_line_spacing = wrap_row_extra_line_spacing;
+ min_pos = wrap_row_min_pos;
+ min_bpos = wrap_row_min_bpos;
+ max_pos = wrap_row_max_pos;
+ max_bpos = wrap_row_max_bpos;
row->continued_p = 1;
row->ends_at_zv_p = 0;
row->exact_window_width_line_p = 0;
@@ -17905,6 +17990,12 @@ display_line (it)
/* Increment number of glyphs actually displayed. */
++it->hpos;
+ /* Record the maximum and minimum buffer positions
+ seen so far in glyphs that will be displayed by
+ this row. */
+ if (it->bidi_p)
+ RECORD_MAX_MIN_POS (it);
+
if (x < it->first_visible_x)
/* Glyph is partially visible, i.e. row starts at
negative X position. */
@@ -17956,6 +18047,10 @@ display_line (it)
if (used_before == 0)
row->glyphs[TEXT_AREA]->charpos = CHARPOS (it->position);
+ /* Record the position of the newline, for use in
+ find_row_edges. */
+ it->eol_pos = it->current.pos;
+
/* Consume the line end. This skips over invisible lines. */
set_iterator_to_next (it, 1);
it->continuation_lines_width = 0;
@@ -18035,7 +18130,7 @@ display_line (it)
/* If line is not empty and hscrolled, maybe insert truncation glyphs
at the left window margin. */
if (it->first_visible_x
- && IT_CHARPOS (*it) != MATRIX_ROW_START_CHARPOS (row))
+ && IT_CHARPOS (*it) != CHARPOS (row->start.pos))
{
if (!FRAME_WINDOW_P (it->f))
insert_left_trunc_glyphs (it);
@@ -18089,12 +18184,19 @@ display_line (it)
/* Remember the position at which this line ends. */
row->end = it->current;
- /* ROW->start and ROW->end must be the smallest and the largest
- buffer positions in ROW. But if ROW was bidi-reordered, these
- two positions can be anywhere in the row, so we must rescan all
- of the ROW's glyphs to find them. */
- if (it->bidi_p)
- row->end = find_row_end (it, row);
+ if (!it->bidi_p)
+ {
+ row->minpos = row->start.pos;
+ row->maxpos = row->end.pos;
+ }
+ else
+ {
+ /* ROW->minpos and ROW->maxpos must be the smallest and
+ `1 + the largest' buffer positions in ROW. But if ROW was
+ bidi-reordered, these two positions can be anywhere in the
+ row, so we must determine them now. */
+ find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos);
+ }
/* Record whether this row ends inside an ellipsis. */
row->ends_in_ellipsis_p
@@ -18140,6 +18242,7 @@ display_line (it)
row to be used. */
it->current_x = it->hpos = 0;
it->current_y += row->height;
+ SET_TEXT_POS (it->eol_pos, 0, 0);
++it->vpos;
++it->glyph_row;
/* The next row should by default use the same value of the
@@ -18150,6 +18253,86 @@ display_line (it)
it->glyph_row->reversed_p = row->reversed_p;
it->start = row->end;
return row->displays_text_p;
+
+#undef RECORD_MAX_MIN_POS
+}
+
+DEFUN ("current-bidi-paragraph-direction", Fcurrent_bidi_paragraph_direction,
+ Scurrent_bidi_paragraph_direction, 0, 1, 0,
+ doc: /* Return paragraph direction at point in BUFFER.
+Value is either `left-to-right' or `right-to-left'.
+If BUFFER is omitted or nil, it defaults to the current buffer.
+
+Paragraph direction determines how the text in the paragraph is displayed.
+In left-to-right paragraphs, text begins at the left margin of the window
+and the reading direction is generally left to right. In right-to-left
+paragraphs, text begins at the right margin and is read from right to left.
+
+See also `bidi-paragraph-direction'. */)
+ (buffer)
+ Lisp_Object buffer;
+{
+ struct buffer *buf;
+ struct buffer *old;
+
+ if (NILP (buffer))
+ buf = current_buffer;
+ else
+ {
+ CHECK_BUFFER (buffer);
+ buf = XBUFFER (buffer);
+ old = current_buffer;
+ }
+
+ if (NILP (buf->bidi_display_reordering))
+ return Qleft_to_right;
+ else if (!NILP (buf->bidi_paragraph_direction))
+ return buf->bidi_paragraph_direction;
+ else
+ {
+ /* Determine the direction from buffer text. We could try to
+ use current_matrix if it is up to date, but this seems fast
+ enough as it is. */
+ struct bidi_it itb;
+ EMACS_INT pos = BUF_PT (buf);
+ EMACS_INT bytepos = BUF_PT_BYTE (buf);
+
+ if (buf != current_buffer)
+ set_buffer_temp (buf);
+ /* Find previous non-empty line. */
+ if (pos >= ZV && pos > BEGV)
+ {
+ pos--;
+ bytepos = CHAR_TO_BYTE (pos);
+ }
+ while (FETCH_BYTE (bytepos) == '\n')
+ {
+ if (bytepos <= BEGV_BYTE)
+ break;
+ bytepos--;
+ pos--;
+ }
+ while (!CHAR_HEAD_P (FETCH_BYTE (bytepos)))
+ bytepos--;
+ itb.charpos = pos;
+ itb.bytepos = bytepos;
+ itb.first_elt = 1;
+
+ bidi_paragraph_init (NEUTRAL_DIR, &itb);
+ if (buf != current_buffer)
+ set_buffer_temp (old);
+ switch (itb.paragraph_dir)
+ {
+ case L2R:
+ return Qleft_to_right;
+ break;
+ case R2L:
+ return Qright_to_left;
+ break;
+ default:
+ abort ();
+ }
+ }
}
@@ -21762,7 +21945,7 @@ append_composite_glyph (it)
g[1] = *g;
glyph = it->glyph_row->glyphs[it->area];
}
- glyph->charpos = CHARPOS (it->position);
+ glyph->charpos = it->cmp_it.charpos;
glyph->object = it->object;
glyph->pixel_width = it->pixel_width;
glyph->ascent = it->ascent;
@@ -25851,6 +26034,7 @@ syms_of_xdisp ()
#endif
defsubr (&Sformat_mode_line);
defsubr (&Sinvisible_p);
+ defsubr (&Scurrent_bidi_paragraph_direction);
staticpro (&Qmenu_bar_update_hook);
Qmenu_bar_update_hook = intern_c_string ("menu-bar-update-hook");
diff --git a/src/xgselect.c b/src/xgselect.c
index d93c1bdf40..42fff2d98d 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+#include <config.h>
#if defined (USE_GTK) || defined (HAVE_GCONF)
#include <glib.h>
diff --git a/src/xsettings.c b/src/xsettings.c
index f1b4c8c9b2..8cfcafe126 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+#include <config.h>
#include <limits.h>
#include <setjmp.h>
#include <fcntl.h>
diff --git a/src/xterm.c b/src/xterm.c
index f867632f22..f195c4fbbd 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -56,9 +56,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "systime.h"
-#ifndef INCLUDED_FCNTL
#include <fcntl.h>
-#endif
#include <ctype.h>
#include <errno.h>
#include <setjmp.h>