1. 17 Jan, 2019 5 commits
    • Alan Mackenzie's avatar
      Temporarily comment out CC Mode from tests which are incompatible with it. · 54f29790
      Alan Mackenzie authored
      * tests/electric-tests (electric-pair-test-for): comment out c++-mode from the
      list of modes to be used in tests.
      (electric-pair-whitespace-chomping-2-at-point-4-in-c++-mode-in-strings)
      (ert-deftest electric-layout-int-main-kernel-style)
      (ert-deftest electric-layout-int-main-allman-style): Comment out.
      54f29790
    • Glenn Morris's avatar
      Fix --enable-profiling builds (bug#34099) · 8ca414de
      Glenn Morris authored
      * src/profiler.c (syms_of_profiler_for_pdumper):
      Only set cpu_log if CPU profiling is enabled.
      8ca414de
    • Martin Rudalics's avatar
      Expand spectrum of window change functions · 0aece3e1
      Martin Rudalics authored
      * src/window.c (run_window_change_functions): Run window
      change functions for Qwindow_state_change_functions.
      (resize_frame_windows): Set frame's window_change slot when
      single-window frames change size.
      (Qwindow_state_change_functions): New symbol.
      (Vwindow_state_change_functions): New Lisp variable.
      * doc/lispref/windows.texi (Selecting Windows): Mention
      'window-selection/state-change-functions' and add reference to
      Window Hooks.
      (Window Hooks): Document 'window-state-change-functions'.
      * etc/NEWS: Mention new hook 'window-state-change-functions'.
      0aece3e1
    • Paul Eggert's avatar
      Port pdumper to older GNU/Linux · 978cf88b
      Paul Eggert authored
      Problem reported by Colin Baxter in:
      https://lists.gnu.org/r/emacs-devel/2019-01/msg00321.html
      * src/alloc.c (my_heap_start): Also define if
      GNU_LINUX && CANNOT_DUMP && DOUG_LEA_MALLOC.
      978cf88b
    • Daniel Colascione's avatar
      Fix segfault in profiler after pdump load · 191a5568
      Daniel Colascione authored
      Move initialization of the profiler's hash test to static
      initialization from the syms function so that pdumper doesn't need to
      bother capturing it in any special way.
      
      * src/profiler.c (cmpfn_profiler, hashfn_profiler):
      forward declare.
      (hashtest_profiler): statically initialize.
      (syms_of_profiler): remove dynamic initialization of
      hashtest_profiler.
      191a5568
  2. 16 Jan, 2019 11 commits
    • Paul Eggert's avatar
      27f53bd6
    • Daniel Colascione's avatar
      3fd369be
    • Daniel Colascione's avatar
      Fix crash in charset detection after pdumper load · ece563e8
      Daniel Colascione authored
      * src/coding.c:
      (reset_coding_after_pdumper_load): new function re-init character
      classes after pdumper load.
      (syms_of_coding): Call it.
      ece563e8
    • Andy Moreton's avatar
      Avoid compilation warnings in MS-Windows build · 8bf51c38
      Andy Moreton authored
      * src/pdumper.c (dump_cold_bignum):
      * src/emacs.c(load_pdump) [WINDOWSNT]: Avoid compiler warnings
      due to 64-bit vs 32-bit data type mismatches.
      8bf51c38
    • Eli Zaretskii's avatar
      Improve documentation of pdumper; minor code cleanup · ebd174e2
      Eli Zaretskii authored
      * src/emacs.c (usage_message): Add the --dump-file option.
      (string_starts_with_p, find_argument): Functions removed; use
      'argmatch' instead.
      (PDUMP_FILE_ARG): Macro removed; use literal strings instead,
      as with other command-line options.  Use HAVE_PDUMPER for cpp
      conditionals which used PDUMP_FILE_ARG.
      (load_pdump, main): Use 'argmatch' for "--dump-file" and
      "--temacs" arguments, thus supporting the "-dump-file" and
      "-temacs" variants, for consistency with other options.
      (main): Remove the extra fatal error for using --dump-file in
      unexec'ed Emacs: load_pdump does that anyway.
      (standard_args): Add --dump-file and --temacs, with
      appropriate priorities.
      
      * etc/NEWS: Expand on the pdumper support.
      
      * doc/emacs/cmdargs.texi (Initial Options): Document the
      '--dump-file' command-line option.
      ebd174e2
    • Eli Zaretskii's avatar
      Fix minor glitch with producing 'emacs' executable · e96a54eb
      Eli Zaretskii authored
      * src/Makefile.in (LC_ALL) [!DUMPING]: Don't overwrite
      previous emacs-X.Y.Z executables with new ones.
      e96a54eb
    • Michael Albinus's avatar
      8832de4f
    • Michael Albinus's avatar
      Some accept-process-output cleanups in Tramp · b2497ef6
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-action-out-of-band): Read process
      output in a loop.
      (tramp-accept-process-output): Return result.
      (tramp-interrupt-process):
      * lisp/net/tramp-adb.el (tramp-adb-parse-device-names):
      * lisp/net/tramp-rclone.el (tramp-rclone-parse-device-names):
      Remove FIXME.
      
      * lisp/net/tramp-sh.el (tramp-local-coding-commands): Fix docstring.
      
      * lisp/net/tramp-smb.el (tramp-smb-wait-for-output): Adapt docstring.
      Simplify code.
      
      * lisp/net/tramp-sudoedit.el (tramp-sudoedit-action-sudo):
      Adapt docstring.  Read process output in a loop.
      
      * test/lisp/net/tramp-tests.el (tramp-test43-asynchronous-requests):
      Remove :unstable tag on emba.
      b2497ef6
    • Glenn Morris's avatar
      ; Copyright fixes for pdumper files · 655badc3
      Glenn Morris authored
      I wonder if the copyright years for lib-src/make-fingerprint.c are correct.
      655badc3
    • Glenn Morris's avatar
      * make-dist: Include src/dmpstruct.awk. · 021f34be
      Glenn Morris authored
      021f34be
    • Paul Eggert's avatar
      Fix unlikely races with GnuTLS, datagrams · e87e6a24
      Paul Eggert authored
      Retry some calls if interrupted at inopportune times.
      These were found by code inspection.
      * src/gnutls.c (gnutls_try_handshake): Simplify by using
      new emacs_gnutls_handle_error API.
      (emacs_gnutls_write): Remove GNUTLS_E_AGAIN hack since
      emacs_gnutls_handle_error now does that.
      Use emacs_gnutls_handle_error only on errors.
      (emacs_gnutls_read): Retry if gnutls_record_recv returns
      GNUTLS_E_INTERRUPTED, to be consistent with emacs_read.
      (emacs_gnutls_handle_error): Return 0 on fatal errors,
      -1 (setting errno) on ordinary errors, to simplify callers.
      Assume that ERR is negative, since it always is now.
      Map non-fatal GnuTLS errors to errno values as best we can.
      * src/process.c (read_process_output) [DATAGRAM_SOCKETS]:
      Retry recvfrom if it is interrupted, to be consistent with
      how things are handled when not a datagram channel.
      (send_process) [DATAGRAM_SOCEKTS]: If sendto is interrupted,
      process pending signals and retry it, to be consistent with
      how things are handled when not a datagram channel.
      e87e6a24
  3. 15 Jan, 2019 7 commits
    • Daniel Colascione's avatar
      Make sure dump-mode is nil after dump · 6b9fa880
      Daniel Colascione authored
      * lisp/loadup.el (dump-mode): Bind dump-mode to nil before dumping
      6b9fa880
    • Daniel Colascione's avatar
      Add NEWS for pdumper · 02976d67
      Daniel Colascione authored
      02976d67
    • Daniel Colascione's avatar
      Add portable dumper · d12e5d00
      Daniel Colascione authored
      Add a new portable dumper as an alternative to unexec.  Use it by default.
      
      * src/dmpstruct.awk: New file.
      * src/doc.c (get_doc_string): use will_dump_p().
      * src/editfns.c (styled_format): silence compiler warning
      with UNINIT.
      * src/emacs-module.c (syms_of_module): staticpro ltv_mark.
      * src/emacs.c (gflags): new variable.
      (init_cmdargs): unwrap
      (string_starts_with_p, find_argument, dump_error_to_string)
      (load_pdump): new functions.
      (main): detect pdumper and --temacs invocation; actually load
      portable dump when detected; set gflags as appropriate; changes to
      init functions throughout to avoid passing explicit
      'initialized' argument.
      * src/eval.c (inhibit_lisp_code): remove unused variable.
      (init_eval_once_for_pdumper): new function.
      (init_eval_once): call it.
      * src/filelock.c: CANNOT_DUMP -> will_dump_p()
      * src/fingerprint-dummy.c: new file
      * src/fingerprint.h: new file
      * src/fns.c: CANNOT_DUMP -> will_dump_p(), etc.
      (weak_hash_tables): remove
      (hashfn_equal, hashfn_eql): un-staticify
      (...
      d12e5d00
    • Paul Eggert's avatar
      Avoid using obsolete accept-process-output arg · 2a3bd679
      Paul Eggert authored
      * lisp/gnus/nnheader.el (nnheader-accept-process-output):
      * lisp/net/dns.el (dns-query):
      * lisp/net/imap.el (imap-wait-for-tag):
      * lisp/net/network-stream.el (network-stream-get-response):
      * lisp/net/pop3.el (pop3-accept-process-output):
      * lisp/obsolete/starttls.el (starttls-negotiate-gnutls)
      (starttls-open-stream-gnutls):
      * lisp/server.el (server-eval-at):
      * lisp/textmodes/ispell.el (ispell-accept-output):
      Do not depend on the obsolete milliseconds argument of
      accept-process-output.
      2a3bd679
    • Paul Eggert's avatar
      Fix accept-process-output/process-live-p confusion · 9fc02ff5
      Paul Eggert authored
      * doc/lispref/processes.texi (Accepting Output):
      Document the issue.
      * lisp/net/tramp-adb.el (tramp-adb-parse-device-names):
      * lisp/net/tramp-rclone.el (tramp-rclone-parse-device-names):
      * lisp/net/tramp-smb.el (tramp-smb-wait-for-output):
      * lisp/net/tramp.el (tramp-interrupt-process):
      * test/src/process-tests.el (make-process/mix-stderr):
      Fix code that uses accept-process-output and process-live-p.
      Add FIXME comments as necessary.
      * lisp/net/tramp-sudoedit.el (tramp-sudoedit-action-sudo):
      * lisp/net/tramp.el (tramp-action-out-of-band):
      Add FIXME comments as necessary.
      9fc02ff5
    • Alan Mackenzie's avatar
      Make CC Mode and electric-pair-mode work together. This fixes bug #33794 · 223e7b87
      Alan Mackenzie authored
      * lisp/progmodes/cc-cmds.el (c-electric-pound, c-electric-slash)
      (c-electric-star, c-electric-semi&comma, c-electric-colon, c-electric-lt-gt):
      Bind post-self-insert-hook to nil around calls to self-insert-command to
      protect against arbitrary functionality confusing CC Mode.
      (c-do-brace-electrics): New function, extracted from c-electric-brace and
      enhanced.
      (c-electric-brace): Bind post-self-insert-hook to nil around the call to
      self-insert-command.  When electric-pair-mode is configured, call
      electric-pair-post-self-insert-function.  Handle any deletion done by this
      function.  Call c-do-brace-electrics for the inserted brace, and perhaps for a
      brace inserted by electric-pair-self-insert-function.
      (c-electric-paren): Bind post-self-insert-hook to nil around the call to
      self-insert-command.  When electric-pair-mode is configured, call
      electric-pair-post-self-insert-function.
      223e7b87
    • Philipp Stephani's avatar
      Disable electric quotes for most files in the Emacs codebase. · 9530108f
      Philipp Stephani authored
      * .dir-locals.el: Disable electric quotes in comments and strings for
      C, Emacs Lisp, and Texinfo, as the Emacs codebase doesn't use them.
      9530108f
  4. 14 Jan, 2019 5 commits
  5. 13 Jan, 2019 2 commits
    • Paul Eggert's avatar
      Fix translation-region bug with MAX_CHAR · 1a722e88
      Paul Eggert authored
      Also, clean up the code a bit.
      Actually I discovered the bug while cleaning up the code.
      * src/editfns.c (Fsubst_char_in_region)
      (Ftranslate_region_internal): Use bool for booleans.
      (Ftranslate_region_internal): Fix off-by-1 bug when a
      translation table translates the maximum char.  Assume C99
      decl-after-statement, similar minor cleanups.
      * test/src/editfns-tests.el (test-translate-region-internal):
      New test.
      1a722e88
    • Paul Eggert's avatar
      Minor overflow fix in translate-region-internal · 800d3815
      Paul Eggert authored
      * src/editfns.c (Ftranslate_region_internal):
      Use ptrdiff_t, not int, for a count that might exceed INT_MAX.
      800d3815
  6. 12 Jan, 2019 1 commit
  7. 11 Jan, 2019 3 commits
    • Glenn Morris's avatar
      Remove some obsolete stub files from etc/ · 8fe21b03
      Glenn Morris authored
      * etc/CENSORSHIP, etc/FTP, etc/GNU, etc/LINUX-GNU, etc/MORE.STUFF:
      * etc/ORDERS, etc/THE-GNU-PROJECT, etc/WHY-FREE:
      Remove stub files that were marked obsolete 5 years ago.
      8fe21b03
    • Martin Rudalics's avatar
      Run window change functions during redisplay · e567ac14
      Martin Rudalics authored
      * doc/lispref/windows.texi (Window Sizes): Move (and rename)
      descriptions of 'window-pixel-height-before-size-change' and
      'window-pixel-width-before-size-change' to Window Hooks
      section.
      (Window Configurations): Remove warning against use of
      'save-window-excursion' in 'window-size-change-functions'.
      (Window Hooks): Rewrite section according to redesign of
      window change functions.
      * lisp/erc/erc-track.el (erc-window-configuration-change)
      (erc-modified-channels-update): Call latter directly from
      'window-configuration-change-hook' instead via
      'post-command-hook'.
      * lisp/frame.el (frame-size-changed-p): Change nomenclature
      in let bindings.
      * lisp/net/rcirc.el (rcirc-window-configuration-change)
      (rcirc-window-configuration-change-1): Call latter directly
      from 'window-configuration-change-hook' instead via
      'post-command-hook'.
      * lisp/window.el (window-pixel-width-before-size-change)
      (window-pixel-height-before-size-change): Defalias.
      (window--resize-mini-window, window-resize)
      (adjust-window-trailing-edge, delete-window)
      (delete-other-windows, balance-windows): Don't run
      'window-configuration-change-hook' any more from here.
      (split-window): Don't run 'window-configuration-change-hook'
      from here.  'run-window-scroll-functions' from here.
      (window--adjust-process-windows): Run from
      'window-configuration-change-hook' only.
      * src/frame.c (old_selected_frame): New Lisp variable.
      (make_frame): Initialize frame's change_stamp slot.
      (Fold_selected_frame): New function.
      * src/frame.h (struct frame): New slots old_selected_window,
      window_change, change_stamp and number_of_windows.
      (fset_old_selected_window): New inlined function.
      (FRAME_WINDOW_CHANGE, FRAME_OLD_SELECTED_WINDOW): New macros.
      * src/window.c (old_selected_window): New Lisp variable.
      (wset_old_buffer): New inlined function.
      (Fframe_old_selected_window, Fold_selected_window)
      (Fwindow_old_buffer): New functions.
      (Fwindow_old_pixel_width, Fwindow_old_pixel_height): Rename
      from Fwindow_pixel_width_before_size_change and
      Fwindow_pixel_height_before_size_change.  Update doc-strings.
      (Fwindow_old_body_pixel_width, Fwindow_old_body_pixel_height):
      New functions.
      (Fdelete_other_windows_internal): Set frame's window_change
      slot instead of running 'window-configuration-change-hook'.
      (Frun_window_configuration_change_hook): In doc-string tell
      that this function is no more needed.
      (Frun_window_scroll_functions): Amend doc-string.  Run with
      window's buffer current.
      (window_sub_list, window_change_record_windows)
      (window_change_record_frame, window_change_record)
      (run_window_change_functions_1, run_window_change_functions):
      New functions.
      (set_window_buffer): Set frame's window_change slot instead of
      running 'window-configuration-change-hook'.
      (make_window): Don't initialize pixel_width_before_size_change
      and pixel_height_before_size_change slots.
      (window_resize_apply, Fdelete_window_internal): Set frame's
      window_change slot.
      (Fsplit_window_internal): Set frame's window_change slot.
      Don't run 'window-scroll-functions' from here.
      * src/window.h (struct window): New slots old_buffer,
      change_stamp, old_pixel_width (renamed from
      pixel_width_before_size_change), old_pixel_height (renamed
      from pixel_height_before_size_change), old_body_pixel_width
      and old_body_pixel_height.
      * src/xdisp.c (init_iterator): Set frame's window_change slot
      when the body height or width changes.
      (prepare_menu_bars): Don't run_window_size_change_functions.
      (redisplay_internal): Don't run_window_size_change_functions,
      run_window_change_functions instead.
      e567ac14
    • Paul Eggert's avatar
      List lengths are always fixnums now · 470082de
      Paul Eggert authored
      Without this patch, it was theoretically possible for a list
      length to be a bignum, which means that safe-length could
      signal an error (due to generating a too-large bignum) contrary
      to its documentation.  Fix things to remove the theoretical
      possibility, so that list lengths are always fixnums (and so
      that list lenghts are always ptrdiff_t values too, since that
      is assumed internally anyway).
      * src/alloc.c (Fcons): Do not allocate so many conses that
      a list length won’t fit into ptrdiff_t or into fixnum.
      This matters only on weird platforms; on typical platforms,
      list lengths always fit anyway.
      * src/fns.c (list_length, Fsafe_length, proper-list-p):
      Remove integer overflow checks that are no longer needed.
      470082de
  8. 10 Jan, 2019 6 commits
    • Paul Eggert's avatar
      Minor tweaks to HAVE_NATIVE_SCALING code · 9609db9d
      Paul Eggert authored
      This mostly just reindents.
      * src/image.c (x_set_image_size): Always define, but to a no-op
      if !HAVE_NATIVE_SCALING, to avoid an #ifdef elsewhere.
      (x_create_x_image_and_pixmap): Move decl to avoid an #ifdef.
      (image_create_x_image_and_pixmap): Move #ifdef outside of call.
      * src/xterm.c (x_composite_image): Avoid ‘else #endif’.
      9609db9d
    • Alan Third's avatar
      Add native image scaling (bug#33587) · a1b7a3f2
      Alan Third authored
      * configure.ac: Test for XRender outside of xft checks.
      * src/Makefile.in (XRENDER_LIBS): List XRender libs separately from
      xft libs.
      * lisp/image.el (image--get-imagemagick-and-warn): Allow resizing if
      native scaling is available.
      * src/dispextern.h: Add XRender and image scaling stuff.
      (struct image): Add XRender Pictures.
      * src/image.c (x_create_bitmap_mask):
      (image_create_x_image_and_pixmap): Handle XRender Picture.
      (scale_image_size):
      (compute_image_size): Make available when any form of scaling is
      enabled.
      (x_set_image_size): New function.
      (lookup_image): Set image size.
      (x_create_x_image_and_pixmap): Create XRender Picture when necessary.
      (x_put_x_image): Handle the case where desired size != actual size.
      (free_image): Free XRender Pictures.
      (Fimage_scaling_p): New function.
      (syms_of_image): Add image-scaling-p.
      * src/nsimage.m (ns_load_image): Remove NS specific resizing.
      ([EmacsImage setSizeFromSpec:]): Remove method.
      (ns_image_set_size): New function.
      * src/n...
      a1b7a3f2
    • Alan Third's avatar
      Fix drag and drop behaviour on NS (bug#30929) · c342b263
      Alan Third authored
      * doc/emacs/macos.texi (Mac / GNUstep Events): Describe the new drag
      and drop behaviour.
      * lisp/term/ns-win.el (ns-drag-n-drop): Handle the new event format.
      (ns-drag-n-drop-other-frame):
      (ns-drag-n-drop-as-text):
      (ns-drag-n-drop-as-text-other-frame): Remove functions and key
      bindings.
      * src/nsterm.m ([EmacsView performDragOperation:]): Send Emacs event
      in new format without setting any modifiers.
      c342b263
    • Michael Albinus's avatar
      New test custom--test-theme-variables · 7ae0a24c
      Michael Albinus authored
      * test/lisp/custom-tests.el (custom--test-user-option)
      (custom--test-variable): New variables.
      (custom--test-theme-variables): New test.
      
      * test/lisp/custom-resources/custom--test-theme.el (custom--test):
      New file.
      7ae0a24c
    • Martin Rudalics's avatar
      Handle dedicated status in 'window--display-buffer' (Bug#33870) · f646675c
      Martin Rudalics authored
      * lisp/window.el (display-buffer-record-window): Rewrite
      doc-string.
      (window--display-buffer): Remove fifth argument DEDICATED and
      either directly use a 'dedicated' entry in ALIST or the value
      of 'display-buffer-mark-dedicated' instead.
      (display-buffer-in-atom-window, display-buffer-use-some-frame)
      (display-buffer-pop-up-frame, display-buffer-pop-up-window)
      (display-buffer-below-selected, display-buffer-at-bottom):
      Adjust callers of 'window--display-buffer'.
      (window--make-major-side-window)
      (display-buffer-in-side-window): Handle dedicated status of
      the chosen side window via a 'dedicated' alist entry and
      adjust 'window--display-buffer' call.
      (display-buffer-in-child-frame): Set up TYPE correctly for and
      adjust 'window--display-buffer' call.
      (display-buffer-in-previous-window): Handle dedicated status
      of a previous window already showing BUFFER.
      * doc/lispref/windows.texi (Buffer Display Action Alists): New
      action alist entry 'dedicated'.
      (Dedicated Windows): Mention new buffer display action alist
      entry 'dedicated'.
      * etc/NEWS: Mention new buffer display action alist entry
      'dedicated'.
      f646675c
    • Paul Eggert's avatar
      Mention Japanese change in documentation · a2e78046
      Paul Eggert authored
      a2e78046