1. 09 Dec, 2018 6 commits
    • Paul Eggert's avatar
      Add make_vector and make_nil_vector · d79bb756
      Paul Eggert authored
      This makes the callers a bit easier to read, and doubtless
      improves efficiency very slightly.  It also simplifies
      possible future changes to allow bignum indexes to buffers.
      * src/alloc.c (allocate_vectorlike):
      Prefer ptrdiff_t to size_t when either will do.
      (make_vector): New function.
      (Fmake_vector): Use it.
      * src/buffer.c (syms_of_buffer):
      * src/bytecode.c (syms_of_bytecode):
      * src/category.c (Fmake_category_table, init_category_once):
      * src/ccl.c (syms_of_ccl):
      * src/character.c (syms_of_character):
      * src/charset.c (Fdefine_charset_internal)
      (Ffind_charset_region, Ffind_charset_string):
      * src/chartab.c (copy_char_table):
      * src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
      * src/composite.c (get_composition_id, Fcomposition_get_gstring):
      * src/composite.h (LGLYPH_NEW):
      * src/fns.c (concat, Flocale_info, make_hash_table):
      * src/font.c (font_otf_ValueRecord, font_otf_anchor)
      (build_style_table, syms_of_font):
      * src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
      (dump_fontset, syms_of_fontset):
      * src/image.c (xpm_make_color_table_v):
      * src/keyboard.c (modify_event_symbol, menu_bar_items)
      (parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
      (syms_of_keyboard):
      * src/keymap.c (Fdefine_key, describe_map, describe_vector):
      * src/lread.c (read_vector):
      * src/macfont.m (macfont_shape):
      * src/menu.c (init_menu_items):
      * src/nsfns.m (ns_make_monitor_attribute_list):
      * src/process.c (conv_sockaddr_to_lisp, network_interface_info):
      * src/profiler.c (make_log):
      * src/window.c (Fcurrent_window_configuration):
      * src/xdisp.c (with_echo_area_buffer_unwind_data)
      (format_mode_line_unwind_data):
      * src/xfaces.c (Finternal_make_lisp_face)
      (Fface_attributes_as_vector):
      * src/xfns.c (x_make_monitor_attribute_list)
      (Fx_display_monitor_attributes_list):
      * src/xfont.c (syms_of_xfont):
      * src/xselect.c (x_handle_dnd_message):
      * src/xwidget.c (save_script_callback):
      Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
      * src/callint.c (Fcall_interactively):
      * src/charset.c (load_charset_map):
      * src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
      * src/composite.c (get_composition_id)
      * src/dispnew.c (Fframe_or_buffer_changed_p)
      (syms_of_display):
      * src/fns.c (make_hash_table, maybe_resize_hash_table):
      * src/font.c (font_style_to_value):
      * src/fontset.c (FONTSET_ADD, fontset_add):
      * src/json.c (json_to_lisp):
      * src/keymap.c (syms_of_keymap):
      * src/lread.c (init_obarray):
      * src/profiler.c (make_log, Fprofiler_cpu_log):
      * src/term.c (term_get_fkeys_1):
      Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
      * src/font.c (build_style_table):
      * src/macfont.m (macfont_shape):
      * src/process.c (conv_sockaddr_to_lisp, network_interface_info):
      Prefer make_uninit_vector if the vector will be initialized soon.
      * src/lisp.h (make_nil_vector): New function.
      d79bb756
    • Eli Zaretskii's avatar
      Fix resolving symlinks in Eshell history file names · c2fdd50c
      Eli Zaretskii authored
      * lisp/eshell/em-dirs.el (eshell-write-last-dir-ring):
      * lisp/eshell/em-hist.el (eshell-write-history): Don't call
      file-truename with argument of nil.  (Bug#33477)
      
      * test/lisp/eshell/eshell-tests.el (with-temp-eshell): Remove
      HISTFILE from the environment, to make sure the Eshell history
      file is nil.
      c2fdd50c
    • Paul Eggert's avatar
      7515a1d4
    • Paul Eggert's avatar
      Port VECTOR_ELTS_MAX to older GCC etc. · fa4dd8dd
      Paul Eggert authored
      Problem reported by Eli Zaretskii in:
      https://lists.gnu.org/r/emacs-devel/2018-12/msg00182.html
      * src/alloc.c (VECTOR_ELTS_MAX): Now a macro.
      Needed for portability to older GCC and non-GCC.
      fa4dd8dd
    • Paul Eggert's avatar
      Streamline and fix vector-size checks · 7bcea8f8
      Paul Eggert authored
      * src/alloc.c (VECTOR_ELTS_MAX): New constant.
      (allocate_vectorlike): LEN now must be positive.  Assume LEN
      is in range.  All callers changed.
      (allocate_vector): Arg is now ptrdiff_t, not EMACS_INT.
      All callers changed.  Return zero vector here, not in
      allocate_vectorlike.
      * src/lisp.h (make_uninit_vector): Simplify.
      * src/xwidget.c (webkit_js_to_lisp):
      Check for overflow in ptrdiff_t calculations.
      7bcea8f8
    • Paul Eggert's avatar
      Suppress WebKitGTK+ 2.21.1 diagnostics · a9732737
      Paul Eggert authored
      * src/xwidget.c: Suppress deprecation warnings (Bug#33679).
      a9732737
  2. 08 Dec, 2018 12 commits
  3. 07 Dec, 2018 3 commits
    • Alan Mackenzie's avatar
      CC Mode: Compensate for backward-sexp ignoring trailing commas after {...} · f6a69957
      Alan Mackenzie authored
      This fixes bug #32808.
      
      * lisp/progmodes/cc-engine.el (c-beginning-of-statement-1): New variable
      comma-delimited, set when we're about to scan backward over a comma.  Do not
      reckon a brace block as bounding a statement when it is followed or preceded
      by a comma (except when argument comma-delim is non-nil).
      (c-guess-basic-syntax, CASE 9C): Call c-beginning-of-statement-1 with argument
      comma-delim changed to non-nil.
      f6a69957
    • Michael Albinus's avatar
      Refactor some Tramp functions · 294b2c2b
      Michael Albinus authored
      * lisp/net/tramp-compat.el (tramp-compat-file-local-name): New defsubst.
      (tramp-compat-file-name-quoted-p, tramp-compat-file-name-quote)
      (tramp-compat-file-name-unquote):
      * lisp/net/tramp.el (tramp-handle-file-name-case-insensitive-p)
      (tramp-handle-file-truename, tramp-get-remote-tmpdir):
      * lisp/net/tramp-adb.el (tramp-adb-handle-copy-file)
      (tramp-adb-handle-rename-file, tramp-adb-handle-exec-path):
      * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly)
      (tramp-sh-handle-exec-path, tramp-find-inline-encoding)
      (tramp-get-remote-touch): Use it.
      
      * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
      Use `tramp-handle-expand-file-name'.
      (tramp-adb-handle-expand-file-name): Move to tramp.el.
      (tramp-adb-handle-file-writable-p): Adapt docstring.
      
      * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
      Use `tramp-handle-file-local-copy', `tramp-handle-file-writable-p'
      and `tramp-handle-write-region'.
      (tramp-gvfs-handle-file-local-copy)
      (tramp-gvfs-handle-file-writable-p)
      (tramp-gvfs-handle-write-region): Move to tramp.el.
      
      * lisp/net/tramp-rclone.el: Dont't require `tramp-adb' and
      `tramp-gvfs' anymore.
      (tramp-rclone-file-name-handler-alist):
      Use `tramp-handle-expand-file-name', `tramp-handle-file-local-copy',
      `tramp-handle-file-writable-p' and `tramp-handle-write-region'.
      (tramp-rclone-handle-directory-files): Simplify.
      
      * lisp/net/tramp.el (tramp-methods): Extend docstring.
      (tramp-parse-netrc): Require `netrc'.
      (tramp-handle-expand-file-name, tramp-handle-file-local-copy)
      (tramp-handle-file-writable-p, tramp-handle-write-region): New defuns.
      294b2c2b
    • Eli Zaretskii's avatar
      Fix the value of default-directory upon startup on MS-Windows · e4a8f6eb
      Eli Zaretskii authored
      * src/w32.c (w32_get_current_directory): New function.
      (GetCachedVolumeInformation, init_environment): Use it.
      (w32_init_current_directory): New function.
      * src/w32.h (w32_init_current_directory): Add prototype.
      * src/emacs.c (main) [WINDOWSNT]: Use w32_init_current_directory
      to get the accurate value of cwd.  This is needed to record
      the correct directory in emacs_wd, which is now initialized
      way earlier in the startup process, when init_environment was
      not yet called.  For details, see the problems reported in
      http://lists.gnu.org/archive/html/emacs-devel/2018-12/msg00068.html.
      Reported by Angelo Graziosi <angelo.g0@libero.it>.
      e4a8f6eb
  4. 06 Dec, 2018 11 commits
    • Juri Linkov's avatar
      bcd74314
    • Paul Eggert's avatar
      0e8e5da1
    • Paul Eggert's avatar
      Mention unsetting XDG_RUNTIME_DIR in doc. · b1d7f19a
      Paul Eggert authored
      b1d7f19a
    • Paul Eggert's avatar
      emacsclient: avoid background chatter · 46b81008
      Paul Eggert authored
      * lib-src/emacsclient.c (process_grouping): New function.
      (act_on_signals, main): Use it.
      (main): Omit "Waiting for Emacs..." and later "\n" messages
      if in background, since that messes up the screen.
      46b81008
    • Paul Eggert's avatar
      Fix emacsclient hang when backgrounded · 2f985977
      Paul Eggert authored
      Problem reported by Kaushal Modi in:
      https://lists.gnu.org/r/emacs-devel/2018-12/msg00083.html
      The tcdrain call replaced an fdatasync call which had no
      effect on the tty, so removing it entirely shouldn’t cause
      problems.  The fdatasync call replaced an fsync call which
      also had no effect on the tty, and the fsync call seems to be
      badly-merged revenant of emacsclient’s old (circa 2004) way of
      communicating to and from Emacs via FILE * streams, where
      fsync was apparently needed when talking to sockets.
      * lib-src/emacsclient.c [!DOS_NT]: Don’t include termios.h.
      (flush_stdout): Remove.  All callers removed.
      (main): Do not drain the tty after "Waiting for Emacs..."
      message.  There should be no need to drain, and draining it
      might send us a SIGTTOU.  Do not fflush stdout just before
      exiting, as exiting does that for us.
      2f985977
    • Paul Eggert's avatar
      struct image_type layout is private to image.c · c5b6f167
      Paul Eggert authored
      * src/dispextern.h (struct image_type): Move from here ...
      * src/image.c (struct image_type): ... to here.
      c5b6f167
    • Eli Zaretskii's avatar
      Avoid an error on exit in a build without threads · 6fa44f96
      Eli Zaretskii authored
      * lisp/simple.el (list-processes--refresh): Avoid signaling an
      error in a build --without-threads.  (Bug#33629)
      6fa44f96
    • Michael Albinus's avatar
      Add missing handler to tramp-rclone.el, improve robustness · 7d33c775
      Michael Albinus authored
      * lisp/net/tramp-rclone.el (tramp-adb): Require.
      (tramp-rclone-file-name-handler-alist):
      Use `tramp-adb-handle-expand-file-name'.
      (tramp-rclone-flush-directory-cache): New defun, derived from
      `tramp-rclone-flush-mount'.
      (tramp-rclone-do-copy-or-rename-file)
      (tramp-rclone-handle-delete-directory)
      (tramp-rclone-handle-delete-file)
      (tramp-rclone-handle-make-directory): Use it.
      (tramp-rclone-handle-directory-files)
      (tramp-rclone-local-file-name):
      Use `tramp-compat-file-name-quoted-p', 	`tramp-compat-file-name-quote'
      and ´tramp-compat-file-name-unquote'.
      (tramp-rclone-handle-file-executable-p)
      (tramp-rclone-handle-file-readable-p): Cache result.
      (tramp-rclone-handle-file-name-all-completions)
      (tramp-rclone-mounted-p, tramp-rclone-remote-file-name)
      (tramp-rclone-maybe-open-connection): Rewrite.
      
      * test/lisp/net/tramp-tests.el (tramp--test-rclone-p): New defun.
      (tramp-test05-expand-file-name-relative)
      (tramp--test-special-characters): Use it.
      7d33c775
    • Michael Albinus's avatar
      Rework Tramp wrt string-match-p, looking-at-p, save-match-data · 66b49fc1
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-find-method, tramp-find-user)
      (tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name)
      (tramp-completion-make-tramp-file-name, tramp-debug-message)
      (tramp-message, tramp-progress-reporter-update)
      (tramp-set-completion-function)
      (tramp-rfn-eshadow-update-overlay)
      (tramp-find-file-name-coding-system-alist)
      (tramp-file-name-for-operation)
      (tramp-use-absolute-autoload-file-names)
      (tramp-get-completion-methods, tramp-get-completion-user-host)
      (tramp-handle-directory-files)
      (tramp-handle-file-name-case-insensitive-p)
      (tramp-handle-file-name-completion, tramp-handle-file-truename)
      (tramp-handle-insert-directory, tramp-handle-load)
      (tramp-handle-shell-command, tramp-action-yesno)
      (tramp-action-yn, tramp-process-actions)
      (tramp-mode-string-to-int, tramp-get-local-locale)
      (tramp-local-host-p):
      * lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info)
      (tramp-adb-handle-directory-files-and-attributes)
      (tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output)
      (tramp-adb-handle-file-name-all-completions)
      (tramp-adb-handle-shell-command)
      (tramp-adb-handle-start-file-process):
      * lisp/net/tramp-archive.el (tramp-archive-dissect-file-name):
      * lisp/net/tramp-cache.el (tramp-get-hash-table)
      (tramp-flush-directory-properties, tramp-flush-file-function):
      * lisp/net/tramp-cmds.el (tramp-reporter-dump-variable)
      (tramp-append-tramp-buffers):
      * lisp/net/tramp-compat.el (tramp-compat-process-running-p):
      * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name)
      (tramp-gvfs-get-file-attributes)
      (tramp-gvfs-handle-file-attributes)
      (tramp-gvfs-monitor-process-filter)
      (tramp-gvfs-handler-mounted-unmounted)
      (tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry)
      (tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection):
      * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls)
      (tramp-do-file-attributes-with-stat)
      (tramp-sh-handle-file-selinux-context)
      (tramp-sh-handle-directory-files-and-attributes)
      (tramp-do-directory-files-and-attributes-with-stat)
      (tramp-sh-handle-file-name-all-completions)
      (tramp-sh-handle-dired-compress-file)
      (tramp-sh-handle-insert-directory)
      (tramp-sh-handle-expand-file-name)
      (tramp-sh-handle-start-file-process)
      (tramp-sh-handle-process-file, tramp-sh-handle-write-region)
      (tramp-sh-handle-file-notify-add-watch)
      (tramp-sh-gio-monitor-process-filter)
      (tramp-sh-gvfs-monitor-dir-process-filter)
      (tramp-sh-inotifywait-process-filter)
      (tramp-sh-handle-file-system-info, tramp-maybe-send-script)
      (tramp-find-executable, tramp-open-shell, tramp-find-shell)
      (tramp-open-connection-setup-interactive-shell)
      (tramp-find-inline-encoding, tramp-call-local-coding-command)
      (tramp-compute-multi-hops, tramp-maybe-open-connection)
      (tramp-convert-file-attributes)
      (tramp-make-copy-program-file-name, tramp-get-remote-locale)
      (tramp-get-test-nt-command, tramp-get-remote-stat)
      (tramp-get-inline-coding):
      * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files)
      (tramp-smb-action-get-acl, tramp-smb-handle-file-attributes)
      (tramp-smb-handle-file-name-all-completions)
      (tramp-smb-handle-file-system-info)
      (tramp-smb-handle-file-writable-p)
      (tramp-smb-handle-insert-directory)
      (tramp-smb-handle-make-directory)
      (tramp-smb-handle-make-directory-internal)
      (tramp-smb-handle-start-file-process, tramp-smb-get-localname)
      (tramp-smb-read-file-entry): Use `string-match-p' and
      `looking-at-p'.  Remove superfluous `save-match-data'.  Apply
      `eval-when-compile' on constant concat data.
      
      * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p):
      Use `string-prefix-p'.
      (tramp-compat-file-name-unquote): Do not use match data.
      66b49fc1
    • Michael Albinus's avatar
      Make stronger tests for Tramp multi hops · 8f3fde38
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-dissect-file-name, tramp-dissect-hop-name):
      Check, that method is capable of multi hops.
      
      * test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect)
      (tramp-test02-file-name-dissect-simplified)
      (tramp-test02-file-name-dissect-separate): Suppress check for multihops.
      (tramp-test03-file-name-method-rules): Check for error if multi
      hops cannot be applied.
      8f3fde38
    • João Távora's avatar
      Keep Flymake compatible with Emacs 26.1 builds --without-x · 8e8b8115
      João Távora authored
      * lisp/progmodes/flymake.el (flymake-double-exclamation-mark):
      Don't define if 'define-fringe-bitmap isn't fbound.
      (Version): Bump to 1.0.2
      8e8b8115
  5. 05 Dec, 2018 1 commit
  6. 04 Dec, 2018 7 commits