1. 08 Apr, 2019 2 commits
  2. 07 Apr, 2019 4 commits
  3. 06 Apr, 2019 4 commits
  4. 05 Apr, 2019 2 commits
  5. 03 Apr, 2019 3 commits
    • Eli Zaretskii's avatar
      Improve commentary in 'field_relpos' · 2bcf0f09
      Eli Zaretskii authored
      * src/pdumper.c (PDUMPER_MAX_OBJECT_SIZE): New macro.
      (field_relpos): Use PDUMPER_MAX_OBJECT_SIZE, and comment on
      why we require that relpos be not too large.
      2bcf0f09
    • Eli Zaretskii's avatar
      Restore process-environment after portable dumping · b29b79ef
      Eli Zaretskii authored
      * src/pdumper.c (struct dump_context): New member
      old_process_environment.
      (Fdump_emacs_portable): Record the original value of
      process-environment.
      (dump_unwind_cleanup): Restore the original values of
      process-environment and post-gc-hook.
      b29b79ef
    • Noam Postavsky's avatar
      Allow partial decompression (Bug#33133) · b36913d8
      Noam Postavsky authored
      * src/decompress.c (Fzlib_decompress_region): Add optional
      ALLOW-PARTIAL parameter.
      * lisp/url/url-http.el (url-handle-content-transfer-encoding): Use it.
      * doc/lispref/text.texi (Decompression): Document it.
      * etc/NEWS: Announce it.
      b36913d8
  6. 02 Apr, 2019 1 commit
    • Stefan Monnier's avatar
      * lisp/subr.el (prog2): Define as a macro · 84616144
      Stefan Monnier authored
      * src/eval.c (Fprog2): Delete function.
      (syms_of_eval): Don't register it.
      
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
      * lisp/emacs-lisp/generator.el (cps--transform-1): Remove `prog2` case.
      
      * lisp/emacs-lisp/bytecomp.el (prog2): Remove handlers.
      (byte-compile-prog2): Delete.
      
      * lisp/emacs-lisp/lisp-mode.el (prog2): Remove property.
      84616144
  7. 01 Apr, 2019 4 commits
    • Paul Eggert's avatar
      Make struct Lisp_Objfwd etc. objects read-only · 74b63d27
      Paul Eggert authored
      Initialize these objects statically, and make them constants.
      This is a bit safer and more efficient.
      * src/data.c (XBOOLFWD, XKBOARD_OBJFWD, XFIXNUMFWD, XOBJFWD):
      * src/lisp.h (XBUFFER_OBJFWD):
      Return a pointer-to-const instead of an unrestricted pointer.
      (lispfwd): fwdptr is now a pointer-to-const instead of an
      unrestricted pointer.  All uses changed.
      (SET_SYMBOL_FWD): Accept pointer-to-const instead of an
      unrestricted pointer.
      (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
      (DEFVAR_KBOARD): Initialize static structures statically
      instead of dynamically, and make them const.
      * src/lread.c (defvar_int, defvar_bool, defvar_lisp_nopro)
      (defvar_lisp, defvar_kboard): Accept pointer-to-const instead
      of an unrestricted pointer; it’s now the caller’s
      responsibility to initialize the pointed-to storage.  No need
      for a separate address argument any more.  All callers
      changed.
      74b63d27
    • Paul Eggert's avatar
      Fix union Lisp_Fwd * alignment bug · 9287813d
      Paul Eggert authored
      It's not portable to cast (e.g.) struct Lisp_Objfwd * to union
      Lisp_Fwd * and then back again, because the compiler can then assume
      that the pointer is aligned for union Lisp_Fwd * when accessing
      the struct Lisp_Objfwd * components, and this assumption might
      be incorrect becase we don't force that alignment.
      * src/lisp.h (lispfwd): New type, replacing ...
      (union Lisp_Fwd): ... this type, which was removed.
      All uses changed.
      (SET_SYMBOL_FWD): 2nd arg is now void *, not lispfwd.
      All uses changed (casts no longer needed; they were
      not portable anyway).
      9287813d
    • Stefan Monnier's avatar
      * lisp/subr.el (setq-default): Define as a macro · 197fbfc7
      Stefan Monnier authored
      * lisp/emacs-lisp/bytecomp.el (byte-compile-setq-default): Delete.
      (byte-compile-set-default): Inline the part that it used.
      
      * lisp/emacs-lisp/edebug.el (setq-default): Remove the debug spec.
      
      * src/data.c (Fsetq_default): Delete.
      (syms_of_data): Don't register.
      197fbfc7
    • Eli Zaretskii's avatar
      Fix a typo in xterm.c and w32term.c · 20ef15fb
      Eli Zaretskii authored
      * src/xterm.c (x_window_to_scroll_bar):
      * src/w32term.c (x_window_to_scroll_bar): Fix a typo.
      20ef15fb
  8. 30 Mar, 2019 4 commits
    • Eli Zaretskii's avatar
      Fix a thinko in a recent commit · dd7d83e1
      Eli Zaretskii authored
      * src/buffer.c (Fkill_buffer): Fix last change.  (Bug#31138)
      Reported by Mattias Engdegård <mattiase@acm.org>.
      dd7d83e1
    • Mattias Engdegård's avatar
      Release regexp before signalling overflow error · f2c14b2f
      Mattias Engdegård authored
      * src/search.c (looking_at_1, search_buffer_re): Unfreeze the regexp
      buffer before signalling a matcher overflow, since the error
      processing may require quite some regexp use as well (Bug#34910).
      f2c14b2f
    • Mattias Engdegård's avatar
      Fix spurious regexp reentrancy error · 75ec1b19
      Mattias Engdegård authored
      * src/search.c (compile_pattern): Don't give up if the last regexp
      cache entry is busy.  Instead, use the last (least recently used)
      non-busy entry, and only signal a reentrancy error if there is no free
      entry at all (Bug#34910).
      75ec1b19
    • Eli Zaretskii's avatar
      Don't run buffer-related hooks in " *code conversion work*" buffers · 9c0fa117
      Eli Zaretskii authored
      Note: portions of this change were mistakenly pushed as part
      of an unrelated commit a35a1f6a.
      
      * src/buffer.c (Fget_buffer_create): Set inhibit_buffer_hooks
      non-zero for temporary buffers created by coding.c.  Don't run
      buffer-list-update-hook for such buffers.
      (Frename_buffer, Fkill_buffer, record_buffer)
      (Fbury_buffer_internal): Don't run hooks for buffers whose
      inhibit_buffer_hooks flag is set.
      * src/buffer.h (struct buffer): New member
      inhibit_buffer_hooks.
      * src/pdumper.c (dump_buffer): Dump the new field.  Update the
      hash value in HASH_buffer_XXX.
      * src/coding.c (make_conversion_work_buffer): Function deleted;
      code moved to code_conversion_save.
      (code_conversion_save): Insert code from
      make_conversion_work_buffer, but arrange for unwind-protecting
      the current buffer before switching to the work buffer.  This
      avoids leaving reused_workbuf_in_use set if user presses C-g
      during encoding/decoding.
      (Vcode_conversion_workbuf_name): Now external variable.
      * src/coding.h (Vcode_conversion_reused_workbuf): Declare.
      9c0fa117
  9. 28 Mar, 2019 5 commits
    • Eli Zaretskii's avatar
      Fix display of sliced images on MS-Windows · 2da9f8bf
      Eli Zaretskii authored
      * src/w32term.c (x_draw_image_foreground): Fix detection of
      scaled images for sliced images.  Scale the original width of
      a slice and its coordinates of origin as well.
      2da9f8bf
    • Paul Eggert's avatar
      Simpler way to export HAVE_X_WINDOWS to GDB · 7f129f2e
      Paul Eggert authored
      * src/.gdbinit: Simplify by removing dependency on globals
      implementation.  This is useful for a future performance
      improvement that I have in mind.
      * src/alloc.c (enum defined_HAVE_X_WINDOWS, defined_HAVE_X_WINDOWS):
      New enum and constant.
      (gdb_make_enums_visible) [__GNUC__]: Use it, to make
      defined_HAVE_X_WINDOWS visible to GDB.
      7f129f2e
    • Paul Eggert's avatar
      Tweak re_registers allocation · 81795bb7
      Paul Eggert authored
      * src/regex-emacs.c (re_match_2_internal):
      No need to allocate one extra trailing search register;
      Emacs does not use it.  Avoid quadratic behavior on
      reallocation.
      81795bb7
    • Paul Eggert's avatar
      No need for m_search_regs_saved in thread.h · eac5f967
      Paul Eggert authored
      * src/search.c (save_search_regs, restore_search_regs):
      Don’t use m_search_regs_saved; it’s equivalent to
      saved_search_regs.num_regs != 0.
      * src/thread.h (struct thread_state): Remove m_search_regs_saved.
      eac5f967
    • Paul Eggert's avatar
      Fix search_regs memory leak when thread destroyed · 361e8898
      Paul Eggert authored
      * src/thread.c (free_search_regs): New function.
      (finalize_one_thread): Use it.
      361e8898
  10. 27 Mar, 2019 3 commits
    • Eli Zaretskii's avatar
      Attempt to fix crashes under GDB on Windows 10 · a35a1f6a
      Eli Zaretskii authored
      * src/pdumper.c (dump_discard_mem)
      [VM_SUPPORTED == VM_MS_WINDOWS]: Don't pass NULL pointer as
      last argument to VirtualProtect.  Reported by Martin Rudalics
      <rudalics@gmx.at>.
      a35a1f6a
    • YAMAMOTO Mitsuharu's avatar
      Support native image resizing on cairo · 2755cf18
      YAMAMOTO Mitsuharu authored
      * src/xterm.c (x_cr_draw_image): Add arguments image_width and
      image_height and support scaling.  All callers changed.
      * src/image.c (Fimage_scaling_p): Return t when USE_CAIRO.
      (x_set_image_size) [USE_CAIRO]: Record the scaled dimensions
      in the image struct.
      * src/dispextern.h (HAVE_NATIVE_SCALING): Define when
      USE_CAIRO as well.
      
      * etc/NEWS: Update the announcement of native image scaling.
      2755cf18
    • YAMAMOTO Mitsuharu's avatar
      Fix cairo image drawing with box · d7e44265
      YAMAMOTO Mitsuharu authored
      * src/xterm.c (x_cr_draw_image): Don't call cr_clip for non-mask case.
      (x_draw_image_foreground) [USE_CAIRO]: Draw image here ...
      (x_draw_image_glyph_string) [USE_CAIRO]: ... instead of here.
      (x_draw_image_foreground, x_draw_image_foreground_1)
      (x_draw_image_glyph_string) [USE_CAIRO]: Ifdef away unused code path.
      d7e44265
  11. 26 Mar, 2019 4 commits
    • YAMAMOTO Mitsuharu's avatar
      Use cairo image surface instead of pattern for fringe bitmap · ae68fad0
      YAMAMOTO Mitsuharu authored
      * src/xterm.c (fringe_bmp, x_cr_define_fringe_bitmap)
      (x_cr_destroy_fringe_bitmap, x_cr_draw_image) [USE_CAIRO]:
      Change type of fringe bitmap.
      ae68fad0
    • YAMAMOTO Mitsuharu's avatar
      Fix cairo scrolling for left scroll bars case · 9a6cba2b
      YAMAMOTO Mitsuharu authored
      * src/xterm.c (x_scroll_run) [USE_CAIRO]: Fix scrolling by unusing
      WINDOW_LEFT_EDGE_X.  (Bug#31288)
      9a6cba2b
    • YAMAMOTO Mitsuharu's avatar
      Support tool bar icon image on GTK+ >= 3.10 with cairo · b40db491
      YAMAMOTO Mitsuharu authored
      * src/gtkutil.c (xg_get_image_for_pixmap) [USE_CAIRO]: Use cairo image
      surface for GtkImage source.
      (xg_tool_item_stale_p, update_frame_tool_bar) [USE_CAIRO]: Use cairo
      image surface instead of pixmap for data associated with tool bar item.
      b40db491
    • YAMAMOTO Mitsuharu's avatar
      Simplify cairo image surface creation and destruction · 75b7b2cf
      YAMAMOTO Mitsuharu authored
      * src/dispextern.h (struct image) [USE_CAIRO]: Remove member cr_data2.
      * src/image.c (set_cairo_image_surface): New function split from
      original create_cairo_image_surface.  Call cairo_surface_mark_dirty.
      (create_cairo_image_surface): Just create image surface and return it.
      (x_clear_image): Don't free cr_data2.
      (xpm_load, pbm_load, png_load_body, jpeg_load_body, tiff_load)
      (gif_load, imagemagick_load_image, svg_load_image) [USE_CAIRO]: Use
      new create_cairo_image_surface and cairo_image_surface_get_data
      instead of xmalloc.  Use set_cairo_image_surface instead of old
      create_cairo_image_surface.
      (pbm_load) [USE_CAIRO]: Call cairo_surface_destroy for surface instead
      of xfree for data.
      (gif_load) [USE_CAIRO]: Multiply y-coordinate value by width instead
      of subimg_width.
      75b7b2cf
  12. 25 Mar, 2019 4 commits
    • Paul Eggert's avatar
      Port recent ngettext stub to non-glibc · 7f967b16
      Paul Eggert authored
      * src/editfns.c: Don’t try to call glibc ngettext;
      we’re not ready for that yet.
      (Fngettext): Do not restrict integer arguments to fixnums.
      Improve doc string a bit.
      7f967b16
    • Paul Eggert's avatar
      Fix alignment bug with pure bignums · db53731c
      Paul Eggert authored
      Problem found on 32-bit sparc, which has stricter alignment
      checking than x86-64.
      * src/alloc.c (pure_alloc): When TYPE is negative it now specifies
      the negation of the required alignment of the result.
      (make_pure_bignum): Specify bignum limb alignment.
      db53731c
    • Juri Linkov's avatar
      * lisp/international/mule-cmds.el (ngettext): Move to editfns.c. · 389475db
      Juri Linkov authored
      * src/editfns.c (Fngettext): Move from mule-cmds.el and use
      gettext's ngettext when available.
      389475db
    • Paul Eggert's avatar
      Fix some integer issues in regex-emacs · b7a98993
      Paul Eggert authored
      Also, remove some duplicate comments related to thread.h.
      * src/regex-emacs.h (struct re_registers):
      * src/regex-emacs.c (SIGN_EXTEND_CHAR): Remove.
      (TALLOC, RETALLOC): Remove.  All uses replaced by usual
      allocators, which check for integer overflow.
      (extract_number): Redo without using ‘unsigned’.
      (CHARSET_RANGE_TABLE_EXISTS_P): Clearly return a boolean.
      (print_fastmap, print_partial_compiled_pattern, CHECK_INFINITE_LOOP)
      (regex_compile, analyze_first, bcmp_translate, mutually_exclusive_p)
      (re_match_2_internal):
      Use bool for booleans.
      (print_fastmap, regex_compile, execute_charset):
      Prefer int to unsigned where either will do.
      (print_double_string): Prefer ptrdiff_t to ssize_t, since the
      latter can in theory be narrower than the former.  Use fwrite
      instead of repeated putchar.
      (emacs_re_max_failures, fail_stack_type, compile_stack_type)
      (re_wctype_parse, regex_compile, re_search, re_search_2)
      (re_match_2, re_match_2_internal, re_compile_pattern):
      Prefer ptrdiff_t to size_t where either will do.
      (union fail_stack_elt, PUSH_FAILURE_REG, POP_FAILURE_REG_OR_COUNT):
      Make the integer an intptr_t, not long.
      (GET_BUFFER_SPACE, EXTEND_BUFFER, regex_compile):
      Use xpalloc to simplify allocation.
      (regex_compile): Check for integer overflow when calculating
      register numbers.
      * src/regex-emacs.c (re_set_registers, re_match_2_internal):
      * src/regex-emacs.h (struct re_registers, struct re_pattern_buffer):
      * src/search.c (Freplace_match):
      Prefer ptrdiff_t to unsigned where either will do.
      * src/regex-emacs.h (struct re_pattern_buffer):
      Prefer bool_bf to unsigned where either will do.
      b7a98993