1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-03 06:00:50 -08:00
Commit graph

31164 commits

Author SHA1 Message Date
Eli Zaretskii
0c22566f00 Set up the bidi iterator for iterating display strings and overlay strings.
Not tested yet, just compiled.

 src/xdisp.c (handle_single_display_spec, next_overlay_string)
 (get_overlay_strings_1, push_display_prop): Set up the bidi
 iterator for displaying display or overlay strings.
 (forward_to_next_line_start): Don't use the shortcut if
 bidi-iterating.
 (back_to_previous_visible_line_start): If handle_display_prop
 pushed the iterator stack, restore the internal state of the bidi
 iterator by calling bidi_pop_it same number of times.
 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
 and we are bidi-iterating, don't decrement the iterator position;
 instead, set the first_elt flag in the bidi iterator, to produce
 the same effect.
 (reseat_1): Remove redundant setting of string_from_display_prop_p.
 (push_display_prop): xassert that we are iterating a buffer.
 (push_it, pop_it): Save and restore the state of the
 bidi iterator.  Save and restore the bidi_p flag.
 (pop_it): Iterate out of display property for string iteration as
 well.
 (iterate_out_of_display_property): Support iteration over strings.
 (handle_single_display_spec): Set up it->bidi_it for iteration
 over a display string, and call bidi_init_it.
 src/bidi.c (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
 src/dispextern.h (struct iterator_stack_entry): New member bidi_p.
 (struct it): Member bidi_p is now a bit field 1 bit wide.
2011-06-25 14:44:30 +03:00
Eli Zaretskii
58b9f433ad Added to bidi.c support functions for reordering display strings.
src/bidi.c (bidi_push_it, bidi_pop_it): New functions.
 (bidi_initialize): Initialize the bidi cache start stack pointer.
 (bidi_cache_ensure_space): New function, refactored from part of
 bidi_cache_iterator_state.
 src/dispextern.h (bidi_push_it, bidi_pop_it): Add prototypes.
2011-06-23 21:09:52 +03:00
Eli Zaretskii
cbb09f0446 Rearrange bidi.c and add leading comments for each part.
No changes in functionality.
2011-06-23 18:14:01 +03:00
Eli Zaretskii
acb2881852 Add comments for forced L2R directions of menu bar and tool bar.
GCPRO Lisp string inside bidi.c.
Force L2R direction in buffer menu buffer.

 src/xdisp.c (tool_bar_lines_needed, redisplay_tool_bar)
 (display_menu_bar): Force left-to-right direction.  Add a FIXME
 comment for making that be controlled by a user option.
 src/bidi.c (bidi_move_to_visually_next): GCPRO the Lisp string we
 are iterating.
 lisp/buff-menu.el (Buffer-menu-mode, list-buffers-noselect): Force
 left-to-right paragraph direction.
2011-06-18 23:17:29 +03:00
Eli Zaretskii
ca3122a07a Fix a gratuitous crash in emacs -nw with iso-safe terminal encoding.
src/term.c (produce_glyphs): Add IT_GLYPHLESS to the values of
 it->what accepted by the xassert.  Fixes a gratuitous crash in an
 Emacs built with -DXASSERTS.
2011-06-18 17:33:14 +03:00
Eli Zaretskii
cc7245e4b5 Tried and abandoned idea of displaying mode line and tool/menu-bars R2L.
Added those features to etc/TODO wishlist.
Fixed src/.gdbinit for changes in Lisp vector structures.

 src/.gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
 and vector-like objects.
2011-06-18 16:28:53 +03:00
Eli Zaretskii
1ace72676c Refactor getting the first element into a separate function.
src/xdisp.c (get_visually_first_element): New function, refactored
 from common parts of next_element_from_buffer, next_element_from_string,
 and next_element_from_c_string.
2011-06-18 14:14:51 +03:00
Eli Zaretskii
4d3a8bb4de Fix box face decision for BEFORE_P case.
src/xdisp.c (face_before_or_after_it_pos): Support bidi iteration.
2011-06-18 13:11:06 +03:00
Eli Zaretskii
40eb66c401 Fix the decision about box_face in mode line for reordered text.
This fixes display of composed characters in buffer name on mode line.

 src/xdisp.c (face_before_or_after_it_pos): Support bidi iteration
 when BEFORE_P is zero.
 (next_element_from_c_string): Handle the case of the first string
 character that is not the first one in the visual order.
2011-06-18 11:09:05 +03:00
Eli Zaretskii
578b494e52 Fix display of R2L strings in mode line.
Composed characters still don't work.

 src/xdisp.c (init_iterator): Don't initialize it->bidi_p for strings
 here.
 (reseat_to_string): Initialize it->bidi_p for strings here.
 (next_element_from_string, next_element_from_c_string)
 (next_element_from_buffer): Add xassert's for correspondence
 between IT's object being iterated and it->bidi_it.string
 structure.
 src/bidi.c (bidi_level_of_next_char): Fix the logic for looking up
 the sentinel state in the cache.
2011-06-16 19:32:33 +03:00
Eli Zaretskii
9f2573525c Fix string handling to avoid data relocation gotcha.
Bugs in mode-line display still there.

 src/xdisp.c (compute_display_string_pos)
 (compute_display_string_end, reseat_to_string): Don't assume
 it->bidi_it.string.s always points to string.lstring's data.
 src/bidi.c (bidi_fetch_char, bidi_paragraph_init)
 (bidi_resolve_explicit_1, bidi_resolve_explicit)
 (bidi_resolve_weak, bidi_level_of_next_char): Don't assume
 string.s always points to string.lstring's data.
2011-06-13 21:35:20 +03:00
Eli Zaretskii
f23590ccc9 Fixed a bug with displaying strings padded with blanks.
src/xdisp.c (set_iterator_to_next): Advance string position
 correctly when padding it with blanks.
2011-06-11 19:50:09 +03:00
Eli Zaretskii
34c48e575a Initial version of string reordering. Tested only on mode line and
TTY menu bar.  Display is buggy.

 src/xdisp.c (next_element_from_buffer): Improve commentary for when
 the iterator is before prev_stop.
 (init_iterator): Initialize bidi_p from the default value of
 bidi-display-reordering, not from buffer-local value.  Use the
 buffer-local value only if initializing for buffer iteration.
 (handle_invisible_prop): Support invisible properties on strings
 that are being bidi-reordered.
 (reseat_to_string): Enable bidi-related code.
 (set_iterator_to_next): Support bidi reordering of C strings and
 Lisp strings.
 (next_element_from_string): Support bidi reordering of Lisp strings.
 (handle_stop_backwards): Support Lisp strings as well.
 (display_mode_line, display_mode_element): Temporarily force L2R
 paragraph direction.
 (display_string): Support display of R2L glyph rows.  Use
 IT_STRING_CHARPOS when displaying from a Lisp string.
2011-06-11 18:13:17 +03:00
Eli Zaretskii
4b988f8b7f Only commentary changes, no functionality changed.
src/xdisp.c (next_element_from_buffer): Improve commentary for when
 the iterator is before prev_stop.
2011-06-11 13:29:05 +03:00
Eli Zaretskii
9f4ef50024 Tested and fixed compute_display_string_pos for buffer iteration.
Also fixed an unrelated bug caused by vertical-motion.

 src/xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
 itb.string.lstring.
 (compute_display_string_pos, compute_display_string_end):
 Fix calculation of the object to scan.  Fixes an error when using
 arrow keys.
 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
 base_level_stop; instead, set base_level_stop to BEGV.  Fixes
 crashes in vertical-motion.
2011-06-10 14:43:04 +03:00
Eli Zaretskii
6db161bec8 Adapt compute_display_string_pos to iteration over strings.
Just compiled, not yet tested.

 src/xdisp.c (compute_display_string_pos): First arg is now struct
 `text_pos *'; all callers changed.  Support display properties on
 Lisp strings.
 (compute_display_string_end): Support display properties on Lisp
 strings.
 (init_iterator, reseat_1, reseat_to_string): Initialize the
 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
 when iterating on a string not from display properties).
 src/bidi.c (bidi_fetch_char): Support strings with display
 properties.
 src/dispextern.h (struct bidi_string_data): New member bufpos.
 (compute_display_string_pos): Update prototype.
2011-06-09 20:12:10 +03:00
Eli Zaretskii
bb269206f6 Add code to initialize bidi iterator for displaying strings.
For now, ifdef'ed away.  Some more testing.

 src/bidi.c (bidi_level_of_next_char): Allow the sentinel "position"
 to pass the test for valid cached positions.
 src/xdisp.c (init_iterator): Call bidi_init_it only of a valid
 buffer position was specified.  Initialize paragraph_embedding to L2R.
 (reseat_to_string): Initialize the bidi iterator (for now ifdef'ed out).
 (display_string): If we need to ignore text properties of
 LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
 original value of -1 will not work with bidi.)
 src/dispextern.h (struct bidi_string_data): New member lstring.
2011-06-09 17:39:27 +03:00
Eli Zaretskii
d9334cb768 Tested with buffer reordering, fixed one crash.
src/xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
 itb.string.s to NULL (avoids a crash in bidi_paragraph_init).
2011-06-09 14:34:28 +03:00
Eli Zaretskii
87e67904f1 Started work on string reordering. Just compiled, not yet tested.
src/bidi.c (bidi_paragraph_info): Delete unused struct.
 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
 (bidi_cache_start): New variable.
 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
 to zero.
 (bidi_cache_fetch_state, bidi_cache_search)
 (bidi_cache_find_level_change, bidi_cache_iterator_state)
 (bidi_cache_find, bidi_peek_at_next_level)
 (bidi_level_of_next_char, bidi_find_other_level_edge)
 (bidi_move_to_visually_next): Compare cache index with
 bidi_cache_start rather than with zero.
 (bidi_fetch_char): Accept new argument STRING; all callers
 changed.  Support iteration over a string.
 (bidi_paragraph_init, bidi_resolve_explicit_1)
 (bidi_resolve_explicit, bidi_resolve_weak)
 (bidi_level_of_next_char, bidi_move_to_visually_next): Support
 iteration over a string.
 (bidi_set_sor_type, bidi_resolve_explicit_1)
 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
 can now be zero (for strings); special values 0 and -1 were
 changed to -1 and -2, respectively.
 (bidi_char_at_pos): New function.
 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
 Call it instead of FETCH_MULTIBYTE_CHAR.
 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
 initialized to valid values.
 (bidi_init_it): Don't initialize charpos and bytepos with invalid
 values.
 src/xdisp.c (compute_display_string_pos)
 (compute_display_string_end): Accept additional argument STRING.
 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
 (reseat_to_string): Initialize bidi_it->string.s and
 bidi_it->string.schars.
 src/dispextern.h (struct bidi_string_data): New structure.
 (struct bidi_it): New member `string'.  Make flag members be 1-bit
 fields, and put them last in the struct.
 (compute_display_string_pos, compute_display_string_end): Update
 prototypes.
2011-06-08 21:01:56 +03:00
Eli Zaretskii
9d68c2a9ab Fix declaration in bidi_level_of_next_char.
src/bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
2011-06-04 15:00:30 +03:00
Eli Zaretskii
57f97249c8 Cleanup. Tested in -nw and verified that bug #7616 didn't become worse.
src/bidi.c (bidi_fetch_char_advance): Remove unused and
 unimplemented function.
2011-06-03 16:34:52 +03:00
Eli Zaretskii
662b2d1a70 src/xdisp.c (single_display_spec_string): Correct a FIXME comment. 2011-05-31 21:08:41 +03:00
Eli Zaretskii
0e14fe90d8 Fix cursor motion across display strings covering reordered text.
src/xdisp.c (set_cursor_from_row): Set start and stop points
 according to the row's direction when priming the loop that looks
 for the glyph on which to display cursor.
 (single_display_spec_intangible_p): Function deleted.
 (display_prop_intangible_p): Reimplement to call
 handle_display_spec instead of single_display_spec_intangible_p.
 Accept 3 additional arguments needed by handle_display_spec.  This
 fixes incorrect cursor motion across display property with complex
 values: lists, `(when COND...)' forms, etc.
 (single_display_spec_string_p): Support property values that are
 lists with the argument STRING its top-level element.
 (display_prop_string_p): Fix the condition for processing a
 property that is a list to be consistent with handle_display_spec.
 src/keyboard.c (adjust_point_for_property): Adjust the call to
 display_prop_intangible_p to its new signature.
 src/dispextern.h (display_prop_intangible_p): Adjust prototype.
2011-05-28 20:23:44 +03:00
Eli Zaretskii
c40e2fb22c Fix cursor motion near overlays covering reordered text.
src/xdisp.c (set_cursor_from_row): Set start and stop points of the
 loop that looks for the glyph on which to display cursor according
 to the row's direction.
2011-05-28 14:05:40 +03:00
Eli Zaretskii
5e9c7958cd src/xdisp.c (compute_display_string_pos): Fix bogus parentheses. 2011-05-28 13:25:19 +03:00
Eli Zaretskii
fc6f18ceea Discovery of replacing display properties now uses the same code
as the display engine.  Tested OK with display properties whose
value is a list.

 src/dispextern.h (struct bidi_it): New member frame_window_p.
 (bidi_init_it, compute_display_string_pos): Update prototypes.
 src/bidi.c (bidi_fetch_char): Accept additional argument
 FRAME_WINDOW_P and pass it to compute_display_string_pos.  All
 callers changed.
 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
 it to initialize the frame_window_p member of struct bidi_it.
 src/xdisp.c (handle_display_spec): New function, refactored from the
 last portion of handle_display_prop.
 (compute_display_string_pos): Accept additional argument
 FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
 value of a `display' property is a "replacing spec".
 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
 and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
 the display property, but just return a value indicating whether
 the display property will replace the characters it covers.
 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
 frame_window_p members of struct bidi_it.
2011-05-21 17:22:14 +03:00
Eli Zaretskii
683a44f77c Remove kludgey save and restore of IT->position for push_it.
src/xdisp.c (push_it): Accept second argument POSITION, where pop_it
 should jump to continue iteration.
2011-05-14 17:05:36 +03:00
Eli Zaretskii
7b60010279 Text covered by `display' overlays is correctly reordered.
Cursor positioning is not yet right near the overlay.

 src/xdisp.c (compute_display_string_pos): Non-trivial implementation.
 (compute_display_string_end): New function.
 src/dispextern.h (compute_display_string_end): Declare prototype.
 src/bidi.c (bidi_resolve_explicit_1): Use ZV for disp_pos.
 (bidi_fetch_char): Implement support for runs of characters
 covered by display strings.
2011-05-14 16:41:52 +03:00
Eli Zaretskii
102ebb0079 Refactoring with bidi_fetch_char tested and debugged.
src/bidi.c (bidi_fetch_char): Accept also character position
 corresponding to BYTEPOS.  All callers changed.
 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
 (bidi_resolve_explicit, bidi_resolve_weak)
 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
 bidi_it->nchars is non-positive.
 (bidi_level_of_next_char): Don't try to lookup the cache for the
 next/previous character if nothing is cached there yet, or if we
 were just reseat()'ed to a new position.
 (bidi_paragraph_init, bidi_resolve_explicit_1)
 (bidi_level_of_next_char): Fix arguments in the calls to
 bidi_fetch_char.
2011-05-14 14:59:20 +03:00
Eli Zaretskii
182ce2d254 Started work on reordering display strings. Refactor FETCH_CHAR.
Only compiled, not tested.

 src/xdisp.c (compute_display_string_pos): New function.
 (reseat_1): Initialize bidi_it.disp_pos.
 src/bidi.c (bidi_copy_it): Use offsetof.
 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
 (bidi_cache_search, bidi_cache_iterator_state)
 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
 (bidi_level_of_next_char, bidi_move_to_visually_next): Support
 character positions inside a run of characters covered by a
 display string.
 (bidi_paragraph_init, bidi_resolve_explicit_1)
 (bidi_level_of_next_char): Call bidi_fetch_char and
 bidi_fetch_char_advance instead of FETCH_CHAR and
 FETCH_CHAR_ADVANCE.
 (bidi_init_it): Initialize new members.
 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
 definitions.
 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
 instead of using explicit *_CHAR codes.
 (bidi_resolve_explicit, bidi_resolve_weak): Use
 FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
 bidirectional text is supported only in multibyte buffers.
 src/dispextern.h (struct bidi_it): New members nchars and disp_pos.
 ch_len is now EMACS_INT.
 (compute_display_string_pos): Declare prototype.
2011-05-10 19:12:16 +03:00
Andreas Schwab
57679c8695 * w32menu.c (set_frame_menubar): Fix submenu allocation. 2011-05-09 13:29:51 +02:00
Eli Zaretskii
b0512a1d79 Fix bug #8597 with setting frame background mode on w32 console.
src/w32console.c (Fset_screen_color): Doc fix.
 (Fget_screen_color): New function.
 (syms_of_ntterm): Defsubr it.
 lisp/term/w32console.el (terminal-init-w32console): Call
 get-screen-color and use its output to set the frame
 background-mode.
2011-05-07 18:44:19 +03:00
Eli Zaretskii
888c9e865f Fix changes in 2011-05-01T00:04:17Z!larsi@gnus.org for MS-DOS.
src/callproc.c (call_process_cleanup): Don't close and unlink the
 temporary file if Fcall_process didn't create it in the first
 place.
 (Fcall_process): Don't create tempfile if stdout of the child
 process will be redirected to a file specified with `:file'.
 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
 cue to call_process_cleanup not to close that handle.
2011-05-07 14:25:05 +03:00
Ben Key
4d3fcc8e60 * nt/configure.bat: Renamed the fusercflags variable to escusercflags
so that the variable name better matches its purpose, to be identical
to usercflags with the exception that all quotes are escaped by the \
character.

Renamed the fuserldflags variable to escuserldflags so that the
variable name better matches its purpose, to be identical to
userldflags with the exception that all quotes are escaped by the \
character.

A new ESC_USER_CFLAGS variable is written to config.settings.  This
variable has the same value as the escusercflags variable.

* nt/gmake.defs, nt/nmake.defs: Added the variable ESC_CFLAGS.  This
variable is identical to the CFLAGS variable except that it includes
the new ESC_USER_CFLAGS variable instead of USER_CFLAGS.

* src/makefile.w32-in: The bootstrap-temacs rule now makes use of one
of two shell specific rules, either bootstrap-temacs-CMD or
bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical to the
previous implementation of the bootstrap-temacs rule.  The
bootstrap-temacs-CMD rule is similar to the previous implementation of
the bootstrap-temacs rule except that it makes use of the ESC_CFLAGS
variable instead of the CFLAGS variable.


These changes are required to extend my earlier fix to add support for
--cflags and --ldflags options that include quotes so that it works
whether make uses cmd or sh as the shell.
2011-05-06 23:00:12 -05:00
Michael Albinus
b4289b644f * dbusbind.c (QCdbus_type_unix_fd): Declare static.
(xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
is a constant.
(Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
a string.  Handle both cases.
(Fdbus_call_method_asynchronously, Fdbus_register_signal)
(Fdbus_register_method): Use Qinvalid_function.
2011-05-07 00:12:31 +02:00
Juanma Barranquero
af4c0e2849 src/makefile.w32-in: Update dependencies. 2011-05-06 17:37:11 +02:00
Eli Zaretskii
c51453d997 Fix the MS-Windows build broken by 2011-05-06T07:13:19Z!eggert@cs.ucla.edu.
src/lread.c: Include limits.h.
2011-05-06 14:26:45 +03:00
Paul Eggert
b08a63ccec Do not assume EMACS_INT is the same width as a pointer.
This prepares for a future patch that will prefer 64-bit EMACS_INT if
available.  That patch can be tried now, by compiling with -DWIDE_EMACS_INT,
but it is temporarily not the default so that it can be further tested.

Also, install some other fixes for problems discovered by the static
checking of GCC 4.6.0.

Fixes: debbugs:8545 debbugs:8601 debbugs:8600 debbugs:8602
2011-05-06 00:13:19 -07:00
Paul Eggert
8ff0ac3c78 Merge from mainline. 2011-05-05 23:30:56 -07:00
Paul Eggert
122b0c8643 Temporarily disable wider-than-pointer EMACS_INT. 2011-05-05 22:55:01 -07:00
Juanma Barranquero
dbdb9a7cae src/gnutls.c, src/image.c: Make function pointers static. 2011-05-06 03:05:25 +02:00
Andreas Schwab
db7a0b4f1d * src/lread.c (lisp_file_lexically_bound_p): Stop scanning at end
marker.  (Bug#8610)
2011-05-05 18:56:39 +02:00
Paul Eggert
4c4b566b11 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local. 2011-05-05 00:23:07 -07:00
Paul Eggert
c717b32678 Revert to wraparound integer arithmetic, instead of going to float. 2011-05-04 23:31:14 -07:00
Paul Eggert
852a74a59b Merge from mainline. 2011-05-04 22:31:24 -07:00
Glenn Morris
f7ff1b0f07 Merge from emacs-23; up to 2010-06-10T05:17:21Z!rgm@gnu.org. 2011-05-04 21:00:38 -07:00
Juanma Barranquero
520cf78a0f src/gnutls.c: Keep list of function aliases in alphabetical order. 2011-05-05 04:18:36 +02:00
Ted Zlatanov
639c109b90 Add fn_NAME alias for `gnutls_certificate_set_x509_key_file'.
* gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
`gnutls_certificate_set_x509_key_file'.
2011-05-04 21:05:36 -05:00
Juanma Barranquero
d212713522 src/makefile.w32-in: Update dependencies. 2011-05-05 02:20:44 +02:00
Juanma Barranquero
e968f4f300 src/gnutls.c: Remove unused parameter `fildes'.
* gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
* gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
  Remove unused parameter `fildes'.
* process.c (read_process_output, send_process): Don't pass it.
2011-05-05 01:56:09 +02:00