1. 18 Sep, 2019 5 commits
    • Paul Eggert's avatar
      Out-of-datedness .elc check is merely a file test · 9597ee68
      Paul Eggert authored
      * src/fileio.c (file_test_errno): Now extern.
      * src/lread.c (Fload): Use file_test_errno instead,
      since this is really just a file test (the attributes
      are not given to the user).
    • Eli Zaretskii's avatar
      Fix the MS-Windows build broken by recent errno changes · 7ff2eef9
      Eli Zaretskii authored
      * src/fileio.c (file_directory_p): If the file exists, but is
      not a directory, set errno to ENOTDIR, like the Posix branch
      does; openp expects that.
    • Paul Eggert's avatar
      Be less picky about EACCES in file test predicates · 735940f4
      Paul Eggert authored
      Problem reported by Tino Calancha (Bug#37445) and others.
      * src/fileio.c (PICKY_EACCES): New constant, false by default.
      (file_test_errno): Ignore EACCES if not picky.
      (check_file_access): Investigate EACCES problems further
      if picky.
    • Paul Eggert's avatar
      Fix permission-denied issue in MS-Windows startup · 94ca934a
      Paul Eggert authored
      * src/callproc.c (init_callproc): Use file_access_p rather
      than Ffile_exists_p during startup (Bug#37445).
    • Paul Eggert's avatar
      Improve reporting of I/O, access errors · 9dc306b1
      Paul Eggert authored
      Signal an error for file-oriented errors that are not tame
      errors like ENOENT and ENOTDIR (Bug#37389).
      Do this for primitives exposed to Lisp; the lower
      level internal C API merely makes errno values available
      to higher-level C code.
      * doc/lispref/files.texi (Testing Accessibility)
      (File Attributes, Extended Attributes): Do not say that the
      functions return nil when the return value cannot be determined.
      * etc/NEWS: Mention the change.
      * src/dired.c (Ffile_attributes): Fix doc string confusion
      about opening a file vs getting its attributes.
      (file_attributes): Signal serious errors.
      * src/fileio.c (check_existing, check_executable)
      (check_writable): Remove.  All callers changed to use
      check_file_access or file_access_p.
      (file_access_p, file_metadata_errno, file_attribute_errno)
      (file_test_errno, check_file_access, check_emacs_readlinkat):
      New functions.
      * src/fileio.c (Ffile_executable_p, Ffile_readable_p)
      (Ffile_name_case_insensitive_p, Frename_file, Ffile_exists_p):
      (Ffile_symlink_p, Ffile_directory_p)
      (Ffile_accessible_directory_p, Ffile_regular_p)
      (Ffile_selinux_context, Ffile_acl, Ffile_modes)
      (Ffile_newer_than_file_p, Fset_visited_file_modtime)
      * src/filelock.c (unlock_file, Ffile_locked_p):
      * src/lread.c (Fload):
      Signal serious errors.
      * src/fileio.c (Ffile_writable_p): Remove unnecessary CHECK_STRING.
      (emacs_readlinkat): Now static.
      * src/filelock.c (current_lock_owner, lock_if_free): Return a
      positive errno on error, and the negative of the old old value
      on success.  All callers changed.
      * src/lread.c (openp): Propagate serious errno values to caller.
  2. 17 Sep, 2019 5 commits
    • Jimmy Aguilar Mena's avatar
      Substituted deprecated WebKitGTK+ api. · ae3edf0a
      Jimmy Aguilar Mena authored
      * src/xwidget.c : Substituted WebKitGTK+ API calls and use
      JavaScriptCore GLib API instead.
    • Juanma Barranquero's avatar
    • Eli Zaretskii's avatar
      Improve font lookup on MS-Windows · 8054935c
      Eli Zaretskii authored
      * src/w32font.c (struct font_callback_data): New member
      (w32font_list_internal, w32font_match_internal): Set up
      match_data.known_fonts if the font spec includes :script that
      names one of the non-USB scripts.
      (add_font_entity_to_list): If font_matches_spec returns zero
      for a font, and we have some fonts in match_data->known_fonts,
      consider the font to be a match if it is named in known_fonts.
      (font_supported_scripts): Update the Unicode Subranges.  In
      particular, map bit 74 to 'burmese', as this is the name Emacs
      uses, not 'myanmar'.  Add a list of scripts that have no USBs
      defined for them.
      (syms_of_w32font) <Qburmese, Qcuneiform_numbers_and_punctuation>
      <Qaegean_number, Qw32_non_USB_fonts>: New symbols.
      * lisp/term/w32-win.el (w32-no-usb-subranges): New defconst.
      (w32--filter-USB-scripts, w32-find-non-USB-fonts): New functions.
      (w32-non-USB-fonts): New defvar.
      * lisp/international/fontset.el (setup-default-fontset): Add
      more scripts to automatic setup by representative characters.
      * doc/emacs/msdos.texi (Windows Fonts): Document
      'w32-find-non-USB-fonts' and 'w32-non-USB-fonts'.
      * etc/NEWS: Mention 'w32-find-non-USB-fonts' and
    • Paul Eggert's avatar
      Pacify GCC -Wmaybe-uninitialized · 01c929bc
      Paul Eggert authored
      * src/dired.c (directory_files_internal):
      Pacify GCC 7.4.0-1ubuntu1~18.04.1 x86-64.
    • Paul Eggert's avatar
      Don’t round file-system-info counts · c108d8ec
      Paul Eggert authored
      * src/fileio.c (blocks_to_bytes): Convert the byte count to an
      integer, since we have bignums now.  This avoids possible rounding
      errors for file systems containing more than 8 PiB or so.
  3. 16 Sep, 2019 7 commits
    • Paul Eggert's avatar
      Remove obsolete Lint directives · 2c2f0eb9
      Paul Eggert authored
      Most of the directives were wrong anyway.  Apparently
      traditional lint hasn’t been used to check Emacs for years.
      * src/callint.c (Finteractive):
      * src/cm.c (evalcost):
      * src/emacs.c (main):
      * src/eval.c (call1, call2, call3, call4, call5, call6, call7, call8):
      * src/fns.c (concat2, concat3, nconc2):
      * src/term.c (calculate_ins_del_char_costs):
      Omit ARGSUSED comments.
      * src/eval.c (call1): Omit VARARGS comment.
    • Paul Eggert's avatar
      directory-files cleanup and speed tweaking · 2335704f
      Paul Eggert authored
      * src/dired.c (directory_files_internal):
      Check ‘match’ before doing anything heavyweight.
      Move decls closer to use.
      Remove obsolete comments about GC.
      No need to encode ‘directory’ or to call multibyte_chars_in_text.
      Remove no-longer-needed bug check.
      Skip finalname construction if file_attributes fails.
    • Eli Zaretskii's avatar
      Improve error reporting in file_accessible_directory_p · facd6d5a
      Eli Zaretskii authored
      * src/w32.c (w32_accessible_directory_p): Set errno, so that
      file_accessible_directory_p does on MS-Windows, to live up to
      its callers' expectations.
    • Eli Zaretskii's avatar
      Fix initialization of shared-game-score-directory on MS-Windows · 169d04b8
      Eli Zaretskii authored
      * src/callproc.c (init_callproc) [WINDOWSNT]: Run PATH_GAME
      through w32_relocate, to expand %emacs_dir%.
      [DOS_NT]: Accept EACCES as not "unusual" errno value.
      Reported by Richard Copley <rcopley@gmail.com>.
    • Paul Eggert's avatar
      Fix some file-name-case-insensitive glitches · be828883
      Paul Eggert authored
      * src/fileio.c (file_name_directory): New static function,
      broken out of Ffile_name_directory.
      (file_name_case_insensitive_err, Ffile_writable_p, Fdo_auto_save):
      Use it.
      (file_name_case_insensitive_err): Rename from
      file_name_case_insensitive_p.  Accept an unencoded Lisp_Object
      rather than an encoded char *, so that platforms other than
      Cygwin and macOS need not encode the file name.  Return an int
      -1, 0, errno rather than a bool (setting errno if false),
      so that the caller can distinguish an error from false.
      All callers changed.
      (Ffile_name_case_insensitive_p): Don’t issue system calls on
      platforms other than Cygwin and macOS.  Fix bug that broke the
      attempt to move up the filesystem tree (it moved up only one
    • Paul Eggert's avatar
      Fix unknown-vs-nonexistent glitch for file timestamps · ba060577
      Paul Eggert authored
      * src/fileio.c (time_error_value): EACCES means the file
      timestamp is unknown, not that the file does not exist.
    • Paul Eggert's avatar
      Improve directory-access diagnostics · de3daf06
      Paul Eggert authored
      * src/callproc.c (init_callproc): Diagnose I/O errors,
      access errors, etc. for the game directory.
      * src/charset.c (init_charset): Improve quality of diagnostic
      when the charsets directory has I/O errors, access errors, etc.
  4. 15 Sep, 2019 1 commit
  5. 14 Sep, 2019 3 commits
    • Paul Eggert's avatar
      Fix gc-elapsed rounding bug · 52172d23
      Paul Eggert authored
      * src/alloc.c (garbage_collect): Don’t accumulate rounding
      errors when computing gc-elapsed.
    • Eli Zaretskii's avatar
    • Paul Eggert's avatar
      Improve gc-cons-percentage calculation · bac66302
      Paul Eggert authored
      The old calculation relied on a hodgpodge of partly updated GC
      stats to find a number to multiply gc-cons-percentage by.
      The new one counts data found by the previous GC, plus half of
      the data allocated since then; this is more systematic albeit
      still ad hoc.
      * src/alloc.c (consing_until_gc, gc_threshold, consing_threshold):
      Now EMACS_INT, not intmax_t.
      (HI_THRESHOLD): New macro.
      (tally_consing): New function.
      (make_interval, allocate_string, allocate_string_data)
      (make_float, free_cons, allocate_vectorlike, Fmake_symbol): Use it.
      (allow_garbage_collection, inhibit_garbage_collection)
      (consing_threshold, garbage_collect):
      Use HI_THRESHOLD rather than INTMAX_MAX.
      (consing_threshold): New arg SINCE_GC.  All callers changed.
      (bump_consing_until_gc): Return new consing_until_gc, instead of
      nil.  All callers changed.  Don’t worry about overflow since we
      now saturate at HI_THRESHOLD.  Guess that half of
      recently-allocated objects are still alive, instead of relying on
      the previous (even less-accurate) hodgepodge.
      (maybe_garbage_collect): New function.
      (garbage_collect): Work even if a finalizer disables or enables
      memory profiling.  Do not use malloc_probe if GC reclaimed nothing.
      * src/lisp.h (maybe_gc): Call maybe_garbage_collect instead
      of garbage_collect.
  6. 13 Sep, 2019 4 commits
    • Paul Eggert's avatar
      Simplify GC statistics-gathering · e4fb98b5
      Paul Eggert authored
      * src/alloc.c (make_interval, allocate_string, make_float)
      (free_cons, Fcons, setup_on_free_list)
      (allocate_vector_from_block, Fmake_symbol):
      Do not update gcstat, since it is for statistics from the most
      recent GC, not for a partially-updated hodgepodge.
      (sweep_vectors): Update gcstat, since setup_on_free_list
      no longer does.
      (garbage_collect_1): Rename to garbage_collect and adopt its API.
      Remove the old garbage_collect, which is no longer needed.
      All callers changed.
    • Gemini Lasswell's avatar
      Don't build print-number-table unless it will be used · 0dba340d
      Gemini Lasswell authored
      There are only a few users of print-number-table, and none of them use
      it when print-circle is nil.  A couple of them used to.  print_object
      was changed in 2012-04-20 "* src/print.c (print_preprocess): Only
      check print_depth if print-circle is nil".
      byte-compile-output-docform which uses print-number-table binds
      print-circle to t before printing unless
      byte-compile-disable-print-circle is set, but that variable has been
      marked obsolete since 24.1.
      * src/print.c (print_preprocess): Assert Vprint_circle is non-nil.
      Remove code handling the case when Vprint_circle is nil.
      (print, Fprint_preprocess): Don't call print_preprocess unless
      Vprint_circle is non-nil.
      (print_object): Remove comment referencing removed code in
    • Gemini Lasswell's avatar
      Fix unnecessary hash table creation in cl-prin1 (bug#36566) · 6eaf39d2
      Gemini Lasswell authored
      cl-prin1 prints all its punctuation by passing strings to prin1.  When
      print-circle was set, print_preprocess was creating a new hash table
      for each string, causing excessive garbage collection when printing
      large Lisp objects with cl-prin1.
      * src/print.c (print_number_index): Fix typo in comment above.
      (PRINT_CIRCLE_CANDIDATE_P): Don't create print_number_table
      for top-level strings with no properties, except when
      print_continuous_numbering is on.
    • Eli Zaretskii's avatar
      Fix assertion violations due to non-ASCII text in menus · 5940ac63
      Eli Zaretskii authored
      * src/xdisp.c (tool_bar_height, redisplay_tool_bar)
      (display_menu_bar): If the Lisp string to be displayed in the
      menu-bar or tool-bar window is multibyte, tell the display
      engine to treat it as multibyte, instead of relying on the
      initial determination by init_iterator (which is based on the
      multibyteness of the current buffer).  (Bug#37385)
  7. 12 Sep, 2019 4 commits
    • Stefan Monnier's avatar
      * src/profiler.c: Leave `key` hashslots as Qunbound (bug#37382) · 99741550
      Stefan Monnier authored
      Now that "key == Qunbound" is used to determine if a hash table entry
      is available, we can't stash pre-allocated vectors into the `key` slot
      anymore, so use the `value` slot instead.
      (make_log): Pre-fill the `value` slots i.s.o `key`.
      (evict_lower_half): Stash key back into `value`, i.s.o `key`.
      (record_backtrace): Get pre-allocated vector for `value` i.s.o `key`.
    • Paul Eggert's avatar
      Fix file name encoding when open_directory signals · c19f5dcd
      Paul Eggert authored
      * src/dired.c (open_directory): New arg ENCODED_DIRNAME.
      All callers changed.  Signal error with original name,
      not encoded name.
    • Paul Eggert's avatar
      Improve error reporting for DOC file problems · ffa870fc
      Paul Eggert authored
      * src/doc.c (get_doc_string): Report all serious errors
      when DOC cannot be opened, not just fd-exhaustion errors.
    • Paul Eggert's avatar
      Fix directory-files-and-attributes race · f7228a64
      Paul Eggert authored
      * src/dired.c (directory_files_internal): Fix race condition:
      when some other process removed a file between the readdir and
      the ensuing lstat, directory-files-and-attributes would return
      a list containing nil.
  8. 11 Sep, 2019 3 commits
    • Paul Eggert's avatar
      Omit duplicate test of current directory · ef926ce3
      Paul Eggert authored
      * src/callproc.c (encode_current_directory): Remove redundant
      call to Ffile_accessible_directory_p.  The code checks the
      encoded name with file_accessible_directory_p anyway.
    • Paul Eggert's avatar
      Improve checking of pdump load failures · 5fafa40d
      Paul Eggert authored
      * src/alloc.c (memory_full): Just report "memory exhausted" if
      failure occurs during initialization, since fancier recovery
      schemes are not likely to work when not initialized.
      * src/emacs.c (dump_error_to_string): Accept int, not enum
      pdumper_load_result, since the result might not fit in the
      enum.  Use strerror if it was derived from errno.  This is for
      better diagnostics of pdump load failures.
      (load_pdump_find_executable): Return char *, not enum.  2nd
      arg is now pointer to buffer size, rather than pointer to
      pointer to buffer.  All callers changed.  Use Emacs allocator
      since they should now be OK even during early startup.
      Use check_executable instead access, to use effective rather
      than real permissions.
      (load_pdump): Return void since callers ignore result.
      Use int where enum could be too narrow.  Use heap rather
      than stack for possibly-long string.  Prefer ptrdiff_t to
      * src/fileio.c (check_executable): Now extern.
      * src/pdumper.c (pdumper_load): Return int that may have
      errno added to it, for better diagnostics when loads fail.
    • Paul Eggert's avatar
      Reset dbus registered buses on dump load · a6daae7b
      Paul Eggert authored
      Problem reported by Leonard Lausen (Bug#37331).
      * src/dbusbind.c: Include pdumper.h.
      New function, to reset the registered buses.
      (syms_of_dbusbind): Use it, fixing a TODO.
  9. 08 Sep, 2019 1 commit
    • Paul Eggert's avatar
      Fix bug when gc-cons-percentage is bumped to 0.8 · b6b7c7fc
      Paul Eggert authored
      Problem reported by Michael Heerdegen (Bug#37321).
      * src/alloc.c (gc_threshold): New static var.
      (bump_consing_until_gc): Change args from DIFF to THRESHOLD and
      PERCENTAGE.  All uses changed.  When accounting for a changed
      gc-cons-percentage, do not assume that total_bytes_of_live_objects
      returns the same value now that it did the last time we were
  10. 07 Sep, 2019 3 commits
  11. 06 Sep, 2019 1 commit
    • Paul Eggert's avatar
      file-truename now uses realpath for local files · a59839d7
      Paul Eggert authored
      This uses fewer syscalls on GNU/Linux and other GNUish platforms.
      * lisp/files.el (file-truename): Try fileio--truename
      if there are no handlers.
      * src/fileio.c: Include stdlib.h, for realpath.
      (Ffileio__truename): New function.
  12. 05 Sep, 2019 3 commits