1. 01 Jan, 2019 1 commit
  2. 01 Jan, 2018 1 commit
  3. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  4. 11 Jul, 2017 1 commit
    • NicolasPetton's avatar
      Add an optional testfn parameter to assoc · 0bece6c6
      NicolasPetton authored
      * src/fns.c (assoc): New optional testfn parameter used for comparison
      when provided.
      * test/src/fns-tests.el (test-assoc-testfn): Add tests for the new
      'testfn' parameter.
      * src/buffer.c:
      * src/coding.c:
      * src/dbusbind.c:
      * src/font.c:
      * src/fontset.c:
      * src/gfilenotify.c:
      * src/image.c:
      * src/keymap.c:
      * src/process.c:
      * src/w32fns.c:
      * src/w32font.c:
      * src/w32notify.c:
      * src/w32term.c:
      * src/xdisp.c:
      * src/xfont.c: Add a third argument to Fassoc calls.
      * etc/NEWS:
      * doc/lispref/lists.texi: Document the new 'testfn' parameter.
      0bece6c6
  5. 01 Jan, 2017 1 commit
  6. 12 Dec, 2016 1 commit
  7. 02 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Make struct font_drivers read-only · ebb96114
      Paul Eggert authored
      This simplifies the code a bit, and makes the structs more
      shareable and less likely to become corrupt.
      * src/alloc.c (cleanup_vector):
      * src/font.c (valid_font_driver, font_prepare_cache)
      (font_finish_cache, font_get_cache, font_clear_cache)
      (register_font_driver, font_update_drivers):
      * src/font.h (struct font, struct font_driver_list)
      (valid_font_driver):
      struct font_drivers are now const.
      * src/font.c, src/ftcrfont.c, src/ftfont.c, src/nsfont.m, src/xfont.c:
      Omit no-longer-necessary decls.
      * src/ftcrfont.c (syms_of_ftcrfont):
      * src/ftxfont.c (syms_of_ftxfont):
      * src/xftfont.c (syms_of_xftfont):
      Omit no-longer-necessary initialization code.
      * src/ftcrfont.c (ftcrfont_driver):
      * src/ftfont.c (ftfont_driver):
      * src/ftxfont.c (ftxfont_driver):
      * src/macfont.m (macfont_driver):
      * src/nsfont.m (nsfont_driver):
      * src/xfont.c (xfont_driver):
      * src/xftfont.c (xftfont_driver):
      Use C99-style initializer for ease of maintenance, and make it const.
      * src/ftcrfont.c, src/ftxfont.c, src/xftfont.c:
      Refer to functions like ftfont_text_extents directly.
      * src/ftfont.c (ftfont_get_cache, ftfont_list, ftfont_list_family)
      (ftfont_has_char, ftfont_encode_char, ftfont_text_extents)
      (ftfont_get_bitmap, ftfont_anchor_point, ftfont_otf_capability)
      (ftfont_variation_glyphs, ftfont_filter_properties)
      (ftfont_combining_capability):
      * src/xfont.c (xfont_get_cache):
      Now extern, so that other modules’ struct font_drivers can use
      them directly.
      * src/macfont.m (macfont_descriptor_entity):
      * src/nsfont.m (nsfont_open):
      Use constant directly; this is clearer.
      ebb96114
  8. 01 Dec, 2016 1 commit
  9. 29 Oct, 2016 1 commit
    • Daniel Colascione's avatar
      Add double-buffering support to reduce flicker · c2907158
      Daniel Colascione authored
      * src/dispextern.h (struct glyph_string): Remove window member
      (block_buffer_flips, unblock_buffer_flips)
      (buffer_flipping_blocked_p): Declare.
      
      * src/xterm.h (struct x_display_info): New member supports_xdbe.
      (struct x_output): New members draw_desc and need_buffer_flip.
      (FRAME_X_DRAWABLE, FRAME_X_RAW_DRAWABLE)
      (FRAME_X_DOUBLE_BUFFERED_P)
      (FRAME_X_NEED_BUFFER_FLIP): New macros.
      (set_up_x_back_buffer, tear_down_x_back_buffer)
      (initial_set_up_x_back_buffer): Declare.
      
      * src/xterm.c: Include Xdbe.h.
      (x_begin_cr_clip, x_fill_rectangle, x_draw_rectangle)
      (x_draw_vertical_window_border, x_update_end)
      (x_setup_relief_color, x_draw_relief_rect)
      (x_draw_fringe_bitmap, x_shift_glyphs_for_insert)
      (x_scroll_run, x_draw_hollow_cursor, x_draw_bar_cursor): Use
      FRAME_X_DRAWABLE instead of FRAME_X_WINDOW; rename local
      variables appropriately; substitute calls to XClearArea with
      x_clear_area, which DTRT for double buffering.
      (x_clear_window, x_clear_area): In double-buffering mode, use
      rect-drawing X functions instead of XClearWindow and
      XClearArea, which always operate on the front buffer.
      (show_back_buffer): New function.
      (XTframe_up_to_date): Call show_back_buffer when done.
      (x_clear_frame, x_clear_frame_area): Remove obsolete calls to
      gtk_widget_queue_draw to refresh scroll bars; scroll bars are
      now independent X windows.
      (handle_one_xevent): Call font_drop_xrender_surfaces when
      XftDraw might need regenerating; perform buffer flip when
      responding to Expose events; issue front-buffer clearing
      commands as stopgap while we wait for redisplay.
      Call flush_dirty_back_buffers.
      (x_make_frame_visible): Un-bitrot comment; move XSETFRAME
      earlier in function.
      (x_free_frame_resources): Call tear_down_x_back_buffer when
      destroying frame.
      (x_term_init): Attempt to initialize double buffer extension.
      (x_flip_and_flush): New function.
      (x_redisplay_interface): Point to x_flip_and_flush instead of
      x_flip directly.
      (flush_dirty_back_buffers): New function.
      (x_create_terminal): Register buffer_flipping_unblocked_hook.
      
      * src/xftfont.c (xftfont_drop_xrender_surfaces): Use
      FRAME_X_DRAWABLE instead of FRAME_X_WINDOW.
      (xftfont_draw): Call x_mark_frame_dirty.
      (xftfont_drop_xrender_surfaces): New function.
      (syms_of_xftfont): Register it.
      
      * src/xfont.c (xfont_draw): Use FRAME_X_DRAWABLE instead of
      FRAME_X_WINDOW.
      
      * src/xfns.c: Include Xdbe.h.
      (x_set_inhibit_double_buffering, set_up_x_back_buffer)
      (Fx_double_buffered_p): New functions.
      (x_window): Call initial_set_up_x_back_buffer.
      (x_make_gc): Use FRAME_X_DRAWABLE instead of FRAME_X_WINDOW.
      (Fx_create_frame): Configure `inhibit-double-buffering'
      frame parameter.
      (x_create_tip_frame): Call initial_set_up_x_back_buffer.
      (x_frame_parm_handlers): Register
      x_set_inhibit_double_buffering.
      (syms_of_xfns): Register Sx_double_buffered_p.
      (x_mark_frame_dirty): Define.
      
      * src/xfaces.c (x_create_gc): Use FRAME_X_DRAWABLE instead of
      FRAME_X_WINDOW.
      
      * src/xdisp.c (remember_mouse_glyph, init_glyph_string): Use
      FRAME_X_DRAWABLE instead of FRAME_X_WINDOW.
      (redisplay_internal): Restart redisplay if a frame is garbaged
      during updating; explain why. Block buffer flips
      during redisplay.
      (redisplay_preserve_echo_area): Block buffer flip during call
      to redisplay_internal.
      (buffer_flip_blocked_depth): New variable.
      (block_buffer_flips, unblock_buffer_flips)
      (buffer_flipping_blocked_p): New functions.
      (init_glyph_string): Stop setting window member of struct
      glyph_string.
      
      * src/w32fns.c (w32_frame_parm_handlers): Add placeholder for
      x_set_inhibit_double_buffering.
      
      * src/termhooks.h (struct terminal): Add
      buffer_flipping_unblocked_hook.
      
      * src/nsfns.m (ns_frame_parm_handlers): Add placeholder for
      x_set_inhibit_double_buffering.
      
      * src/image.c (x_create_bitmap_from_data)
      (x_create_bitmap_from_file, x_create_x_image_and_pixmap)
      (Create_Pixmap_From_Bitmap_Data)
      (x_create_bitmap_from_xpm_data, xpm_load, gs_load): Use
      FRAME_X_DRAWABLE instead of FRAME_X_WINDOW; rename local
      variables appropriately.
      
      * src/gtkutil.c: Include Xdbe.h.
      (xg_get_widget_from_map): Forward declare.
      (xg_clear_under_internal_border): Remove obsolete calls to
      refresh scroll bars.
      (xg_create_frame_widgets): Call initial_set_up_x_back_buffer.
      (xg_free_frame_widgets): Call tear_down_x_back_buffer; reset
      FRAME_X_DRAWABLE as well as FRAME_X_WINDOW and for the
      same reason.
      (xg_set_background_color): Set scroll bar background colors.
      (xg_finish_scroll_bar_creation): New function with common
      logic of xg_create_scroll_bar, xg_create_horizontal_scroll_bar. Force
      scroll bars to be real X11 windows.
      (xg_create_scroll_bar, xg_create_horizontal_scroll_bar): Call
      xg_finish_scroll_bar_creation.
      (xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
      Remove obsolete calls to refresh scroll bars; fix comments.
      
      * src/ftxfont.c (ftxfont_get_gcs, ftxfont_draw_bitmap,
      (ftxfont_draw_background): Use FRAME_X_DRAWABLE instead of
      FRAME_X_WINDOW.
      
      * src/frame.c (frame_parms): Add table entry for new
      `inhibit-double-buffering' frame parameter
      (syms_of_frame): Register Qinhibit_double_buffering.
      
      * src/font.h (struct font_driver): Add new `flush_frame_caches' hook.
      (font_drop_xrender_surfaces): Declare.
      
      * src/font.c (font_drop_xrender_surfaces): New function.
      
      * src/Makefile.in (XDBE_LIBS, XDBE_CFLAGS): Substitute.
      
      * etc/NEWS: Mention use of double buffering
      
      * doc/lispref/frames.texi (Management Parameters): Document
      `inhibit-double-buffering' frame parameters.
      (Visibility of Frames): Document `x-double-buffered-p'.
      
      * configure.ac: Check for the X double buffer extension
      c2907158
  10. 30 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Limit <config.h>’s includes · f4eb8900
      Paul Eggert authored
      This follows up on recent problems with the fact that config.h
      includes stdlib.h etc.; some files need to include stdlib.h later.
      config.h generally should limit itself to includes that are
      universally safe; outside of MS-Windows, only stdbool.h makes
      the cut among the files currently included.  So, move the
      other includes to just the files that need them (Bug#24506).
      * configure.ac (config_opsysfile): Remove, as this generic hook
      is no longer needed.
      * lib-src/etags.c, src/unexmacosx.c, src/w32.c, src/w32notify.c:
      * src/w32proc.c (_GNU_SOURCE):
      Remove, as it’s OK for config.h to do this now.
      * src/conf_post.h: Include <ms-w32.h>, instead of the generic
      config_opsysfile, for simplicity as this old way of configuring is
      now done only for the MS-Windows port.  Do not include <ms-w32.h>
      if DEFER_MS_W32_H, for the benefit of the few files that want its
      effects later.  Do not include <alloca.h>, <string.h>, or
      <stdlib.h>.  Other files modified to include these headers as
      needed, or to not include headers that are no longer needed.
      * src/lisp.h: Include <alloca.h> and <string.h> here, since
      some of the inline functions need them.
      * src/regex.c: Include <alloca.h> if not emacs.  (If emacs,
      we can rely on SAFE_ALLOCA.)  There is no longer any need to
      worry about HAVE_ALLOCA_H.
      * src/unexmacosx.c: Rely on config.h not including stdlib.h.
      * src/w32.c, src/w32notify.c, src/w32proc.c (DEFER_MS_W32_H):
      Define before including <config.h> first, and include <ms-w32.h>
      after the troublesome headers.
      f4eb8900
  11. 08 Jun, 2016 1 commit
  12. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  13. 01 Jan, 2016 1 commit
  14. 21 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Include-file cleanup for src directory · 63cfb75f
      Paul Eggert authored
      Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707).
      In a few cases, add ‘#include "foo.h"’ if the file needs foo.h
      but does not include it directly.  As a general rule, a source
      file should include foo.h if it needs the interfaces that foo.h
      defines.
      * src/alloc.c: Don’t include process.h.  Include dispextern.h,
      systime.h.
      * src/atimer.c: Don’t include blockinput.h.
      * src/buffer.c: Include coding.h, systime.h.  Don’t include
      keyboard.h, coding.h.
      * src/callint.c: Don’t include commands.h, keymap.h.
      * src/callproc.c: Don’t include character.h, ccl.h, composite.h,
      systty.h, termhooks.h.
      * src/casetab.c: Don’t include character.h.
      * src/category.c: Don’t include charset.h, keymap.h.
      * src/ccl.h: Don’t include character.h.
      * src/character.c: Don’t include charset.h.
      * src/charset.c: Don’t include disptab.h.
      * src/chartab.c: Don’t include ccl.h.
      * src/cm.c: Don’t include frame.h, termhooks.h.
      * src/cmds.c: Don’t include window.h, dispextern.h.
      * src/coding.c: Don’t include window.h, frame.h.
      * src/composite.c: Include composite.h.  Don’t include window.h,
      font.h.
      * src/data.c: Don’t include syssignal.h, termhooks.h, font.h.
      * src/dbusbind.c: Don’t include frame.h.
      * src/decompress.c: Don’t include character.h.
      * src/dired.c: Don’t include character.h, commands.h, charset.h.
      * src/dispnew.c: Don’t include character.h, indent.h, intervals.h,
      process.h, timespec.h.  Include systime.h.
      * src/doc.c: Include coding.h.  Don’t include keyboard.h.
      * src/editfns.c: Include composite.h.  Don’t include frame.h.
      * src/emacs.c: Include fcntl.h, coding.h.  Don’t include
      commands.h, systty.h..
      * src/fileio.c: Don’t include intervals.h, dispextern.h.
      Include composite.h.
      * src/filelock.c: Don’t include character.h, systime.h.
      * src/fns.c: Don’t include time.h, commands.h, keyboard.h,
      keymap.h, frame.h, blockinput.h, xterm.h.  Include composite.h.
      * src/font.c: Include termhooks.h.
      * src/font.h: Don’t include ccl.h, frame.h.  Add forward decls of
      struct composition_it, struct face, struct glyph_string.
      * src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h,
      intervals.h, window.h, termhooks.h.
      * src/frame.c: Don’t include character.h, commands.h, font.h.
      * src/frame.h: Don’t include dispextern.h.
      * src/fringe.c: Don’t include character.h.
      * src/ftcrfont.c: Don’t include dispextern.h, frame.h,
      character.h, charset.h, fontset.h.
      * src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h,
      fontset.h.
      * src/ftxfont.c: Don’t include dispextern.h, character.h,
      charset.h, fontset.h.
      * src/gfilenotify.c: Don’t include frame.h, process.h.
      * src/gtkutil.c: Include dispextern.h, frame.h, systime.h.
      Don’t include syssignal.h, buffer.h, charset.h, font.h.
      * src/gtkutil.h: Don’t include frame.h.
      * src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h.
      Don’t include character.h.
      * src/indent.c: Don’t include keyboard.h, termchar.h.
      * src/inotify.c: Don’t include character.h, frame.h.
      * src/insdel.c: Include composite.h.  Don’t include blockinput.h.
      * src/intervals.c: Don’t include character.h, keyboard.h.
      * src/intervals.h: Don’t include dispextern.h, composite.h.
      * src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h.
      Include coding.h.
      * src/keyboard.h: Don’t incldue systime.h.
      * src/keymap.c: Don’t include charset.h, frame.h.
      * src/lread.c: Include dispextern.h and systime.h.
      Don’t include frame.h.  Include systime.h.
      * src/macros.c: Don’t include commands.h, character.h, buffer.h.
      * src/menu.c: Include character.h, coding.h.  Don’t include
      dispextern.h.
      * src/menu.h: Don’t include systime.h.
      * src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h,
      intervals.h, termhooks.h.
      * src/print.c: Include coding.h.  Don’t include keyboard.h,
      window.h, dispextern.h, termchar.h, termhooks.h, font.h.
      Add forward decl of struct terminal.
      * src/process.c: Don’t include termhooks.h, commands.h,
      dispextern.h, composite.h.
      * src/region-cache.c: Don’t include character.h.
      * src/scroll.c: Don’t include keyboard.h, window.h.
      * src/search.c: Don’t include category.h, commands.h.
      * src/sound.c: Don’t include dispextern.h.
      * src/syntax.c: Don’t include command.h, keymap.h.
      * src/sysdep.c: Don’t include window.h, dispextern.h.
      * src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’,
      * src/term.c: Don’t include systty.h, intervals.h, xterm.h.
      * src/terminal.c: Include character.h.
      Don’t include charset.h, coding.h.
      * src/textprop.c: Don’t include character.h.
      * src/undo.c: Don’t include character.h, commands.h, window.h.
      * src/unexsol.c: Don’t include character.h, charset.h.
      * src/widget.c: Include widget.h.  Don’t include keyboard.h,
      window.h, dispextern.h, blockinput.h, character.h, font.h.
      * src/widgetprv.h: Don’t include widget.h.
      * src/window.c: Don’t include character.h, menu.h, intervals.h.
      * src/xdisp.c: Include composite.h, systime.h.  Don’t include
      macros.h, process.h.
      * src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h,
      intervals.h.
      * src/xfns.c: Don’t include menu.h, character.h, intervals.h,
      epaths.h, fontset.h, systime.h, atimer.h, termchar.h.
      * src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h.
      * src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h.
      * src/xgselect.c: Don’t include timespec.h, frame.h.
      Include systime.h.
      * src/xgselect.h: Don’t include time.h.
      Use a forward decl to struct timespec instead.
      * src/xmenu.c: Don’t include keymap.h, character.h, charset.h,
      dispextern.h.  Include systime.h.
      * src/xml.c: Don’t include character.h.
      * src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h.
      * src/xselect.c: Don’t include dispextern.h, character.h,
      buffer.h, process.h.
      * src/xsmfns.c: Don’t include systime.h, sysselect.h.
      * src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h,
      intervals.h process.h, keymap.h, xgselect.h.  Include composite.h.
      63cfb75f
  15. 09 Feb, 2015 2 commits
  16. 25 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Count MANY function args more reliably · a3689d3c
      Paul Eggert authored
      * alloc.c (Fgc_status, purecopy, unbind_to, garbage_collect_1):
      * buffer.c (Fbuffer_list, Fkill_buffer):
      * callint.c (read_file_name, Fcall_interactively):
      * charset.c (Fset_charset_priority, syms_of_charset):
      * chartab.c (uniprop_encode_value_numeric):
      * coding.c (syms_of_coding):
      * composite.c (syms_of_composite):
      * data.c (wrong_range):
      * dbusbind.c (syms_of_dbusbind):
      * dired.c (file_attributes):
      * editfns.c (Fdecode_time, update_buffer_properties, format2):
      * eval.c (run_hook_with_args_2, apply1, call1, call2, call3)
      (call4, call5, call6, call7):
      * fileio.c (Finsert_file_contents, choose_write_coding_system)
      (Fcar_less_than_car, build_annotations, auto_save_error):
      * filelock.c (get_boot_time):
      * fns.c (internal_equal, nconc2, Fyes_or_no_p, Fwidget_apply):
      (maybe_resize_hash_table, secure_hash):
      * font.c (font_style_to_value, font_open_by_name, Flist_fonts):
      * fontset.c (fontset_add, Fset_fontset_font):
      * ftfont.c (ftfont_lookup_cache):
      * gtkutil.c (xg_get_font):
      * insdel.c (signal_before_change, signal_after_change):
      * keymap.c (append_key):
      * lread.c (load_warn_old_style_backquotes, Fload, init_lread):
      * minibuf.c (Fread_buffer):
      * print.c (print_preprocess):
      * process.c (Fformat_network_address, Fmake_network_process)
      (server_accept_connection):
      * sound.c (Fplay_sound_internal):
      * term.c (Fsuspend_tty, Fresume_tty):
      * window.c (window_list):
      * xdisp.c (run_redisplay_end_trigger_hook, add_to_log)
      (message_with_string):
      * xfaces.c (Fx_list_fonts):
      * xfont.c (syms_of_xfont):
      * xselect.c (x_handle_selection_request)
      (x_handle_selection_clear, x_clear_frame_selections)
      (x_clipboard_manager_error_1):
      Prefer CALLMANY and CALLN to counting args by hand.
      * doc.c (reread_doc_file): Remove unused code.
      * fns.c (concat2, concat3): Redo to avoid need for local-var vector.
      (cmpfn_user_defined, hashfn_user_defined, Fmaphash):
      Prefer call1 and call2 to Ffuncall.
      * keyboard.c (safe_run_hook_funcall, safe_run_hooks):
      Use struct literal rather than a local var, for simplicity.
      * keymap.c (where_is_internal): Use NULL rather than a pointer
      to unused args.
      * lisp.h (CALLMANY, CALLN): New macros.
      * sound.c (Fplay_sound_internal): Coalesce duplicate code.
      Fixes: bug#19634
      a3689d3c
  17. 22 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Use bool for boolean in xfont.c, xftfont.c, xgselect.c · b631bb57
      Paul Eggert authored
      * xfont.c (xfont_driver, xfont_chars_supported)
      (xfont_text_extents):
      * xftfont.c (xftfont_get_colors, xftfont_open)
      (xftfont_prepare_face, xftfont_done_face)
      (xftfont_cached_font_ok):
      * xgselect.c (xg_select):
      Use bool for boolean.
      b631bb57
  18. 01 Jan, 2015 2 commits
  19. 14 Nov, 2014 1 commit
  20. 29 Sep, 2014 1 commit
    • Dmitry Antipov's avatar
      Keep stack-allocated Lisp objects fast rather than versatile. · 71a72686
      Dmitry Antipov authored
      * 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.
      71a72686
  21. 25 Sep, 2014 1 commit
    • Paul Eggert's avatar
      Fix local_cons etc. to not exhaust the stack when in a loop. · 10381f58
      Paul Eggert authored
      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.
      10381f58
  22. 23 Sep, 2014 2 commits
    • Paul Eggert's avatar
      * lisp.h (lispstpcpy): Rename from lispstrcpy, and act like stpcpy. · 97914756
      Paul Eggert authored
      All callers changed.
      * xterm.c (x_term_init): Use new functionality to avoid two needs
      to compute a string length.
      97914756
    • Dmitry Antipov's avatar
      Use known length of a Lisp string to copy it faster. · 59e10fbd
      Dmitry Antipov authored
      * lisp.h (lispstrcpy): New function.  Add comment.
      * callproc.c (child_setup):
      * dbusbind.c (xd_append_arg):
      * doc.c (get_doc_string):
      * font.c (Ffont_xlfd_name):
      * frame.c (xrdb_get_resource):
      * process.c (Fmake_network_process, network_interface_info):
      * w32fns.c (Fx_open_connection):
      * w32proc.c (sys_spawnve):
      * xfns.c (select_visual):
      * xfont.c (xfont_list):
      * xsmfns.c (x_session_initialize):
      * xterm.c (x_term_init): Use it.
      59e10fbd
  23. 18 Sep, 2014 1 commit
    • Dmitry Antipov's avatar
      More and more stack-allocated Lisp objects if USE_LOCAL_ALLOCATORS. · 3cab7dd4
      Dmitry Antipov authored
      * 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.
      3cab7dd4
  24. 25 Aug, 2014 1 commit
    • Dmitry Antipov's avatar
      One more minor cleanup of font subsystem. · 8661ebaa
      Dmitry Antipov authored
      * font.h (struct font_driver): Convert text_extents to
      return void because returned value is never actually used.
      * macfont.c (macfont_text_extents):
      * w32font.c (w32font_text_extents):
      * xftfont.c (xftfont_text_extents): Adjust to return void
      and assume that 'metrics' argument is always non-NULL.
      * ftfont.c (ftfont_text_extents):
      * xfont.c (xfont_text_extents): Likewise.  Avoid redundant memset.
      8661ebaa
  25. 09 Jul, 2014 1 commit
    • Dmitry Antipov's avatar
      Next minor cleanup of font subsystem. · 876d043f
      Dmitry Antipov authored
      * font.h (enum font_property_index): Remove FONT_ENTITY_INDEX (no
      users) and FONT_FORMAT_INDEX (set by a few font drivers but never
      really used).
      (FONT_ENTITY_NOT_LOADABLE, FONT_ENTITY_SET_NOT_LOADABLE): Remove;
      unused.
      * ftfont.h (ftfont_font_format): Remove prototype.
      * ftfont.c (ftfont_font_format): Remove; now unused.
      (ftfont_open):
      * nsfont.m (nsfont_open):
      * w32font.c (w32font_open_internal):
      * w32uniscribe.c (uniscribe_open):
      * xfont.c (xfont_open):
      * xftfont.c (xftfont_open): All users changed.
      876d043f
  26. 04 Jul, 2014 1 commit
    • Dmitry Antipov's avatar
      * font.h (struct font_driver): Remove get_outline and free_outline; · 9d7b0167
      Dmitry Antipov authored
      not used by any font driver.
      * ftfont.c (ftfont_driver):
      * macfont.m (macfont_driver):
      * nsfont.m (nsfont_driver):
      * w32font.c (w32font_driver):
      * w32uniscribe.c (uniscribe_font_driver):
      * xfont.c (xfont_driver): Related users changed.
      * xselect.c (x_get_window_property): Use convenient xmalloc.
      Call to xfree only if some data was really allocated.
      9d7b0167
  27. 10 Jun, 2014 1 commit
    • Dmitry Antipov's avatar
      * dispextern.h (struct face) [HAVE_XFT]: Ifdef 'extra' member. · 24ce6a02
      Dmitry Antipov authored
      * font.c (font_done_for_face):
      * xface.c (realize_non_ascii_face): Adjust user.
      * font.h (struct font_driver): Convert 'prepare_face' to return
      void because its return value is never used anyway.
      * xfont.c (xfont_prepare_face): Return void.
      * xftfont.c (xftfont_prepare_face): Likewise.  Use xmalloc.
      (xftfont_done_face): Use xfree.
      24ce6a02
  28. 03 Mar, 2014 1 commit
    • Dmitry Antipov's avatar
      Avoid crashes when X fonts are erroneously freed on reused X · 19dae293
      Dmitry Antipov authored
      'Display *' connection data (Bug#16069).  Note that X font
      resources still may be leaked, but currently there is no way
      to completely avoid it.
      * xterm.h (struct x_display_info): New member x_id.  Add comments.
      * xterm.c (x_display_id): New variable.
      (x_term_init): Assign identifier to each opened X connection.
      * xfont.c (struct xfont): New member x_display_id.
      (xfont_open): Initialize it with frame's display id.
      (xfont_close): Check whether font's display id matches the one
      recorded for the given display.  Adjust comment.
      * xftfont.c (struct xftfont_info):
      (xftfont_open, xftfont_close): Exactly as above with xfont stuff.
      19dae293
  29. 01 Jan, 2014 1 commit
  30. 22 Dec, 2013 1 commit
  31. 16 Dec, 2013 1 commit
    • Dmitry Antipov's avatar
      * font.c (valid_font_driver) [ENABLE_CHECKING]: New function · 5ae356d9
      Dmitry Antipov authored
      intended to find bogus pointers in font objects (Bug#16140).
      * font.h (valid_font_driver) [ENABLE_CHECKING]: Add prototype.
      * alloc.c (cleanup_vector): Use valid_font_driver in eassert.
      (compact_font_cache_entry, compact_font_caches) [!HAVE_NTGUI]:
      Disable for MS-Windows due to Bug#15876; apparently this
      requires more or less substantial changes in fontset code.
      * xfont.c (xfont_close):
      * xftfont.c (xftfont_close): Call x_display_info_for_display
      to check whether 'Display *' is valid (Bug#16093 and probably
      Bug#16069).
      5ae356d9
  32. 13 Dec, 2013 1 commit
  33. 12 Dec, 2013 1 commit
    • Dmitry Antipov's avatar
      * font.h (struct font_entity) [HAVE_NS]: New field to record · cf86e18b
      Dmitry Antipov authored
      font driver which was used to create this entity.
      (struct font) [HAVE_WINDOW_SYSTEM]: New field to record
      frame where the font was opened.
      (font_close_object): Add prototype.
      * font.c (font_make_entity) [HAVE_NS]: Zero out driver field.
      (font_close_object): Not static any more.  Lost frame arg.
      Adjust comment and users.
      * alloc.c (cleanup_vector): Call font_close_object to adjust
      per-frame font counters correctly.  If HAVE_NS, also call
      driver-specific cleanup for font-entity objects.
      * ftfont.c (ftfont_open):
      * nsfont.m (nsfont_open):
      * w32font.c (w32font_open_internal):
      * xfont.c (xfont_open):
      * xftfont.c (xftfont_open): Save frame pointer in font object.
      * macfont.m (macfont_open): Likewise.
      (macfont_descriptor_entity): Save driver pointer to be able
      to call its free_entity routine when font-entity is swept.
      * ftxfont.c (ftxfont_open): Add eassert because frame
      pointer should be saved by ftfont_driver.open.
      cf86e18b
  34. 04 Nov, 2013 1 commit
    • Paul Eggert's avatar
      Port to stricter C99 platforms. · 91f2d272
      Paul Eggert authored
      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.
      91f2d272
  35. 25 Oct, 2013 1 commit
    • Dmitry Antipov's avatar
      Omit unused frame argument of font API's close function. · 78e0b35c
      Dmitry Antipov authored
      * font.h (struct font): Drop frame argument.  Adjust comment.
      * font.c (font_clear_cache, font_close_object): Adjust users.
      * ftfont.c (ftfont_close):
      * ftxfont.c (ftxfont_close):
      * macfont.m (macfont_close):
      * nsfont.m (nsfont_close):
      * w32font.c (w32font_close):
      * xfont.c (xfont_close):
      * xftfont.c (xftfont_close): Adjust driver-specific close
      functions, tweak comments and make functions safe if called
      more than once for the same font object.
      78e0b35c
  36. 24 Sep, 2013 1 commit
    • Dmitry Antipov's avatar
      Use union for the payload of struct Lisp_Vector. · d6d9cbc1
      Dmitry Antipov authored
      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.
      d6d9cbc1
  37. 13 Sep, 2013 1 commit
    • Dmitry Antipov's avatar
      Unify FRAME_window_system_DISPLAY_INFO macros between all ports. · aad3612f
      Dmitry Antipov authored
      All of them are replaced with FRAME_DISPLAY_INFO, defined in
      each port to reference the port-specific window system data.
      * msdos.h (FRAME_X_DISPLAY_INFO): Remove.
      (FRAME_DISPLAY_INFO): Define.
      * w32term.h (FRAME_W32_DISPLAY_INFO, FRAME_X_DISPLAY_INFO): Remove.
      (FRAME_DISPLAY_INFO): Define.  Adjust users.
      * xterm.h (FRAME_X_DISPLAY_INFO): Remove.
      (FRAME_DISPLAY_INFO): Define.  Adjust users.
      * frame.h (FRAME_RES_X, FRAME_RES_Y): Unify.
      * font.c, frame.c, gtkutil.c, image.c, menu.c, msdos.c, nsfns.m:
      * nsfont.m, nsterm.m, w32fns.c, w32font.c, w32menu.c, w32term.c:
      * w32xfns.c, widget.c, xdisp.c, xfaces.c, xfns.c, xfont.c, xmenu.c:
      * xselect.c, xterm.c: All related users changed.
      aad3612f