1. 01 Jan, 2020 1 commit
  2. 04 Aug, 2019 1 commit
  3. 25 Jun, 2019 1 commit
    • Paul Eggert's avatar
      Avoid some strlen work, primarily via strnlen · d7c68362
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add strnlen.
      * lib-src/etags.c (find_entries):
      * src/emacs.c (main):
      * src/nsmenu.m (parseKeyEquiv:):
      * src/nsterm.m (ns_xlfd_to_fontname):
      * src/term.c (vfatal):
      Prefer !*X to !strlen (X).
      * lib-src/etags.c (pfnote, add_regex):
      * lib-src/pop.c (pop_open):
      * lib-src/update-game-score.c (main):
      * lwlib/lwlib.c (lw_separator_p):
      * src/doprnt.c (doprnt):
      * src/emacs.c (main):
      * src/inotify.c (inotifyevent_to_event):
      * src/keyboard.c (menu_separator_name_p, parse_tool_bar_item):
      * src/sysdep.c (get_current_dir_name_or_unreachable):
      * src/xdisp.c (store_mode_line_string):
      Use strnlen to avoid unnecessary work with strlen.
      * lib-src/etags.c (Prolog_functions, prolog_pr)
      (Erlang_functions, erlang_func):
      Prefer ptrdiff_t to size_t when either will do.
      (prolog_pr, erlang_func): New arg LASTLEN, to avoid
      unnecessary strlen call. All callers changed.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/strnlen.c, m4/strnlen.m4: New files, copied from Gnulib.
      * lwlib/lwlib.c (lw_separator_p):
      * src/json.c (json_has_prefix):
      Use strncmp to avoid unecessary work with strlen + memcmp.
      * src/process.c (set_socket_option): Use SBYTES instead of strlen.
      d7c68362
  4. 23 Apr, 2019 1 commit
    • Paul Eggert's avatar
      Remove some unnecessary #ifdef directives · 51595f53
      Paul Eggert authored
      These directives are in files that are compiled only if the
      symbols are defined.
      * src/gfilenotify.c: Remove unnecessary ‘#ifdef HAVE_GFILENOTIFY’.
      * src/inotify.c: Remove unnecessary ‘#ifdef HAVE_INOTIFY’.
      * src/kqueue.c: Remove unnecessary ‘#ifdef HAVE_KQUEUE’.
      51595f53
  5. 01 Jan, 2019 1 commit
  6. 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
  7. 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
  8. 16 Feb, 2018 1 commit
  9. 01 Jan, 2018 1 commit
  10. 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
  11. 27 May, 2017 3 commits
    • Paul Eggert's avatar
      Depromiscuify inotify with IN_MASK_ADD · d3873050
      Paul Eggert authored
      Use IN_MASK_ADD instead of using a no-longer-promiscuous-enough
      mask.  This simplifies the code and restores the ability to
      use IN_ACCESS, IN_CLOSE_WRITE, IN_CLOSE_NOWRITE, and IN_OPEN
      in some cases (Bug#26973).
      * src/inotify.c (INOTIFY_DEFAULT_MASK): Remove.
      (Finotify_add_watch): Use IN_MASK_ADD instead.
      d3873050
    • Paul Eggert's avatar
      Restore inotify onlydir support · ad656a72
      Paul Eggert authored
      There was no need to remove it in the 2017-03-26 inotify change,
      as it is like IN_DONT_FOLLOW and does not affect other watchers
      for the same file.
      * src/inotify.c (symbol_to_inotifymask, Finotify_add_watch)
      (syms_of_inotify): Bring back onlydir.
      ad656a72
    • Paul Eggert's avatar
      Simplify computation of inotify mask · 8f59ff24
      Paul Eggert authored
      * src/inotify.c (add_watch): Accept uint32_t imask instead
      of Lisp_Object aspect.  Caller changed.
      (Finotify_add_watch): Use aspect_to_inotifymask earlier, to
      simplify the code.
      8f59ff24
  12. 26 May, 2017 2 commits
  13. 31 Mar, 2017 1 commit
  14. 30 Mar, 2017 1 commit
    • Paul Eggert's avatar
      Some inotify cleanup · 6ff87021
      Paul Eggert authored
      This catches some problems with integer overflow and races
      that I noticed in inotify.c after reviewing the changes
      installed to fix Bug#26126.
      * src/fns.c, src/lisp.h (equal_no_quit): Now extern.
      * src/inotify.c (aspect_to_inotifymask):
      Check for cycles and for improper lists.
      (make_lispy_mask, lispy_mask_match_p): Remove.
      All callers changed to use INTEGER_TO_CONS and CONS_TO_INTEGER.
      (inotifyevent_to_event, add_watch):
      Don’t assume watch descriptors and cookies fit in fixnums.
      (add_watch): Use assoc_no_quit, not Fassoc.
      Avoid integer overflow in (very!) long-running processes where
      the Emacs watch ID could overflow.  Avoid some duplicate code.
      (find_descriptor): New function.
      (remove_descriptor): First arg is now the returned value from
      find_descriptor, rather than the descriptor.  This way, the
      value can be removed without calling Fdelete, which might quit.
      Wait until the end (when watch_list is consistent) before signaling
      any errors.
      (remove_watch, inotify_callback):
      Use find_descriptor to avoid the need for Fdelete.
      (inotify_callback): Use simpler tests for ioctl failure.
      Free temporary buffer if signaled, and put it on the stack if small.
      Use ssize_t to index through read results, to avoid a cast.
      (valid_watch_descriptor): New function, with a tighter check.
      (Finotify_rm_watch, Finotify_valid_p): Use it.
      (Finotify_valid_p): Use assoc_no_quit and ass_no_quit instead
      of Fassoc.  Do not assume the first assoc succeeds.
      * test/src/inotify-tests.el (inotify-valid-p-simple):
      Add inotify-valid-p tests, some of which dump core without
      the fixes noted above.
      6ff87021
  15. 28 Mar, 2017 1 commit
  16. 26 Mar, 2017 3 commits
    • Andreas Politz's avatar
      Minor fixes for inotify.c and filenotify.el · 082e2cb3
      Andreas Politz authored
      * lisp/filenotify.el (file-notify--watch-absolute-filename):
      Add docstring.
      (file-notify-callback): Simplify.
      
      * src/inotify.c (Finotify_add_watch): Adapt docstring.
      082e2cb3
    • Michael Albinus's avatar
      ; Format files from last commit · 74129db6
      Michael Albinus authored
      74129db6
    • Andreas Politz's avatar
      Fix issues regarding inotify file-notification · 158bb855
      Andreas Politz authored
      Remove special code handling the inotify back-end.
      * lisp/filenotify.el (file-notify--watch): New struct
      representing a file-watch.
      (file-notify-descriptors): Use the new struct as hash-value.
      (file-notify-handle-event): Check that event is a cons.
      (file-notify--rm-descriptor, file-notify--event-watched-file)
      (file-notify--event-file-name, file-notify--event-file1-name)
      (file-notify-callback, file-notify-add-watch)
      (file-notify-rm-watch, file-notify-valid-p): Use new struct.
      Remove special code handling inotify descriptors.  Remove code
      handling multiple clients per descriptor.
      (file-notify--descriptor): Remove unused function.
      
      Let inotify-add-watch return a unique descriptor on every
      call, like every other back-end does (Bug#26126).  Prevent
      multiple clients from interfering with each other, when
      watching a shared descriptor.
      * src/inotify.c (watch_list): Extend the format by including a
      id and the provided mask.
      (INOTIFY_DEFAULT_MASK): Default mask used for all clients.
      (make_watch_descriptor): Removed.
      (make_lispy_mask, lispy_mask_match_p): New functions.
      (inotifyevent_to_event): Match event against the mask provided
      by the client.
      (add_watch, remove_descriptor, remove_watch): New functions
      for managing the watch_list.
      (inotify_callback): Use the new functions.
      (Finotify_add_watch, Finotify_rm_watch): Remove deprecated
      flags from documentation.  Add check for validity of provided
      descriptor.  Use the new functions.  Use the default mask.
      (INOTIFY_DEBUG): Add new debug conditional.
      (inotify-watch-list, inotify-allocated-p): New debug functions.
      (symbol_to_inotifymask, syms_of_inotify): Remove deprecated symbols.
      
      * test/lisp/filenotify-tests.el:
      (file-notify-test02-rm-watch): Remove expected failure for inotify.
      158bb855
  17. 19 Feb, 2017 1 commit
  18. 01 Jan, 2017 1 commit
  19. 29 Dec, 2016 1 commit
    • Michael Albinus's avatar
      Improve filenotify-tests.el · b9cacf04
      Michael Albinus authored
      * src/inotify.c (Finotify_valid_p):
      * src/kqueue.c (Fkqueue_valid_p):
      * src/w32notify.c (Fw32notify_valid_p):
      * src/gfilenotify.c (Fgfile_valid_p): Fix typo in docstring.
      (Fgfile_monitor_name): New defun.
      (syms_of_gfilenotify): Declare Sgfile_monitor_name.
      
      * test/lisp/filenotify-tests.el	(file-notify--test-read-event):
      New defun, derived from `file-notify--test-read-event-timeout'.
      Replace all calls of `read-event' by this.
      (file-notify--test-timeout): Fix docstring.
      (file-notify--test-monitor): New defun.
      (file-notify--deftest-remote): Do not bind
      `file-notify--test-read-event-timeout' anymore.
      (file-notify-test00-availability): Print also monitor, if existent.
      (file-notify--test-with-events): Add an additional
      `file-notify--test-read-event' call, in order to get it work
      after `file-notify-add-watch'.  Remove special timeout for cygwin.
      (file-notify-test02-events): Make a better check for cygwin.
      (file-notify-test06-many-events): Improve event list for cygwin.
      (file-notify-test08-watched-file-in-watched-dir): Add cygwin case.
      b9cacf04
  20. 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
  21. 22 Jan, 2016 1 commit
    • Michael Albinus's avatar
      Backport kqueue integration from master · 7bf54d01
      Michael Albinus authored
      * configure.ac (--with-file-notification): Add kqueue.
      (top): Remove special test for "${HAVE_NS}" and
      ${with_file_notification}, this is handled inside gfilenotify
      tests.  Add kqueue tests.  Use NOTIFY_CFLAGS and NOTIFY_LIBS
      instead of library specific variables.  Add error message for
      gfile on Nextstep.
      
      * doc/lispref/os.texi (File Notifications): Add kqueue as backend.
      Fix some glitches in the example.
      
      * etc/NEWS: Mention kqueue.
      
      * lisp/filenotify.el (file-notify--library)
      (file-notify-descriptors, file-notify-callback)
      (file-notify-add-watch, file-notify-rm-watch)
      (file-notify-valid-p): Add kqueue support.
      (file-notify--rm-descriptor): Remove WHAT arg.
      
      * src/Makefile.in: Use NOTIFY_CFLAGS and NOTIFY_LIBS.
      
      * src/emacs.c (main): Call globals_of_kqueue and syms_of_kqueue.
      
      * src/inotify.c (inotifyevent_to_event): Extract file name from
      watch_object if the event doesn't provide it.
      (Finotify_add_watch): Add file name to watch_object.
      
      * src/keyboard.c (make_lispy_event): Check also for HAVE_KQUEUE.
      
      * src/kqueue.c: New file.
      
      * src/lisp.h: Declare extern globals_of_kqueue and syms_of_kqueue.
      
      * test/automated/file-notify-tests.el
      (file-notify--test-expected-events): Remove.
      (file-notify--test-cleanup): Do not set that variable.
      (file-notify--test-timeout) Use different timeouts for
      different libraries.
      (file-notify--test-library): New defun.
      (file-notify--test-event-test): Make stronger checks.
      (file-notify--test-with-events): EVENTS can also be a list of
      lists.  Flush outstanding events before running the body.
      Make timeout heuristically depend on the number of events.
      (file-notify-test01-add-watch, file-notify-test02-events)
      (file-notify-test04-file-validity, file-notify-test05-dir-validity):
      Rewrite in order to call file monitors but directory monitors.
      (file-notify-test02-events, file-notify-test04-file-validity): Do
      not skip cygwin tests.  Add additional test for file creation.
      Adapt expected result for different backends.
      (file-notify-test03-autorevert): Some of the tests don't work for
      w32notify.
      (file-notify-test06-many-events): New test.
      7bf54d01
  22. 01 Jan, 2016 1 commit
  23. 25 Nov, 2015 2 commits
    • Michael Albinus's avatar
      Some final fixes in file notification before merging with master · bec57a48
      Michael Albinus authored
      * lisp/filenotify.el (file-notify--rm-descriptor): Remove WHAT arg.
      (file-notify-callback): Improve check for `stopped' event.  Call
      `file-notify-rm-watch' rather than `file-notify--rm-descriptor'.
      (file-notify-add-watch): In case FILE is not a directory, call the
      file monitor for the kqueue backend.  Otherwise, call the
      directory monitor for the upper directory.
      
      * src/inotify.c (inotifyevent_to_event): Extract file name from
      watch_object if the event doesn't provide it.
      (Finotify_add_watch): Add file name to watch_object.
      
      * test/automated/file-notify-tests.el (file-notify--test-timeout):
      Use different timeouts for different libraries.
      (file-notify--test-with-events): Suppress lock files.  Flush
      outstanding events before running the body.
      (file-notify-test02-events, file-notify-test04-file-validity): Do
      not skip cygwin tests.  Add additional test for file creation.
      Adapt expected result for different backends.
      (file-notify-test03-autorevert): Some of the tests don't work for
      w32notify.
      (file-notify-test06-many-events): Rename into both directions.
      bec57a48
    • Michael Albinus's avatar
      Some final fixes in file notification before merging with master · 15e7544b
      Michael Albinus authored
      * lisp/filenotify.el (file-notify--rm-descriptor): Remove WHAT arg.
      (file-notify-callback): Improve check for `stopped' event.  Call
      `file-notify-rm-watch' rather than `file-notify--rm-descriptor'.
      (file-notify-add-watch): In case FILE is not a directory, call the
      file monitor for the kqueue backend.  Otherwise, call the
      directory monitor for the upper directory.
      
      * src/inotify.c (inotifyevent_to_event): Extract file name from
      watch_object if the event doesn't provide it.
      (Finotify_add_watch): Add file name to watch_object.
      
      * test/automated/file-notify-tests.el (file-notify--test-timeout):
      Use different timeouts for different libraries.
      (file-notify--test-with-events): Suppress lock files.  Flush
      outstanding events before running the body.
      (file-notify-test02-events, file-notify-test04-file-validity): Do
      not skip cygwin tests.  Add additional test for file creation.
      Adapt expected result for different backends.
      (file-notify-test03-autorevert): Some of the tests don't work for
      w32notify.
      (file-notify-test06-many-events): Rename into both directions.
      15e7544b
  24. 21 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Include-file cleanup for src directory · 63cfb75f
      Paul Eggert authored
      Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707).
      In a few cases, add ‘#include "foo.h"’ if the file needs foo.h
      but does not include it directly.  As a general rule, a source
      file should include foo.h if it needs the interfaces that foo.h
      defines.
      * src/alloc.c: Don’t include process.h.  Include dispextern.h,
      systime.h.
      * src/atimer.c: Don’t include blockinput.h.
      * src/buffer.c: Include coding.h, systime.h.  Don’t include
      keyboard.h, coding.h.
      * src/callint.c: Don’t include commands.h, keymap.h.
      * src/callproc.c: Don’t include character.h, ccl.h, composite.h,
      systty.h, termhooks.h.
      * src/casetab.c: Don’t include character.h.
      * src/category.c: Don’t include charset.h, keymap.h.
      * src/ccl.h: Don’t include character.h.
      * src/character.c: Don’t include charset.h.
      * src/charset.c: Don’t include disptab.h.
      * src/chartab.c: Don’t include ccl.h.
      * src/cm.c: Don’t include frame.h, termhooks.h.
      * src/cmds.c: Don’t include window.h, dispextern.h.
      * src/coding.c: Don’t include window.h, frame.h.
      * src/composite.c: Include composite.h.  Don’t include window.h,
      font.h.
      * src/data.c: Don’t include syssignal.h, termhooks.h, font.h.
      * src/dbusbind.c: Don’t include frame.h.
      * src/decompress.c: Don’t include character.h.
      * src/dired.c: Don’t include character.h, commands.h, charset.h.
      * src/dispnew.c: Don’t include character.h, indent.h, intervals.h,
      process.h, timespec.h.  Include systime.h.
      * src/doc.c: Include coding.h.  Don’t include keyboard.h.
      * src/editfns.c: Include composite.h.  Don’t include frame.h.
      * src/emacs.c: Include fcntl.h, coding.h.  Don’t include
      commands.h, systty.h..
      * src/fileio.c: Don’t include intervals.h, dispextern.h.
      Include composite.h.
      * src/filelock.c: Don’t include character.h, systime.h.
      * src/fns.c: Don’t include time.h, commands.h, keyboard.h,
      keymap.h, frame.h, blockinput.h, xterm.h.  Include composite.h.
      * src/font.c: Include termhooks.h.
      * src/font.h: Don’t include ccl.h, frame.h.  Add forward decls of
      struct composition_it, struct face, struct glyph_string.
      * src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h,
      intervals.h, window.h, termhooks.h.
      * src/frame.c: Don’t include character.h, commands.h, font.h.
      * src/frame.h: Don’t include dispextern.h.
      * src/fringe.c: Don’t include character.h.
      * src/ftcrfont.c: Don’t include dispextern.h, frame.h,
      character.h, charset.h, fontset.h.
      * src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h,
      fontset.h.
      * src/ftxfont.c: Don’t include dispextern.h, character.h,
      charset.h, fontset.h.
      * src/gfilenotify.c: Don’t include frame.h, process.h.
      * src/gtkutil.c: Include dispextern.h, frame.h, systime.h.
      Don’t include syssignal.h, buffer.h, charset.h, font.h.
      * src/gtkutil.h: Don’t include frame.h.
      * src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h.
      Don’t include character.h.
      * src/indent.c: Don’t include keyboard.h, termchar.h.
      * src/inotify.c: Don’t include character.h, frame.h.
      * src/insdel.c: Include composite.h.  Don’t include blockinput.h.
      * src/intervals.c: Don’t include character.h, keyboard.h.
      * src/intervals.h: Don’t include dispextern.h, composite.h.
      * src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h.
      Include coding.h.
      * src/keyboard.h: Don’t incldue systime.h.
      * src/keymap.c: Don’t include charset.h, frame.h.
      * src/lread.c: Include dispextern.h and systime.h.
      Don’t include frame.h.  Include systime.h.
      * src/macros.c: Don’t include commands.h, character.h, buffer.h.
      * src/menu.c: Include character.h, coding.h.  Don’t include
      dispextern.h.
      * src/menu.h: Don’t include systime.h.
      * src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h,
      intervals.h, termhooks.h.
      * src/print.c: Include coding.h.  Don’t include keyboard.h,
      window.h, dispextern.h, termchar.h, termhooks.h, font.h.
      Add forward decl of struct terminal.
      * src/process.c: Don’t include termhooks.h, commands.h,
      dispextern.h, composite.h.
      * src/region-cache.c: Don’t include character.h.
      * src/scroll.c: Don’t include keyboard.h, window.h.
      * src/search.c: Don’t include category.h, commands.h.
      * src/sound.c: Don’t include dispextern.h.
      * src/syntax.c: Don’t include command.h, keymap.h.
      * src/sysdep.c: Don’t include window.h, dispextern.h.
      * src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’,
      * src/term.c: Don’t include systty.h, intervals.h, xterm.h.
      * src/terminal.c: Include character.h.
      Don’t include charset.h, coding.h.
      * src/textprop.c: Don’t include character.h.
      * src/undo.c: Don’t include character.h, commands.h, window.h.
      * src/unexsol.c: Don’t include character.h, charset.h.
      * src/widget.c: Include widget.h.  Don’t include keyboard.h,
      window.h, dispextern.h, blockinput.h, character.h, font.h.
      * src/widgetprv.h: Don’t include widget.h.
      * src/window.c: Don’t include character.h, menu.h, intervals.h.
      * src/xdisp.c: Include composite.h, systime.h.  Don’t include
      macros.h, process.h.
      * src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h,
      intervals.h.
      * src/xfns.c: Don’t include menu.h, character.h, intervals.h,
      epaths.h, fontset.h, systime.h, atimer.h, termchar.h.
      * src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h.
      * src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h.
      * src/xgselect.c: Don’t include timespec.h, frame.h.
      Include systime.h.
      * src/xgselect.h: Don’t include time.h.
      Use a forward decl to struct timespec instead.
      * src/xmenu.c: Don’t include keymap.h, character.h, charset.h,
      dispextern.h.  Include systime.h.
      * src/xml.c: Don’t include character.h.
      * src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h.
      * src/xselect.c: Don’t include dispextern.h, character.h,
      buffer.h, process.h.
      * src/xsmfns.c: Don’t include systime.h, sysselect.h.
      * src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h,
      intervals.h process.h, keymap.h, xgselect.h.  Include composite.h.
      63cfb75f
  25. 16 Sep, 2015 1 commit
    • Michael Albinus's avatar
      Use common report_file_notify_error function · c762d330
      Michael Albinus authored
      * src/fileio.c (report_file_notify_error): New function.
      
      * src/inotify.c (report_inotify_error): Remove function.
      (inotify_callback, symbol_to_inotifymask, Finotify_add_watch)
      (Finotify_rm_watch): Use report_file_notify_error.
      
      * src/lisp.h (report_file_notify_error): Declare external function.
      
      * src/w32notify.c (report_w32notify_error): Remove function.
      (Fw32notify_add_watch, Fw32notify_rm_watch):
      Use report_file_notify_error.
      c762d330
  26. 15 Sep, 2015 2 commits
  27. 14 Sep, 2015 1 commit
    • Michael Albinus's avatar
      Adaot file-notify-tests.el test cases · 67ddc7c5
      Michael Albinus authored
      * lisp/filenotify.el (file-notify-rm-watch): Ignore `file-notify-error'.
      
      * src/inotify.c (Finotify_valid_p): Adapt docstring.
      
      * test/automated/file-notify-tests.el ()
      (file-notify-test03-autorevert)
      (file-notify-test04-file-validity)
      (file-notify-test04-file-validity-remote)
      (file-notify-test05-dir-validity)
      (file-notify-test05-dir-validity-remote): Adapt docstring.
      (file-notify-test04-file-validity): Let events arrive before
      calling final `file-notify-valid-p'.  Do not ignore errors.
      (file-notify-test05-dir-validity): Do not manipulate
      `temporary-file-directory', it isn't necessary.  Let events arrive
      before calling final `file-notify-valid-p'.  Do not ignore errors.
      67ddc7c5
  28. 13 Sep, 2015 1 commit
    • Michael Albinus's avatar
      Introduce `file-notify-valid-p' · f6f92e87
      Michael Albinus authored
      * lisp/filenotify.el (file-notify-valid-p): New defun.
      (gfile-valid-p, w32notify-valid-p): Make them an alias to `identity'.
      
      * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist)
      * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist)
      * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist)
      * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist)
      <file-notify-valid-p>: Add handler.
      
      * lisp/net/tramp.el (tramp-file-name-for-operation):
      Add `file-notify-valid-p'.
      (tramp-handle-file-notify-valid-p): New defun.
      
      * src/inotify.c (Finotify_valid_p): New defun.
      (syms_of_inotify): Declare Sinotify_valid_p.
      f6f92e87
  29. 05 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Compute C decls for DEFSYMs automatically · 58f2d6ef
      Paul Eggert authored
      Fixes Bug#15880.
      This patch also makes Q constants (e.g., Qnil) constant addresses
      from the C point of view.
      * make-docfile.c: Revamp to generate table of symbols, too.
      Include <stdbool.h>.
      (xstrdup): New function.
      (main): Don't process the same file twice.
      (SYMBOL): New constant in enum global_type.
      (struct symbol): Turn 'value' member into a union, either v.value
      for int or v.svalue for string.  All uses changed.
      (add_global): New arg svalue, which overrides value, so that globals
      can have a string value.
      (close_emacs_global): New arg num_symbols; all uses changed.
      Output lispsym decl.
      (write_globals): Output symbol globals too.  Output more
      ATTRIBUTE_CONST, now that Qnil etc. are C constants.
      Output defsym_name table.
      (scan_c_file): Move most of guts into ...
      (scan_c_stream): ... new function.  Scan for DEFSYMs and
      record symbols found.  Don't read past EOF if file doesn't
      end in newline.
      * alloc.c, bidi.c, buffer.c, bytecode.c, callint.c, casefiddle:
      * casetab.c, category.c, ccl.c, charset.c, chartab.c, cmds.c, coding.c:
      * composite.c, data.c, dbusbind.c, decompress.c, dired.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, fns.c, font.c, fontset.c:
      * frame.c, fringe.c, ftfont.c, ftxfont.c, gfilenotify.c, gnutls.c:
      * image.c, inotify.c, insdel.c, keyboard.c, keymap.c, lread.c:
      * macfont.m, macros.c, minibuf.c, nsfns.m, nsfont.m, nsimage.m:
      * nsmenu.m, nsselect.m, nsterm.m, print.c, process.c, profiler.c:
      * search.c, sound.c, syntax.c, term.c, terminal.c, textprop.c, undo.c:
      * window.c, xdisp.c, xfaces.c, xfns.c, xftfont.c, xmenu.c, xml.c:
      * xselect.c, xsettings.c, xterm.c:
      Remove Q vars that represent symbols (e.g., Qnil, Qt, Qemacs).
      These names are now defined automatically by make-docfile.
      * alloc.c (init_symbol): New function.
      (Fmake_symbol): Use it.
      (c_symbol_p): New function.
      (valid_lisp_object_p, purecopy): Use it.
      * alloc.c (marked_pinned_symbols):
      Use make_lisp_symbol instead of make_lisp_ptr.
      (garbage_collect_1): Mark lispsym symbols.
      (CHECK_ALLOCATED_AND_LIVE_SYMBOL): New macro.
      (mark_object): Use it.
      (sweep_symbols): Sweep lispsym symbols.
      (symbol_uses_obj): New function.
      (which_symbols): Use it.  Work for lispsym symbols, too.
      (init_alloc_once): Initialize Vpurify_flag here; no need to wait,
      since Qt's address is already known now.
      (syms_of_alloc): Add lispsym count to symbols_consed.
      * buffer.c (init_buffer_once): Compare to Qnil, not to make_number (0),
      when testing whether storage is all bits zero.
      * dispextern (struct image_type):
      * font.c (font_property_table):
      * frame.c (struct frame_parm_table, frame_parms):
      * keyboard.c (scroll_bar_parts, struct event_head):
      * xdisp.c (struct props):
      Use XSYMBOL_INIT (Qfoo) and struct Lisp_Symbol * rather than &Qfoo and
      Lisp_Object *, since Qfoo is no longer an object whose address can be
      taken.  All uses changed.
      * eval.c (run_hook): New function.  Most uses of Frun_hooks changed to
      use it, so that they no longer need to take the address of a Lisp sym.
      (syms_of_eval): Don't use DEFSYM on Vrun_hooks, as it's a variable.
      * frame.c (syms_of_frame): Add defsyms for the frame_parms table.
      * keyboard.c (syms_of_keyboard): Don't DEFSYM Qmenu_bar here.
      DEFSYM Qdeactivate_mark before the corresponding var.
      * keymap.c (syms_of_keymap): Use DEFSYM for Qmenu_bar and Qmode_line
      instead of interning their symbols; this avoids duplicates.
      (LISP_INITIALLY, TAG_PTR)
      (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END, XSYMBOL_INIT):
      New macros.
      (LISP_INITIALLY_ZERO): Use it.
      (enum symbol_interned, enum symbol_redirect, struct Lisp_Symbol)
      (EXFUN, DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_*):
      Move decls up, to avoid forward uses.  Include globals.h earlier, too.
      (make_lisp_symbol): New function.
      (XSETSYMBOL): Use it.
      (DEFSYM): Now just a placeholder for make-docfile.
      * lread.c (DEFINE_SYMBOLS): Define, for globals.h.
      (intern_sym): New function, with body taken from old intern_driver.
      (intern_driver): Use it.  Last arg is now Lisp integer, not ptrdiff_t.
      All uses changed.
      (define_symbol): New function.
      (init_obarray): Define the C symbols taken from lispsym.
      Use plain DEFSYM for Qt and Qnil.
      * syntax.c (init_syntax_once): No need to worry about
      Qchar_table_extra_slots.
      58f2d6ef
  30. 01 Jan, 2015 2 commits
  31. 01 Jan, 2014 1 commit
  32. 12 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Fix races with threads and file descriptors. · bacba3c2
      Paul Eggert authored
      * configure.ac (PTY_TTY_NAME_SPRINTF): Use emacs_close, not close.
      * src/callproc.c (Fcall_process_region):
      * src/dired.c (open_directory):
      * src/emacs.c (main, Fdaemon_initialized):
      * src/image.c (x_find_image_file):
      * src/inotify.c (Finotify_rm_watch):
      * src/lread.c (Flocate_file_internal):
      * src/process.c (Fnetwork_interface_list, Fnetwork_interface_info):
      * src/term.c (term_mouse_moveto, init_tty):
      * src/termcap.c (tgetent):
      * src/unexaix.c, src/unexcoff.c (report_error, report_error_1, adjust_lnnoptrs)
      * src/unexaix.c, src/unexcoff.c, src/unexcw.c, src/unexelf.c (unexec):
      * src/unexhp9k800.c, src/unexmacosx.c (unexec):
      * src/callproc.c (Fcall_process_region):
      Use emacs_close, not close.
      * src/sysdep.c (POSIX_CLOSE_RESTART, posix_close) [!POSIX_CLOSE_RESTART]:
      New macro and function, which emulates the POSIX_CLOSE_RESTART macro
      and posix_close function on current platforms (which all lack them).
      (emacs_close): Use it.  This should fix the races on GNU/Linux and
      on AIX and on future platforms that support POSIX_CLOSE_RESTART,
      and it should avoid closing random victim file descriptors on
      other platforms.
      bacba3c2