summaryrefslogtreecommitdiff
path: root/src/composite.c
Commit message (Collapse)AuthorAgeFilesLines
* ; * src/composite.c (composition_compute_stop_pos): Add comment.Eli Zaretskii2024-03-041-5/+21
|
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* Code cleanup for long line optimizationsGregory Heytings2023-03-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit does not change any code, it merely renames functions and clarifies the documentation, to make the code hopefully easier to grasp. * src/dispextern.h (struct it): Rename the 'narrowed_begv', 'narrowed_zv', 'locked_narrowing_begv', 'locked_narrowing_zv' to 'medium_narrowing_begv', 'medium_narrowing_zv', 'large_narrowing_begv', 'large_narrowing_zv'. Clarify the comments. Update the prototypes of the functions renamed in xdisp.c. * src/lisp.h: Update the prototypes of the functions renamed in editfns.c. Remove the prototype of 'safe_run_hooks_maybe_narrowed', which is used only in keyboard.c. * src/xdisp.c (get_small_narrowing_begv): Renamed from 'get_closer_narrowed_begv'. (get_medium_narrowing_begv): Renamed from 'get_narrowed_begv'. (get_medium_narrowing_zv): Renamed from 'get_narrowed_zv'. (get_large_narrowing_begv): Renamed from 'get_locked_narrowing_begv'. (get_large_narrowing_zv): Renamed from 'get_locked_narrowing_zv'. (SET_WITH_NARROWED_BEGV): Use the new field names. (handle_fontified_prop): Use the new function and new field names. (back_to_previous_line_start): Use the new field name. (back_to_previous_visible_line_start): Use the new field name. (reseat): Use the new function and new field names. (get_visually_first_element): Use the new field name. (move_it_vertically_backward): Use the new function name. (redisplay_internal): Use the new function name. Also add a large comment to explain how Emacs deals with long lines. * src/keyboard.c: (safe_run_hooks_maybe_narrowed): Use the new function names from xdisp.c and editfns.c. Make the function static, and add a prototype. * src/editfns.c: (labeled_restrictions): Renamed from 'narrowing_locks'. (labeled_restrictions_add): Renamed from 'narrowing_locks_add'. (labeled_restrictions_remove): Renamed from 'narrowing_locks_remove'. (labeled_restrictions_get_bound): Renamed from 'narrowing_lock_get_bound'. (labeled_restrictions_peek_label): Renamed from 'narrowing_lock_peek_tag'. (labeled_restrictions_push): Renamed from 'narrowing_lock_push'. (labeled_restrictions_pop): Renamed from 'narrowing_lock_pop'. (unwind_reset_outermost_restriction): Renamed from 'unwind_reset_outermost_narrowing'. (reset_outermost_restrictions): Renamed from 'reset_outermost_narrowings'. (labeled_restrictions_save): Renamed from 'narrowing_locks_save'. (labeled_restrictions_restore): Renamed from 'narrowing_locks_restore'. (unwind_labeled_narrow_to_region): Renamed from 'unwind_narrow_to_region_locked'. (labeled_narrow_to_region): Renamed from 'narrow_to_region_locked'. (Finternal__label_restriction): Renamed from 'Finternal__lock_narrowing'. (Finternal__unlabel_restriction): Renamed from 'Finternal__unlock_narrowing'. (Fwiden): Use the new function names. (Fnarrow_to_region): Use the new function names. (save_restriction_save): Use the new function names. (syms_of_editfns): Use the new function names. <outermost-restriction>: Renamed from 'outermost-narrowing'. * lisp/subr.el (internal--with-restriction): Use the new internal function name. (internal--without-restriction): Use the new internal function name. * src/composite.c (composition_compute_stop_pos): (find_automatic_composition): Use the new function name. * doc/lispref/positions.texi (Narrowing): Add index entry.
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Avoid uninitialized variable warningYAMAMOTO Mitsuharu2022-09-271-4/+7
| | | | | * src/composite.c (composition_gstring_adjust_zero_width): Simplify last change with respect to an exit condition.
* Adjust zero-width grapheme clusters so they are displayed (Bug#50951)YAMAMOTO Mitsuharu2022-09-271-0/+44
| | | | | | * src/composite.c (composition_gstring_adjust_zero_width): New function. * src/composite.h: Declare it. * src/font.c (Ffont_shape_gstring): Use it before putting gstring to cache.
* Fix rare shaping problems with Urdu and ArabicYAMAMOTO Mitsuharu2022-09-171-1/+2
| | | | | * src/composite.c (fill_gstring_body): Clear unused slots of the gstring. (Bug#50951)
* ; * src/composite.c: Include stdlib.h.Eli Zaretskii2022-08-061-0/+2
|
* ; * src/composite.c (Fcomposition_sort_rules): Fix last change.Eli Zaretskii2022-08-061-1/+1
|
* New function 'composition-sort-rules'Eli Zaretskii2022-08-061-0/+49
| | | | | * src/composite.c (Fcomposition_sort_rules) (compare_composition_rules): New functions.
* ; * src/composite.c (find_automatic_composition): Fix a typo.Eli Zaretskii2022-08-041-1/+1
|
* Improve Bidi with long lines.Gregory Heytings2022-08-041-7/+13
| | | | | | | | | | | | | * src/composite.c (composition_compute_stop_pos): Use an 'endpos' that is not too far away. (find_automatic_composition): Use a 'head' that is not too far away. Also make sure that this code path is not taken when long line optimizations are disabled. * src/dispextern.h (struct composition_it): Add a field that points to the parent iterator. * src/xdisp.c (init_iterator): Set it.
* Various improvements to long lines handling.Gregory Heytings2022-08-011-1/+1
| | | | | | | | | | | * src/xdisp.c (get_visually_first_element, (move_it_vertically_backward): Do not go back too far with bidi. (get_narrowed_begv): Do not return 0 anymore instead of BEGV. (handle_fontified_prop): Simplify accordingly. * src/keyboard.c (safe_run_hooks_maybe_narrowed): Simplify accordingly. * src/composite.c (find_automatic_composition): Ditto.
* Improve narrowing when iterator has moved outside of narrowing bounds.Gregory Heytings2022-07-291-1/+1
| | | | | | | | | | | | | | | * src/xdisp.c (get_narrowed_begv, get_narrowed_zv): Add 'pos' parameter. (init_iterator): Add arguments to 'get_narrowed_begv' and 'get_narrowed_zv'. (handle_fontified_prop): Recompute the narrowing when iterator has moved outside of narrowing bounds. * src/dispextern.h (get_narrowed_begv, get_narrowed_zv): Adapt prototypes. * src/composite.c (find_automatic_composition): Add argument to 'get_narrowed_begv'.
* Merge branch 'feature/fix-the-long-lines-display-bug'Gregory Heytings2022-07-211-0/+6
|\
| * Fix segfault in composite.cEli Zaretskii2022-07-091-1/+1
| | | | | | | | | | | | * src/composite.c (find_automatic_composition): Don't use narrowed_begv if it's zero. This avoids segfault in BACKWARD_CHAR, since zero is not a valid buffer position.
| * Actually fix the long lines display bug (bug#56393).Gregory Heytings2022-07-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/dispextern.h (struct it): New 'narrowed_begv' field. * src/dispextern.h (WITH_NARROWED_BEGV): New macro. * src/xdisp.c (get_narrowed_begv): New function. (init_iterator): Initilize the 'narrowed_begv' field. (back_to_previous_line_start, get_visually_first_element, move_it_vertically_backward): Use the new macro. * src/dispextern.h: Prototype of 'get_narrowed_begv'. * src/window.c (window_body_height): Make it externally visible. * src/window.h: Prototype of 'window_body_height'. * src/composite.c (find_automatic_composition): Optimize display in buffers with very long lines with 'get_narrowed_begv'. * lisp/obsolete/longlines.el: Reobsolete longlines-mode. * etc/NEWS: Announce the new minor mode, and remove the unobsoletion indication for 'longlines-mode'. * doc/emacs/trouble.texi (Long Lines): Remove the section. (Lossage): Remove the entry for the Long Lines section. * doc/emacs/emacs.texi (Top): Remove the entry for the Long Lines section.
* | * src/composite.c (find_automatic_composition): Fix off-by-one error.Eli Zaretskii2022-07-161-1/+1
| |
* | ; * src/composite.c (Fcomposition_get_gstring): Fix compiler warnings.Po Lu2022-07-101-1/+1
| |
* | Speed up 'find_automatic_composition'Eli Zaretskii2022-07-101-17/+29
| | | | | | | | | | * src/composite.c (find_automatic_composition): Limit search backward in buffers to the first newline. Fix commentary.
* | Make STRING_SET_MULTIBYTE an inline functionStefan Monnier2022-07-091-4/+6
|/ | | | | | | * src/lisp.h (STRING_SET_MULTIBYTE): Make it into a function. * src/composite.c (Fcomposition_get_gstring): Prefer `make_multibyte_string` over Fconcat+STRING_SET_MULTIBYTE.
* Use BASE_EQ when comparing with QunboundMattias EngdegÄrd2022-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qunbound is uninterned and can therefore never be EQ to any symbol with position. * src/buffer.c (Fbuffer_local_value, buffer_lisp_local_variables) (buffer_local_variables_1): * src/bytecode.c (exec_byte_code): * src/comp.c (compile_function, Fcomp__compile_ctxt_to_file): * src/composite.c (composition_gstring_cache_clear_font): * src/data.c (Fboundp, Fsymbol_value, set_internal) (Fdefault_boundp, Fdefault_value, Fmake_variable_buffer_local): * src/emacs-module.c (module_global_reference_p): * src/eval.c (Fdefault_toplevel_value, defvar) (run_hook_with_args): * src/fns.c (hash_put, Fmaphash): * src/font.c (font_put_extra): * src/frame.c (gui_set_frame_parameters) (gui_frame_get_and_record_arg, gui_default_parameter) (gui_figure_window_size): * src/haikufns.c (get_geometry_from_preferences) (haiku_create_frame, haiku_create_tip_frame): * src/haikuterm.c (haiku_draw_text_decoration) (haiku_default_font_parameter): * src/json.c (lisp_to_json_nonscalar_1): * src/keymap.c (access_keymap_1, access_keymap, current_minor_maps): * src/lread.c (readevalloop, define_symbol): * src/minibuf.c (read_minibuf, Ftry_completion): (Fall_completions, Ftest_completion): * src/pgtkfns.c (pgtk_default_font_parameter, Fx_create_frame) (x_create_tip_frame): * src/pgtkselect.c (Fpgtk_own_selection_internal): * src/print.c (print): * src/profiler.c (evict_lower_half, record_backtrace): * src/terminal.c (create_terminal): * src/textprop.c (set_properties): * src/w32fns.c (my_create_window, w32_icon) (w32_default_font_parameter, Fx_create_frame) (w32_create_tip_frame): * src/w32term.c (w32_draw_glyph_string): * src/xdisp.c (handle_single_display_spec) (cursor_row_fully_visible_p, calc_pixel_width_or_height): * src/xfns.c (x_default_scroll_bar_color_parameter, x_icon_verify) (x_icon, x_default_font_parameter, Fx_create_frame) (x_create_tip_frame): * src/xselect.c (x_handle_selection_request): * src/xterm.c (x_draw_glyph_string, x_term_init): Use BASE_EQ instead of EQ when comparing with Qunbound.
* Prefer CALLNPaul Eggert2022-03-141-2/+2
| | | | | | | * src/bytecode.c (Fbyte_code): * src/composite.c (Fclear_composition_cache): Prefer CALLN to doing it by hand. * src/fns.c (ccall2): Remove. All uses replaced by CALLN.
* Fix character compositions on the mode lineEli Zaretskii2022-02-191-4/+12
| | | | | | | * src/composite.c (composition_compute_stop_pos) (Ffind_composition_internal): When characters come from a string, determine whether to compose them from that string's multibyteness, not from that of the current buffer. (Bug#53729)
* Optionally allow point to enter composed character sequencesEli Zaretskii2022-02-121-0/+10
| | | | | | | | | | | | | | | | | | | | This changeset is based on code originally posted by Kenichi Handa <handa@gnu.org> as part of discussing bug#20140, with a few adjustments and changes, mainly to support R2L text and provide a user option to control the feature. * src/xdisp.c (compute_stop_pos, next_element_from_buffer) (composition_reseat_it): Don't allow auto-composing characters past point when 'composition-break-at-point' is non-nil. (syms_of_xdisp) <composition-break-at-point>: New boolean variable. (redisplay_internal, redisplay_window): Disable "just move the cursor" optimizations when 'composition-break-at-point' is non-nil. * src/keyboard.c (command_loop_1): Force redisplay when 'composition-break-at-point' is non-nil. * lisp/cus-start.el (standard): Provide customization form for 'composition-break-at-point'. * etc/NEWS: Announce the new feature.
* Replace ptrdiff_t with new specpdl_ref type for specpdl referencesMattias EngdegÄrd2022-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The specpdl_ref type is just an alias for ptrdiff_t; the compiled code remains the same. All operations on specpdl_ref (arithmetic, comparison etc) now go through inline functions. The bulk of the change is almost completely mechanical. It is done to prepare for a type-safe representation and subsequent performance improvement. * src/lisp.h (specpdl_ref, specpdl_count_to_ref, specpdl_ref_to_count) (specpdl_ref_eq, specpdl_ref_lt, specpdl_ref_valid_p) (make_invalid_specpdl_ref, specpdl_ref_add, specpdl_ref_to_ptr): New. (SPECPDL_INDEX, struct handler, USE_SAFE_ALLOCA, safe_free) (safe_free_unbind_to): * src/alloc.c (run_finalizer_function, inhibit_garbage_collection) (garbage_collect, Fgarbage_collect, which_symbols): * src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): * src/buffer.c (Fkill_buffer, Fset_buffer_major_mode, Fmove_overlay) (Fdelete_overlay): * src/bytecode.c (exec_byte_code): * src/callint.c (Ffuncall_interactively, Fcall_interactively): * src/callproc.c (Fcall_process, call_process, create_temp_file) (Fcall_process_region): * src/charset.c (load_charset_map_from_file): * src/coding.c (decode_coding_gap, decode_coding_object) (encode_coding_object, Fread_coding_system): * src/comp.c (emit_static_object, helper_unbind_n, load_comp_unit): * src/composite.c (update_compositions, autocmp_chars): * src/cygw32.c (conv_filename_to_w32_unicode) (conv_filename_from_w32_unicode): * src/data.c (notify_variable_watchers): * src/decompress.c (Fzlib_decompress_region): * src/dired.c (directory_files_internal, file_name_completion) (file_attributes): * src/dispnew.c (Fredisplay): * src/doc.c (get_doc_string, Fsnarf_documentation): * src/editfns.c (Fsave_excursion, Fsave_current_buffer) (Freplace_buffer_contents, Fsubst_char_in_region, Fsave_restriction) (styled_format): * src/emacs-module.c (Fmodule_load, funcall_module): * src/emacs.c (init_cmdargs, Fdump_emacs): * src/eval.c (call_debugger, do_debug_on_call, FletX, Flet) (Ffuncall_with_delayed_message, Funwind_protect) (internal_lisp_condition_case, signal_or_quit) (load_with_autoload_queue, Feval, grow_specpdl_allocation) (record_in_backtrace, eval_sub, Ffuncall, apply_lambda) (funcall_lambda, clear_unwind_protect, set_unwind_protect) (set_unwind_protect_ptr, unbind_to, Fbacktrace_eval): * src/fileio.c (Fmake_temp_file_internal, Fcopy_file, Frename_file) (Finsert_file_contents, write_region, Fdo_auto_save): * src/fns.c (Fyes_or_no_p, Frequire, hash_table_user_defined_call): * src/fringe.c (update_window_fringes): * src/gtkutil.c (xg_dialog_run): * src/haiku_io.c (c_specpdl_idx_from_cxx): * src/haiku_support.cc (be_popup_file_dialog): * src/haiku_support.h (c_specpdl_idx_from_cxx): * src/haikufns.c (haiku_create_frame, haiku_create_tip_frame) (haiku_hide_tip, Fx_show_tip, Fhaiku_read_file_name): * src/haikumenu.c (haiku_popup_dialog, set_frame_menubar): * src/image.c (slurp_file): * src/indent.c (line_number_display_width, Fvertical_motion): * src/insdel.c (signal_before_change, signal_after_change) (Fcombine_after_change_execute): * src/intervals.c (get_local_map): * src/json.c (lisp_to_json_nonscalar_1, Fjson_serialize, Fjson_insert) (Fjson_parse_string, Fjson_parse_buffer): * src/keyboard.c (recursive_edit_1, Frecursive_edit, cmd_error) (Finternal_track_mouse, command_loop_1, read_menu_command) (safe_run_hooks, read_event_from_main_queue, read_char, timer_check_2) (menu_item_eval_property, read_key_sequence, read_key_sequence_vs) (Fsuspend_emacs): * src/keymap.c (Fcurrent_active_maps, Fdescribe_vector) (Fhelp__describe_vector): * src/lread.c (Fload, save_match_data_load, readevalloop) (Feval_buffer, Feval_region, grow_read_buffer, read_integer, read1): * src/macros.c (Fexecute_kbd_macro): * src/menu.c (x_popup_menu_1): * src/minibuf.c (read_minibuf, set_minibuffer_mode) (read_minibuf_unwind, Fread_string, Fread_buffer): * src/nsfns.m (Fx_create_frame, Fx_show_tip): * src/nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog): * src/pdumper.c (Fdump_emacs_portable): * src/pgtkfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip) (Fx_show_tip, Fpgtk_print_frames_dialog, Fx_file_dialog, Fx_select_font): * src/pgtkmenu.c (set_frame_menubar, create_and_show_popup_menu) (pgtk_menu_show, create_and_show_dialog, pgtk_dialog_show) (pgtk_popup_dialog): * src/pgtkterm.c (pgtk_cr_export_frames): * src/print.c (PRINTPREPARE, temp_output_buffer_setup) (Fprin1_to_string, print_vectorlike): * src/process.c (Fmake_process, create_process, Fmake_pipe_process) (Fmake_serial_process, connect_network_socket, Fmake_network_process) (network_interface_info, server_accept_connection) (wait_reading_process_output, read_process_output, exec_sentinel): * src/regex-emacs.c (re_match_2_internal): * src/search.c (looking_at_1, fast_looking_at, search_buffer_re): * src/sound.c (Fplay_sound_internal): * src/sysdep.c (system_process_attributes): * src/term.c (tty_menu_show): * src/textprop.c (Fnext_single_char_property_change) (Fprevious_single_char_property_change, add_text_properties_1) (set_text_properties, set_text_properties_1, Fremove_text_properties) (Fremove_list_of_text_properties): * src/thread.c (Fmutex_lock, invoke_thread_function): * src/undo.c (truncate_undo_list): * src/w32fns.c (Fx_create_frame, w32_create_tip_frame, w32_hide_tip) (Fx_show_tip, Fx_file_dialog): * src/w32font.c (Fx_select_font): * src/w32menu.c (set_frame_menubar): * src/window.c (window_list, next_window, window_list_1) (run_window_configuration_change_hook, Frun_window_scroll_functions) (run_window_change_functions, set_window_buffer) (temp_output_buffer_show, window_scroll, scroll_command) (Fscroll_other_window, Fscroll_other_window_down): * src/xdisp.c (safe__call, handle_fontified_prop, handle_face_prop) (handle_single_display_spec, Fbuffer_text_pixel_size) (message_dolog, with_echo_area_buffer, setup_echo_area_for_printing) (display_echo_area, set_message, clear_message, echo_area_display) (gui_consider_frame_title, prepare_menu_bars, update_menu_bar) (update_tab_bar, update_tool_bar, redisplay_internal) (redisplay_preserve_echo_area, run_window_scroll_functions) (redisplay_window, extend_face_to_end_of_line) (display_count_lines_logically, display_count_lines_visually) (display_mode_lines, display_mode_line, Fformat_mode_line) (decode_mode_spec): * src/xfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip) (Fx_show_tip, Fx_file_dialog, Fx_select_font, Fx_print_frames_dialog): * src/xmenu.c (set_frame_menubar, create_and_show_popup_menu) (x_menu_show, create_and_show_dialog, x_dialog_show) (xw_popup_dialog): * src/xselect.c (x_get_local_selection, x_reply_selection_request) (x_handle_selection_request, wait_for_property_change): * src/xterm.c (x_cr_export_frames, x_connection_closed): Replace ptrdiff_t with specpdl_ref for referencing specpdl and use the corresponding functions instead of direct arithmetic.
* ; * src/composite.c (syms_of_composite) <auto-composition-mode>: Doc fix.Eli Zaretskii2022-01-251-1/+2
|
* ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
|
* Handle VS-16 correctly for non-emoji codepointsRobert Pluim2021-10-191-0/+11
| | | | | | | | | | | | | | | | | * admin/unidata/blocks.awk: Remove emoji overrides for codepoints with Emoji_Presentation = No, they're no longer necessary. * lisp/composite.el: Remove #xFE0F (VS-16) from the range handled by `compose-gstring-for-variation-glyph' so it can be handled by `font_range'. * src/composite.c (syms_of_composite): New variable `auto-composition-emoji-eligible-codepoints'. * admin/unidata/emoji-zwj.awk: Generate value for `auto-composition-emoji-eligible-codepoints'. Add `composition-function-table' entries for 'codepoint + U+FE0F' for them. * src/font.c (codepoint_is_emoji_eligible): New function to check if we should try to use the emoji font for a codepoint. (font_range): Use it.
* Enhance font_range to check for emoji composition triggersRobert Pluim2021-09-271-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | If the codepoint that triggered composition is from the emoji script, use the emoji font to check the string being composed, rather than the font of the first character of the string. This makes e.g. "emoji codepoint with Emoji_Presentation = No followed by VS-16 (FE0F)" display the emoji version of the glyph for that codepoint. * admin/unidata/blocks.awk: Add VS-1 through VS-16 to the emoji script. * src/composite.c (autocmp_chars): Accept additional argument CH for the codepoint that triggered composition, pass it to font_range. (composition_reseat_it, find_automatic_composition): Pass codepoint that triggered composition to autocmp_chars. * src/font.c (font_range): Accept additional argument CH for the triggering codepoint. If the codepoint is from the 'emoji' script, use Vscript_representative_chars to find the font to use for the composition attempt. (syms_of_font): Add Qemoji symbol. * src/font.h: Update font_range prototype for argument CH. * etc/NEWS: Announce change.
* Fix cursor motion around some Emoji sequencesEli Zaretskii2021-09-251-0/+3
| | | | | | | | * src/character.h: Add TAG_SPACE and CANCEL_TAG to known Unicode characters values. * src/composite.c (char_composable_p): Recognize TAG characters relevant to Emoji as composable regardless of their General Category. (Bug#39799)
* Improve documentation of last change.Eli Zaretskii2021-08-181-2/+2
| | | | | | | * etc/NEWS: Mention the string value of 'auto-composition-mode'. * src/composite.c (syms_of_composite) <auto-composition-mode>: Doc fix.
* Disable auto compositions on the Linux console onlyLars Ingebrigtsen2021-08-181-4/+24
| | | | | | | | | | | | | | | | * lisp/term/linux.el (terminal-init-linux): Disable auto compositions on "linux" consoles (bug#21363). * src/composite.c (inhibit_auto_composition): New function to implement this. (composition_compute_stop_pos, composition_adjust_point) (Ffind_composition_internal): Use it. (syms_of_composite): Document it. * src/lisp.h: Export tty_type_name. * src/term.c (tty_type_name): Factored out. (Ftty_type): Use it.
* Fix slow operation of 'string-width'Eli Zaretskii2021-06-051-13/+63
| | | | | | | | | | | | | | * src/composite.c (find_automatic_composition): Accept one additional argument BACKLIM; don't look back in buffer or string farther than that. Add an assertion for BACKLIM. (composition_adjust_point, Ffind_composition_internal): Callers adjusted. * src/composite.h (find_automatic_composition): Adjust prototype. * src/character.c (lisp_string_width): Call 'find_automatic_composition' with the value of BACKLIM equal to POS, to avoid costly and unnecessary search back in the string, since those previous characters were already checked for automatic compositions. (Bug#48734) (Bug#48839)
* Make 'string-width' auto-composition awareEli Zaretskii2021-05-261-3/+7
| | | | | | | | | | * src/composite.c (find_automatic_composition): Now extern. (char_composable_p): Don't assume 'unicode-category-table' is always available. * src/composite.h (find_automatic_composition): Add prototype. * src/character.c (lisp_string_width): Support automatic compositions; call 'find_automatic_composition' when 'auto-composition-mode' is ON.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Avoid segfaults due to using fonts that were closedEli Zaretskii2020-10-261-0/+21
| | | | | | | | | | * src/composite.c (composition_gstring_cache_clear_font): New function. * src/composite.h (composition_gstring_cache_clear_font): Add prototype. * src/font.c (font_clear_cache): When we are about to close a font, remove from the gstring cache any lgstring that uses this font. (Bug#42943)
* Improve support for shaping Egyptian HieroglyphsEli Zaretskii2020-10-251-5/+3
| | | | | | | | | | | | | | | | * src/composite.c (composition_gstring_lookup_cache): Renamed from gstring_lookup_cache and made external. All callers changed. * src/composite.h (composition_gstring_lookup_cache): Add prototype. * src/font.c (Ffont_shape_gstring): Call composition_gstring_lookup_cache and return the cached composition if it is already in the cache. * lisp/language/misc-lang.el (egyptian-shape-grouping): New function. (composition-function-table): Use egyptian-shape-grouping in setting up compositions for Egyptian Hieroglyphs. Fix the composition setup for horizontal and vertical joiners.
* Merge from origin/emacs-27Glenn Morris2020-08-181-1/+1
|\ | | | | | | | | cf0ee6f49b ; spelling fixes 16f4f26632 Fix startup working dir bug on NeXTSTEP
| * ; spelling fixesPaul Eggert2020-08-131-1/+1
| |
* | Fix GC bugs related to uninitialized vectorsPaul Eggert2020-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid problems if GC occurs while initializing a vector. Problem with Fdelete reported by Pip Cet in: https://lists.gnu.org/r/emacs-devel/2020-08/msg00313.html I looked for similar problems elsewhere and found quite a few. * src/coding.c (make_subsidiaries): * src/composite.c (syms_of_composite): * src/font.c (build_style_table, Ffont_get_glyphs): * src/nsselect.m (clean_local_selection_data): * src/nsxwidget.m (js_to_lisp): * src/syntax.c (init_syntax_once): * src/window.c (Fcurrent_window_configuration): * src/xselect.c (selection_data_to_lisp_data) (clean_local_selection_data): Use make_nil_vector instead of make_uninit_vector. * src/fns.c (Fdelete): * src/xwidget.c (webkit_js_to_lisp): Use allocate_nil_vector instead of allocate_vector. * src/search.c (Fnewline_cache_check): Use make_vector instead of make_uninit_vector.
* | Rehash hash tables eagerly after loading a dumpPip Cet2020-08-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies code, and helps performance in some cases (Bug#36597). * src/lisp.h (hash_rehash_needed_p): Remove. All uses removed. (hash_rehash_if_needed): Remove. All uses removed. (struct Lisp_Hash_Table): Remove comment about rehashing hash tables. * src/pdumper.c (thaw_hash_tables): New function. (hash_table_thaw): New function. (hash_table_freeze): New function. (dump_hash_table): Simplify. (dump_hash_table_list): New function. (hash_table_contents): New function. (Fdump_emacs_portable): Handle hash tables by eager rehashing. (pdumper_load): Restore hash tables. (init_pdumper_once): New function.
* | Merge from origin/emacs-27Glenn Morris2020-07-291-3/+16
|\| | | | | | | | | | | 4b3085a7fe Fix last change efdd4632c9 Fix Arabic shaping when column-number-mode is in effect d5acc50941 Fix description of kmacro-* commands in the user manual
| * Fix last changeEli Zaretskii2020-07-251-2/+13
| | | | | | | | | | * src/composite.c (composition_reseat_it): Fix of the commentary, and a minor change of the last fix.
| * Fix Arabic shaping when column-number-mode is in effectPip Cet2020-07-251-1/+3
| | | | | | | | | | | | | | | | * src/indent.c (scan_for_column, compute_motion): Pass -1, instead of NEUTRAL_DIR, to 'composition_reseat_it'. * src/composite.c (composition_reseat_it): Interpret negative value of BIDI_LEVEL to mean the caller doesn't know what is the bidi direction of the text. (Bug#41005)
* | ; * src/composite.c (syms_of_composite): Fix last change.Eli Zaretskii2020-06-021-1/+2
| |
* | Fix Arabic composition rulesEli Zaretskii2020-06-021-1/+2
| | | | | | | | | | | | | | | | * lisp/language/misc-lang.el (composition-function-table): Reorder Arabic composition rules in descending order of lookback. * src/composite.c (syms_of_composite): Document the order of rules in 'composition-function-table'.
* | Prefer more inline functions in character.hPaul Eggert2020-04-171-23/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/buffer.h (fetch_char_advance, fetch_char_advance_no_check) (buf_next_char_len, next_char_len, buf_prev_char_len) (prev_char_len, inc_both, dec_both): New inline functions, replacing the old character.h macros FETCH_CHAR_ADVANCE, FETCH_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS, INC_POS, BUF_DEC_POS, DEC_POS, INC_BOTH, DEC_BOTH respectively. All callers changed. These new functions all assume buffer primitives and so need to be here rather than in character.h. * src/casefiddle.c (make_char_unibyte): New static function, replacing the old MAKE_CHAR_UNIBYTE macro. All callers changed. (do_casify_unibyte_string): Use SINGLE_BYTE_CHAR_P instead of open-coding it. * src/ccl.c (GET_TRANSLATION_TABLE): New static function, replacing the old macro of the same name. * src/character.c (string_char): Omit 2nd arg. 3rd arg can no longer be NULL. All callers changed. * src/character.h (SINGLE_BYTE_CHAR_P): Move up. (MAKE_CHAR_UNIBYTE, MAKE_CHAR_MULTIBYTE, PREV_CHAR_BOUNDARY) (STRING_CHAR_AND_LENGTH, STRING_CHAR_ADVANCE) (FETCH_STRING_CHAR_ADVANCE) (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE) (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE) (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH) (DEC_BOTH, BUF_INC_POS, BUF_DEC_POS): Remove. (make_char_multibyte): New static function, replacing the old macro MAKE_CHAR_MULTIBYTE. All callers changed. (CHAR_STRING_ADVANCE): Remove; all callers changed to use CHAR_STRING. (NEXT_CHAR_BOUNDARY): Remove; it was unused. (raw_prev_char_len): New inline function, replacing the old PREV_CHAR_BOUNDARY macro. All callers changed. (string_char_and_length): New inline function, replacing the old STRING_CHAR_AND_LENGTH macro. All callers changed. (STRING_CHAR): Rewrite in terms of string_char_and_length. (string_char_advance): New inline function, replacing the old STRING_CHAR_ADVANCE macro. All callers changed. (fetch_string_char_advance): New inline function, replacing the old FETCH_STRING_CHAR_ADVANCE macro. All callers changed. (fetch_string_char_as_multibyte_advance): New inline function, replacing the old FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE macro. All callers changed. (fetch_string_char_advance_no_check): New inline function, replacing the old FETCH_STRING_CHAR_ADVANCE_NO_CHECK macro. All callers changed. * src/regex-emacs.c (HEAD_ADDR_VSTRING): Remove; no longer used. * src/syntax.c (scan_lists): Use dec_bytepos instead of open-coding it. * src/xdisp.c (string_char_and_length): Rename from string_char_and_length to avoid name conflict with new function in character.h. All callers changed.
* | Treat out-of-range positions consistentlyPaul Eggert2020-03-271-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a position argument to get-byte etc. is an out-of-range integer, treat it the same regardless of whether it is a fixnum or a bignum. * src/buffer.c (fix_position): New function. * src/buffer.c (validate_region): * src/character.c (Fget_byte): * src/coding.c (Ffind_coding_systems_region_internal) (Fcheck_coding_systems_region): * src/composite.c (Ffind_composition_internal): * src/editfns.c (Fposition_bytes, Fchar_after, Fchar_before) (Finsert_buffer_substring, Fcompare_buffer_substrings) (Fnarrow_to_region): * src/fns.c (Fsecure_hash_algorithms): * src/font.c (Finternal_char_font, Ffont_at): * src/fringe.c (Ffringe_bitmaps_at_pos): * src/search.c (search_command): * src/textprop.c (get_char_property_and_overlay): * src/window.c (Fpos_visible_in_window_p): * src/xdisp.c (Fwindow_text_pixel_size): Use it instead of CHECK_FIXNUM_COERCE_MARKER, so that the code is simpler and treats bignums consistently with fixnums. * src/buffer.h (CHECK_FIXNUM_COERCE_MARKER): Define here rather than in lisp.h, and reimplement in terms of fix_position so that it treats bignums consistently with fixnums. * src/lisp.h (CHECK_FIXNUM_COERCE_MARKER): Move to buffer.h. * src/textprop.c (validate_interval_range): Signal with original bounds rather than modified ones.
* | Merge from origin/emacs-27Glenn Morris2020-03-041-4/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a4e4510ccd Fix handling MS-Windows keyboard input above the BMP a38bebb0c1 * etc/NEWS: More complete description of rx 'not' changes. d373647e8f ; * doc/emacs/mini.texi (Yes or No Prompts): Fix last change. 1ca6d15656 * doc/emacs/mini.texi (Yes or No Prompts): 'y-or-n-p' now ... fe1a447d52 Don't attempt to cache glyph metrics for FONT_INVALID_CODE b42b894d1d Fix fit-frame-to-buffer for multi-monitor setup 366fd4fd07 (emacs-27) ; * etc/NEWS: Fix typo. 49d3cd90bd rx: Improve 'or' compositionality (bug#37659) 6b48aedb6b * lisp/tab-line.el: Fix auto-hscrolling (bug#39649) c5f255d681 (tag: emacs-27.0.90) ; Update lisp/ldefs-boot.el 60c84ad992 ; * etc/TODO: Fix last change. 5af9e5baad ; Add an entry to TODO d424195905 Fix rx charset generation 9908b5a614 Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e... 6dc2ebe00e Fix overquoting in mule.el 5cca73dd82 * src/timefns.c (time_arith): Omit incorrect comment. d767c357ca Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e... 4dec693f70 * lisp/vc/vc-cvs.el (vc-cvs-ignore): Copy-edit doc string ff729e3f97 ; bug#39779: Fix some typos in documentation. 696ee02c3a checkdoc: Don't mistake "cf." for sentence end # Conflicts: # etc/NEWS