1. 20 Jan, 2020 1 commit
    • Paul Eggert's avatar
      Work better if stat etc. are interrupted · b3ad638a
      Paul Eggert authored
      Quit or retry if fstat, lstat, stat or openat fail with EINTR.
      This should fix some bugs on platforms where accessing files via
      NFS can fail that way (Bug#9256).
      * src/dired.c (file_attributes):
      * src/fileio.c (file_directory_p) [O_PATH]:
      Use emacs_openat instead of openat.
      * src/dired.c (file_attributes): Use emacs_fstatat instead of fstatat.
      * src/fileio.c (barf_or_query_if_file_exists, Frename_file):
      * src/filelock.c (rename_lock_file):
      Use emacs_fstatat instead of lstat.
      * src/fileio.c (file_directory_p, Ffile_regular_p, Ffile_modes)
      (Ffile_newer_than_file_p, Fverify_visited_file_modtime)
      (Fset_visited_file_modtime, auto_save_1):
      * src/lread.c (Fload):
      * src/sysdep.c (get_current_dir_name_or_unreachable):
      Use emacs_fstatat instead of stat.
      * src/sysdep.c (emacs_fstatat, emacs_openat): New functions.
      (emacs_open): Redo in terms of emacs_open.
      b3ad638a
  2. 01 Jan, 2020 1 commit
  3. 04 Nov, 2019 1 commit
  4. 03 Nov, 2019 1 commit
    • Eli Zaretskii's avatar
      Fix case-insensitive completion of non-ASCII file names · 0b21ecdb
      Eli Zaretskii authored
      * src/dired.c (scmp): Comment on (non)applicability to
      comparisons of  non-ASCII strings case-insensitively.
      (file_name_completion): Decode early the file names read from
      the directory, and use the decoded names for comparison when
      letter-case should be ignored.  (Bug#11339)
      0b21ecdb
  5. 18 Sep, 2019 1 commit
    • 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)
      (Ffile_system_info):
      * 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.
      9dc306b1
  6. 17 Sep, 2019 1 commit
  7. 16 Sep, 2019 1 commit
    • 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.
      2335704f
  8. 12 Sep, 2019 2 commits
  9. 09 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Avoid some unnecessary stdio.h includes · cebea291
      Paul Eggert authored
      * src/atimer.c, src/callproc.c, src/coding.c, src/dired.c, src/eval.c:
      * src/fringe.c, src/ftcrfont.c, src/ftfont.c, src/ftxfont.c:
      * src/gfilenotify.c, src/indent.c, src/kqueue.c, src/menu.c:
      * src/scroll.c, src/terminal.c, src/unexcoff.c, src/window.c:
      * src/xfont.c, src/xftfont.c:
      Do not include stdio.h since it is unused.
      cebea291
  10. 29 Jun, 2019 1 commit
    • Ken Brown's avatar
      Simplify workaround for Cygwin O_PATH bug · 0b2841f9
      Ken Brown authored
      Suggested by Paul Eggert (Bug#36405#22).
      * configure.ac (HAVE_CYGWIN_O_PATH_BUG): New AC_DEFINE, for Cygwin
      versions 3.0.0 through 3.0.7.
      * src/dired.c (O_PATH) [__CYGWIN__]: Remove #undef.
      (file_attributes) [HAVE_CYGWIN_O_PATH_BUG]: Don't use O_PATH.
      0b2841f9
  11. 27 Jun, 2019 1 commit
  12. 22 Mar, 2019 1 commit
    • Stefan Monnier's avatar
      Fix misuses of NULL when talking about the NUL character · 76fea1eb
      Stefan Monnier authored
      * lisp/subr.el (inhibit-null-byte-detection): Make it an obsolete alias.
      
      * src/coding.c (setup_coding_system): Use new name.
      (detect_coding): Rename null_byte_found => nul_byte_found.
      (detect_coding_system): Use new name.
      Rename null_byte_found => nul_byte_found.
      (Fdefine_coding_system_internal): Use new name.
      (syms_of_coding): Rename inhibit-null-byte-detection to
      inhibit-nul-byte-detection.
      * src/w16select.c (get_clipboard_data): null_char => nul_char.
      * src/json.c (check_string_without_embedded_nuls): Rename from
      check_string_without_embedded_nulls.
      (Fjson_parse_string): Adjust accordingly.
      * src/coding.h (enum define_coding_undecided_arg_index)
      (enum coding_attr_index): ...null_byte... => ...nul_byte....
      * lisp/info.el (info-insert-file-contents, Info-insert-dir):
      * lisp/international/mule.el (define-coding-system):
      * lisp/vc/vc-git.el (vc-git--call):
      * doc/lispref/nonascii.texi (Lisp and Coding Systems): Use the new name.
      76fea1eb
  13. 01 Jan, 2019 1 commit
  14. 27 Dec, 2018 1 commit
  15. 22 Dec, 2018 1 commit
    • Michael Albinus's avatar
      Use "file name handler" consequently · 88b41c40
      Michael Albinus authored
      * doc/lispref/files.texi:
      * doc/lispref/processes.texi:
      * doc/misc/ediff.texi:
      * lisp/simple.el:
      * lisp/vc/ediff-ptch.el:
      * src/buffer.c:
      * src/dired.c:
      * src/fileio.c:
      * src/image.c:
      * src/insdel.c:
      * src/w32fns.c: Use "file name handler" consequently.
      88b41c40
  16. 24 Sep, 2018 1 commit
    • Paul Eggert's avatar
      file-attributes cleanup · 662bee7d
      Paul Eggert authored
      Mostly, this replaces magic-number calls like (nth 4 A) with
      more-informative calls like (file-attribute-access-time A).
      It also fixes some documentation and minor timestamp coding
      issues that I noticed while looking into this.
      * doc/lispref/files.texi (File Attributes):
      * lisp/files.el (file-attribute-size)
      (file-attribute-inode-number, file-attribute-device-number):
      * src/dired.c (Fdirectory_files_and_attributes)
      (Ffile_attributes):
      Mention which attributes must be integers, or nonnegative integers,
      as opposed to merely being numbers.  Remove no-longer-correct
      talk about representing large integers as conses of integers.
      * doc/lispref/files.texi (Magic File Names):
      * doc/misc/gnus.texi (Low-level interface to the spam-stat dictionary):
      * lisp/autorevert.el (auto-revert-find-file-function)
      (auto-revert-tail-mode, auto-revert-handler):
      * lisp/auth-source.el (auth-source-netrc-parse):
      * lisp/cedet/ede/files.el (ede--inode-for-dir):
      * lisp/cedet/semantic/db-file.el (object-write):
      * lisp/cedet/semantic/db-mode.el (semanticdb-kill-hook):
      * lisp/cedet/semantic/db.el (semanticdb-needs-refresh-p)
      (semanticdb-synchronize):
      * lisp/cedet/srecode/table.el (srecode-mode-table-new):
      * lisp/desktop.el (desktop-save, desktop-read):
      * lisp/dired-aux.el (dired-file-set-difference)
      (dired-do-chxxx, dired-do-chmod, dired-copy-file-recursive)
      (dired-create-files):
      * lisp/dired.el (dired-directory-changed-p, dired-readin):
      * lisp/dos-w32.el (w32-direct-print-region-helper):
      * lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads)
      (autoload-find-destination, update-directory-autoloads):
      * lisp/emacs-lisp/shadow.el (load-path-shadows-same-file-or-nonexistent):
      * lisp/epg.el (epg--start, epg-wait-for-completion):
      * lisp/eshell/em-ls.el (eshell-ls-filetype-p)
      (eshell-ls-applicable, eshell-ls-size-string)
      (eshell-ls-file, eshell-ls-dir, eshell-ls-files)
      (eshell-ls-entries):
      * lisp/eshell/em-pred.el (eshell-predicate-alist)
      (eshell-pred-file-type, eshell-pred-file-links)
      (eshell-pred-file-size):
      * lisp/eshell/em-unix.el (eshell-shuffle-files, eshell/cat)
      (eshell-du-sum-directory, eshell/du):
      * lisp/eshell/esh-util.el (eshell-read-passwd)
      (eshell-read-hosts):
      * lisp/files.el (remote-file-name-inhibit-cache)
      (find-file-noselect, insert-file-1, dir-locals-find-file)
      (dir-locals-read-from-dir, backup-buffer)
      (file-ownership-preserved-p, copy-directory)
      (read-file-modes):
      * lisp/find-lisp.el (find-lisp-format):
      * lisp/gnus/gnus-agent.el (gnus-agent-unfetch-articles)
      (gnus-agent-read-agentview, gnus-agent-expire-group-1)
      (gnus-agent-request-article, gnus-agent-regenerate-group)
      (gnus-agent-update-files-total-fetched-for)
      (gnus-agent-update-view-total-fetched-for):
      * lisp/gnus/gnus-cache.el (gnus-cache-read-active)
      (gnus-cache-update-file-total-fetched-for)
      (gnus-cache-update-overview-total-fetched-for):
      * lisp/gnus/gnus-cloud.el (gnus-cloud-file-new-p):
      * lisp/gnus/gnus-score.el (gnus-score-score-files):
      * lisp/gnus/gnus-start.el (gnus-save-newsrc-file)
      (gnus-master-read-slave-newsrc):
      * lisp/gnus/gnus-sum.el (gnus-summary-import-article):
      * lisp/gnus/gnus-util.el (gnus-file-newer-than)
      (gnus-cache-file-contents):
      * lisp/gnus/mail-source.el (mail-source-delete-old-incoming)
      (mail-source-callback, mail-source-movemail):
      * lisp/gnus/nneething.el (nneething-create-mapping)
      (nneething-make-head):
      * lisp/gnus/nnfolder.el (nnfolder-read-folder):
      * lisp/gnus/nnheader.el (nnheader-file-size)
      (nnheader-insert-nov-file):
      * lisp/gnus/nnmail.el (nnmail-activate):
      * lisp/gnus/nnmaildir.el (nnmaildir--group-maxnum)
      (nnmaildir--new-number, nnmaildir--update-nov)
      (nnmaildir--scan, nnmaildir-request-scan)
      (nnmaildir-request-update-info)
      (nnmaildir-request-expire-articles):
      * lisp/gnus/nnmh.el (nnmh-request-list-1)
      (nnmh-request-expire-articles, nnmh-update-gnus-unreads):
      * lisp/gnus/nnml.el (nnml-request-expire-articles):
      * lisp/gnus/spam-stat.el (spam-stat-save, spam-stat-load)
      (spam-stat-process-directory, spam-stat-test-directory):
      * lisp/ido.el (ido-directory-too-big-p)
      (ido-file-name-all-completions):
      * lisp/image-dired.el (image-dired-get-thumbnail-image)
      (image-dired-create-thumb-1):
      * lisp/info.el (info-insert-file-contents):
      * lisp/ls-lisp.el (ls-lisp-insert-directory)
      (ls-lisp-handle-switches, ls-lisp-classify-file)
      (ls-lisp-format):
      * lisp/mail/blessmail.el:
      * lisp/mail/feedmail.el (feedmail-default-date-generator)
      (feedmail-default-message-id-generator):
      * lisp/mail/mailabbrev.el (mail-abbrevs-sync-aliases)
      (mail-abbrevs-setup):
      * lisp/mail/mspools.el (mspools-size-folder):
      * lisp/mail/rmail.el (rmail-insert-inbox-text):
      * lisp/mail/sendmail.el (sendmail-sync-aliases):
      * lisp/mh-e/mh-alias.el (mh-alias-tstamp):
      * lisp/net/ange-ftp.el (ange-ftp-parse-netrc)
      (ange-ftp-write-region, ange-ftp-file-newer-than-file-p)
      (ange-ftp-cf1):
      * lisp/net/eudcb-mab.el (eudc-mab-query-internal):
      * lisp/net/eww.el (eww-read-bookmarks):
      * lisp/net/netrc.el (netrc-parse):
      * lisp/net/newst-backend.el (newsticker--image-get):
      * lisp/nxml/rng-loc.el (rng-get-parsed-schema-locating-file):
      * lisp/obsolete/fast-lock.el (fast-lock-save-cache):
      * lisp/obsolete/vc-arch.el (vc-arch-state)
      (vc-arch-diff3-rej-p):
      * lisp/org/ob-eval.el (org-babel--shell-command-on-region):
      * lisp/org/org-attach.el (org-attach-commit):
      * lisp/org/org-macro.el (org-macro-initialize-templates):
      * lisp/org/org.el (org-babel-load-file)
      (org-file-newer-than-p):
      * lisp/org/ox-html.el (org-html-format-spec):
      * lisp/org/ox-publish.el (org-publish-find-date)
      (org-publish-cache-ctime-of-src):
      * lisp/pcmpl-gnu.el (pcomplete/tar):
      * lisp/pcmpl-rpm.el (pcmpl-rpm-packages):
      * lisp/play/cookie1.el (cookie-snarf):
      * lisp/progmodes/cmacexp.el (c-macro-expansion):
      * lisp/ps-bdf.el (bdf-file-mod-time):
      * lisp/server.el (server-ensure-safe-dir):
      * lisp/simple.el (shell-command-on-region):
      * lisp/speedbar.el (speedbar-item-info-file-helper)
      (speedbar-check-obj-this-line):
      * lisp/thumbs.el (thumbs-cleanup-thumbsdir):
      * lisp/time.el (display-time-mail-check-directory)
      (display-time-file-nonempty-p):
      * lisp/url/url-cache.el (url-is-cached):
      * lisp/url/url-file.el (url-file-asynch-callback):
      * lisp/vc/diff-mode.el (diff-delete-if-empty):
      * lisp/vc/pcvs-info.el (cvs-fileinfo-from-entries):
      * lisp/vc/vc-bzr.el (vc-bzr-state-heuristic):
      * lisp/vc/vc-cvs.el (vc-cvs-checkout-model)
      (vc-cvs-state-heuristic, vc-cvs-merge-news)
      (vc-cvs-retrieve-tag, vc-cvs-parse-status, vc-cvs-parse-entry):
      * lisp/vc/vc-hg.el (vc-hg--slurp-hgignore-1)
      (vc-hg--ignore-patterns-valid-p)
      (vc-hg--cached-dirstate-search, vc-hg-state-fast):
      * lisp/vc/vc-hooks.el (vc-after-save):
      * lisp/vc/vc-rcs.el (vc-rcs-workfile-is-newer):
      * lisp/vc/vc-svn.el (vc-svn-merge-news, vc-svn-parse-status):
      * lisp/vc/vc.el (vc-checkout, vc-checkin, vc-revert-file):
      * lisp/xdg.el (xdg-mime-apps):
      Prefer (file-attribute-size A) to (nth 7 A), and similarly
      for other file attributes accessors.
      * doc/lispref/files.texi (File Attributes):
      * doc/lispref/intro.texi (Version Info):
      * doc/lispref/os.texi (Idle Timers):
      * lisp/erc/erc.el (erc-string-to-emacs-time):
      * lisp/files.el (file-attribute-access-time)
      (file-attribute-modification-time)
      (file-attribute-status-change-time):
      * lisp/net/tramp-compat.el:
      (tramp-compat-file-attribute-modification-time)
      (tramp-compat-file-attribute-size):
      * src/buffer.c (syms_of_buffer):
      * src/editfns.c (Fget_internal_run_time):
      * src/fileio.c (Fvisited_file_modtime)
      (Fset_visited_file_modtime):
      * src/keyboard.c (Fcurrent_idle_time):
      * src/process.c (Fprocess_attributes):
      Defer implementation details about timestamp format to the
      section that talks about timestamp format, to make it easier
      to change the documentation later if timestamp formats are
      extended.
      * lisp/gnus/gnus-util.el (gnus-file-newer-than):
      * lisp/speedbar.el (speedbar-check-obj-this-line):
      * lisp/vc/vc-rcs.el (vc-rcs-workfile-is-newer):
      Prefer time-less-p to doing it by hand.
      * lisp/ls-lisp.el (ls-lisp-format): Inode numbers are no longer conses.
      * lisp/vc/vc-bzr.el (vc-bzr-state-heuristic):
      Use eql, not eq, to compare integers that might be bignums.
      * lisp/org/ox-publish.el (org-publish-cache-ctime-of-src):
      Prefer float-time to doing time arithmetic by hand.
      662bee7d
  17. 08 Sep, 2018 1 commit
    • Eli Zaretskii's avatar
      Fix documentation for conversion to bignums · e4896856
      Eli Zaretskii authored
      * src/xselect.c (selection_data_to_lisp_data):
      * src/w32fns.c (Fw32_read_registry):
      * src/process.c (Fprocess_id):
      * src/font.c (Ffont_variation_glyphs, Finternal_char_font):
      * src/fns.c (Fsafe_length):
      * src/editfns.c (Fuser_uid, Fuser_real_uid, Fgroup_gid)
      (Fgroup_real_gid, Femacs_pid):
      * src/dired.c (Ffile_attributes):
      * src/charset.c (Fencode_char): Update commentary and doc
      strings for recent changes that produce bignums where
      previously cons cells of integers were produced.
      e4896856
  18. 28 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Improve bignum support for system types · d77d01d2
      Paul Eggert authored
      Use bignums when Emacs converts to and from system types like
      off_t for file sizes whose values can exceed fixnum range.
      Formerly, Emacs sometimes generted floats and sometimes ad-hoc
      conses of integers.  Emacs still accepts floats and conses for
      these system types, in case some stray Lisp code is generating
      them, though this usage is obsolescent.
      * doc/lispref/files.texi (File Attributes):
      * doc/lispref/hash.texi (Defining Hash):
      * doc/lispref/nonascii.texi (Character Sets):
      * doc/lispref/os.texi (User Identification):
      * doc/lispref/processes.texi (System Processes):
      * etc/NEWS:
      Document changes.
      * src/bignum.c (mpz_set_uintmax, make_biguint)
      (mpz_set_uintmax_slow, bignum_to_intmax, bignum_to_uintmax):
      New functions.
      (mpz_set_intmax_slow): Implement via mpz_limbs_write,
      to avoid the need for an extra pass through a negative number.
      * src/charset.c (Fencode_char):
      * src/composite.h (LGLYPH_SET_CODE):
      * src/dired.c (file_attributes):
      * src/dosfns.c, src/w32.c (list_system_processes)
      (system_process_attributes):
      * src/editfns.c (init_editfns, Fuser_uid, Fuser_real_uid)
      (Fgroup_gid, Fgroup_real_gid, Femacs_pid):
      * src/emacs-module.c (check_vec_index):
      * src/fns.c (Fsafe_length):
      * src/process.c (record_deleted_pid, Fprocess_id):
      * src/sysdep.c (list_system_processes, system_process_attributes):
      * src/xselect.c (x_own_selection, selection_data_to_lisp_data):
      * src/xterm.c (set_wm_state):
      * src/inotify.c (inotifyevent_to_event, add_watch)
      (inotify_callback):
      If an integer is out of fixnum range, use a bignum
      instead of converting it to a float or a cons of integers.
      * src/coding.c (Fdefine_coding_system_internal):
      * src/frame.c (frame_windows_min_size)
      (x_set_frame_parameters):
      * src/fringe.c (Fdefine_fringe_bitmap):
      * src/nsterm.m (mouseDown:):
      * src/syntax.c (find_defun_start):
      * src/w32fns.c (x_set_undecorated, w32_createwindow)
      (w32_wnd_proc, Fx_create_frame, Fx_show_tip)
      (w32_console_toggle_lock_key):
      * src/w32inevt.c (key_event):
      * src/w32proc.c (Fw32_get_locale_info):
      Do not mishandle floats by treating their addresses as their
      values.
      * src/data.c (store_symval_forwarding):
      * src/gnutls.c (Fgnutls_error_fatalp, Fgnutls_error_string):
      * src/keyboard.c (command_loop_1, make_lispy_event):
      * src/lread.c (read_filtered_event, read1)
      (substitute_object_recurse):
      * src/window.c (Fcoordinates_in_window_p, Fwindow_at)
      (window_resize_apply, Fset_window_vscroll):
      * src/xdisp.c (handle_single_display_spec, try_scrolling)
      (redisplay_window, calc_pixel_width_or_height)
      (calc_line_height_property, on_hot_spot_p):
      * src/xfaces.c (check_lface_attrs):
      * src/xselect.c (x_get_local_selection, cons_to_x_long)
      (lisp_data_to_selection_data, clean_local_selection_data)
      (x_check_property_data, x_fill_property_data):
      (x_send_client_event):
      Do not reject bignums.
      * src/data.c (INTBIG_TO_LISP, intbig_to_lisp)
      (uintbig_to_lisp):
      Remove.  All uses removed.
      * src/data.c (cons_to_unsigned, cons_to_signed):
      * src/dbusbind.c (xd_signature, xd_extract_signed)
      (xd_extract_unsigned):
      * src/dispnew.c (sit_for):
      * src/dosfns.c, src/w32.c (system_process_attributes):
      * src/editfns.c (Fuser_full_name):
      * src/fileio.c (file_offset):
      * src/fileio.c (write_region):
      * src/font.c (font_unparse_xlfd, font_open_for_lface, Fopen_font):
      * src/frame.c (x_set_screen_gamma):
      * src/frame.h (NUMVAL, FRAME_PIXEL_X_FROM_CANON_X)
      (FRAME_PIXEL_Y_FROM_CANON_Y):
      * src/image.c (parse_image_spec, x_edge_detection)
      (compute_image_size):
      * src/json.c (json_to_lisp):
      * src/lcms.c (PARSE_LAB_LIST_FIELD, Flcms_cie_de2000)
      (PARSE_XYZ_LIST_FIELD, PARSE_JCH_LIST_FIELD)
      (PARSE_JAB_LIST_FIELD, PARSE_VIEW_CONDITION_FLOAT)
      (Flcms_temp_to_white_point):
      * src/nsimage.m (ns_load_image, setSizeFromSpec):
      * src/process.c (Fsignal_process, handle_child_signal):
      * src/sysdep.c (system_process_attributes):
      * src/xdisp.c (calc_line_height_property):
      Handle bignums.
      * src/data.c (Fnumber_to_string): Use proper predicate name in
      signal if the argument is not a number.
      * src/lisp.h (make_uint): New function.
      (INT_TO_INTEGER): New macro.
      (FIXED_OR_FLOATP, CHECK_FIXNUM_OR_FLOAT)
      (CHECK_FIXNUM_OR_FLOAT_COERCE_MARKER, INTEGER_TO_CONS)
      (make_fixnum_or_float): Remove; no longer used.
      * src/nsfns.m, src/w32fns.c, src/xfns.c (Fx_create_frame):
      Reject floating-point min-width or min-height.
      * src/process.c (handle_child_signal): Do not worry
      about floating-point pids, as they are no longer generated.
      d77d01d2
  19. 08 Aug, 2018 1 commit
    • Tom Tromey's avatar
      More macro renamings for bignum · d1ec3a0a
      Tom Tromey authored
      * src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
      src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
      src/category.c, src/ccl.c, src/character.c, src/character.h,
      src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
      src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
      src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
      src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
      src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
      src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
      src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
      src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
      src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
      src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
      src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
      src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
      src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
      src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
      src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
      src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
      src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
      src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
      src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
      Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
      d1ec3a0a
  20. 20 Jul, 2018 1 commit
    • Paul Eggert's avatar
      Prefer NILP (x) to EQ (x, Qnil) · fb24ce37
      Paul Eggert authored
      This simplifies the code a bit, and also simplifies some
      potential future changes slightly (e.g., altering eq vs eql).
      * src/alloc.c (mark_object):
      * src/callint.c (fix_command):
      * src/chartab.c (Fchar_table_range, Fset_char_table_range):
      * src/dbusbind.c (XD_OBJECT_TO_DBUS_TYPE, xd_signature):
      * src/dired.c (Fsystem_users):
      * src/fileio.c (Fdo_auto_save):
      * src/fns.c (concat):
      * src/frame.c (get_frame_param, frame_inhibit_resize)
      (store_in_alist, store_frame_param, x_set_autoraise)
      (x_set_autolower, x_get_arg):
      * src/image.c (Fclear_image_cache):
      * src/intervals.c (intervals_equal):
      * src/intervals.h (DEFAULT_INTERVAL_P):
      * src/lread.c (substitute_object_recurse):
      * src/menu.c (digest_single_submenu)
      (find_and_call_menu_selection)
      (find_and_return_menu_selection):
      * src/nsfns.m (x_set_icon_name, Fx_create_frame):
      * src/nsmenu.m (ns_menu_show):
      * src/nsselect.m (ns_string_to_pasteboard_internal)
      (Fns_selection_exists_p, Fns_selection_owner_p):
      * src/process.c (Faccept_process_output)
      (wait_reading_process_output):
      * src/terminal.c (store_terminal_param):
      * src/textprop.c (verify_interval_modification):
      * src/xdisp.c (next_element_from_buffer):
      * src/xfaces.c (Finternal_set_lisp_face_attribute):
      * src/xfns.c (x_set_icon_type, Fx_synchronize):
      * src/xmenu.c (x_menu_show):
      * src/xselect.c (Fx_selection_owner_p)
      (Fx_selection_exists_p):
      * src/xwidget.c (xwidget_view_lookup):
      Prefer NILP (x) to EQ (x, Qnil).
      fb24ce37
  21. 13 Jul, 2018 1 commit
    • Tom Tromey's avatar
      Rename integerp->fixnum, etc, in preparation for bignums · 42fe787b
      Tom Tromey authored
      * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
      src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
      src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
      src/process.c, src/profiler.c, src/search.c, src/sound.c,
      src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
      src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
      src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
      src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
      src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
      src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
      src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
      INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
      make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
      NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
      42fe787b
  22. 16 Jun, 2018 1 commit
  23. 01 Jun, 2018 1 commit
  24. 31 May, 2018 1 commit
  25. 01 Jan, 2018 1 commit
  26. 01 Nov, 2017 1 commit
  27. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  28. 25 Aug, 2017 1 commit
    • Paul Eggert's avatar
      Fix file-attributes race on GNU hosts · 2b7e0092
      Paul Eggert authored
      * doc/lispref/files.texi (File Attributes):
      Document file-attributes atomicity.
      * etc/NEWS: Document the fix.
      * src/dired.c (file_attributes): New args DIRNAME and FILENAME,
      for diagnostics.  All callers changed.  On platforms like
      GNU/Linux that support O_PATH, fix a race condition in
      file-attributes and similar functions, so that these functions do
      not return nonsense if a directory entry is replaced while getting
      its attributes.  On non-GNU platforms, do a better (though not
      perfect) job of detecting the race, and return nil if detected.
      2b7e0092
  29. 31 Jul, 2017 1 commit
    • Paul Eggert's avatar
      Avoid most stat calls when completing file names · 3a8d0cc8
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add d-type.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * m4/d-type.m4: New file, copied from gnulib.
      * src/dired.c (DT_UNKNOWN, DT_DIR, DT_LINK)
      [!HAVE_STRUCT_DIRENT_D_TYPE]: New constants.
      (dirent_type): New function.
      (file_name_completion): Use it, to avoid unnecessary calls to
      stat-like functions on GNU/Linux and other platforms with d_type.
      (file_name_completion_stat): Just follow the link; there is no
      need to try first with AT_SYMLINK_NOFOLLOW since the directory
      entry was already checked to exist.
      3a8d0cc8
  30. 01 Feb, 2017 1 commit
    • Paul Eggert's avatar
      Remove immediate_quit. · 33be5003
      Paul Eggert authored
      The old code that sets and clears immediate_quit was
      ineffective except when Emacs is running in terminal mode, and
      has problematic race conditions anyway, so remove it.  This
      will introduce some hangs when Emacs runs in terminal mode,
      and these hangs should be fixed in followup patches.
      * src/keyboard.c (immediate_quit): Remove.  All uses removed.
      33be5003
  31. 26 Jan, 2017 1 commit
    • Paul Eggert's avatar
      Replace QUIT with maybe_quit · b3a3ed52
      Paul Eggert authored
      There’s no longer need to have QUIT stand for a slug of C statements.
      Use the more-obvious function-call syntax instead.
      Also, use true and false when setting immediate_quit.
      These changes should not affect the generated machine code.
      * src/lisp.h (QUIT): Remove.  All uses replaced by maybe_quit.
      b3a3ed52
  32. 01 Jan, 2017 1 commit
  33. 25 Dec, 2016 1 commit
    • Paul Eggert's avatar
      regex.h now includes sys/types.h · 615cec1d
      Paul Eggert authored
      * src/dired.c, src/emacs.c, src/search.c, src/syntax.c, src/thread.h:
      Do not include sys/types.h; no longer needed.
      * src/regex.h: Include <sys/types.h>, as that's what Gnulib and
      glibc regex.h does, and POSIX has blessed this since 2008.
      615cec1d
  34. 26 Oct, 2016 1 commit
    • Noam Postavsky's avatar
      Revert fixes to allocation of regex matching · fee4cef7
      Noam Postavsky authored
      The fix was not complete, and completing it was proving too complicated.
      
      - Revert "* src/regex.c (re_search_2): Make new code safe for
                -Wjump-misses-init."
        This reverts commit c2a17924.
      - Revert "Port to GCC 6.2.1 + --enable-gcc-warnings"
        This reverts commit f6134bbd.
      - Revert "Fix handling of allocation in regex matching"
        This reverts commit ad66b3fa.
      - Revert "Fix handling of buffer relocation in regex.c functions"
        This reverts commit ee04aedc.
      fee4cef7
  35. 22 Oct, 2016 1 commit
    • Noam Postavsky's avatar
      Fix handling of allocation in regex matching · ad66b3fa
      Noam Postavsky authored
      `re_match_2_internal' uses pointers to the lisp objects that it
      searches.  Since it may call malloc when growing the "fail stack", these
      pointers may be invalidated while searching, resulting in memory
      curruption (Bug #24358).
      
      To fix this, we check the pointer that the lisp object (as specified by
      re_match_object) points to before and after growing the stack, and
      update existing pointers accordingly.
      
      * src/regex.c (STR_BASE_PTR): New macro.
      (ENSURE_FAIL_STACK, re_search_2): Use it to convert pointers into
      offsets before possible malloc call, and back into pointers again
      afterwards.
      (POS_AS_IN_BUFFER): Add explanatory comment about punning trick.
      * src/search.c (search_buffer): Instead of storing search location as
      pointers, store them as pointers and recompute the corresponding address
      for each call to `re_search_2'.
      (string_match_1, fast_string_match_internal, fast_looking_at):
      * src/dired.c (directory_files_internal): Set `re_match_object' to Qnil
      after calling `re_search' or `re_match_2'.
      * src/regex.h (re_match_object): Mention new usage in commentary.
      ad66b3fa
  36. 27 May, 2016 1 commit
  37. 21 May, 2016 1 commit
    • Eli Zaretskii's avatar
      Fix compiler warnings in the MinGW build · cb5af792
      Eli Zaretskii authored
      * configure.ac [mingw32]: Don't add -Wpointer-sign, and add
      -Wno-pointer-sign, to keep the noise level down.
      
      * nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable
      -Wredundant-decls, as that produces a lot of noise due to
      redeclaration of time-related functions by gnulib.
      * nt/runemacs.c (set_user_model_id): Fix argument type of
      'SetCurrentProcessExplicitAppUserModelID'.
      
      * src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't
      declare 'dpyinfo', as it is unused.
      (xpm_load): Fix warnings about pointer signedness.
      * src/w32proc.c (IsValidLocale, init_winsock): Remove redundant
      prototypes.
      (sys_spawnve): Avoid warnings about discarding 'const' qualifier.
      (sys_select): Provide prototype.
      (g_b_init_compare_string_w): Move declaration to file scope.
      * src/w32heap.c (dumped_data_commit): Now static.
      (FREEABLE_P): Avoid warnings about pointer comparison with integer.
      (mmap_realloc): Cast to 'char *' for arithmetics on void pointers.
      * src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr)
      (evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear):
      Provide prototypes.
      * src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove
      redundant prototypes.
      (w32_get_internal_run_time, map_w32_filename): Provide prototype.
      (init_environment, sys_ctime): Avoid warnings about discarding
      'const' qualifier.
      Include utimens.h.
      (sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir)
      (sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock)
      (sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide
      prototypes.
      (sys_rename_replace): Use %d to avoid compiler warnings.
      (_wsa_errlist): Make the message text 'const char *', to avoid
      compilation warnings.
      (dynlib_reset_last_error): Move prototype to file scope.
      (w32_get_resource): First argument is now 'const char *'.
      * src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype.
      (otf_features): Second argument is no 'const char *'.
      * src/w32term.c (free_frame_menubar, x_wm_set_size_hint)
      (x_set_window_size): Remove redundant prototypes.
      (XChangeGC, XGetGCValues, w32_draw_underwave)
      (w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave)
      (x_calc_absolute_position, x_destroy_window): Now static.
      (menubar_selection_callback): Move prototype to file scope.
      * src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant
      declaration.
      (w32_to_x_charset): Fix warnings about discarding 'const' qualifier.
      (w32font_full_name): Fix warnings about implicit conversion of
      'float' to 'double'.
      * src/w32reg.c (w32_get_rdb_resource): Fix warnings about
      discarding 'const' qualifier.
      * src/w32menu.c (syms_of_w32menu, globals_of_w32menu)
      (set_frame_menubar): Remove redundant prototypes.
      (menubar_selection_callback, w32_menu_display_help): Provide
      prototypes.
      (simple_dialog_show): Avoid warnings about discarding 'const'
      qualifier.
      * src/w32fns.c (syms_of_w32fns, globals_of_w32fns)
      (free_frame_menubar, w32_strerror, x_set_menu_bar_lines)
      (x_set_tool_bar_lines, x_set_internal_border_width): Remove
      redundant prototypes.
      (current_popup_menu): Remove redundant declaration.
      (colormap_t): Member 'name' is now 'const char *'.
      (add_system_logical_colors_to_map): Fix signed/unsigned warnings.
      (x_decode_color, x_set_border_pixel)
      (x_clear_under_internal_border, x_set_name, hook_w32_key)
      (reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now
      static.
      (w32_load_cursor, w32_key_to_modifier, map_keypad_keys)
      (w32_msg_worker, w32_last_error): Provide prototypes.
      (funhook, lookup_vk_code): Avoid warnings about missing
      parentheses.
      (x_default_font_parameter, Fw32_notification_notify): Avoid
      warnings about discarding 'const' qualifier.
      (Fx_create_frame): Avoid warnings about empty body of 'else'.
      (x_screen_planes): Ifdef away unused function.
      (Fx_show_tip): Remove unused variables.
      (Fw32_battery_status): Avoid warnings about implicit promotion
      from float to double.
      (Fw32_notification_notify): Initialize 'timeout'.
      * src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only
      define the TIMER_SETTIME_RUNNING value if it will be used.
      * src/w32notify.c (send_notifications): Ifdef away an empty if
      clause.  Remove unused variable.
      (watch_end, watch_completion): Provide prototypes.
      * src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused.
      * src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix
      warning with pointer signedness.
      * src/gnutls.c (gnutls_x509_crt_get_signature)
      (gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and
      don't load them from the GnuTLS library, as they are no longer
      used.
      * src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't
      define, as it's unused.
      * src/unexw32.c (open_input_file, open_output_file)
      (close_file_data): Remove redundant prototypes.
      (_start): provide prototype.
      (mainCRTStartup): Move prototype to file level.
      (find_section): Use type-cast to shut up compiler warnings.
      (offset_to_section, relocate_offset): Now static.
      (find_section): First argument is now a 'const char *'.
      (offset_to_section): Ifdef away, as it's unused.
      * src/w32heap.h (find_section): Adjust prototype.
      * src/dynlib.c (dynlib_reset_last_error): Provide prototype.
      * src/dired.c (directory_files_internal_w32_unwind): Avoid
      warnings about missing prototypes.
      (is_slow_fs) [WINDOWSNT]: Provide prototype at file level.
      (directory_files_internal) [WINDOWSNT]: Fix warnings about pointer
      signedness.
      * src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]:
      Fix warnings about pointer signedness.
      * src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's
      unused.
      * src/sysdep.c (_getpid): Remove redundant prototype.
      (sys_subshell) [DOS_NT]: Don't define 'status', it's unused.
      [!MSDOS]: Don't define 'st', it's unused.
      (init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused.
      (str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness.
      * src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define
      n_to_read, as it is not used.
      (MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused.
      * src/w32font.h (syms_of_w32font): Remove redundant prototype.
      * src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro.
      * src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are
      not used by DOS_NT builds, to avoid compiler warnings.
      * src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant
      declaration.
      * src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut
      up compiler warnings.
      * src/w32term.h (x_set_window_size, x_get_focus_frame)
      (x_make_frame_visible, x_make_frame_invisible, x_iconify_frame)
      (x_set_frame_alpha, x_activate_menubar, x_bitmap_icon)
      (x_free_frame_resources, x_real_positions)
      (display_x_get_resource): Remove redundant prototypes.
      
      * lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp)
      (sys_rename, gettimeofday): Provide prototypes.
      * lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant
      declarations.
      * lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'.
      (xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname)
      (close_winsock, initialize_sockets, w32_set_user_model_id)
      (w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add
      prototypes.
      (w32_get_resource) [WINDOWSNT]: Fix a warning about signedness
      difference.
      (w32_set_user_model_id): Update prototype of
      SetCurrentProcessExplicitAppUserModelID to avoid compiler
      warnings.
      (start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to
      shut up compiler warnings.
      * lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
      cb5af792
  38. 20 Mar, 2016 1 commit
    • Paul Eggert's avatar
      No need to block input when reading directories · 9d5f2351
      Paul Eggert authored
      * src/dired.c: Don’t include blockinput.h.
      (open_directory, directory_files_internal_unwind)
      (directory_files_internal, file_attributes):
      Don’t block input here, as the reasons for blocking input should
      no longer apply.  See blockinput.h FIXME.  (Bug#22996).
      9d5f2351
  39. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6