1. 13 May, 2017 2 commits
    • Philipp's avatar
      Make `old-style-backquotes' variable internal · a1d46159
      Philipp authored
      * src/lread.c (load_warn_old_style_backquotes, Fload, read1)
      (syms_of_lread): Rename `old-style-backquotes' to
      `lread--old-style-backquotes', and clarify that it's for internal
      use only.
      * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Rename
      variable.
      * test/src/lread-tests.el (lread-tests--old-style-backquotes): Add
      unit test.
      * emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--old-style-backquotes): Add unit test.
      a1d46159
    • Philipp Stephani's avatar
      Improve unescaped character literal warnings · 16004397
      Philipp Stephani authored
      * src/lread.c (load_warn_unescaped_character_literals)
      (syms_of_lread):
      lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Improve
      formatting of unescaped character literal warnings.
      
      * test/src/lread-tests.el (lread-tests--unescaped-char-literals):
      test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--unescaped-char-literals): Adapt unit tests.
      16004397
  2. 09 May, 2017 1 commit
    • Glenn Morris's avatar
      Put re-loaded file back at start of load-history (bug#26837) · db30296b
      Glenn Morris authored
      * src/lread.c (readevalloop): Fix the "whole buffer" check to
      operate in the correct buffer.
      (Feval_buffer): Move point back to the start after checking
      for lexical binding.
      * test/src/lread-tests.el (lread-test-bug26837): New test.
      * test/data/somelib.el, test/data/somelib2.el: New test data files.
      db30296b
  3. 01 May, 2017 1 commit
    • Philipp Stephani's avatar
      Warn about missing backslashes during load · c2bbdc33
      Philipp Stephani authored
      * src/lread.c (load_warn_unescaped_character_literals, Fload, read1)
      (syms_of_lread): Warn if unescaped character literals are
      found (Bug#20152).
      * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Check for
      unescaped character literals during byte compilation.
      * test/src/lread-tests.el (lread-tests--unescaped-char-literals): New
      unit test.
      (lread-tests--with-temp-file, lread-tests--last-message): Helper
      functions for unit test.
      * test/lisp/emacs-lisp/bytecomp-tests.el
      (bytecomp-tests--unescaped-char-literals): New unit test.
      * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file):
      Helper macro for unit test.
      c2bbdc33
  4. 10 Apr, 2017 1 commit
    • Lars Brinkhoff's avatar
      Add PVSIZE function to return the size of a pseudovector. · 3ccd0ff1
      Lars Brinkhoff authored
      * src/lisp.h (PVSIZE): New function.
      
      * src/chartab.c (copy_char_table):
      * src/data.c (Ftype_of, Finteractive_form, Faref, Faset):
      * src/doc.c (Fdocumentation, store_function_docstring):
      * src/eval.c (Fcommandp, funcall_lambda, lambda_arity, Ffetch_bytecode):
      * src/fns.c (Flength, Fcopy_sequence):
      * src/font.h (FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P):
      * src/lread.c (substitute_object_recurse):
      * src/src/print.c (print_object):
        Use it.
      3ccd0ff1
  5. 08 Apr, 2017 1 commit
  6. 04 Apr, 2017 1 commit
    • Lars Brinkhoff's avatar
      Add record objects with user-defined types. · a2c33430
      Lars Brinkhoff authored
      * src/alloc.c (allocate_record): New function.
      (Fmake_record, Frecord, Fcopy_record): New functions.
      (syms_of_alloc): defsubr them.
      (purecopy): Work with records.
      
      * src/data.c (Ftype_of): Return slot 0 for record objects, or type
      name if record's type holds class.
      (Frecordp): New function.
      (syms_of_data): defsubr it.  Define `Qrecordp'.
      (Faref, Faset): Work with records.
      
      * src/fns.c (Flength): Work with records.
      
      * src/lisp.h (prec_type): Add PVEC_RECORD.
      (RECORDP, CHECK_RECORD, CHECK_RECORD_TYPE): New functions.
      
      * src/lread.c (read1): Add syntax for records.
      
      * src/print.c (PRINT_CIRCLE_CANDIDATE_P): Add RECORDP.
      (print_object): Add syntax for records.
      
      * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-2):
      New test.
      
      * test/src/alloc-tests.el (record-1, record-2, record-3):
      New tests.
      
      * doc/lispref/elisp.texi, doc/lispref/objects.texi,
      doc/lispref/records.texi: Add documentation for records.
      a2c33430
  7. 02 Mar, 2017 1 commit
    • Paul Eggert's avatar
      Restore XFLOATINT but with restricted args · 56aaaf9b
      Paul Eggert authored
      Turn instances of extract_float into XFLOAT_DATA when possible,
      and to a resurrected XFLOATINT when the arg is a number.
      The resurrected XFLOATINT is more like XFLOAT and XINT in
      that is valid only if its arg is a number.  This clarifies
      the ways in which floats can be extracted at the C level.
      * src/editfns.c (styled_format):
      * src/floatfns.c (extract_float, Fexpt):
      Use XFLOATINT rather than open-coding it.
      * src/fns.c (internal_equal):
      * src/image.c (imagemagick_load_image):
      * src/xdisp.c (resize_mini_window):
      Prefer XFLOAT_DATA to extract_float on values known to be floats.
      * src/frame.c (x_set_screen_gamma):
      * src/frame.h (NUMVAL):
      * src/image.c (x_edge_detection, compute_image_size):
      * src/lread.c (read_filtered_event):
      * src/window.c (Fset_window_vscroll):
      * src/xdisp.c (handle_single_display_spec, try_scrolling)
      (redisplay_window, calc_pixel_width_or_height, x_produce_glyphs)
      (on_hot_spot_p):
      Prefer XFLOATINT to extract_float on values known to be numbers.
      * src/lisp.h (XFLOATINT): Bring back this function, except
      it now assumes its argument is a number.
      56aaaf9b
  8. 24 Feb, 2017 1 commit
    • Gemini Lasswell's avatar
      Support read syntax for circular objects in Edebug (Bug#23660) · 8b912ab4
      Gemini Lasswell authored
      * lisp/emacs-lisp/edebug.el (edebug-read-special): New name
      for edebug-read-function. Handle the read syntax for circular
      objects.
      (edebug-read-objects): New variable.
      (edebug-read-and-maybe-wrap-form1): Reset edebug-read-objects.
      
      * src/lread.c (Fsubstitute_object_in_subtree): Make
      substitute_object_in_subtree into a Lisp primitive.
      8b912ab4
  9. 01 Feb, 2017 1 commit
    • Paul Eggert's avatar
      Revamp quitting and fix infloops · b01ac672
      Paul Eggert authored
      This fixes some infinite loops that cannot be quitted out of,
      e.g., (defun foo () (nth most-positive-fixnum '#1=(1 . #1#)))
      when byte-compiled and when run under X.  See:
      http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00577.html
      This also attempts to keep the performance improvements I recently
      added, as much as possible under the constraint that the infloops
      must be caught.  In some cases this fixes infloop bugs recently
      introduced when I removed immediate_quit.
      * src/alloc.c (Fmake_list):
      Use rarely_quit, not maybe_quit, for speed in the usual case.
      * src/bytecode.c (exec_byte_code):
      * src/editfns.c (Fcompare_buffer_substrings):
      * src/fns.c (Fnthcdr):
      * src/syntax.c (scan_words, skip_chars, skip_syntaxes)
      (Fbackward_prefix_chars):
      Use rarely_quit so that users can C-g out of long loops.
      * src/callproc.c (call_process_cleanup, call_process):
      * src/fileio.c (read_non_regular, Finsert_file_contents):
      * src/indent.c (compute_motion):
      * src/syntax.c (scan_words, Fforward_comment):
      Remove now-unnecessary maybe_quit calls.
      * src/callproc.c (call_process):
      * src/doc.c (get_doc_string, Fsnarf_documentation):
      * src/fileio.c (Fcopy_file, read_non_regular, Finsert_file_contents):
      * src/lread.c (safe_to_load_version):
      * src/sysdep.c (system_process_attributes) [GNU_LINUX]:
      Use emacs_read_quit instead of emacs_read in places where
      C-g handling is safe.
      * src/eval.c (maybe_quit): Move comment here from lisp.h.
      * src/fileio.c (Fcopy_file, e_write):
      Use emacs_write_quit instead of emacs_write_sig in places where
      C-g handling is safe.
      * src/filelock.c (create_lock_file): Use emacs_write, not
      plain write, as emacs_write no longer has a problem.
      (read_lock_data): Use emacs_read, not read, as emacs_read
      no longer has a problem.
      * src/fns.c (rarely_quit): Move to lisp.h and rename to
      incr_rarely_quit.  All uses changed..
      * src/fns.c (Fmemq, Fmemql, Fassq, Frassq, Fplist_put, Fplist_member):
      * src/indent.c (compute_motion):
      * src/syntax.c (find_defun_start, back_comment, forw_comment)
      (Fforward_comment, scan_lists, scan_sexps_forward):
      Use incr_rarely_quit so that users can C-g out of long loops.
      * src/fns.c (Fnconc): Move incr_rarely_quit call to within
      inner loop, so that it catches C-g there too.
      * src/keyboard.c (tty_read_avail_input): Remove commented-out
      and now-obsolete code dealing with interrupts.
      * src/lisp.h (rarely_quit, incr_rarely_quit): New functions,
      the latter moved here from fns.c and renamed from rarely_quit.
      (emacs_read_quit, emacs_write_quit): New decls.
      * src/search.c (find_newline, search_buffer, find_newline1):
      Add maybe_quit to catch C-g.
      * src/sysdep.c (get_child_status): Always invoke maybe_quit
      if interruptible, so that the caller need not bother.
      (emacs_nointr_read, emacs_read_quit, emacs_write_quit):
      New functions.
      (emacs_read): Rewrite in terms of emacs_nointr_read.
      Do not handle C-g or signals; that is now for emacs_read_quit.
      (emacs_full_write): Replace PROCESS_SIGNALS two-way arg
      with INTERRUPTIBLE three-way arg.  All uses changed.
      b01ac672
  10. 30 Jan, 2017 1 commit
    • Vibhav Pant's avatar
      Fix hash tables not being purified correctly. · 9c4dfdd1
      Vibhav Pant authored
      * src/alloc.c
      (purecopy_hash_table) New function, makes a copy of the given hash
      table in pure storage.
      Add new struct `pinned_object' and `pinned_objects' linked list for
      pinning objects.
      (Fpurecopy) Allow purifying hash tables
      (purecopy) Pin hash tables that are either weak or not declared with
      `:purecopy t`, use purecopy_hash_table otherwise.
      (marked_pinned_objects) New function, marks all objects in pinned_objects.
      (garbage_collect_1) Use it. Mark all pinned objects before sweeping.
      * src/lisp.h Add new field `pure' to struct `Lisp_Hash_Table'.
      * src/fns.c: Add `purecopy' parameter to hash tables.
      (Fmake_hash_table): Check for a `:purecopy PURECOPY' argument, pass it
      to make_hash_table.
      (make_hash_table): Add `pure' parameter, set h->pure to it.
      (Fclrhash, Fremhash, Fputhash): Enforce that the table is impure with
      CHECK_IMPURE.
      * src/lread.c: (read1) Parse for `purecopy' parameter while reading
        hash tables.
      * src/print.c: (print_object) add the `purecopy' parameter while
        printing hash tables.
      * src/category.c, src/emacs-module.c, src/image.c, src/profiler.c,
        src/xterm.c: Use new (make_hash_table).
      9c4dfdd1
  11. 26 Jan, 2017 1 commit
    • Paul Eggert's avatar
      Replace QUIT with maybe_quit · b3a3ed52
      Paul Eggert authored
      There’s no longer need to have QUIT stand for a slug of C statements.
      Use the more-obvious function-call syntax instead.
      Also, use true and false when setting immediate_quit.
      These changes should not affect the generated machine code.
      * src/lisp.h (QUIT): Remove.  All uses replaced by maybe_quit.
      b3a3ed52
  12. 01 Jan, 2017 1 commit
  13. 30 Dec, 2016 1 commit
    • Ken Raeburn's avatar
      Increase the obarray size. · 064701dc
      Ken Raeburn authored
      In a typical GNU/Linux/X11 build, we wind up with over 15k symbols by
      the time we've started.  The old obarray size ensured an average chain
      length of 10 or more.
      
      * src/lread.c (OBARRAY_SIZE): Increase to 15121.
      064701dc
  14. 23 Dec, 2016 1 commit
    • Philipp Stephani's avatar
      Treat incomplete integer literals as errors · 6eaadcc7
      Philipp Stephani authored
      See Bug#25120.
      
      * src/lread.c (read_integer): Treat incomplete integer literals as errors.
      * test/src/lread-tests.el (lread-empty-int-literal): New unit test for
      incomplete integer literals.
      6eaadcc7
  15. 19 Dec, 2016 1 commit
    • Glenn Morris's avatar
      Improve default load-path for uninstalled CANNOT_DUMP builds · 504e3846
      Glenn Morris authored
      * src/lread.c (load_path_default) [CANNOT_DUMP]:
      Use build load-path if we seem to be running uninstalled.  (Bug#24974)
      I think this became an issue several years ago when we stopped
      using EMACSLOADPATH in the Makefiles; however this change should
      improve the CANNOT_DUMP uninstalled case in general.
      504e3846
  16. 08 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Make read1 more reentrant · f0a1e9ec
      Paul Eggert authored
      This is needed if ‘read’ is called soon after startup, before the
      Unicode tables have been set up, and it reads a \N escape and
      needs to look up a value the Unicode tables, a lookup that in turn
      calls read1 recursively.  Although this change doesn’t make ‘read’
      fully reentrant, it’s good enough to handle this case.
      * src/lread.c (read_buffer_size, read_buffer): Remove static vars.
      (grow_read_buffer): Revamp to use locals, not statics, and to
      record memory allocation un the specpdl.  All callers changed.
      (read1): Start with a stack-based buffer, and use the heap
      only if the stack buffer is too small.  Use unbind_to to
      free any heap buffer allocated.  Use bool for boolean.
      Redo symbol loop so that only one call to grow_read_buffer
      is needed.
      (init_obarray): Remove no-longer-needed initialization.
      f0a1e9ec
  17. 03 Dec, 2016 1 commit
    • Noam Postavsky's avatar
      Add lisp watchpoints · 22721316
      Noam Postavsky authored
      This allows calling a function whenever a symbol-value is changed.
      
      * src/lisp.h (lisp_h_SYMBOL_TRAPPED_WRITE_P):
      (SYMBOL_TRAPPED_WRITE_P): New function/macro.
      (lisp_h_SYMBOL_CONSTANT_P): Check for SYMBOL_NOWRITE specifically.
      (enum symbol_trapped_write): New enumeration.
      (struct Lisp_Symbol): Rename field constant to trapped_write.
      (make_symbol_constant): New function.
      
      * src/data.c (Fadd_variable_watcher, Fremove_variable_watcher):
      (set_symbol_trapped_write, restore_symbol_trapped_write):
      (harmonize_variable_watchers, notify_variable_watchers): New functions.
      
      * src/data.c (Fset_default): Call `notify_variable_watchers' for trapped
      symbols.
      (set_internal): Change bool argument BIND to 3-value enum and call
      `notify_variable_watchers' for trapped symbols.
      
      * src/data.c (syms_of_data):
      * src/data.c (syms_of_data):
      * src/font.c (syms_of_font):
      * src/lread.c (intern_sym, init_obarray):
      * src/buffer.c (syms_of_buffer): Use make_symbol_constant.
      
      * src/alloc.c (init_symbol):
      * src/bytecode.c (exec_byte_code): Use SYMBOL_TRAPPED_WRITE_P.
      * src/data.c (Fmake_variable_buffer_local, Fmake_local_variable):
      (Fmake_variable_frame_local):
      * src/eval.c (Fdefvaralias, specbind): Refer to Lisp_Symbol's
      trapped_write instead of constant.
      (Ffuncall): Move subr calling code into separate function.
      (funcall_subr): New function.
      22721316
  18. 22 Nov, 2016 1 commit
  19. 04 Nov, 2016 1 commit
  20. 14 Oct, 2016 1 commit
  21. 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
  22. 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
  23. 15 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Prefer now-standard int width macros · 0bbf00c7
      Paul Eggert authored
      * src/data.c (ULL_WIDTH):
      * src/lisp.h (EMACS_INT_WIDTH, BITS_PER_BITS_WORD):
      * src/lread.c (read_integer):
      * src/term.c (produce_glyphless_glyph):
      * src/xterm.c (x_send_scroll_bar_event):
      Use *_WIDTH macros instead of CHAR_BIT * sizeof.
      * src/data.c (ULL_WIDTH): Rename from BITS_PER_ULL for consistency
      with the *_WIDTH standard macros.  All uses changed.
      * src/gmalloc.c (INT_BIT): Remove.  All uses replaced with INT_WIDTH.
      * src/lisp.h (EMACS_INT_WIDTH): Rename from BITS_PER_EMACS_INT
      for consistency with the *_WIDTH standard macros.  All uses changed.
      (BITS_PER_CHAR): Remove; all uses replaced by CHAR_BIT.  This must
      be the same as CHAR_WIDTH and avoids confusion with Elisp
      char-width, which counts columns not bits.
      (BITS_PER_SHORT): Remove; all uses replaced by SHRT_WIDTH.
      (BITS_PER_LONG): Remove; all uses replaced by LONG_WIDTH.
      * src/lread.c: Do not include limits.h since CHAR_BIT is no longer
      used directly.
      0bbf00c7
  24. 30 Jun, 2016 1 commit
    • Dmitry Antipov's avatar
      Minor tweaks to openp · fd6a133f
      Dmitry Antipov authored
      * src/lread.c (openp): Move invariant code out of the loop
      and thus avoid redundant calls to memcpy.  Adjust comments.
      fd6a133f
  25. 22 Jun, 2016 1 commit
  26. 12 Jun, 2016 1 commit
    • Paul Eggert's avatar
      emacs_strerror cleanups · 5932ffcd
      Paul Eggert authored
      * src/buffer.c, src/emacs.c, src/lread.c: Don’t include coding.h;
      no longer needed, now that emacs_strerror is declared by lisp.h.
      * src/coding.c (emacs_strerror): Remove; moved to emacs.c.
      * src/coding.h (emacs_strerror) [emacs]: Remove decl; moved
      to lisp.h.
      * src/emacs.c (emacs_strerror): Move here from coding.c.  Do not
      convert result string; this is now the caller’s responsibility,
      as some need conversion and others don’t.
      * src/fileio.c (report_file_errno, report_file_notify_error):
      Use emacs_strerror rather than rolling it ourselves.
      * src/lisp.h (emacs_strerror): Move decl here from coding.h.
      * src/lread.c (dir_warning): Just call emacs_strerror rather than
      both strerror and emacs_strerror.  Convert its result from
      locale-coding-system, since it no longer does that conversion.
      * src/sound.c (sound_perror):
      * src/sysdep.c (emacs_perror, str_collate):
      Use emacs_strerror, not strerror.
      5932ffcd
  27. 08 Jun, 2016 1 commit
  28. 01 May, 2016 1 commit
  29. 30 Apr, 2016 2 commits
    • Lars Ingebrigtsen's avatar
      Have the doc strings of `load-path' and `require' mention each other · 3eca9a03
      Lars Ingebrigtsen authored
      * src/fns.c (Frequire): Mention `load-path' and fill the doc
      string (bug#18829).
      
      * src/lread.c (syms_of_lread): Mention that `require' uses
      `load-path'.
      3eca9a03
    • Eli Zaretskii's avatar
      Fix the MSDOS build · ccdaf04c
      Eli Zaretskii authored
      * config.bat:
      * msdos/sedlisp.inp:
      * msdos/sedlibmk.inp:
      * msdos/sedleim.inp:
      * msdos/sedadmin.inp:
      * msdos/sed6.inp:
      * msdos/sed3v2.inp:
      * msdos/sed2v2.inp:
      * msdos/sed1v2.inp: Adapt to Emacs 25.
      
      * src/process.c (remove_slash_colon): Move out of "#ifdef
      subprocesses" block, as it its called unconditionally.  Move
      ADD_SUBFEATURE calls into "#ifdef subprocesses" block, as they
      reference variables only defined in that block.
      * src/msdos.h: Provide prototypes for IT_set_frame_parameters,
      faccessat, msdos_fatal_signal, syms_of_msdos, pthread_sigmask,
      dos_keysns, dos_keyread, run_msdos_command, and
      syms_of_win16select, to avoid compiler warnings.
      * src/msdos.c (SYS_ENVIRON): Define to either '_environ' or
      'environ', depending on the DJGPP version.
      Remove declarations of externally-visible Lisp objects, like
      Qbackground_color and Qreverse.
      (run_msdos_command): First argument is not signed, not unsigned.
      Use SYS_ENVIRON.
      (sys_select): Use 'timespec_cmp' instead of 'timespec_sign', as
      the latter doesn't work when 'time_t' is an unsigned data type.
      This caused idle timers to behave incorrectly: they only fired
      after a keyboard input event.
      * src/frame.c (adjust_frame_size) [MSDOS]: Account for
      FRAME_TOP_MARGIN that isn't counted in the frame's number of
      lines, but dos_set_window_size needs it to be added.
      * src/lread.c (INFINITY, NAN) [DJGPP < 2.05]: Provide definitions.
      * src/fns.c (sort_vector_copy) [__GNUC__ < 4]: Provide a prototype
      that works around compilation errors with older GCC versions.
      * src/w16select.c: Don't declare QCLIPBOARD and QPRIMARY as Lisp
      Objects.
      * src/filelock.c [MSDOS]: Ifdef away most of the code.  Provide
      no-op implementations for 'lock_file' and 'unlock_file'.
      (Ffile_locked_p) [MSDOS]: Always return nil.  This avoids multiple
      ifdefs in all users of filelock.c functionality.
      * src/conf_post.h (EOVERFLOW, SIZE_MAX) [DJGPP < 2.04]: Define.
      * src/emacs.c [MSDOS]: Include dosfns.h, to avoid compiler
      warnings.
      * src/dosfns.h: Provide prototypes for dos_cleanup,
      syms_of_dosfns, and init_dosfns.
      * src/deps.mk (atimer.o): Depend on msdos.h.
      (emacs.o): Depend on dosfns.h.
      * src/atimer.c [MSDOS]: Include msdos.h, to avoid compiler
      warnings.
      
      * lisp/window.el (window--adjust-process-windows): Skip the body
      if 'process-list' is not available.  This avoids failure to start
      up on MS-DOS.
      * lisp/vc/diff.el (diff-no-select): Test 'make-process', not
      'start-process', as the latter is now available on all platforms.
      * lisp/textmodes/ispell.el (ispell-async-processp): Replace
      'start-process' with 'make-process' in a comment.
      * lisp/term/internal.el (IT-unicode-translations): Modify and add
      a few translations to display Info files with Unicode markup.  Fix
      an ancient off-by-one mismatch error with Unicode codepoints.
      * lisp/progmodes/compile.el (compilation-start): Test
      'make-process', not 'start-process', as the latter is now
      available on all platforms.
      * lisp/man.el (Man-build-man-command, Man-getpage-in-background):
      Test 'make-process', not 'start-process', as the latter is now
      available on all platforms.
      * lisp/international/mule-cmds.el (set-coding-system-map): Test
      'make-process', not 'start-process', as the latter is now
      available on all platforms.
      * lisp/eshell/esh-cmd.el (eshell-do-pipelines-synchronously): Doc
      fix.
      (eshell-execute-pipeline): Test 'make-process', not
      'start-process', as the latter is now available on all platforms.
      ccdaf04c
  30. 25 Apr, 2016 1 commit
    • Paul Eggert's avatar
      New function ‘char-from-name’ · 86d08343
      Paul Eggert authored
      This also fixes the mishandling of "\N{CJK COMPATIBILITY
      IDEOGRAPH-F900}", "\N{VARIATION SELECTOR-1}", etc.
      Problem reported by Eli Zaretskii in:
      http://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00614.html
      * doc/lispref/nonascii.texi (Character Codes), etc/NEWS: Document this.
      * lisp/international/mule-cmds.el (char-from-name): New function.
      (read-char-by-name): Use it.  Document that "BED" is treated as
      a name, not as a hexadecimal number.  Reject out-of-range integers,
      floating-point numbers, and strings with trailing junk.
      * src/lread.c (character_name_to_code): Call char-from-name
      instead of inspecting ucs-names directly, so that we handle
      computed names like "VARIATION SELECTOR-1".  Do not use an auto
      string, since char-from-name might GC.
      * test/src/lread-tests.el: Add tests for new behavior, and
      fix some old tests that were wrong.
      86d08343
  31. 22 Apr, 2016 4 commits
    • Paul Eggert's avatar
      Improve character name escapes · bd1c7ca6
      Paul Eggert authored
      * doc/lispref/nonascii.texi (Character Properties):
      Avoid duplication of Unicode names.  Reformat examples to fit in
      narrow pages.
      * doc/lispref/objects.texi (General Escape Syntax):
      Simplify and better-organize explanation of \N{...} escapes.
      * src/character.h (CHAR_SURROGATE_PAIR_P): Remove; unused.
      (char_surrogate_p): New inline function.
      * src/lread.c: Do not include string.h; no longer needed.
      (invalid_character_name, check_scalar_value): Remove; the ideas
      behind these functions are now bundled into character_name_to_code.
      (character_name_to_code): Remove undocumented support for "CJK
      IDEOGRAPH-XXXX" names, as "U+XXXX" suffices.  Reject monstrosities
      like "\N{U+-0}" and null bytes in \N escapes.  Reject floating
      point in \N escapes instead of returning garbage.  Use
      AUTO_STRING_WITH_LEN to lessen pressure on the garbage collector.
      * test/src/lread-tests.el (lread-char-number, lread-char-name)
      (lread-string-char-number, lread-string-char-name):
      Test runtime behavior, not compile-time, as the test framework
      is not set up to test compile-time.
      (lread-char-surrogate-1, lread-char-surrogate-2)
      (lread-char-surrogate-3, lread-char-surrogate-4)
      (lread-string-char-number-2, lread-string-char-number-3):
      New tests.
      (lread-string-char-number-1): Rename from lread-string-char-number.
      bd1c7ca6
    • Philipp Stephani's avatar
      Use 'ucs-names' for character name escapes · e7cb38ed
      Philipp Stephani authored
      * lread.c (invalid_character_name, check_scalar_value)
      (parse_code_after_prefix, character_name_to_code): New helper
      functions that use 'ucs-names' and parsing for CJK ideographs.
      (read_escape): Use helper functions.
      (syms_of_lread): New symbol 'ucs-names'.
      * test/src/lread-tests.el: New tests; fix a couple of bugs in
      existing tests.
      e7cb38ed
    • Philipp Stephani's avatar
      Minor cleanups for character name escapes · 753c8757
      Philipp Stephani authored
      * src/lread.c (init_character_names): Add missing 'void'.
      Remove top-level 'const'.
      (read_escape): Simplify loop a bit.  Remove top-level 'const'.
      753c8757
    • Philipp Stephani's avatar
      Implement named character escapes, similar to Perl · de7d5f36
      Philipp Stephani authored
      * lread.c (init_character_names): New function.
      (read_escape): Read Perl-style named character escape sequences.
      (syms_of_lread): Initialize new variable 'character_names'.
      * test/src/lread-tests.el (lread-char-empty-name): Add test file
      for src/lread.c.
      de7d5f36
  32. 14 Apr, 2016 1 commit
    • Paul Eggert's avatar
      Simplify use of O_BINARY · c2ce5476
      Paul Eggert authored
      * src/callproc.c (call_process):
      * src/fileio.c (write_region):
      * src/filelock.c (read_lock_data):
      * src/image.c (x_find_image_fd):
      * src/lread.c (openp):
      * src/sysdep.c (init_random, emacs_fopen):
      * src/unexcw.c (unexec):
      Omit unnecessary use of O_BINARY, since emacs_open now arranges
      that for us.
      c2ce5476
  33. 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
  34. 09 Mar, 2016 1 commit
  35. 11 Jan, 2016 1 commit
    • Eli Zaretskii's avatar
      Avoid unnecessary failures of auto-saving after fatal error · 20067529
      Eli Zaretskii authored
      * src/w32.c (map_w32_filename): Avoid non-trivial system calls for
      the benefit of FAT volumes if we are called as part of shutting
      down due to a fatal error, which probably means we are trying to
      auto-save the session.
      * src/lread.c (check_obarray): Don't bother making the obarray
      valid if we are shutting down due to a fatal error.  This avoids
      interfering with auto-saving the crashed session.
      20067529