1. 19 Feb, 2017 3 commits
    • Paul Eggert's avatar
      Fix glitches in recent hash table changes · c8d14cfc
      Paul Eggert authored
      * src/fns.c (Fmake_hash_table): Simplify the machine code slightly
      by using 0 rather than -1.
      * src/lisp.h (struct Lisp_Hash_Table.pure): Now bool rather
      than a bitfield, for speed (the bitfield did not save space).
      (struct Lisp_Hash_Table.rehash_threshold): Now double rather than
      float, since the float caused unwanted rounding errors, e.g.,
      (hash-table-rehash-threshold (make-hash-table)) yielded
      0.800000011920929 instead of the correct 0.8.
      c8d14cfc
    • Eli Zaretskii's avatar
      Avoid aborts during loadup · b36f8a4d
      Eli Zaretskii authored
      * src/emacs-module.c (syms_of_module):
      * src/image.c (xpm_make_color_table_h): Update calls to
      make_hash_table to adjust to a recent change in fns.c.
      * src/fns.c (make_hash_table):
      * src/lisp.h (make_hash_table): 4th arg is now of type double.
      b36f8a4d
    • Stefan Monnier's avatar
      Change type of `rehash_threshold' and `pure' fields in hash-tables · fe927ecf
      Stefan Monnier authored
      * src/lisp.h (struct Lisp_Hash_Table): Change type of
      `rehash_threshold' and `pure' fields and move them after `count'.
      * src/fns.c (make_hash_table): Change type of `rehash_threshold' and `pure'.
      (Fmake_hash_table, Fhash_table_rehash_threshold):
      * src/category.c (hash_get_category_set):
      * src/xterm.c (syms_of_xterm):
      * src/profiler.c (make_log):
      * src/print.c (print_object):
      * src/alloc.c (purecopy_hash_table, purecopy): Adjust accordingly.
      fe927ecf
  2. 16 Feb, 2017 1 commit
  3. 07 Feb, 2017 1 commit
  4. 05 Feb, 2017 4 commits
    • Paul Eggert's avatar
      Port to clang 3.8.0 · d45dbccc
      Paul Eggert authored
      It does not allow a for-loop's control var to be an anonymous struct.
      * src/lisp.h (struct for_each_tail_internal): New type.
      (FOR_EACH_TAIL_INTERNAL): Use it.
      d45dbccc
    • Paul Eggert's avatar
      FOR_EACH_TAIL now checks for quit · b491322e
      Paul Eggert authored
      As per Eli Zaretskii (Bug#25606#20).  Although these calls to
      maybe_quit are unnecessary in practice, Eli was not convinced
      that the calls are unnecessary.
      * src/lisp.h (FOR_EACH_TAIL, FOR_EACH_TAIL_CONS):
      Call maybe_quit every so often.
      (FOR_EACH_TAIL_INTERNAL): New arg CHECK_QUIT.  All callers changed.
      b491322e
    • Paul Eggert's avatar
      Signal list cycles in ‘length’ etc. · 14dd9101
      Paul Eggert authored
      Use macros like FOR_EACH_TAIL instead of maybe_quit to
      catch list cycles automatically instead of relying on the
      user becoming impatient and typing C-g (Bug#25606).
      * src/fns.c (Flength, Fmember, Fmemq, Fmemql, Fassq, Fassoc, Frassq)
      (Frassoc, Fdelete, Freverse):
      Use FOR_EACH_TAIL instead of maybe_quit.
      (Fnreverse): Use simple EQ to check for circular list instead
      of rarely_quit, as this suffices in this unusual case.
      (Fplist_put, Flax_plist_put, Flax_plist_put):
      Use FOR_EACH_TAIL_CONS instead of maybe_quit.
      (internal_equal): Use FOR_EACH_TAIL_CONS to check lists, instead
      of by-hand tail recursion that did not catch cycles.
      * src/fns.c (Fsafe_length, Fplist_get):
      * src/xdisp.c (display_mode_element):
      Use FOR_EACH_TAIL_SAFE instead of by-hand Floyd’s algorithm.
      * src/lisp.h (QUIT_COUNT_HEURISTIC): Remove; no longer needed.
      (rarely_quit): Simply count toward USHRT_MAX + 1, since the
      fancier versions are no longer needed.
      (FOR_EACH_TAIL_CONS, FOR_EACH_TAIL_SAFE)
      (FOR_EACH_TAIL_INTERNAL): New macros, the last with definiens
      mostly taken from FOR_EACH_TAIL.
      (FOR_EACH_TAIL): Rewrite in terms of FOR_EACH_TAIL_INTERNAL.
      14dd9101
    • Paul Eggert's avatar
      Simplify use of FOR_EACH_TAIL · b7fa6b1f
      Paul Eggert authored
      * src/data.c (circular_list): New function.
      * src/lisp.h (FOR_EACH_TAIL): Use Brent’s algorithm and C99 for-loop
      decl, to eliminate the need for the args TAIL, TORTOISE and N, and
      to speed things up a bit on typical hosts with optimization.
      All uses changed (Bug#25605).
      b7fa6b1f
  5. 02 Feb, 2017 1 commit
    • Paul Eggert's avatar
      Fix lisp.h underparenthesization · eee53726
      Paul Eggert authored
      * src/lisp.h (STACK_CONS, AUTO_STRING_WITH_LEN):
      Parenthesize compound literals that are function call args.
      Although this does not fix any bugs, it is the proper style for
      macro parenthesization as it means this code will continue to
      work even if make_lisp_ptr is changed to a macro.
      eee53726
  6. 01 Feb, 2017 3 commits
    • Paul Eggert's avatar
      Fix quitting bug when buffers are frozen · b4c9f912
      Paul Eggert authored
      Problem noted by Eli Zaretskii in:
      http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00721.html
      This patch also fixes some other issues in that report.
      * src/lisp.h (incr_rarely_quit): Remove.
      All callers changed to use rarely_quit directly.
      * src/search.c (freeze_buffer_relocation)
      (thaw_buffer_relocation): New functions.
      (looking_at_1, fast_looking_at, search_buffer):
      Use them to fix bug when quitting when buffers are frozen.
      * src/sysdep.c (emacs_intr_read): Rename from emacs_nointr_read.
      All uses changed.
      b4c9f912
    • Paul Eggert's avatar
      Revamp quitting and fix infloops · b01ac672
      Paul Eggert authored
      This fixes some infinite loops that cannot be quitted out of,
      e.g., (defun foo () (nth most-positive-fixnum '#1=(1 . #1#)))
      when byte-compiled and when run under X.  See:
      http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00577.html
      This also attempts to keep the performance improvements I recently
      added, as much as possible under the constraint that the infloops
      must be caught.  In some cases this fixes infloop bugs recently
      introduced when I removed immediate_quit.
      * src/alloc.c (Fmake_list):
      Use rarely_quit, not maybe_quit, for speed in the usual case.
      * src/bytecode.c (exec_byte_code):
      * src/editfns.c (Fcompare_buffer_substrings):
      * src/fns.c (Fnthcdr):
      * src/syntax.c (scan_words, skip_chars, skip_syntaxes)
      (Fbackward_prefix_chars):
      Use rarely_quit so that users can C-g out of long loops.
      * src/callproc.c (call_process_cleanup, call_process):
      * src/fileio.c (read_non_regular, Finsert_file_contents):
      * src/indent.c (compute_motion):
      * src/syntax.c (scan_words, Fforward_comment):
      Remove now-unnecessary maybe_quit calls.
      * src/callproc.c (call_process):
      * src/doc.c (get_doc_string, Fsnarf_documentation):
      * src/fileio.c (Fcopy_file, read_non_regular, Finsert_file_contents):
      * src/lread.c (safe_to_load_version):
      * src/sysdep.c (system_process_attributes) [GNU_LINUX]:
      Use emacs_read_quit instead of emacs_read in places where
      C-g handling is safe.
      * src/eval.c (maybe_quit): Move comment here from lisp.h.
      * src/fileio.c (Fcopy_file, e_write):
      Use emacs_write_quit instead of emacs_write_sig in places where
      C-g handling is safe.
      * src/filelock.c (create_lock_file): Use emacs_write, not
      plain write, as emacs_write no longer has a problem.
      (read_lock_data): Use emacs_read, not read, as emacs_read
      no longer has a problem.
      * src/fns.c (rarely_quit): Move to lisp.h and rename to
      incr_rarely_quit.  All uses changed..
      * src/fns.c (Fmemq, Fmemql, Fassq, Frassq, Fplist_put, Fplist_member):
      * src/indent.c (compute_motion):
      * src/syntax.c (find_defun_start, back_comment, forw_comment)
      (Fforward_comment, scan_lists, scan_sexps_forward):
      Use incr_rarely_quit so that users can C-g out of long loops.
      * src/fns.c (Fnconc): Move incr_rarely_quit call to within
      inner loop, so that it catches C-g there too.
      * src/keyboard.c (tty_read_avail_input): Remove commented-out
      and now-obsolete code dealing with interrupts.
      * src/lisp.h (rarely_quit, incr_rarely_quit): New functions,
      the latter moved here from fns.c and renamed from rarely_quit.
      (emacs_read_quit, emacs_write_quit): New decls.
      * src/search.c (find_newline, search_buffer, find_newline1):
      Add maybe_quit to catch C-g.
      * src/sysdep.c (get_child_status): Always invoke maybe_quit
      if interruptible, so that the caller need not bother.
      (emacs_nointr_read, emacs_read_quit, emacs_write_quit):
      New functions.
      (emacs_read): Rewrite in terms of emacs_nointr_read.
      Do not handle C-g or signals; that is now for emacs_read_quit.
      (emacs_full_write): Replace PROCESS_SIGNALS two-way arg
      with INTERRUPTIBLE three-way arg.  All uses changed.
      b01ac672
    • 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
  7. 31 Jan, 2017 1 commit
  8. 30 Jan, 2017 1 commit
    • Vibhav Pant's avatar
      Fix hash tables not being purified correctly. · 9c4dfdd1
      Vibhav Pant authored
      * src/alloc.c
      (purecopy_hash_table) New function, makes a copy of the given hash
      table in pure storage.
      Add new struct `pinned_object' and `pinned_objects' linked list for
      pinning objects.
      (Fpurecopy) Allow purifying hash tables
      (purecopy) Pin hash tables that are either weak or not declared with
      `:purecopy t`, use purecopy_hash_table otherwise.
      (marked_pinned_objects) New function, marks all objects in pinned_objects.
      (garbage_collect_1) Use it. Mark all pinned objects before sweeping.
      * src/lisp.h Add new field `pure' to struct `Lisp_Hash_Table'.
      * src/fns.c: Add `purecopy' parameter to hash tables.
      (Fmake_hash_table): Check for a `:purecopy PURECOPY' argument, pass it
      to make_hash_table.
      (make_hash_table): Add `pure' parameter, set h->pure to it.
      (Fclrhash, Fremhash, Fputhash): Enforce that the table is impure with
      CHECK_IMPURE.
      * src/lread.c: (read1) Parse for `purecopy' parameter while reading
        hash tables.
      * src/print.c: (print_object) add the `purecopy' parameter while
        printing hash tables.
      * src/category.c, src/emacs-module.c, src/image.c, src/profiler.c,
        src/xterm.c: Use new (make_hash_table).
      9c4dfdd1
  9. 26 Jan, 2017 2 commits
    • 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
    • Paul Eggert's avatar
      A quicker check for quit · 1392ec74
      Paul Eggert authored
      On some microbenchmarks this lets Emacs run 60% faster on my
      platform (AMD Phenom II X4 910e, Fedora 25 x86-64).
      * src/atimer.c: Include keyboard.h, for pending_signals.
      * src/editfns.c (Fcompare_buffer_substrings):
      * src/fns.c (Fnthcdr, Fmemq, Fmemql, Fassq, Frassq, Fplist_put)
      (Fnconc, Fplist_member):
      Set and clear immediate_quit before and after loop instead of
      executing QUIT each time through the loop.  This is OK for loops
      that affect only locals.
      * src/eval.c (process_quit_flag): Now static.
      (maybe_quit): New function, containing QUIT’s old body.
      * src/fns.c (rarely_quit): New function.
      (Fmember, Fassoc, Frassoc, Fdelete, Fnreverse, Freverse)
      (Flax_plist_get, Flax_plist_put, internal_equal, Fnconc):
      Use it instead of QUIT, for
      speed in tight loops that might modify non-locals.
      * src/keyboard.h (pending_signals, process_pending_signals):
      These belong to keyboard.c, so move them here ...
      * src/lisp.h: ... from here.
      (QUIT): Redefine in terms of the new maybe_quit function, which
      contains this macro’s old definiens.  This works well with branch
      prediction on processors with return stack buffers, e.g., x86
      other than the original Pentium.
      1392ec74
  10. 22 Jan, 2017 1 commit
    • Paul Eggert's avatar
      Improve uses of CHECK_LIST etc. · 0a49f158
      Paul Eggert authored
      * src/eval.c (FletX): Report an error for invalid constructs like
      ‘(let* (a . 0))’, so that ‘let*’ is more consistent with ‘let’.
      (lambda_arity): Use plain CHECK_CONS.
      * src/fns.c (CHECK_LIST_END): Move from here to lisp.h.
      (Fcopy_alist): Remove unnecessary CHECK_LIST call, since
      concat does that for us.
      (Fnthcdr, Fmember, Fmemql, Fdelete, Fnreverse):
      Use CHECK_LIST_END, not CHECK_LIST_CONS.  This hoists a
      runtime check out of the loop.
      (Fmemq): Simplify and use CHECK_LIST_END instead of CHECK_LIST.
      (Fassq, Fassoc, Frassq, Frassoc):
      Simplify and use CHECK_LIST_END instead of CAR.
      (assq_no_quit, assoc_no_quit): Simplify and assume proper list.
      (Fnconc): Use plain CHECK_CONS, and do-while instead of while loop.
      * src/fontset.c (Fnew_fontset):
      * src/frame.c (Fmodify_frame_parameters):
      Use CHECK_LIST_END at end, rather than CHECK_LIST at start, for a
      more-complete check.
      * src/gfilenotify.c (Fgfile_add_watch):
      Omit unnecessary CHECK_LIST, since Fmember does that for us.
      * src/lisp.h (lisp_h_CHECK_LIST_CONS, CHECK_LIST_CONS):
      Remove; no longer used.
      (CHECK_LIST_END): New inline function.
      0a49f158
  11. 01 Jan, 2017 1 commit
  12. 30 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Rename main_thread to main_thread_id and simplify · 966d5159
      Paul Eggert authored
      * src/emacs-module.c: Include syssignal.h, for main_thread_id.
      [HAVE_PTHREAD]: Do not include pthread.h.
      (main_thread): Remove.  All uses replaced by main_thread_id,
      or by dwMainThreadId on NT.  Since the HAVE_PTHREAD code is now using
      the main_thread_id established by sysdep.c, there is no need for a
      separate copy of the main thread ID here.
      (module_init): Remove.  All uses removed.
      * src/sysdep.c (main_thread_id) [HAVE_PTHREAD]:
      Rename from main_thread.  All uses changed.  Now extern.
      966d5159
  13. 27 Dec, 2016 1 commit
  14. 25 Dec, 2016 2 commits
    • Paul Eggert's avatar
      Fix typo in lisp.h reordering patch · e135b8c7
      Paul Eggert authored
      * src/lisp.h (XUNTAG) [!USE_LSB_TAG]: Remove duplicate defn.
      Reported by Eli Zaretskii (Bug#25128#19).
      e135b8c7
    • Paul Eggert's avatar
      Reorder lisp.h to declare types before using them · f5b9c1e5
      Paul Eggert authored
      This puts basic functions for types to be after the corresponding
      type definitions.  This is a more-common programming style in C,
      and will make it easier to port Emacs to gcc
      -fcheck-pointer-bounds, since the functions now have access to the
      corresponding types' sizes.  This patch does not change the code;
      it just moves declarations and definitions and removes
      no-longer-needed forward declarations (Bug#25128).
      * src/buffer.c, src/data.c, src/image.c:
      Include process.h, for PROCESSP.
      * src/buffer.h (BUFFERP, CHECK_BUFFER, XBUFFER):
      * src/process.h (PROCESSP, CHECK_PROCESS, XPROCESS):
      * src/termhooks.h (TERMINALP, XTERMINAL):
      * src/window.h (WINDOWP, CHECK_WINDOW, XWINDOW):
      * src/thread.h (THREADP, CHECK_THREAD, XTHREAD, MUTEXP, CHECK_MUTEX)
      (XMUTEX, CONDVARP, CHECK_CONDVAR, XCONDVAR):
      Move here from lisp.h.
      * src/intervals.h: Include buffer.h, for BUFFERP.
      Include lisp.h, for Lisp_Object.
      * src/lisp.h: Reorder declarations and definitions as described
      above.  Move thread includes to be later, so that they can use the
      reordered definitions.  Move some symbols to other headers (noted
      elsewhere).  Remove forward decls that are no longer needed.
      * src/thread.h: Include systhread.h here, not in lisp.h,
      since lisp.h itself does not need systhread.h.
      f5b9c1e5
  15. 24 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Remove interpreter’s byte stack · a815e5f1
      Paul Eggert authored
      This improves performance overall on my benchmark on x86-64,
      since the interpreted program-counter resides in a machine
      register rather than in RAM.
      * etc/DEBUG, src/.gdbinit: Remove xbytecode GDB command, as there
      is no longer a byte stack to decode.
      * src/bytecode.c (struct byte_stack, byte_stack_list)
      (relocate_byte_stack): Remove.  All uses removed.
      (FETCH): Simplify now that pc is now local (typically, in a
      register) and no longer needs to be relocated.
      (CHECK_RANGE): Remove.  All uses now done inline, in a different way.
      (BYTE_CODE_QUIT): Remove; now done by op_relative_branch.
      (exec_byte_code): Allocate a copy of the function’s bytecode,
      so that there is no problem if GC moves it.
      * src/lisp.h (struct handler): Remove byte_stack member.
      All uses removed.
      * src/thread.c (unmark_threads): Remove.  All uses removed.
      * src/thread.h (struct thread_state): Remove m_byte_stack_list member.
      All uses removed.  m_stack_bottom is now the first non-Lisp field.
      a815e5f1
  16. 22 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Pacify --enable-gcc-warnings · b10bd719
      Paul Eggert authored
      * src/charset.c (load_charset_map):
      * src/coding.c (decode_coding_object):
      * src/frame.c (make_frame):
      * src/window.c (Frecenter):
      Mark locals with UNINIT to silence false alarms from
      -Wmaybe-uninitialized.
      * src/lisp.h (SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD)
      (SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD):
      Check and assume that values are nonnull.  This pacifies
      -Wmaybe-uninitialized in Fmake_variable_buffer_local and
      Fmake_local_variable.
      b10bd719
  17. 21 Dec, 2016 1 commit
    • Stefan Monnier's avatar
      * src/data.c (Fmake_variable_frame_local): Remove · a6063ffe
      Stefan Monnier authored
      * src/lisp.h (struct Lisp_Buffer_Local_Value): Remove `frame_local'.
      
      * src/data.c (swap_in_symval_forwarding, set_internal)
      (set_symbol_trapped_write, make_blv, Fmake_variable_buffer_local)
      (Fmake_local_variable, Fkill_local_variable, Flocal_variable_p):
      Don't pay attention to ->frame_local any more.
      (syms_of_data): Remove Qtrapping_frame_local and don't defsubr
      Smake_variable_frame_local.
      
      * etc/NEWS (Incompatible Lisp Changes in Emacs 26.1): Announce removal
      of make-variable-frame-local.
      
      * lisp/help-fns.el (describe-variable): Don't handle the now impossible
      frame-local case.
      
      * lisp/subr.el (make-variable-frame-local): Remove obsolescence data.
      
      * src/frame.c (store_frame_param):
      * src/eval.c (specbind): Don't pay attention to ->frame_local any more.
      
      * src/widget.c (first_frame_p): Remove, unused.
      a6063ffe
  18. 13 Dec, 2016 2 commits
    • Phillip Lord's avatar
      Replace ldefs-boot with a much smaller file · c27b6459
      Phillip Lord authored
       * Makefile.in (bootstrap-build,generate-ldefs-boot): New targets.
         (bootstrap): Depend on bootstrap-build.
       * admin/ldefs-clean.el: New file.
       * lisp/Makefile.in (compile-first): Depend on loaddefs.el
       * lisp/ldefs-boot.el: Remove.
       * lisp/ldefs-boot-auto.el: New file.
       * lisp/ldefs-boot-manual.el: New file.
       * lisp/loadup.el: Load ldefs-boot-manual.el.
       * src/emacs.c (generating_ldefs_boot): New variable.
         (main): Check whether we are generating ldefs.
       * src/eval.c (autoload-do-load): Dump autoload forms to stderr when
         requested.
       * src/lisp.h (generating_ldefs_boot): New variable.
       * admin/gitmerge.el, admin/make-tarball.txt, admin/notes/copyright,
         lisp/Makefile.in, lisp/cus-dep.el, lisp/emacs-lisp/elint.el,
         lisp/finder.el, lisp/loadup.el, msdos/mainmake.v2: Update reference to
         ldefs-boot.
       * admin/update_autogen: Alter mechanism for ldefs-boot generation.
      c27b6459
    • Noam Postavsky's avatar
      Clean up var watcher disabling on thread switching · f66174a1
      Noam Postavsky authored
      * src/data.c (Fset_default): Move code into new C level function,
      `set_default_internal'.
      (set_default_internal): New function, like `Fset_default' but also takes
      additional bindflag parameter.
      (set_internal): Only call `notify_variable_watchers' if bindflag is not
      SET_INTERNAL_THREAD_SWITCH.
      * src/eval.c (do_specbind, do_one_unbind): Add bindflag parameter,
      passed on to set_internal and set_default_internal.  Adjust callers.
      (rebind_for_thread_switch, unbind_for_thread_switch): Pass
      SET_INTERNAL_THREAD_SWITCH to do_specbind, do_one_unbind instead of
      temporarily adjusting symbol's trapped_write field.
      f66174a1
  19. 10 Dec, 2016 1 commit
    • Eli Zaretskii's avatar
      Documentation and commentary improvements · 19bc4302
      Eli Zaretskii authored
      * src/lisp.h:
      * src/regex.c:
      * src/xgselect.c (xg_select): Improve commentary and formatting.
      
      * doc/lispref/objects.texi (Thread Type, Mutex Type)
      (Condition Variable Type): New subsections.
      (Type Predicates): Add thread-related predicates.
      * doc/lispref/objects.texi (Editing Types):
      * doc/lispref/elisp.texi (Top): Update higher-level menus.
      19bc4302
  20. 09 Dec, 2016 1 commit
  21. 07 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Simplify FUNCTIONP implementation · f0870da2
      Paul Eggert authored
      * src/bytecode.c (exec_byte_code):
      * src/image.c (parse_image_spec):
      Prefer FUNCTIONP (x) to !NILP (Ffunctionp (x)).
      * src/eval.c (FUNCTIONP): Move here ...
      * src/lisp.h: ... from here.  No longer inline, as that
      bloats the text and does not help speed (at least on my platform).
      (functionp): Remove this name, since callers use FUNCTIONP.
      f0870da2
  22. 06 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Change two _Noreturn functions to return void · c95270ad
      Paul Eggert authored
      This is a bit clearer than _Noreturn functions that (do not)
      return a non-void type.
      * src/callproc.c (call_process) [MSDOS]:
      Use 'status' local to record status.
      (child_setup): Return CHILD_SETUP_TYPE.
      * src/data.c, src/lisp.h (wrong_type_argument): Return void.
      All callers changed.
      * src/lisp.h (CHILD_SETUP_TYPE): New macro.
      c95270ad
  23. 05 Dec, 2016 2 commits
  24. 03 Dec, 2016 1 commit
    • Noam Postavsky's avatar
      Add lisp watchpoints · 22721316
      Noam Postavsky authored
      This allows calling a function whenever a symbol-value is changed.
      
      * src/lisp.h (lisp_h_SYMBOL_TRAPPED_WRITE_P):
      (SYMBOL_TRAPPED_WRITE_P): New function/macro.
      (lisp_h_SYMBOL_CONSTANT_P): Check for SYMBOL_NOWRITE specifically.
      (enum symbol_trapped_write): New enumeration.
      (struct Lisp_Symbol): Rename field constant to trapped_write.
      (make_symbol_constant): New function.
      
      * src/data.c (Fadd_variable_watcher, Fremove_variable_watcher):
      (set_symbol_trapped_write, restore_symbol_trapped_write):
      (harmonize_variable_watchers, notify_variable_watchers): New functions.
      
      * src/data.c (Fset_default): Call `notify_variable_watchers' for trapped
      symbols.
      (set_internal): Change bool argument BIND to 3-value enum and call
      `notify_variable_watchers' for trapped symbols.
      
      * src/data.c (syms_of_data):
      * src/data.c (syms_of_data):
      * src/font.c (syms_of_font):
      * src/lread.c (intern_sym, init_obarray):
      * src/buffer.c (syms_of_buffer): Use make_symbol_constant.
      
      * src/alloc.c (init_symbol):
      * src/bytecode.c (exec_byte_code): Use SYMBOL_TRAPPED_WRITE_P.
      * src/data.c (Fmake_variable_buffer_local, Fmake_local_variable):
      (Fmake_variable_frame_local):
      * src/eval.c (Fdefvaralias, specbind): Refer to Lisp_Symbol's
      trapped_write instead of constant.
      (Ffuncall): Move subr calling code into separate function.
      (funcall_subr): New function.
      22721316
  25. 01 Dec, 2016 1 commit
  26. 29 Nov, 2016 1 commit
    • Paul Eggert's avatar
      Pacify Sun C 5.14 · 36dbdede
      Paul Eggert authored
      * src/lisp.h (enum Lisp_Save_Type): Put SAVE_UNUSED,
      SAVED_INTEGER, SAVE_FUNCPOINTER, SAVE_POINTER, and SAVE_OBJECT
      into this enum rather than into an anonymous enum.  This avoids
      diagnostics from Sun C 5.14 and is a bit clearer anyway.
      36dbdede
  27. 21 Nov, 2016 1 commit
  28. 16 Nov, 2016 1 commit
    • Glenn Morris's avatar
      Add --new-daemon, which runs in the foreground and does not fork · 36b99556
      Glenn Morris authored
      This is intended for modern init systems such as systemd,
      which manage many of the traditional aspects of daemon behavior
      themselves.  (Bug#2677)
      * src/emacs.c (daemon_type): New integer.
      (usage, standard_args): Add --old-daemon and --new-daemon.
      (main): Handle --old-daemon and --new-daemon arguments.
      Restrict all the forking and complicated daemon stuff to old-daemon.
      (Fdaemon_initialized): Handle new-style daemon.
      * src/lisp.h (IS_DAEMON, DAEMON_RUNNING) [!WINDOWNT]:
      Replace daemon_pipe with daemon_type.
      * doc/emacs/cmdargs.texi (Initial Options):
      * doc/emacs/glossary.texi (Glossary):
      * doc/emacs/misc.texi (Emacs Server):
      * doc/lispref/display.texi (Window Systems):
      * doc/lispref/os.texi (Startup Summary): Related doc updates.
      * etc/NEWS: Mention this.
      * etc/emacs.service: Use Type=simple and --new-daemon.
      36b99556
  29. 08 Nov, 2016 1 commit
    • Mark Oteiza's avatar
      Remove obsolete default-FOO variables · 73d47d22
      Mark Oteiza authored
      * etc/NEWS: Indicate the removed variables.
      * lisp/emacs-lisp/edebug.el (edebug-outside-mark): Fix comment.
      * lisp/subr.el (default-mode-line-format, default-header-line-format):
      (default-line-spacing, default-abbrev-mode, default-ctl-arrow):
      (default-truncate-lines, default-left-margin, default-tab-width):
      (default-case-fold-search, default-left-margin-width):
      (default-right-margin-width, default-left-fringe-width):
      (default-right-fringe-width, default-fringes-outside-margins):
      (default-scroll-bar-width, default-vertical-scroll-bar):
      (default-indicate-empty-lines, default-indicate-buffer-boundaries):
      (default-fringe-indicator-alist, default-fringe-cursor-alist):
      (default-scroll-up-aggressively, default-scroll-down-aggressively):
      (default-fill-column, default-cursor-type):
      (default-cursor-in-non-selected-windows):
      (default-buffer-file-coding-system, default-major-mode):
      (default-enable-multibyte-characters): Remove obsolete declarations.
      * src/buffer.c (default-mode-line-format, default-header-line-format):
      (default-line-spacing, default-abbrev-mode, default-ctl-arrow):
      (default-truncate-lines, default-left-margin, default-tab-width):
      (default-case-fold-search, default-left-margin-width):
      (default-right-margin-width, default-left-fringe-width):
      (default-right-fringe-width, default-fringes-outside-margins):
      (default-scroll-bar-width, default-vertical-scroll-bar):
      (default-indicate-empty-lines, default-indicate-buffer-boundaries):
      (default-fringe-indicator-alist, default-fringe-cursor-alist):
      (default-scroll-up-aggressively, default-scroll-down-aggressively):
      (default-fill-column, default-cursor-type):
      (default-cursor-in-non-selected-windows):
      (default-buffer-file-coding-system, default-major-mode):
      (default-enable-multibyte-characters): Remove.
      * src/fileio.c (choose_write_coding_system): Fix comment.
      * src/lisp.h (DEFVAR_BUFFER_DEFAULTS): Remove.
      73d47d22