summaryrefslogtreecommitdiff
path: root/src/fontset.c
Commit message (Collapse)AuthorAgeFilesLines
* Use AUTO_CONS instead of SCOPED_CONS, etc.Paul Eggert2014-09-301-5/+5
| | | | | | | | | | | | | | | | | | | * doc/lispref/internals.texi (Stack-allocated Objects): Adjust to match the revised, less error-prone macros. * src/frame.h (AUTO_FRAME_ARG): Rename from FRAME_PARAMETER. * src/lisp.h (AUTO_CONS): Rename from scoped_cons. (AUTO_LIST1): Rename from scoped_list1. (AUTO_LIST2): Rename from scoped_list2. (AUTO_LIST3): Rename from scoped_list3. (AUTO_LIST4): Rename from scoped_list4. (AUTO_STRING): Rename from SCOPED_STRING. * src/frame.h (AUTO_FRAME_ARG): * src/lisp.h (AUTO_CONS, AUTO_LIST1, AUTO_LIST2, AUTO_LIST3) (AUTO_LIST4, AUTO_STRING): Prepend a new argument 'name'. Declare a variable instead of yielding a value. All uses changed. * src/lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros.
* Simplify stack-allocated Lisp objects, and make them more portable.Paul Eggert2014-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The build_local_string macro was used in two ways: (1) string literals for which scoped allocation suffices, and (2) file name components, where it's not safe in general to assume bounded-size ASCII data. Simplify by defining a new macro SCOPED_STRING that allocates a block-scope string, and by using SCOPED_STRING for (1) and build_string for (2). Furthermore, actually use stack allocation only for objects known to have sufficient alignment. This simpler implementation means Emacs can make USE_STACK_LISP_OBJECTS the default unless GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS. * lisp.h (GCALIGNED): Align even if !USE_STACK_LISP_OBJECTS, for fewer differences among implementations. (struct Lisp_String): Now GCALIGNED. (USE_STACK_LISP_OBJECTS): Default to true, since the implementation no longer insists on a nonempty GCALIGNED. But make it false if GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS. (SCOPED_CONS_INITIALIZER): Remove, since it's no longer needed separately. Move definiens to scoped_cons. The old definition was incorrect when GCALIGNED was defined to be empty. (union Aligned_String): New type. (USE_STACK_CONS, USE_STACK_STRING): New constants, so that the implementation ports to compilers that don't align strictly enough. Don't worry about the union sizes; it's not worth bothering about. (scoped_cons, scoped_list1, scoped_list3, scoped_list4): Rewrite using USE_STACK_CONS. (scoped_cons): Assume the use of union Aligned_Cons. (lisp_string_size, make_local_string, build_local_string): Remove. Unless otherwise specified, all callers of build_local_string changed to use SCOPED_STRING. (SCOPED_STRING): New macro. * data.c (wrong_choice): * menu.c (single_menu_item): * process.c (Fformat_network_address): Hoist use of SCOPED_STRING out of a scope, so that its returned object lives long enough. * fileio.c (Fexpand_file_name): Use build_string, not SCOPED_STRING, as the string might be long or might not be ASCII.
* Keep stack-allocated Lisp objects fast rather than versatile.Dmitry Antipov2014-09-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (HAVE_STATEMENT_EXPRESSIONS): Remove. For USE_STACK_LISP_OBJECTS, we always assume __GNUC__. * lisp.h (union Aligned_Cons) [!GCALIGNED]: Define as such. (SCOPED_CONS_INITIALIZER): New macro. (scoped_cons) [USE_STACK_LISP_OBJECTS]: Use it. (USE_LOCAL_ALLOCA): Remove. (local_cons, local_list1, local_list2, local_list3, local_list4): Remove. Stack overflow checking makes them too slow. (make_local_vector): Likewise. Also we just don't have enough users for it. (enum LISP_STRING_OVERHEAD): Remove. (local_string_init, local_vector_init): Remove prototypes. (make_local_string, build_local_string): Redesign to target short compile-time string constants, fall back to regular string allocation where appropriate. (lisp_string_size): New function. (verify_ascii) [ENABLE_CHECKING]: Add prototype. * alloc.c (local_string_init, local_vector_init): Remove. (verify_ascii) [ENABLE_CHECKING]: New function. * buffer.c, charset.c, chartab.c, data.c, editfns.c, emacs.c, fileio.c: * fns.c, font.c, fontset.c, frame.c, keyboard.c, keymap.c, lread.c: * menu.c, minibuf.c, process.c, textprop.c, xdisp.c, xfns.c, xfont.c: * xselect.c, xterm.c: All related users changed.
* Fix local_cons etc. to not exhaust the stack when in a loop.Paul Eggert2014-09-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem reported in: http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00696.html * buffer.c (Fother_buffer, other_buffer_safely, init_buffer): * charset.c (load_charset_map_from_file, Ffind_charset_region) (Ffind_charset_string): * chartab.c (uniprop_encode_value_numeric, uniprop_table): * data.c (wrong_range): * editfns.c (Fpropertize, format2): * emacs.c (init_cmdargs, decode_env_path): * fileio.c (auto_save_error): * fns.c (Fyes_or_no_p): * font.c (font_style_to_value, font_parse_xlfd) (font_parse_family_registry, font_delete_unmatched) (font_add_log): * fontset.c (Fset_fontset_font): * frame.c (x_get_arg): * keyboard.c (echo_dash, safe_run_hooks_error, parse_menu_item) (read_char_minibuf_menu_prompt): * keymap.c (silly_event_symbol_error, describe_vector): * lread.c (load_warn_old_style_backquotes): * menu.c (single_menu_item): * minibuf.c (Fread_buffer): * process.c (status_message, Fformat_network_address) (server_accept_connection): * textprop.c (copy_text_properties): * xdisp.c (Fcurrent_bidi_paragraph_direction): * xfns.c (x_default_scroll_bar_color_parameter): * xfont.c (xfont_open): * xselect.c (x_clipboard_manager_error_1): * xterm.c (x_term_init): Put USE_LOCAL_ALLOCA at the start of the function. * fns.c (maybe_resize_hash_table): Use build_string instead of build_local_string, since we'd otherwise need a conditional USE_LOCAL_ALLOCA here, but this is just debugging output and is not worth the bother of optimization. * font.c (font_delete_unmatched): Remove by-hand code that observed MAX_ALLOCA limit, since it's now done automatically. * keymap.c (Fsingle_key_description): Put USE_SAFE_ALLOCA at top, since build_local_string needs its sa_alloc. * lisp.h (lisp_word_count): New function. (SAFE_ALLOCA_LISP): Use it. (USE_LOCAL_ALLOCA): New macro. (local_cons, make_local_vector, make_local_string): Observe the MAX_ALLOCA limit. (LISP_STRING_OVERHEAD): New constant. (make_local_string): Use it.
* More and more stack-allocated Lisp objects if USE_LOCAL_ALLOCATORS.Dmitry Antipov2014-09-181-1/+1
| | | | | | | | | | | | | | | | * lisp.h (local_list4) [USE_LOCAL_ALLOCATORS]: New macro. [!USE_LOCAL_ALLOCATORS]: Fall back to regular list4. * frame.h (FRAME_PARAMETER): New macro. * dispnew.c (init_display): * fontset.c (Fset_fontset_font): * frame.c (x_default_parameter): * xfaces.c (set_font_frame_param, Finternal_merge_in_global_face): * xfns.c (x_default_scroll_bar_color_parameter) (x_default_font_parameter, x_create_tip_frame): Use it. * editfns.c (Fpropertize): Use local_cons. * process.c (status_message): Use build_local_string. * xfont.c (xfont_open): Use make_local_string. * xdisp.c (build_desired_tool_bar_string): Use local_list4.
* If USE_LOCAL_ALLOCATORS, allocate some Lisp objects on stack.Dmitry Antipov2014-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp.h (local_cons, local_list1, local_list2, local_list3) [USE_LOCAL_ALLOCATORS]: New macros. [!USE_LOCAL_ALLOCATORS]: Fall back to regular functions. (build_local_string): Avoid argument name expansion clash with make_local_string. * alloc.c (toplevel) [USE_LOCAL_ALLOCATORS && GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS]: Preprocessor guard to avoid impossible configuration. * charset.c (Ffind_charset_region, Ffind_charset_string): Use make_local_vector. * lread.c (read1, substitute_object_recurse): Use scoped_cons. * textprop.c (Fput_text_property, Fadd_face_text_property): Use scoped_list2. (copy_text_properties): Use local_cons and local_list3. * chartab.c (uniprop_table): * data.c (wrong_choice, wrong_range): * doc.c (get_doc_string): * editfns.c (format2): * fileio.c (Fexpand_file_name, auto_save_error): * fns.c (Fyes_or_no_p): * font.c (font_parse_xlfd, font_parse_family_registry, font_add_log): * fontset.c (Fset_fontset_font): * keyboard.c (echo_add_key, echo_dash, parse_menu_item) (read_char_minibuf_menu_prompt): * keymap.c (silly_event_symbol_error, describe_vector): * menu.c (single_menu_item): * minibuf.c (Fread_buffer): * process.c (status_message, Fformat_network_address) (server_accept_connection): Use make_local_string and build_local_string. Prefer compound literals where appropriate.
* Use SAFE_ALLOCA etc. to avoid unbounded stack allocation.Paul Eggert2014-09-071-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows up on the recent thread in emacs-devel on alloca; see: http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html This patch also cleans up alloca-related glitches noted while examining the code looking for unbounded alloca. * alloc.c (listn): * callproc.c (init_callproc): Rewrite to avoid need for alloca. * buffer.c (mouse_face_overlay_overlaps) (report_overlay_modification): * buffer.h (GET_OVERLAYS_AT): * coding.c (make_subsidiaries): * doc.c (Fsnarf_documentation): * editfns.c (Fuser_full_name): * fileio.c (Ffile_name_directory, Fexpand_file_name) (search_embedded_absfilename, Fsubstitute_in_file_name): * fns.c (Fmake_hash_table): * font.c (font_vconcat_entity_vectors, font_update_drivers): * fontset.c (fontset_pattern_regexp, Ffontset_info): * frame.c (Fmake_terminal_frame, x_set_frame_parameters) (xrdb_get_resource, x_get_resource_string): * ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf): * ftxfont.c (ftxfont_draw): * image.c (xbm_load, xpm_load, jpeg_load_body): * keyboard.c (echo_add_key, menu_bar_items, tool_bar_items): * keymap.c (Fdescribe_buffer_bindings, describe_map): * lread.c (openp): * menu.c (digest_single_submenu, find_and_call_menu_selection) (find_and_return_menu_selection): * print.c (PRINTFINISH): * process.c (Fformat_network_address): * scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): * search.c (search_buffer, Fmatch_data, Fregexp_quote): * sound.c (wav_play, au_play): * syntax.c (skip_chars): * term.c (tty_menu_activate, tty_menu_show): * textprop.c (get_char_property_and_overlay): * window.c (Fset_window_configuration): * xdisp.c (safe__call, next_overlay_change, vmessage) (compute_overhangs_and_x, draw_glyphs, note_mouse_highlight): * xfaces.c (face_at_buffer_position): * xmenu.c (x_menu_show): Use SAFE_ALLOCA etc. instead of plain alloca, since the allocation size isn't bounded. * callint.c (Fcall_interactively): Redo memory_full check so that it can be done at compile-time on some platforms. * coding.c (MAX_LOOKUP_MAX): New constant. (get_translation_table): Use it. * callproc.c (call_process): Use SAFE_NALLOCA instead of SAFE_ALLOCA, to catch integer overflows on size calculation. (exec_failed) [!DOS_NT]: New function. (child_setup) [!DOS_NT]: Use it. * editfns.c (Ftranspose_regions): Hoist USE_SAFE_ALLOC + SAFE_FREE out of 'if'. * editfns.c (check_translation): Allocate larger buffers on the heap. * eval.c (internal_lisp_condition_case): Check for MAX_ALLOCA overflow. * fns.c (sort_vector): Use SAFE_ALLOCA_LISP rather than Fmake_vector. (Fbase64_encode_region, Fbase64_decode_region): Avoid unnecessary calls to SAFE_FREE before 'error'. * buffer.c (mouse_face_overlay_overlaps): * editfns.c (Fget_pos_property, check_translation): * eval.c (Ffuncall): * font.c (font_unparse_xlfd, font_find_for_lface): * ftfont.c (ftfont_drive_otf): * keyboard.c (echo_add_key, read_decoded_event_from_main_queue) (menu_bar_items, tool_bar_items): * sound.c (Fplay_sound_internal): * xdisp.c (load_overlay_strings, dump_glyph_row): Use an ordinary auto buffer rather than alloca, since the allocation size is fixed and small. * ftfont.c: Include <c-strcase.h>. (matching_prefix): New function. (get_adstyle_property): Use it, to avoid need for alloca. * keyboard.c (echo_add_key): * keymap.c (describe_map): Use ptrdiff_t, not int. * keyboard.c (echo_add_key): Prefer sizeof to strlen. * keymap.c (Fdescribe_buffer_bindings): Use SBYTES, not SCHARS, when counting bytes. * lisp.h (xlispstrdupa): Remove, replacing with ... (SAFE_ALLOCA_STRING): ... new macro with different API. This fixes a portability problem, namely, alloca result passed to another function. All uses changed. (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Check for MAX_ALLOCA, not MAX_ALLOCA - 1. * regex.c (REGEX_USE_SAFE_ALLOCA, REGEX_SAFE_FREE) (REGEX_ALLOCATE): New macros. (REGEX_REALLOCATE, REGEX_ALLOCATE_STACK, REGEX_REALLOCATE_STACK) (REGEX_FREE_STACK, FREE_VARIABLES, re_match_2_internal): Use them. * xdisp.c (message3): Use SAFE_ALLOCA_STRING rather than doing it by hand. (decode_mode_spec_coding): Store directly into buf rather than into an alloca temporary and copying the temporary to the buf. Fixes: debbugs:18410
* Merge from emacs-24; up to 2014-06-28T23:35:17Z!rgm@gnu.orgGlenn Morris2014-08-101-0/+4
|\
| * Fix bug #18162 with assertion violations due to empty face cache.Eli Zaretskii2014-08-071-0/+4
| | | | | | | | | | src/fontset.c (Finternal_char_font): Recompute basic faces if the frame's face cache was cleared.
* | Minor cleanup of fonset code.Dmitry Antipov2014-06-191-28/+11
|/ | | | | | | | | | | | * fontset.c (FONTSET_ID, set_fontset_id, FONTSET_NAME) (set_fontset_name, FONTSET_ASCII, set_fontset_ascii) (FONTSET_BASE, set_fontset_base, FONTSET_FRAME) (set_fontset_frame, FONTSET_NOFONT_FACE, set_fontset_nofont_face) (FONTSET_DEFAULT, set_fontset_default, FONTSET_FALLBACK) (set_fontset_fallback): Reorder extra slots and avoid unused slots. (free_realized_fontset): Remove because a no-op since 2008. (free_face_fontset): Adjust user. (syms_of_fontset): Shrink fontset by one extra slot.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* * dispextern.h (FACE_SUITABLE_FOR_CHAR_P): Remove unused macro.Dmitry Antipov2013-12-121-31/+9
| | | | | | | | | (FACE_FOR_CHAR): Simplify because face_for_char does the same. * fontset.c (face_suitable_for_char_p) [0]: Remove unused function. (font_for_char): Prefer ptrdiff_t to int for buffer position. (face_for_char): Likewise. Rearrange eassert and return ASCII face for CHAR_BYTE8_P. * fontset.h (font_for_char, face_for_char): Adjust prototypes.
* Port to stricter C99 platforms.Paul Eggert2013-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Especially, C99 prohibits nesting a struct X inside struct Y if struct X has a flexible array member. Also, merge from gnulib, incorporating: 2013-11-03 intprops: port to Oracle Studio c99 * lib/intprops.h: Update from gnulib. * src/alloc.c (struct sdata): New type. (sdata): Implement in terms of struct sdata. Remove u member; all uses replaced by next_vector, set_next_vector. (SDATA_SELECTOR, SDATA_DATA, SDATA_DATA_OFFSET): Adjust to sdata change. (SDATA_DATA_OFFSET): Now a constant, not a macro. (struct sblock): Rename first_data member to data, which is now a flexible array member. All uses changed. (next_vector, set_next_vector, large_vector_vec): New functions. (vector_alignment): New constant. (roundup_size): Make it a multiple of ALIGNOF_STRUCT_LISP_VECTOR, too. (struct large-vector): Now merely a NEXT member, since the old approach ran afoul of stricter C99. All uses changed to use large_vector_vec or large_vector_offset. (large_vector_offset): New constant. * src/dispnew.c: Include tparam.h, for tgetent. Do not include term.h; no longer needed. * src/gnutls.c (Fgnutls_boot): Don't continue after calling a _Noreturn. * src/lisp.h (ENUM_BF) [__SUNPRO_C && __STDC__]: Use unsigned int. (struct Lisp_Vector): Use a flexible array member for contents, instead of a union with a member that is an array of size 1. All uses changed. (ALIGNOF_STRUCT_LISP_VECTOR): New constant, to make up for the fact that the struct no longer contains a union. (struct Lisp_Misc_Any, struct Lisp_Marker, struct Lisp_Overlay) (struct Lisp_Save_Value, struct Lisp_Free): Use unsigned, not int, for spacers, to avoid c99 warning. (union specbinding): Use unsigned, not bool, for bitfield, as bool is not portable to pre-C99 hosts.
* Add pre-redisplay-function and rectangular regionStefan Monnier2013-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/rect.el: Use lexical-binding. Add new rectangular region support. (rectangle-mark): New command. (rectangle--region): New var. (deactivate-mark-hook): Reset rectangle--region. (rectangle--extract-region, rectangle--insert-for-yank) (rectangle--highlight-for-redisplay) (rectangle--unhighlight-for-redisplay): New functions. (region-extract-function, redisplay-unhighlight-region-function) (redisplay-highlight-region-function): Use them to handle rectangular region. * lisp/simple.el (region-extract-function): New var. (delete-backward-char, delete-forward-char, deactivate-mark): Use it. (kill-new, kill-append): Remove obsolete `yank-handler' argument. (kill-region): Replace obsolete `yank-handler' arg with `region'. (copy-region-as-kill, kill-ring-save): Add `region' argument. (redisplay-unhighlight-region-function) (redisplay-highlight-region-function): New vars. (redisplay--update-region-highlight): New function. (pre-redisplay-function): Use it. (exchange-point-and-mark): Don't deactivate the mark before reactivate-it anyway. * lisp/comint.el (comint-kill-region): Remove yank-handler argument. * lisp/delsel.el (delete-backward-char, backward-delete-char-untabify) (delete-char): Remove property, since it's now part of their default behavior. (self-insert-iso): Remove property since this command doesn't exist. * src/xdisp.c (prepare_menu_bars): Call Vpre_redisplay_function. (syms_of_xdisp): Declare pre-redisplay-function. (markpos_of_region): Remove function. (init_iterator, compute_stop_pos, handle_face_prop) (face_before_or_after_it_pos, reseat_to_string) (get_next_display_element, window_buffer_changed) (redisplay_internal, try_cursor_movement, redisplay_window) (try_window_reusing_current_matrix, try_window_id, display_line) (note_mode_line_or_margin_highlight, note_mouse_highlight) (display_string, mouse_face_from_buffer_pos): Remove region handling. * src/window.h (struct window): Remove field `region_showing'. * src/dispextern.h (struct it): Remove region_beg/end_charpos. (face_at_buffer_position, face_for_overlay_string) (face_at_string_position): Update prototypes. * src/xfaces.c (face_at_buffer_position, face_for_overlay_string) (face_at_string_position): Remove `region_beg' and `region_end' args. * src/fontset.c (Finternal_char_font): * src/font.c (font_at, font_range): Adjust calls accordingly. * src/insdel.c (Qregion_extract_function): New var. (syms_of_insdel): Initialize it. (prepare_to_modify_buffer_1): Use it.
* Use union for the payload of struct Lisp_Vector.Dmitry Antipov2013-09-241-1/+1
| | | | | | | | | | | | This helps to avoid a few glitches dictated by C's aliasing rules. * lisp.h (struct Lisp_Vector): Use union for next and contents member. Adjust comment. Change related users. * alloc.c (next_in_free_list, set_next_in_free_list): Remove. Related users changed. * buffer.c, bytecode.c, ccl.c, character.h, chartab.c, composite.c: * composite.h, disptab.h, fns.c, fontset.c, indent.c, keyboard.c: * lread.c, msdos.c, process.c, w32menu.c, window.c, xdisp.c: * xfaces.c, xfont.c, xmenu.c: Related users changed.
* * fontset.c, window.c, xdisp.c (toplevel): Use TERM_HEADER.Dmitry Antipov2013-09-051-10/+3
| | | | * xfaces.c (toplevel) [HAVE_X_WINDOWS]: Do not include xterm.h twice.
* * fontset.c (face_for_char): Check char in the current face font firstJan Djärv2013-09-011-0/+13
| | | | | | if HAVE_NS. Fixes: debbugs:15138
* Drop FRAME_PTR typedef.Dmitry Antipov2013-08-031-10/+11
| | | | | | | | | | | * composite.c, font.c, font.h, fontset.c, fontset.h, frame.c, frame.h: * ftfont.c, ftxfont.c, gtkutil.c, gtkutil.h, image.c, keyboard.c: * menu.c, menu.h, msdos.c, nsfns.m, nsfont.m, nsmenu.m, nsterm.h: * nsterm.m, scroll.c, term.c, w32fns.c, w32font.c, w32font.h: * w32inevt.c, w32inevt.h, w32menu.c, w32notify.c, w32term.c, w32term.h: * w32uniscribe.c, w32xfns.c, widget.c, window.c, xdisp.c, xfaces.c: * xfns.c, xfont.c, xftfont.c, xmenu.c, xselect.c, xterm.c: All related users changed.
* Prefer list1 (X) to Fcons (X, Qnil) when building lists.Paul Eggert2013-07-151-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the code easier to read and the executable a bit smaller. Do not replace all calls to Fcons that happen to create lists, just calls that are intended to create lists. For example, when creating an alist that maps FOO to nil, use list1 (Fcons (FOO, Qnil)) rather than list1 (list1 (FOO)) or Fcons (Fcons (FOO, Qnil), Qnil). Similarly for list2 through list5. * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): * bytecode.c (exec_byte_code): * callint.c (quotify_arg, Fcall_interactively): * callproc.c (Fcall_process, create_temp_file): * charset.c (load_charset_map_from_file) (Fdefine_charset_internal, init_charset): * coding.c (get_translation_table, detect_coding_system) (Fcheck_coding_systems_region) (Fset_terminal_coding_system_internal) (Fdefine_coding_system_internal, Fdefine_coding_system_alias): * composite.c (update_compositions, Ffind_composition_internal): * dired.c (directory_files_internal, file_name_completion) (Fsystem_users): * dispnew.c (Fopen_termscript, bitch_at_user, init_display): * doc.c (Fsnarf_documentation): * editfns.c (Fmessage_box): * emacs.c (main): * eval.c (do_debug_on_call, signal_error, maybe_call_debugger) (Feval, eval_sub, Ffuncall, apply_lambda): * fileio.c (make_temp_name, Fcopy_file, Faccess_file) (Fset_file_selinux_context, Fset_file_acl, Fset_file_modes) (Fset_file_times, Finsert_file_contents) (Fchoose_write_coding_system, Fwrite_region): * fns.c (Flax_plist_put, Fyes_or_no_p, syms_of_fns): * font.c (font_registry_charsets, font_parse_fcname) (font_prepare_cache, font_update_drivers, Flist_fonts): * fontset.c (Fset_fontset_font, Ffontset_info, syms_of_fontset): * frame.c (make_frame, Fmake_terminal_frame) (x_set_frame_parameters, x_report_frame_params) (x_default_parameter, Fx_parse_geometry): * ftfont.c (syms_of_ftfont): * image.c (gif_load): * keyboard.c (command_loop_1): * keymap.c (Fmake_keymap, Fmake_sparse_keymap, access_keymap_1) (Fcopy_keymap, append_key, Fcurrent_active_maps) (Fminor_mode_key_binding, accessible_keymaps_1) (Faccessible_keymaps, Fwhere_is_internal): * lread.c (read_emacs_mule_char): * menu.c (find_and_return_menu_selection): * minibuf.c (get_minibuffer): * nsfns.m (Fns_perform_service): * nsfont.m (ns_script_to_charset): * nsmenu.m (ns_popup_dialog): * nsselect.m (ns_get_local_selection, ns_string_from_pasteboard) (Fx_own_selection_internal): * nsterm.m (append2): * print.c (Fredirect_debugging_output) (print_prune_string_charset): * process.c (Fdelete_process, Fprocess_contact) (Fformat_network_address, set_socket_option) (read_and_dispose_of_process_output, write_queue_push) (send_process, exec_sentinel): * sound.c (Fplay_sound_internal): * textprop.c (validate_plist, add_properties) (Fput_text_property, Fadd_face_text_property) (copy_text_properties, text_property_list, syms_of_textprop): * unexaix.c (report_error): * unexcoff.c (report_error): * unexsol.c (unexec): * xdisp.c (redisplay_tool_bar, store_mode_line_string) (Fformat_mode_line, syms_of_xdisp): * xfaces.c (set_font_frame_param) (Finternal_lisp_face_attribute_values) (Finternal_merge_in_global_face, syms_of_xfaces): * xfns.c (x_default_scroll_bar_color_parameter) (x_default_font_parameter, x_create_tip_frame): * xfont.c (xfont_supported_scripts): * xmenu.c (Fx_popup_dialog, xmenu_show, xdialog_show) (menu_help_callback, xmenu_show): * xml.c (make_dom): * xterm.c (set_wm_state): Prefer list1 (FOO) to Fcons (FOO, Qnil) when creating a list, and similarly for list2 through list5.
* Get rid of some platform-specific functions examining windowDmitry Antipov2013-04-071-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | system and its capabilities. This is a partial rework of the 2013-04-05 change. * lisp.h (have_menus_p): Remove prototype. This function is replaced with platform-independent window_system_available. (check_window_system): Move to... * frame.h (decode_window_system_frame, window_system_available): ...here, add new prototypes. * frame.c (window_system_available, decode_window_system_frame): New functions. (check_window_system): Platform-independent now. * xterm.h (x_in_use): Remove declaration. (check_x_frame): * w32term.h (check_x_frame): * nsterm.h (check_x_frame): Remove prototypes. This function is replaced with platform-independent decode_window_system_frame. * msdos.c (have_menus_p): Remove. * nsfns.m (check_window_system, have_menus_p, check_ns_frame): Remove platform-specific functions. Use check_window_system, decode_window_system_frame and check_ns_display_info where appropriate. Minor style and comment tweaks. * w32fns.c (w32_in_use, check_window_system, have_menus_p) (check_x_frame): Likewise. * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame): Likewise. * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m: * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c: * xmenu.c, xselect.c: All related users changed.
* Consistently use platform-specific function to detect window system.Dmitry Antipov2013-04-051-6/+2
| | | | | | | | | | | | | | | | | | * lisp.h (check_window_system): New prototype. This function is going to replace check_x, check_w32 and check_ns. (have_menus_p): Mention msdos.c in comment. * fontset.c (check_window_system_func): Remove. Adjust all users. * fontset.h (check_window_system_func): Remove prototype. * nsterm.h (check_ns): * xterm.h (check_x): * w32term.h (check_w32): Likewise. * menu.c (Fx_popup_menu): Use check_window_system. * msdos.c (check_window_system): Define for MS-DOS. * nsfns.m (check_window_system): Define for NS. Adjust all users. * w32fns.c (check_window_system): Likewise for MS-Windows. * xfns.c (check_window_system): Likewise for X. * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c: * xfaces.c, xmenu.c: Use check_window_system where appropriate.
* * lisp.h (make_uninit_vector): New function.Dmitry Antipov2013-02-081-2/+3
| | | | | | | | | | | | | | | | | | * alloc.c (Fvector, Fmake_byte_code): * ccl.c (Fregister_ccl_program): * charset.c (Fdefine_charset_internal, define_charset_internal): * coding.c (make_subsidiaries, Fdefine_coding_system_internal): * composite.c (syms_of_composite): * font.c (Fquery_font, Ffont_info, syms_of_font): * fontset.c (FONT_DEF_NEW, Fset_fontset_font): * ftfont.c (ftfont_shape_by_flt): * indent.c (recompute_width_table): * nsselect.m (clean_local_selection_data): * syntax.c (init_syntax_once): * w32unsubscribe.c (uniscribe_shape): * window.c (Fcurrent_window_configuration): * xfaces.c (Fx_family_fonts): * xselect.c (selection_data_to_lisp_data): Use it.
* Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.caPaul Eggert2013-01-021-1/+1
|\
| * Update copyright notices for 2013.Paul Eggert2013-01-011-1/+1
| |
* | Merge from emacs-24; up to 2012-11-20T20:06:17Z!monnier@iro.umontreal.caGlenn Morris2012-11-261-0/+2
|\ \ | |/
| * Don't crash if internal-char-font is called on non-GUI frames.Eli Zaretskii2012-11-261-0/+2
| | | | | | | | | | src/fontset.c (Finternal_char_font): Return nil on non-GUI frames. (Bug#11964)
* | Widely used frame validity and checking functions.Dmitry Antipov2012-11-061-6/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.h (decode_live_frame, decode_any_frame): Add prototypes. * frame.c (decode_live_frame, decode_any_frame): New functions. (delete_frame, Fredirect_frame_focus, Fframe_parameters) (Fframe_parameter, Fframe_char_height, Fframe_char_width) (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width) (Fframe_pointer_visible_p): Use decode_any_frame. (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame) (Fraise_frame, Flower_frame, Fmodify_frame_parameters) (Fset_frame_height, Fset_frame_width): Use decode_live_frame. (Fframe_focus): Likewise. Allow zero number of arguments. Adjust docstring. (frame_buffer_list, frame_buffer_predicate): Remove. * lisp.h (frame_buffer_predicate): Remove prototype. * buffer.c (Fother_buffer): Use decode_any_frame. * xdisp.c (Ftool_bar_lines_needed): Likewise. * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise. * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font) (Fclose_font, Ffont_info): Use decode_live_frame. * fontset.c (check_fontset_name): Likewise. * terminal.c (Fframe_terminal): Likewise. * w32fns.c (check_x_frame): Likewise. * window.c (Fminibuffer_window, Fwindow_at) (Fcurrent_window_configuration): Likewise. (Frun_window_configuration_change_hook, Fwindow_resize_apply): Likewise. Allow zero number of arguments. Adjust docstring. * dispnew.c (Fredraw_frame): Likewise. * xfaces.c (frame_or_selected_frame): Remove. (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font) (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p) (Fframe_face_alist): Use decode_live_frame. * xfns.c (check_x_frame): Likewise.
* Merge from trunkDaniel Colascione2012-10-071-2/+2
|\
| * Simplify and avoid signal-handling races.Paul Eggert2012-09-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nt/inc/ms-w32.h (emacs_raise): New macro. * src/alloc.c (die): * src/sysdep.c (emacs_abort) [HAVE_NTGUI]: Avoid recursive loop if there's a fatal error in the function itself. * src/atimer.c (pending_atimers): * src/blockinput.h: Don't include "atimer.h"; no longer needed. (interrupt_input_pending): Remove. All uses removed. pending_signals now counts both atimers and ordinary interrupts. This is less racy than having three separate pending-signal flags. (block_input, unblock_input, totally_unblock_input, unblock_input_to) (input_blocked_p): Rename from their upper-case counterparts BLOCK_INPUT, UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO, INPUT_BLOCKED_P, and turn into functions. All uses changed. This makes it easier to access volatile variables more accurately. (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input (). (input_blocked_p): Prefer this to 'interrupt_input_blocked', as that's more reliable if the code is buggy and sets interrupt_input_blocked to a negative value. All uses changed. * src/atimer.c (deliver_alarm_signal): Remove. No need to deliver this to the parent; any thread can handle this signal now. All uses replaced by underlying handler. * src/atimer.c (turn_on_atimers): * src/dispnew.c (handle_window_change_signal): * src/emacs.c (handle_danger_signal): * src/keyboard.c (kbd_buffer_get_event): Don't reestablish signal handler; not needed with sigaction. * src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT) (UNBLOCK_INPUT_TO): Rework to avoid unnecessary accesses to volatile variables. (UNBLOCK_INPUT_TO): Now a function. (totally_unblock_input, unblock_input): New decls. * src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c (init_data): Remove. Necessary stuff now done in init_signal. * src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions. * src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c. (fatal_error_code): Remove; no longer needed. (terminate_due_to_signal): Rename from fatal_error_backtrace, since it doesn't always backtrace. All uses changed. No need to reset signal to default, since sigaction and/or die does that for us now. Use emacs_raise (FOO), not kill (getpid (), FOO). (main): Check more-accurately whether we're dumping. Move fatal-error setup to sysdep.c * src/floatfns.c: Do not include "syssignal.h"; no longer needed. * src/gtkutil.c (xg_get_file_name, xg_get_font): Remove no-longer-needed signal-mask manipulation. * src/keyboard.c, src/process.c (POLL_FOR_INPUT): Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined. * src/keyboard.c (read_avail_input): Remove. All uses replaced by gobble_input. (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code. (kbd_buffer_store_event_hold, gobble_input): (record_asynch_buffer_change) [USABLE_SIGIO]: (store_user_signal_events): No need to mess with signal mask. (gobble_input): If blocking input and there are terminals, simply set pending_signals to 1 and return. All hooks changed to not worry about whether input is blocked. (process_pending_signals): Clear pending_signals before processing them, in case a signal comes in while we're processing. By convention callers now test pending_signals before calling us. (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input): New functions, to support changes to blockinput.h. (handle_input_available_signal): Now extern. (reinvoke_input_signal): Remove. All uses replaced by handle_async_input. (quit_count): Now volatile, since a signal handler uses it. (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All callers changed. Block SIGINT only if not already blocked. Clear sigmask reliably, even if Fsignal returns, which it can. Omit unnecessary accesses to volatile var. (quit_throw_to_read_char): No need to restore sigmask. * src/keyboard.c (gobble_input, handle_user_signal): * src/process.c (wait_reading_process_output): Call signal-handling code rather than killing ourselves. * src/lisp.h: Include <float.h>, for... (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication. (pending_signals): Now volatile. (syms_of_data): Now const if IEEE floating point. (handle_input_available_signal) [USABLE_SIGIO]: (terminate_due_to_signal, record_child_status_change): New decls. * src/process.c (create_process): Avoid disaster if memory is exhausted while we're processing a vfork, by tightening the critical section around the vfork. (send_process_frame, process_sent_to, handle_pipe_signal) (deliver_pipe_signal): Remove. No longer needed, as Emacs now ignores SIGPIPE. (send_process): No need for setjmp/longjmp any more, since the SIGPIPE stuff is now gone. Instead, report an error if errno is EPIPE. (record_child_status_change): Now extern. PID and W are now args. Return void, not bool. All callers changed. * src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]: Remove. All uses removed. This bug should be fixed now in a different way. (wait_for_termination_1): Use waitpid rather than sigsuspend, and record the child status change directly. This avoids the need to futz with the signal mask. (process_fatal_action): Move here from emacs.c. (emacs_sigaction_flags): New function, containing much of what used to be in emacs_sigaction_init. (emacs_sigaction_init): Use it. Block nonfatal system signals that are caught by emacs, to make races less likely. (deliver_process_signal): Rename from handle_on_main_thread. All uses changed. (BACKTRACE_LIMIT_MAX): Now at top level. (thread_backtrace_buffer, threadback_backtrace_pointers): New static vars. (deliver_thread_signal, deliver_fatal_thread_signal): New functions, for more-accurate delivery of thread-specific signals. (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c. (deliver_arith_signal): Handle in this thread, not in the main thread, since it's triggered by this thread. (maybe_fatal_sig): New function. (init_signals): New arg DUMPING so that we can be more accurate about whether we're dumping. Caller changed. Treat thread-specific signals differently from process-general signals. Block all signals while handling fatal error; that's safer. xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal on IEEE hosts. When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored. Ignore SIGPIPE unless batch. (emacs_backtrace): Output backtrace for the appropriate thread, which is not necessarily the main thread. * src/syssignal.h: Include <stdbool.h>. (emacs_raise): New macro. * src/xterm.c (x_connection_signal): Remove; no longer needed now that we use sigaction. (x_connection_closed): No need to mess with sigmask now. (x_initialize): No need to reset SIGPIPE handler here, since init_signals does this for us now. Fixes: debbugs:12471
* | Merge from trunkDaniel Colascione2012-09-171-19/+10
|\ \ | |/
| * Port better to POSIX hosts lacking _setjmp.Paul Eggert2012-09-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols. (_setjmp, _longjmp): Remove. * src/lisp.h: Include <setjmp.h> here, since we use its symbols here. All instances of '#include <setjmp.h>' removed, if the only reason for the instance was because "lisp.h" was included. (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols. Unless otherwise specified, replace all uses of jmp_buf, _setjmp, and _longjmp with the new symbols. Emacs already uses _setjmp if available, so this change affects only POSIXish hosts that have sigsetjmp but not _setjmp, such as some versions of Solaris and Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.) * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros. (png_load_body) [HAVE_PNG]: (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]: (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]: Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp, since PNG requires jmp_buf. This is the only exception to the general rule that we now use sys_setjmp and sys_longjmp. This exception is OK since this code does not change the signal mask or longjmp out of a signal handler. Fixes: debbugs:12446
| * Use bool for booleans in font-related modules.Paul Eggert2012-09-061-18/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * font.c (font_intern_prop, font_style_to_value) (font_style_symbolic, font_parse_xlfd, font_parse_fcname) (generate_otf_features, font_check_otf_features, font_check_otf) (font_match_p, font_list_entities, font_at): * fontset.c (fontset_id_valid_p, reorder_font_vector (fontset_find_font, Fset_fontset_font) (face_suitable_for_char_p) [0]: * ftfont.c (fc_initialized, ftfont_get_open_type_spec) (ftfont_open, ftfont_text_extents, ftfont_check_otf): (m17n_flt_initialized, ftfont_shape_by_flt): * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw): * nsfont.m (nsfont_draw): * w32font.c (w32font_draw): * w32term.c (x_draw_glyphless_glyph_string_foreground): Use bool for booleans. * font.h: Adjust to above API changes. (struct font, struct font_driver, struct font_driver_list): Use bool for booleans. (struct font): Remove useless member encoding_type. All users removed. * fontset.c, xftfont.c: Omit unnecessary static decls.
* | Implement cygw32Daniel Colascione2012-09-171-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Here, we use the generic window-system configuration system we just implemented to support the w32 window-system in the mainline build under Cygwin. (Previously, the w32 window system could only be compiled as part of the NT-native Emacs build process.) The changes in this patch need to be applied atomically in order to avoid breaking Emacs. The changes include: - Changes throughout the Lisp and C code to not assume that NT Emacs and the w32 window system are synonymous. - Wiring up the regular select(2) event loop to Windows messages - Cleaning up the w32 drag-and-drop receiving code. - Exposing Cygwin path conversion functions to elisp. - Unicode file dialog support when compiling for Cygwin. - Splitting the w32 term lisp initialization code into code applicable to any w32 window-system and code specific to system-type windows-nt. - Integrating the old and new w32 code into the build system.
* * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.Paul Eggert2012-08-221-6/+5
| | | | | | Otherwise, the compiler complains about (A?B:C) where B is void and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12. (fontset_add): Return void, for FONTSET_ADD.
* Make recently-introduced setters macros.Paul Eggert2012-08-211-34/+58
| | | | | | | | | * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii) (set_fontset_base, set_fontset_frame, set_fontset_nofont_face) (set_fontset_default, set_fontset_fallback): Rename from their upper-case counterparts, and make them functions rather than macros. This is more consistent with the other recently-introduced setters. These don't need to be inline, since they're local.
* Setter macros for fontsets.Dmitry Antipov2012-08-211-38/+59
| | | | | | | * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII) (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE) (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros. Adjust users.
* * lisp.h (set_char_table_extras): Rename from char_table_set_extras.Paul Eggert2012-08-171-1/+1
| | | | | | | (set_char_table_contents): Rename from char_table_set_contents. (set_sub_char_table_contents): Rename from sub_char_table_sub_contents. All uses changed. See the end of <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
* * lisp.h (CSET): Remove.Paul Eggert2012-08-171-1/+1
| | | | | | | | | | | | (set_char_table_ascii, set_char_table_defalt, set_char_table_parent) (set_char_table_purpose): New functions, replacing CSET. All uses changed. For example, replace "CSET (XCHAR_TABLE (char_table), parent, parent);" with "char_table_set_parent (char_table, parent);". The old version was confusing because it used the same name 'parent' for two different things. Fixes: debbugs:12215
* Simple interface to set Lisp_Object fields of chararcter tables.Dmitry Antipov2012-08-161-2/+2
| | | | | | | | * lisp.h (CSET): New macro. (char_table_set_extras, char_table_set_contents) (sub_char_table_set_contents): New function. * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c: * syntax.c: Adjust users.
* Generalize and cleanup font subsystem checks.Dmitry Antipov2012-08-151-4/+2
| | | | | | * font.h (FONT_DEBUG, font_assert): Remove. * font.c, fontset.c, w32font.c, xfont.c, xftfont.c: Change font_assert to eassert. Use eassert where appropriate.
* Drop WGET and revert read access to Lisp_Objects slots of struct window.Dmitry Antipov2012-08-071-1/+1
| | | | | | | | | | | * window.h (WGET): Remove. (struct window): Do not use INTERNAL_FIELD. * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c: * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c: * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m: * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c: * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
* Drop FGET and revert read access to Lisp_Objects slots of struct frame.Dmitry Antipov2012-08-071-1/+1
| | | | | | | | | * frame.h (FGET): Remove. (struct frame): Do not use INTERNAL_FIELD. * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c: * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m: * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h: * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
* Separate read and write access to Lisp_Object slots of struct window.Dmitry Antipov2012-08-061-1/+1
| | | | | | | | | | * window.h (WGET, WSET): New macros similar to AREF and ASET. * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c: * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c: * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m: * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c: * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
* Separate read and write access to Lisp_Object slots of struct frame.Dmitry Antipov2012-08-061-1/+1
| | | | | | | | * frame.h (FGET, FSET): New macros similar to AREF and ASET. * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c: * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m: * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h: * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
* Generalize common compile-time constants.Dmitry Antipov2012-08-051-3/+3
| | | | | | | | | | | | * lisp.h (header_size, bool_header_size, word_size): Now here. (struct Lisp_Vector): Add comment. (struct Lisp_Bool_Vector): Move up to define handy constants. (VECSIZE, PSEUDOVECSIZE): Simplify. (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation. * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c: * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c: * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c: * xfont.c, xmenu.c: Use word_size where appropriate.
* Use INTERNAL_FIELD for windows.Dmitry Antipov2012-08-011-1/+1
| | | | | | | | | | | | | | * src/window.h (WVAR): New macro. (struct window): Change Lisp_Object members to INTERNAL_FIELD. * src/alloc.c, src/buffer.c, src/composite.c, src/dispextern.h: * src/dispnew.c, src/editfns.c, src/fileio.c, src/font.c, src/fontset.c: * src/frame.c, src/frame.h, src/fringe.c, src/indent.c, src/insdel.c: * src/keyboard.c, src/keymap.c, src/lisp.h, src/minibuf.c, src/nsterm.m: * src/print.c, src/textprop.c, src/w32fns.c, src/w32menu.c, src/w32term.c: * src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xmenu.c: * src/xterm.c: Users changed. * admin/coccinelle/window.cocci: Semantic patch to replace direct access to Lisp_Object members of struct window to WVAR.
* Fix some of the breakage introduced with ↵Eli Zaretskii2012-07-311-1/+2
| | | | | | | | 2012-07-31T12:36:19Z!dmantipov@yandex.ru. src/w32menu.c (w32_menu_show): Revert bogus introduction of FVAR. src/fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING after introduction of FVAR.
* * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR insteadAndreas Schwab2012-07-111-1/+1
| | | | | | | | | | | of Fcar/Fcdr if possible. * font.c (check_otf_features): Likewise. * fontset.c (Fnew_fontset): Likewise. * gnutls.c (Fgnutls_boot): Likewise. * minibuf.c (read_minibuf): Likewise. * msdos.c (IT_set_frame_parameters): Likewise. * xmenu.c (Fx_popup_dialog): Likewise. * w32menu.c (Fx_popup_dialog): Likewise.
* Avoid calls to strlen in font processing functions.Dmitry Antipov2012-07-111-1/+1
| | | | | | | | | | | * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname) (font_open_by_name): Changed to use length argument. Adjust users accordingly. * font.h (font_open_by_name, font_parse_xlfd): Adjust prototypes. * xfont.c (xfont_decode_coding_xlfd): Changed to return ptrdiff_t. (xfont_list_pattern, xfont_match): Use length returned by xfont_decode_coding_xlfd. * xfns.c (x_default_font_parameter): Omit useless xstrdup.
* Use XCAR and XCDR instead of Fcar and Fcdr where possible.Dmitry Antipov2012-07-101-1/+1
| | | | | | | | | | | * admin/coccinelle/list_loop.cocci: Semantic patch to convert from Fcdr to XCDR and consistently use CONSP in the list iteration loops. * admin/coccinelle/vector_contents.cocci: Fix indentation. * src/callint.c, src/coding.c, src/doc.c, src/editfns.c, src/eval.c, * src/font.c, src/fontset.c, src/frame.c, src/gnutls.c, src/minibuf.c, * src/msdos.c, src/textprop.c, src/w32fns.c, src/w32menu.c, src/window.c, * src/xmenu.c: Changed to use XCAR and XCDR where argument type is known to be a Lisp_Cons.