1. 01 Jan, 2019 1 commit
  2. 16 Feb, 2018 1 commit
  3. 01 Jan, 2018 1 commit
  4. 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
  5. 08 Jul, 2017 1 commit
  6. 06 Jul, 2017 1 commit
    • Paul Eggert's avatar
      Convert hex digits more systematically · d6662694
      Paul Eggert authored
      This makes the code a bit smaller and presumably faster, as
      it substitutes a single lookup for conditional jumps.
      * src/character.c (hexdigit): New constant.
      (syms_of_character) [HEXDIGIT_IS_CONST]: Initialize it.
      * src/character.h (HEXDIGIT_CONST, HEXDIGIT_IS_CONST): New macros.
      (hexdigit): New decl.
      (char_hexdigit): New inline function.
      * src/charset.c: Do not include c-ctype.h.
      * src/charset.c (read_hex):
      * src/editfns.c (styled_format):
      * src/image.c (xbm_scan):
      * src/lread.c (read_escape):
      * src/regex.c (ISXDIGIT) [emacs]:
      Use char_hexdigit insted of doing it by hand.
      d6662694
  7. 22 Jun, 2017 2 commits
    • Paul Eggert's avatar
      Use unlocked stdio more systematically · f6ef15cf
      Paul Eggert authored
      This can improve performance significantly on stdio-bottlenecked code.
      E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
      * admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
      * lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
      * lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
      * lib-src/profile.c, lib-src/update-game-score.c:
      Include unlocked-io.h instead of stdio.h, since these programs are
      single-threaded.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
      * src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
      * src/lread.c, src/term.c:
      Include sysstdio.h, possibly instead of stdio.h, to define
      the unlocked functions if the system does not provide them.
      * src/charset.c, src/lread.c (getc_unlocked):
      Remove, since sysstdio.h now defines it if needed.
      * src/cm.c (cmputc, cmcheckmagic):
      * src/dispnew.c (update_frame, update_frame_with_menu)
      (update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
      * src/emacs.c (main, Fdump_emacs):
      * src/fileio.c (Fdo_auto_save, Fset_binary_mode):
      * src/image.c (slurp_file, png_read_from_file, png_load_body)
      (our_stdio_fill_input_buffer):
      * src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
      * src/lread.c (readbyte_from_file):
      * src/minibuf.c (read_minibuf_noninteractive):
      * src/print.c (printchar_to_stream, strout)
      (Fredirect_debugging_output):
      * src/sysdep.c (reset_sys_modes, procfs_ttyname)
      (procfs_get_total_memory):
      * src/term.c (tty_ring_bell, tty_send_additional_strings)
      (tty_set_terminal_modes, tty_reset_terminal_modes)
      (tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
      (tty_write_glyphs_with_face, tty_insert_glyphs)
      (tty_menu_activate):
      * src/xfaces.c (Fx_load_color_file):
      Use unlocked stdio when it should be safe.
      * src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
      (fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
      (fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
      (putc_unlocked, putchar_unloced): Provide substitutes if not declared.
      f6ef15cf
    • Ken Raeburn's avatar
      Use getc_unlocked. · efe200c1
      Ken Raeburn authored
      * configure.ac: Check for getc_unlocked.
      * src/charset.c (read_hex, load_charset_map_from_file): Use
      getc_unlocked instead of getc.
      (getc_unlocked) [!HAVE_GETC_UNLOCKED]: Fall back to getc.
      * src/lread.c (readbyte_from_file, Fget_file_char, read1,
      getc_unlocked): Likewise.
      efe200c1
  8. 01 Jan, 2017 1 commit
  9. 22 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Pacify --enable-gcc-warnings · b10bd719
      Paul Eggert authored
      * src/charset.c (load_charset_map):
      * src/coding.c (decode_coding_object):
      * src/frame.c (make_frame):
      * src/window.c (Frecenter):
      Mark locals with UNINIT to silence false alarms from
      -Wmaybe-uninitialized.
      * src/lisp.h (SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD)
      (SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD):
      Check and assume that values are nonnull.  This pacifies
      -Wmaybe-uninitialized in Fmake_variable_buffer_local and
      Fmake_local_variable.
      b10bd719
  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. 24 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Improve integer overflow handling a bit · b3e1b382
      Paul Eggert authored
      * src/charset.c (read_hex): Use INT_LEFT_SHIFT_OVERFLOW for clarity.
      The machine code is the same on my platform.
      * src/doprnt.c (doprnt):
      * src/emacs-module.c (module_funcall):
      * src/font.c (font_intern_prop):
      * src/keyboard.c (Frecursion_depth):
      * src/lread.c (read1):
      Use WRAPV macros instead of checking overflow by hand.
      * src/editfns.c (hi_time, time_arith, decode_time_components):
      * src/emacs-module.c (Fmodule_load):
      Simplify by using FIXNUM_OVERFLOW_P.
      * src/emacs-module.c: Include intprops.h.
      * src/xdisp.c (percent99): New function.
      (decode_mode_spec): Use it to simplify overflow avoidance and
      formatting of %p and %P.
      b3e1b382
  12. 21 Aug, 2016 1 commit
    • Paul Eggert's avatar
      Minor text-quoting-style fixes · b1601a95
      Paul Eggert authored
      * src/charset.c (check_iso_charset_parameter):
      * src/frame.c (store_frame_param):
      * src/xselect.c (x_fill_property_data):
      Use grave accent for left single quote in ‘error’ format strings.
      b1601a95
  13. 24 Jul, 2016 1 commit
    • Paul Eggert's avatar
      ‘signal’ no longer returns · 50cc08bf
      Paul Eggert authored
      Although for decades ‘signal’ has been documented to not return,
      a corner case in the Lisp debugger causes ‘signal’ to return.
      Remove the corner case and adjust Emacs internals accordingly.
      An alternative would be to document the corner case, but this
      would complicate the Lisp API unnecessarily.  (Bug#24047)
      * src/eval.c (signal_or_quit): New function, with most of the
      old contents of Fsignal.
      (quit): New function, which uses signal_or_quit and which
      might return.  All keyboard-based callers of Fsignal (Qquit,
      Qnil) changed to use this new function instead.
      (Fsignal): Use signal_or_quit.  Now _Noreturn.  All callers
      changed.
      (xsignal): Move to lisp.h.
      * src/lisp.h (xsignal): Now an inline function, as it's now
      just an alias for Fsignal.
      50cc08bf
  14. 30 Jun, 2016 1 commit
    • Dmitry Antipov's avatar
      Cleanup around mature character manipulation functions · 4bd35039
      Dmitry Antipov authored
      * lisp/international/mule-diag.el (decode-codepage-char): Remove.
      
      * lisp/ldefs-boot.el (toplevel): Adjust accordingly.
      
      * lisp/subr.el (toplevel): Do not advertise calling conventions
      for 'decode-char' and 'encode-char'.
      
      * src/charset.c (Fdecode_char, Fencode_char): Remove unused 3rd arg.
      4bd35039
  15. 08 Jun, 2016 1 commit
  16. 30 May, 2016 1 commit
    • Paul Eggert's avatar
      Omit IF_LINT code that no longer seems needed · 237244bb
      Paul Eggert authored
      Nowadays GCC is smarter, or the Emacs code has mutated, or both,
      and now is as good a time as any to remove uses of IF_LINT that
      now seem to be unnecessary.
      * lib-src/emacsclient.c (set_local_socket):
      * lib-src/movemail.c (main) [MAIL_USE_MAILLOCK && HAVE_TOUCHLOCK]:
      * src/buffer.c (fix_start_end_in_overlays, fix_overlays_before):
      * src/casefiddle.c (casify_region):
      * src/charset.c (load_charset_map):
      * src/coding.c (decode_coding_object, encode_coding_object):
      * src/data.c (Fmake_variable_buffer_local, Fmake_local_variable)
      (cons_to_unsigned, cons_to_signed):
      * src/frame.c (make_frame, x_set_frame_parameters):
      * src/keyboard.c (read_event_from_main_queue):
      * src/regex.c (regex_compile):
      * src/syntax.c (back_comment):
      * src/window.c (Frecenter):
      * src/xfaces.c (Fx_list_fonts):
      Remove IF_LINT that no longer seems necessary.
      * src/image.c (png_load_body, jpeg_load_body): Simplify use of IF_LINT.
      * src/keyboard.c (read_char): Use IF_LINT (volatile) rather than
      a pragma dance to pacify GCC -Wclobbered.
      * src/xdisp.c (x_produce_glyphs): Rewrite to avoid need for IF_LINT.
      
      * src/xterm.c (x_connection_closed): Now _Noreturn, which should
      mean we do not need IF_LINT any more.
      (x_io_error_quitter): Now _Noreturn.  Put an 'assume (false)’
      at the end, to forestall warnings from older compilers.
      237244bb
  17. 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
  18. 05 Feb, 2016 1 commit
    • Paul Eggert's avatar
      Prefer memcpy and memset to doing it by hand · 605f9019
      Paul Eggert authored
      * src/alloc.c (Fmake_vector):
      * src/ccl.c (setup_ccl_program):
      Use memset to clear array.
      * src/alloc.c (Fvector, Fmake_byte_code):
      * src/charset.c (Fdefine_charset_internal):
      Use memcpy to copy array.
      605f9019
  19. 01 Jan, 2016 1 commit
  20. 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
  21. 13 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Make add_to_log varargs · fbee6265
      Paul Eggert authored
      * src/alloc.c (run_finalizer_handler):
      * src/charset.c (load_charset_map_from_vector):
      * src/nsimage.m (ns_load_image):
      * src/xfaces.c (load_pixmap, load_color2):
      Simplify, now that add_to_log has a variable number of args.
      * src/image.c (image_error): Take a variable number of args.
      Callers simplified.
      * src/lisp.h (add_to_log, vadd_to_log): Adjust to new APIs.
      * src/xdisp.c (format_nargs, vadd_to_log): New functions.
      (add_to_log): Make varargs, and reimplement in terms of vadd_to_log.
      * src/xfaces.c (merge_face_ref): Fix typo that omitted color name.
      fbee6265
  22. 31 May, 2015 1 commit
    • Paul Eggert's avatar
      Remove unused DEFSYMs · 0c2a3cf6
      Paul Eggert authored
      Remove DEFSYMs that aren't used at the C level.  Also:
      * src/decompress.c (Qzlib_dll):
      * src/font.c (Qunicode_sip):
      * src/frame.c (Qtip_frame):
      * src/ftfont.c (Qserif):
      * src/gnutls.c (Qgnutls_dll):
      * src/xml.c (Qlibxml2_dll):
      Move from here ...
      * src/w32fns.c (syms_of_w32fns): ... to here,
      as these are used only on MS-Windows.
      0c2a3cf6
  23. 21 Feb, 2015 1 commit
    • Paul Eggert's avatar
      Prefer 'Qfoo' to 'intern ("foo")' · 3ebf0630
      Paul Eggert authored
      * buffer.c (syms_of_buffer):
      * bytecode.c (exec_byte_code):
      * callint.c (Fcall_interactively):
      * callproc.c (create_temp_file):
      * charset.c (define_charset_internal):
      * coding.c (syms_of_coding):
      * editfns.c (syms_of_editfns):
      * emacs.c (main):
      * fns.c (syms_of_fns):
      * frame.c (delete_frame, Fframe_parameters):
      * keyboard.c (syms_of_keyboard):
      * keymap.c (syms_of_keymap):
      * minibuf.c (read_minibuf, syms_of_minibuf):
      * nsfns.m (ns_cursor_type_to_lisp):
      * textprop.c (syms_of_textprop):
      * xdisp.c (Fformat_mode_line, syms_of_xdisp):
      * xfns.c (x_create_tip_frame, Fx_select_font):
      * xml.c (parse_region):
      Prefer constants like 'Qfoo' to calls like 'intern ("foo")'.
      * buffer.c (syms_of_buffer): OK to do (put 'erase-buffer 'disabled
      t) here now ...
      (keys_of_buffer): ... instead of here.
      * ftfont.c (syms_of_ftfont): Move DEFSYM of Qmono from here ...
      * xfns.c (syms_of_xfns): ... to here, since ftfont.c is more
      optional than xfns.c.
      3ebf0630
  24. 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
  25. 05 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Compute C decls for DEFSYMs automatically · 58f2d6ef
      Paul Eggert authored
      Fixes Bug#15880.
      This patch also makes Q constants (e.g., Qnil) constant addresses
      from the C point of view.
      * make-docfile.c: Revamp to generate table of symbols, too.
      Include <stdbool.h>.
      (xstrdup): New function.
      (main): Don't process the same file twice.
      (SYMBOL): New constant in enum global_type.
      (struct symbol): Turn 'value' member into a union, either v.value
      for int or v.svalue for string.  All uses changed.
      (add_global): New arg svalue, which overrides value, so that globals
      can have a string value.
      (close_emacs_global): New arg num_symbols; all uses changed.
      Output lispsym decl.
      (write_globals): Output symbol globals too.  Output more
      ATTRIBUTE_CONST, now that Qnil etc. are C constants.
      Output defsym_name table.
      (scan_c_file): Move most of guts into ...
      (scan_c_stream): ... new function.  Scan for DEFSYMs and
      record symbols found.  Don't read past EOF if file doesn't
      end in newline.
      * alloc.c, bidi.c, buffer.c, bytecode.c, callint.c, casefiddle:
      * casetab.c, category.c, ccl.c, charset.c, chartab.c, cmds.c, coding.c:
      * composite.c, data.c, dbusbind.c, decompress.c, dired.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, fns.c, font.c, fontset.c:
      * frame.c, fringe.c, ftfont.c, ftxfont.c, gfilenotify.c, gnutls.c:
      * image.c, inotify.c, insdel.c, keyboard.c, keymap.c, lread.c:
      * macfont.m, macros.c, minibuf.c, nsfns.m, nsfont.m, nsimage.m:
      * nsmenu.m, nsselect.m, nsterm.m, print.c, process.c, profiler.c:
      * search.c, sound.c, syntax.c, term.c, terminal.c, textprop.c, undo.c:
      * window.c, xdisp.c, xfaces.c, xfns.c, xftfont.c, xmenu.c, xml.c:
      * xselect.c, xsettings.c, xterm.c:
      Remove Q vars that represent symbols (e.g., Qnil, Qt, Qemacs).
      These names are now defined automatically by make-docfile.
      * alloc.c (init_symbol): New function.
      (Fmake_symbol): Use it.
      (c_symbol_p): New function.
      (valid_lisp_object_p, purecopy): Use it.
      * alloc.c (marked_pinned_symbols):
      Use make_lisp_symbol instead of make_lisp_ptr.
      (garbage_collect_1): Mark lispsym symbols.
      (CHECK_ALLOCATED_AND_LIVE_SYMBOL): New macro.
      (mark_object): Use it.
      (sweep_symbols): Sweep lispsym symbols.
      (symbol_uses_obj): New function.
      (which_symbols): Use it.  Work for lispsym symbols, too.
      (init_alloc_once): Initialize Vpurify_flag here; no need to wait,
      since Qt's address is already known now.
      (syms_of_alloc): Add lispsym count to symbols_consed.
      * buffer.c (init_buffer_once): Compare to Qnil, not to make_number (0),
      when testing whether storage is all bits zero.
      * dispextern (struct image_type):
      * font.c (font_property_table):
      * frame.c (struct frame_parm_table, frame_parms):
      * keyboard.c (scroll_bar_parts, struct event_head):
      * xdisp.c (struct props):
      Use XSYMBOL_INIT (Qfoo) and struct Lisp_Symbol * rather than &Qfoo and
      Lisp_Object *, since Qfoo is no longer an object whose address can be
      taken.  All uses changed.
      * eval.c (run_hook): New function.  Most uses of Frun_hooks changed to
      use it, so that they no longer need to take the address of a Lisp sym.
      (syms_of_eval): Don't use DEFSYM on Vrun_hooks, as it's a variable.
      * frame.c (syms_of_frame): Add defsyms for the frame_parms table.
      * keyboard.c (syms_of_keyboard): Don't DEFSYM Qmenu_bar here.
      DEFSYM Qdeactivate_mark before the corresponding var.
      * keymap.c (syms_of_keymap): Use DEFSYM for Qmenu_bar and Qmode_line
      instead of interning their symbols; this avoids duplicates.
      (LISP_INITIALLY, TAG_PTR)
      (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END, XSYMBOL_INIT):
      New macros.
      (LISP_INITIALLY_ZERO): Use it.
      (enum symbol_interned, enum symbol_redirect, struct Lisp_Symbol)
      (EXFUN, DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_*):
      Move decls up, to avoid forward uses.  Include globals.h earlier, too.
      (make_lisp_symbol): New function.
      (XSETSYMBOL): Use it.
      (DEFSYM): Now just a placeholder for make-docfile.
      * lread.c (DEFINE_SYMBOLS): Define, for globals.h.
      (intern_sym): New function, with body taken from old intern_driver.
      (intern_driver): Use it.  Last arg is now Lisp integer, not ptrdiff_t.
      All uses changed.
      (define_symbol): New function.
      (init_obarray): Define the C symbols taken from lispsym.
      Use plain DEFSYM for Qt and Qnil.
      * syntax.c (init_syntax_once): No need to worry about
      Qchar_table_extra_slots.
      58f2d6ef
  26. 01 Jan, 2015 2 commits
  27. 20 Dec, 2014 2 commits
  28. 01 Oct, 2014 1 commit
    • Paul Eggert's avatar
      Use AUTO_CONS instead of SCOPED_CONS, etc. · 27900ac7
      Paul Eggert authored
      * 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.
      27900ac7
  29. 30 Sep, 2014 1 commit
    • Paul Eggert's avatar
      Simplify stack-allocated Lisp objects, and make them more portable. · dc452569
      Paul Eggert authored
      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.
      dc452569
  30. 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
  31. 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
  32. 16 Sep, 2014 1 commit
    • Dmitry Antipov's avatar
      If USE_LOCAL_ALLOCATORS, allocate even more Lisp objects on stack. · b98b1a83
      Dmitry Antipov authored
      * charset.c (load_charset_map_from_file): Use scoped_list2
      and build_local_string.
      * buffer.c (Fother_buffer, other_buffer_safely, init_buffer):
      * emacs.c (init_cmdargs, decode_env_path):
      * fileio.c (Fexpand_file_name):
      * fns.c (maybe_resize_hash_table) [ENABLE_CHECKING]:
      * frame.c (x_get_arg):
      * keyboard.c (safe_run_hooks_error):
      * lread.c (load_warn_old_style_backquotes):
      * xdisp.c (Fcurrent_bidi_paragraph_direction):
      * xfns.c (x_default_scroll_bar_color_parameter, select_visual):
      * xselect.c (x_clipboard_manager_error_1)
      (x_clipboard_manager_save_all):
      * xterm.c (x_term_init): Use build_local_string.
      b98b1a83
  33. 15 Sep, 2014 1 commit
    • Dmitry Antipov's avatar
      If USE_LOCAL_ALLOCATORS, allocate some Lisp objects on stack. · edb0288b
      Dmitry Antipov authored
      * 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.
      edb0288b
  34. 11 Sep, 2014 2 commits
    • Dmitry Antipov's avatar
      Remove redundant GCPROs around Ffuncall and Fapply calls. This · 1dd12186
      Dmitry Antipov authored
      is safe because Ffuncall protects all of its arguments by itself.
      * charset.c (map_charset_for_dump): Remove redundant GCPRO.
      * eval.c (Fapply, apply1, call0, call1, call2, call3, call4, call5)
      (call6, call7): Likewise.  Use compound literals where applicable.
      (run_hook_with_args_2): Use compound literal.
      1dd12186
    • Paul Eggert's avatar
      * charset.c (Fget_unused_iso_final_char): Fix subscript error. · fe252976
      Paul Eggert authored
      Use check_iso_charset_parameter instead of doing the checks by hand.
      (check_iso_charset_parameter): Move up.  Check parameters a bit
      more carefully, and return true for 96-char sets.  All callers changed.
      fe252976
  35. 01 Sep, 2014 1 commit
    • Dmitry Antipov's avatar
      Avoid extra calls to strlen in filesystem I/O routines. · 50e9e580
      Dmitry Antipov authored
      * fileio.c (Fexpand_file_name): Avoid calls to strlen if
      the length of 'newdir' is known or may be precalculated.
      (file_accessible_directory_p): Prefer to pass Lisp_Object,
      not 'char *', and so use precalculated length.
      (Ffile_accessible_directory_p):
      * callproc.c (encode_current_directory, init_callproc):
      * charset.c (init_charset):
      * lread.c (load_path_check, load_path_default): Adjust users.
      * lisp.h (file_accessible_directory_p): Tweak prototype.
      50e9e580
  36. 23 Jun, 2014 1 commit
    • Dmitry Antipov's avatar
      Simplify and cleanup character conversion stuff. · 200fc949
      Dmitry Antipov authored
      * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe):
      Remove prototypes.
      * character.c (multibyte_char_to_unibyte)
      (multibyte_char_to_unibyte_safe): Remove; no longer used.
      * character.h (make_char): Remove; unused.
      (CHAR_TO_BYTE8, CHAR_TO_BYTE_SAFE): Simplify.
      (ASCII_BYTE_P): Remove; ASCII_CHAR_P does the same thing.
      * buffer.c, charset.c, charset.h, cmds.c, coding.c, editfns.c:
      * fileio.c, indent.c, insdel.c, keyboard.c, lread.c, print.c:
      * search.c, term.c, xdisp.c, xterm.c: Related users changed.
      200fc949