1. 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
  2. 24 Apr, 2016 1 commit
  3. 22 Apr, 2016 5 commits
    • Martin Rudalics's avatar
      In x_set_window_size restore do_pending_window_change calls · 2b31a0c2
      Martin Rudalics authored
      * src/xterm.c (x_set_window_size):
      * src/w32term.c (x_set_window_size): Restore
      do_pending_window_change calls after their stupid removal on
      2015-08-31.
      2b31a0c2
    • 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
  4. 21 Apr, 2016 1 commit
  5. 18 Apr, 2016 1 commit
    • Paul Eggert's avatar
      Minor fixups for external socket launching · 531c9a43
      Paul Eggert authored
      * configure.ac (HAVE_LIBSYSTEMD): Change earliest version to 222.
      * doc/emacs/misc.texi (Emacs Server):
      * etc/NEWS: Spelling and doc fixes.
      * src/emacs.c (main) [HAVE_LIBSYSTEMD]:
      Check for sd_is_socket returning positive, not zero.
      * src/process.c (external_sock_fd): Instead of initializing here ...
      (init_process_emacs): ... initialize it here, so that it does the
      right thing after dump/restore.
      (connect_network_socket): Simplify socket_to_use test.
      531c9a43
  6. 17 Apr, 2016 1 commit
  7. 16 Apr, 2016 1 commit
    • Matthew Leach's avatar
      Add external socket launching support · e390b7b5
      Matthew Leach authored
      * src/process.c (connect_network_socket): Allow a pre-allocated socket
      descriptor to be used if passed to Emacs, avoiding the call to
      'socket' and 'bind'.
      (Fmake_network_process): Allow users to pass ':use-external-socket' in
      the parameter plist to use any sockets that have been passed to Emacs.
      (wait_reading_process_output): Call 'socket' and 'bind' every time.
      (syms_of_process): New symbol ':use-external-socket'.
      (set_external_socket_descriptor): New function.
      (external_sock_fd): New variable.
      * src/lisp.h: (set_external_socket_descriptor): New declaration.
      * src/emacs.c (main): Call 'sd_listen_fds' to read the number of sockets
      passed and call 'set_external_socket_descriptor' to set the external
      socket.
      * src/Makefile.in: Add libsystemd library and C flags to the Emacs
      compilation options.
      
      * configure.ac: Add new default-on option "systemd" and check for
      libsystemd at configure time.
      
      * lisp/server.el (server-start): Set ':use-external-socket' to 't' when
      calling 'make-network-process'.
      
      * etc/NEWS: Document new socket-passing functionality and the configure
      option to disable systemd interaction.
      
      * doc/emacs/misc.texi (Emacs Server): Document systemd socket passing
      functionality and provide systemd unit examples.
      * doc/lispref/processes.texi (Network Processes): Document new
      'make-network-process' option ':use-external-socket'.
      e390b7b5
  8. 15 Apr, 2016 1 commit
  9. 14 Apr, 2016 3 commits
    • 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
    • Paul Eggert's avatar
      * src/indent.c (Fvertical_motion): Pacify GCC · 177d40de
      Paul Eggert authored
      5.3.1 20160406 (Red Hat 5.3.1-6) on x86-64.
      177d40de
    • Paul Eggert's avatar
      substitute-command-keys keeps quotes’ text props · 32364bbb
      Paul Eggert authored
      Problem reported by Clément Pit--Claudel (Bug#23254).
      * src/doc.c: Include intervals.h.
      (Fsubstitute_command_keys): If the only substitutions are for
      quotes, copy the source string’s text properties too, since no
      substring lengths have changed.
      32364bbb
  10. 13 Apr, 2016 1 commit
  11. 12 Apr, 2016 2 commits
    • Paul Eggert's avatar
      Support OFFSET and (OFFSET ABBR) time zone rules · fdb1ba14
      Paul Eggert authored
      This simplifies Gnus and VC time zone support, by letting them
      feed the output of ‘current-time-zone’ and ‘decode time’ to
      primitives that accept time zone arguments.
      * doc/lispref/os.texi (Time Zone Rules, Time Conversion):
      * etc/NEWS:
      * lisp/gnus/message.el (message-insert-formatted-citation-line):
      * lisp/org/org.el (org-timestamp-format):
      * src/editfns.c (Fformat_time_string, Fdecode_time):
      (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
      Document new behavior.
      * lisp/gnus/gmm-utils.el (gmm-format-time-string):
      * lisp/vc/add-log.el (add-log-iso8601-time-zone):
      Mark as obsolete, as it is now just an alias or narrow wrapper
      around format-time-string.
      * src/editfns.c (tzlookup): Also support integer OFFSET and
      list (OFFSET ABBR) as time zone rules.
      (Fencode_time): No longer need a special case for a cons ZONE.
      (Fcurrent_time_zone): If the time zone string is missing, compute
      it the same way the other new code does.
      fdb1ba14
    • Paul Eggert's avatar
      Improve time zone documentation · ca509810
      Paul Eggert authored
      * doc/lispref/os.texi (Time Zone Rules):
      New section, mostly with material moved here from other sections.
      * doc/emacs/cmdargs.texi (General Variables):
      * doc/lispref/os.texi (Time Conversion, Time Parsing):
      Xref new section.
      * etc/NEWS, etc/PROBLEMS:
      * lisp/org/org.el (org-timestamp-format):
      * src/editfns.c (Fformat_time_string, Fdecode_time)
      (Fencode_time, Fcurrent_time_string, Fcurrent_time_zone)
      (Fset_time_zone_rule):
      When documenting time zone rule strings, mention the TZ
      environment variable in preference to mentioning the
      sort-of-internal function set-time-zone-rule.
      ca509810
  12. 11 Apr, 2016 2 commits
  13. 10 Apr, 2016 1 commit
    • Michael Albinus's avatar
      Fix Bug#23207 · 7172ba7f
      Michael Albinus authored
      * src/keyboard.c (read_char): Resume idle timers in case of
      dbus-event, file-notify-event and config-changed-event.
      Reported by Johan Claesson <johanclaesson@bredband.net>.  (Bug#23207)
      7172ba7f
  14. 09 Apr, 2016 2 commits
    • Philipp Stephani's avatar
      Remove undefined behavior in OS X dumper. · b5707692
      Philipp Stephani authored
      Found by Address Sanitizer.
      
      * src/unexmacosx.c (unexec_write): Use Mach virtual memory API to
      avoid undefined behavior when reading arbitrary memory.
      b5707692
    • Joakim Verona's avatar
      Fix clipping of xwidgets · 97211f36
      Joakim Verona authored
      * src/xwidget.c (x_draw_xwidget_glyph_string): Use window_box
      instead of calculating the clipping borders manually.  Suggested
      by YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>.
      97211f36
  15. 08 Apr, 2016 4 commits
  16. 05 Apr, 2016 2 commits
  17. 04 Apr, 2016 4 commits
    • Paul Eggert's avatar
      New C macro AUTO_STRING_WITH_LEN · 17cb263a
      Paul Eggert authored
      Put a bit less pressure on the garbage collector by defining a
      macro that is like AUTO_STRING but also allows null bytes in strings,
      and by extending AUTO_STRING to work with any unibyte string.
      * src/alloc.c (verify_ascii): Remove; all uses removed.
      AUTO_STRING can now be used on non-ASCII unibyte strings.
      * src/lisp.h (AUTO_STRING): Now allows non-ASCII unibyte strings.
      (AUTO_STRING_WITH_LEN): New macro.
      * src/coding.c (from_unicode_buffer):
      * src/editfns.c (format_time_string):
      * src/emacs-module.c (module_make_string, module_format_fun_env):
      * src/fileio.c (Fexpand_file_name):
      * src/font.c (font_parse_family_registry):
      * src/ftfont.c (ftfont_get_charset):
      * src/keymap.c (silly_event_symbol_error):
      * src/menu.c (single_menu_item):
      * src/sysdep.c (system_process_attributes):
      Use AUTO_STRING_WITH_LEN if possible.
      * src/emacs-module.c (module_make_function):
      * src/fileio.c (report_file_errno, report_file_notify_error):
      * src/fns.c (Flocale_info):
      * src/sysdep.c (system_process_attributes):
      Use AUTO_STRING if possible.  This is doable more often now
      that AUTO_STRING works on any unibyte string.
      17cb263a
    • Paul Eggert's avatar
      Port redirect-debugging-output to MS-Windows · 0322457e
      Paul Eggert authored
      Suggested by Eli Zaretskii in:
      http://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00037.html
      * src/print.c [WINDOWSNT]: Include sys/socket.h.
      * src/w32.c (sys_dup2): Work around problem with MS-Windows _dup2.
      0322457e
    • Paul Eggert's avatar
      Port redirect-debugging-output to non-GNU/Linux · 6bccb19c
      Paul Eggert authored
      Problem reported by Kylie McClain for musl in:
      http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01592.html
      * etc/DEBUG, etc/NEWS: Mention this.
      * src/callproc.c (child_setup) [!MSDOS]:
      * src/dispnew.c (init_display):
      * src/emacs.c (main, Fdaemon_initialized):
      * src/minibuf.c (read_minibuf_noninteractive):
      * src/regex.c (xmalloc, xrealloc):
      Prefer symbolic names like STDERR_FILENO to magic numbers like 2,
      to make file-descriptor manipulation easier to follow.
      * src/emacs.c (relocate_fd) [!WINDOWSNT]: Remove; no longer needed
      now that we make sure stdin, stdout and stderr are open.  All uses
      removed.
      (main): Make sure standard FDs are OK.  Prefer symbolic names like
      EXIT_FAILURE to magic numbers like 1.  Use bool for boolean.
      * src/lisp.h (init_standard_fds): New decl.
      * src/print.c (WITH_REDIRECT_DEBUGGING_OUTPUT) [GNU_LINUX]:
      Remove; no longer needed.
      (Fredirect_debugging_output): Define on all platforms, not just
      GNU/Linux.  Redirect file descriptor, not stream, so that the code
      works even if stderr is not an lvalue.  Report an error if the
      file arg is neither a string nor nil.
      (syms_of_print): Always define redirect-debugging-output.
      * src/sysdep.c (force_open, init_standard_fds): New functions.
      6bccb19c
    • Paul Eggert's avatar
      Spelling fixes · a11756ad
      Paul Eggert authored
      a11756ad
  18. 03 Apr, 2016 3 commits
  19. 02 Apr, 2016 2 commits
  20. 01 Apr, 2016 2 commits
    • Paul Eggert's avatar
      Fix resize incompatibility with GTK+ master · afc9e654
      Paul Eggert authored
      Problem reported by Matthias Clasen (Bug#23144).
      * src/xterm.c (handle_one_xevent) [USE_GTK]:
      Do not call xg_frame_resized.
      afc9e654
    • Eli Zaretskii's avatar
      Avoid crashes due to insanely large columns in tabulated-list-format · b3b523cd
      Eli Zaretskii authored
      * src/xdisp.c (append_stretch_glyph, produce_xwidget_glyph)
      (produce_image_glyph): Limit the pixel width of the produced glyph
      to SHRT_MAX.  (Bug#23178)
      (append_composite_glyph, append_glyph, append_glyphless_glyph):
      Add assertions to verify that the pixel width of the glyph will
      never overflow a 'short'.
      * src/term.c (append_composite_glyph): Add assertion to verify
      that the pixel width of the glyph will never overflow a 'short'.
      b3b523cd