1. 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
  2. 08 Jun, 2016 1 commit
  3. 01 May, 2016 1 commit
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 09 Mar, 2016 1 commit
  10. 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
  11. 01 Jan, 2016 1 commit
  12. 09 Dec, 2015 1 commit
    • Anders Lindgren's avatar
      Don't add "." to load path (bug#21104) · ae305741
      Anders Lindgren authored
      When configured with --enable-locallisppath=no, which is the
      default for OS X, the load-path incorrectly was populated with ".".
      
      * src/lread.c (init_lread): Don't call `decode_env_path' when
      PATH_SITELOADSEARCH is empty.
      ae305741
  13. 01 Dec, 2015 1 commit
  14. 27 Nov, 2015 1 commit
  15. 22 Nov, 2015 1 commit
    • Eli Zaretskii's avatar
      Allow loading modules by 'load-file' · 40ed767b
      Eli Zaretskii authored
      * src/lread.c (Fload): Call 'unbind_to' with 'Fmodule_load' as the
      2nd arg, to avoid the "binding stack not balanced" error.
      (syms_of_lread) <module-file-suffix>: New Lisp variable.
      
      * lisp/files.el (module-file-suffix): Declare.
      (load-file): Remove 'module-file-suffix' from
      'completion-ignored-extensions', to allow completion on modules.
      
      * etc/NEWS: Mention 'module-file-suffix'.
      40ed767b
  16. 21 Nov, 2015 3 commits
    • Paul Eggert's avatar
      Add a few safety checks when ENABLE_CHECKING · 8afaa132
      Paul Eggert authored
      This was motivated by the recent addition of module code,
      which added some ENABLE_CHECKING-enabled checks that are
      useful elsewhere too.
      * src/alloc.c (compact_font_cache_entry):
      * src/fns.c (sweep_weak_table):
      * src/lread.c (oblookup):
      Use gc_asize rather than doing it by hand.
      * src/emacs-module.c (module_make_global_ref)
      (module_free_global_ref, module_vec_size):
      Omit assertions that lisp.h now checks.
      * src/lisp.h (XFASTINT, ASIZE): In functional implementations,
      check that the result is nonnegative.  Use eassume, as this
      info can help a bit when optimizing production code.
      (XSYMBOL) [!USE_LSB_TAG]: Assert that argument is a symbol,
      to be consistent with the USE_LSB_TAG case.
      (gc_asize): New function, when ASIZE is needed in the gc.
      (gc_aset): Use it.
      (HASH_TABLE_P): Move definition up, so that it can be used ...
      (XHASH_TABLE): ... here, to assert that the arg is a hash table.
      8afaa132
    • Eli Zaretskii's avatar
      ; * src/lread.c (Fload): Fix last change. · 3c407d29
      Eli Zaretskii authored
      3c407d29
    • Eli Zaretskii's avatar
      Improve documentation of dynamic modules · 3858b794
      Eli Zaretskii authored
      * src/fns.c (Frequire): Doc fix to include the dynamic module
      support.
      * src/lread.c (Fload, Vload_suffixes): Doc fixes to include the
      dynamic module support.
      (Fload): Treat the module suffix the same as '*.el' and '*.elc'
      wrt the MUST-SUFFIX argument.
      
      * etc/NEWS: Expand documentation of dynamically loaded modules.
      3858b794
  17. 19 Nov, 2015 3 commits
    • Paul Eggert's avatar
      Prefer signed integer types in module code · 92949781
      Paul Eggert authored
      Generally speaking, at the C level the Emacs source code prefers
      signed types like ‘ptrdiff_t’ to unsigned types like ‘size_t’,
      partly to avoid the usual signedness confusion when comparing values.
      Change the module API to follow this convention.
      Use ‘int’ for small values that can’t exceed INT_MAX.
      * modules/mod-test/mod-test.c (Fmod_test_globref_make)
      (Fmod_test_string_a_to_b, Fmod_test_vector_fill)
      (Fmod_test_vector_eq):
      * src/emacs-module.c (struct emacs_value_frame)
      (module_make_global_ref, module_free_global_ref)
      (module_copy_string_contents, module_make_string)
      (module_vec_set, module_vec_get, module_vec_size):
      * src/emacs-module.h (struct emacs_runtime, struct emacs_env_25):
      * src/lread.c (suffix_p):
      Prefer signed to unsigned integer types.
      92949781
    • Paul Eggert's avatar
      Omit ‘const’ on locals · d9b300af
      Paul Eggert authored
      Remove ‘const’ qualifier from locals that were newly added.
      We don’t normally bother declaring locals with ‘const’ even
      though they are not modified, for the same reason we don’t
      bother declaring them with ‘register’ even though their
      addresses are not taken; the advantage in compile-time
      checking isn’t worth the loss of readability.
      * modules/mod-test/mod-test.c (Fmod_test_non_local_exit_funcall)
      (Fmod_test_vector_fill, Fmod_test_vector_eq):
      * src/emacs-module.c (MODULE_SETJMP_1)
      (module_make_global_ref, module_free_global_ref)
      (module_non_local_exit_get, module_make_function)
      (module_extract_integer, module_extract_float)
      (module_get_user_ptr, module_set_user_ptr)
      (module_get_user_finalizer, module_set_user_finalizer)
      (module_vec_get, Fmodule_call)
      (module_non_local_exit_signal_1)
      (module_non_local_exit_throw_1, lisp_to_value)
      (finalize_storage, allocate_emacs_value, mark_modules)
      (module_handle_signal, module_handle_throw)
      (module_format_fun_env):
      * src/eval.c (push_handler, push_handler_nosignal)
      (init_handler):
      * src/lread.c (suffix_p):
      Omit unnecessary ‘const’.
      d9b300af
    • Juanma Barranquero's avatar
  18. 18 Nov, 2015 1 commit
    • Aurélien Aptel's avatar
      Make 'Fload' look for modules · 218caccd
      Aurélien Aptel authored
      'Fload' can now load dynamic modules. This also makes 'require' work.
      
      * src/lread.c:
        (suffix_p): New function.
        (Fload): Use 'suffix_p'.  Call 'Fmodule_load' when we try to load a file
        with a module suffix.
        (syms_of_lread): Append module suffix to 'Vload_suffixes'.
      218caccd
  19. 08 Nov, 2015 1 commit
    • Paul Eggert's avatar
      Prefer xpalloc to doubling buffers by hand · 8a8613bc
      Paul Eggert authored
      * src/lread.c (grow_read_buffer): New function, which uses xpalloc.
      (read1): Use it for simplicity.
      * src/macros.c (store_kbd_macro_char):
      * src/minibuf.c (read_minibuf_noninteractive):
      * src/term.c (encode_terminal_code):
      * src/xrdb.c (magic_db):
      Prefer xpalloc to growing buffers by hand.
      This doesn’t fix any bugs, but simplifies the code a bit.
      8a8613bc
  20. 29 Oct, 2015 1 commit
  21. 26 Oct, 2015 1 commit
  22. 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
  23. 16 Sep, 2015 1 commit
    • Paul Eggert's avatar
      Omit unnecessary \ before paren in C docstrings · 032ce1c7
      Paul Eggert authored
      Although \( is needed in docstrings in Elisp code, it is not needed in
      docstrings in C code, since C function definitiions do not start with
      a parenthesis.  The backslashes made the docstrings a bit harder to
      read and to format in columns.  Also, some C docstrings had ( in
      column 1 and this did not appear to be causing any problems.  So,
      simplify C docstrings by replacing \( with ( and \) with ).
      032ce1c7
  24. 27 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Assume GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS · 60d1b187
      Paul Eggert authored
      This removes the need for GCPRO1 etc.  Suggested by Stefan Monnier in:
      http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00918.html
      * doc/lispref/internals.texi (Writing Emacs Primitives):
      * etc/NEWS:
      Document the change.
      * src/alloc.c (gcprolist, dump_zombies, MAX_ZOMBIES, zombies)
      (nzombies, ngcs, avg_zombies, max_live, max_zombies, avg_live)
      (Fgc_status, check_gcpros, relocatable_string_data_p, gc-precise):
      * src/bytecode.c (mark_byte_stack) [BYTE_MARK_STACK]:
      * src/eval.c (gcpro_level) [DEBUG_GCPRO]:
      * src/lisp.h (struct handler.gcpro, struct gcpro, GC_MARK_STACK)
      (GC_USE_GCPROS_AS_BEFORE, GC_MAKE_GCPROS_NOOPS)
      (GC_MARK_STACK_CHECK_GCPROS, GC_USE_GCPROS_CHECK_ZOMBIES)
      (BYTE_MARK_STACK, GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6)
      (GCPRO7, UNGCPRO, RETURN_UNGCPRO):
      Remove.  All uses removed.  The code now assumes
      GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS.
      * src/bytecode.c (relocate_byte_stack):
      Rename from unmark_byte_stack, since it now only relocates.
      All callers changed.
      * src/frame.c (make_frame): Add an IF_LINT to pacify GCC 5.2
      with GCPROs removed.
      * src/systime.h: Use EMACS_LISP_H as the canary instead of GCPRO1.
      * test/automated/finalizer-tests.el (finalizer-basic)
      (finalizer-circular-reference, finalizer-cross-reference)
      (finalizer-error):
      * test/automated/generator-tests.el (cps-test-iter-close-finalizer):
      Remove tests, as they depend on gc-precise.
      60d1b187
  25. 26 Aug, 2015 1 commit
    • Paul Eggert's avatar
      format-message now curves ` and ' · 71781c31
      Paul Eggert authored
      That way, the caller doesn’t have to use curved quotes to
      get diagnostics that match the text-quoting-style preferences.
      Suggested by Dmitry Gutov in:
      http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00893.html
      This means we no longer need %qs, so remove that format.
      While we’re at it, fix an unlikely bug and lessen the pressure
      on the garbage collector by processing the string once rather
      than twice in the usual case.
      * doc/lispref/strings.texi (Formatting Strings):
      * etc/NEWS: Document this.
      * lisp/subr.el (format-message): Remove; now done in C.
      * src/callint.c (Fcall_interactively):
      * src/editfns.c (Fmessage, Fmessage_box):
      Use Fformat_message instead of Finternal__text_restyle
      followed by Fformat.
      * src/doc.c (LSQM, RSQM): Remove; all uses changed to use
      uLSQM and uRSQM.
      (Fsubstitute_command_keys): Prefer AUTO_STRING to build_string
      when pure ASCII now suffices.  Fix unlikely bug when parsing
      unibyte string containing non-ASCII bytes.  Use inline code
      rather than memcpy, as it’s a tiny number of bytes.
      (Finternal__text_restyle): Remove; no longer used.
      (syms_of_doc): Don’t declare it.
      * src/editfns.c (Fformat): Rewrite in terms of new function
      ‘styled_format’.
      (Fformat_message): New function, moved here from subr.el.
      (styled_format): New function, with the old guts of Fformat,
      except it now optionally transliterates quotes, and it transliterates
      traditional grave accent and apostrophe quoting as well.
      Remove recently-added q flag; no longer needed or used.
      (syms_of_editfns): Define format-message.
      * src/lisp.h (uLSQM0, uLSQM1, uLSQM2, uRSQM0, uRSQM1, uRSQM2):
      Remove; no longer need to be global symbols.
      * src/xdisp.c (vadd_to_log): Use Fformat_message, not Fformat,
      so that callers can use `%s'.
      * src/image.c (image_size_error, xbm_load_image, xbm_load)
      (xpm_load, pbm_load, png_load_body, jpeg_load_body, tiff_load)
      (gif_load, imagemagick_load_image, imagemagick_load, svg_load)
      (svg_load_image, gs_load, x_kill_gs_process):
      * src/lread.c (load_warn_old_style_backquotes):
      * src/xfaces.c (load_pixmap):
      * src/xselect.c (x_clipboard_manager_error_1):
      Use `%s' instead of %qs in formats.
      71781c31
  26. 19 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Use new q ‘format’ flag when fixing quotes in C · 87fbe1a6
      Paul Eggert authored
      * src/image.c (image_size_error): New function.  All uses of
      image_error with "Invalid image size ..."  changed to use it.
      * src/image.c (image_size_error, xbm_load_image, xbm_load)
      (xpm_load, xpm_load_image, xpm_load, pbm_load, png_load_body)
      (jpeg_load_body, tiff_load, gif_load, imagemagick_load_image)
      (imagemagick_load, svg_load, svg_load_image, gs_load)
      (x_kill_gs_process):
      * src/lread.c (load_warn_old_style_backquotes):
      * src/xfaces.c (load_pixmap):
      * src/xselect.c (x_clipboard_manager_error_1):
      Use %qs, not uLSQM and uRSQM.
      * src/syntax.c (Finternal_describe_syntax_value):
      Prefer Fsubstitute_command_keys to Fformat, as this lets
      us use AUTO_STRING.
      * src/xdisp.c (vadd_to_log): Use AUTO_STRING on the format argument,
      as it's now guaranteed to be ASCII.
      * src/xselect.c (x_clipboard_manager_error_2):
      Avoid grave accent in low-level stderr diagnostic.
      87fbe1a6
  27. 18 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Fix file name encodings in diagnostics · 63673686
      Paul Eggert authored
      Also, close some minor races when opening image files, by opening
      them once instead of multiple times.
      * src/gtkutil.c (xg_get_image_for_pixmap):
      * src/image.c (xpm_load, tiff_load, gif_load, imagemagick_load)
      (svg_load):
      * src/nsimage.m (allocInitFromFile:):
      * src/xfns.c (xg_set_icon):
      Encode file name, since x_find_image_file no longer does that.
      * src/image.c (x_find_image_fd): New function.
      (x_find_image_file): Use it.  Do not encode resulting file name,
      since callers sometimes need it decoded.
      (slurp_file): File arg is now a fd, not a file name.
      All callers changed.  This saves us having to open the file twice.
      (xbm_load, xpm_load, pbm_load, png_load_body, jpeg_load_body)
      (svg_load):
      Use x_find_image_fd and fdopen to save a file-open.
      Report file name that failed.
      * src/lread.c (openp): If PREDICATE is t, open the file in binary mode.
      63673686
  28. 16 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Fix quoting in Fformat calls · 59b5141d
      Paul Eggert authored
      * src/image.c (xbm_read_bitmap_data, xbm_load_image, xbm_load)
      (xpm_load, xpm_load_image, pbm_load, png_load_body)
      (jpeg_load_body, tiff_load, gif_load, imagemagick_load_image)
      (imagemagick_load, svg_load, svg_load_image, gs_load)
      (x_kill_gs_process):
      * src/lread.c (load_warn_old_style_backquotes):
      * src/xfaces.c (load_pixmap):
      * src/xselect.c (x_clipboard_manager_error_1):
      Quote diagnostics according to user preference when calling
      Fformat or its derivatives.
      59b5141d
  29. 11 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Give names to Unicode code points in C code · d6640d6e
      Paul Eggert authored
      * src/character.h (NO_BREAK_SPACE, SOFT_HYPHEN)
      (ZERO_WIDTH_NON_JOINER, ZERO_WIDTH_JOINER, HYPHEN)
      (NON_BREAKING_HYPHEN, LEFT_SINGLE_QUOTATION_MARK)
      (RIGHT_SINGLE_QUOTATION_MARK, PARAGRAPH_SEPARATOR)
      (LEFT_POINTING_ANGLE_BRACKET, RIGHT_POINTING_ANGLE_BRACKET)
      (LEFT_ANGLE_BRACKET, RIGHT_ANGLE_BRACKET)
      (OBJECT_REPLACEMENT_CHARACTER):
      New named constants for Unicode code points.
      * src/bidi.c (bidi_fetch_char, CANONICAL_EQU):
      * src/composite.c (char_composable_p):
      * src/lread.c (readevalloop, read1):
      * src/xdisp.c (get_next_display_element):
      Use them.
      * src/doc.c (LEFT_SINGLE_QUOTATION_POINT):
      Remove; now in character.h.
      d6640d6e
  30. 01 Jun, 2015 1 commit
    • Paul Eggert's avatar
      Avoid grave accent quoting in stderr diagnostics · 2c656f7d
      Paul Eggert authored
      A few Emacs diagnostics go directly to stderr, and so can't easily
      contain curved quotes (as non-UTF-8 locales might mishandle them).
      Instead of bothering to add support for this rarity, reword the
      diagnostics so that they don't use grave accent to quote.
      * src/alloc.c (mark_memory): Fix comment.
      * src/buffer.c (init_buffer):
      * src/dispnew.c (init_display):
      * src/emacs.c (main, sort_args):
      * src/lread.c (dir_warning):
      * src/term.c (init_tty):
      * src/unexmacosx.c (unexec):
      * src/xfns.c (select_visual):
      * src/xterm.c (cvt_string_to_pixel, x_io_error_quitter):
      Reword stderr diagnostics to avoid quoting `like this'.
      * src/unexmacosx.c: Include errno.h.
      * src/xfns.c (select_visual): Encode value for locale.
      2c656f7d
  31. 06 May, 2015 1 commit
    • Stefan Monnier's avatar
      * lisp/emacs-lisp/testcover.el: Don't use edebug--read (bug#20487) · 1340aefd
      Stefan Monnier authored
      * lisp/emacs-lisp/testcover.el: Use lexical-binding.
      (testcover--read): Rename from testcover-read.  Change calling convention.
      Use edebug-read-and-maybe-wrap-form now that edebug-read is gone.
      (testcover-start): Use add-function.  Move edebug-all-defs binding to
      testcover--read.
      (testcover-this-defun): Tighten scope of edebug-all-defs binding.
      (testcover-mark): Remove unused var `item'.
      
      * src/lread.c (syms_of_lread): Default load-read-function to `read'.
      1340aefd
  32. 22 Apr, 2015 1 commit
    • Paul Eggert's avatar
      Omit needless "\ " after multibyte then newline · 7128b0de
      Paul Eggert authored
      * src/print.c: Include <c-ctype.h>, for c_isxdigit.
      (print_object): When print-escape-multibyte is non-nil and a
      multibyte character is followed by a newline or formfeed, followed
      by a hex digit, don't output a needless "\ " before the hex digit.
      * test/automated/print-tests.el (print-hex-backslash): New test.
      7128b0de