1. 01 Sep, 2015 1 commit
  2. 27 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Assume GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS · 60d1b187
      Paul Eggert authored
      This removes the need for GCPRO1 etc.  Suggested by Stefan Monnier in:
      http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00918.html
      * doc/lispref/internals.texi (Writing Emacs Primitives):
      * etc/NEWS:
      Document the change.
      * src/alloc.c (gcprolist, dump_zombies, MAX_ZOMBIES, zombies)
      (nzombies, ngcs, avg_zombies, max_live, max_zombies, avg_live)
      (Fgc_status, check_gcpros, relocatable_string_data_p, gc-precise):
      * src/bytecode.c (mark_byte_stack) [BYTE_MARK_STACK]:
      * src/eval.c (gcpro_level) [DEBUG_GCPRO]:
      * src/lisp.h (struct handler.gcpro, struct gcpro, GC_MARK_STACK)
      (GC_USE_GCPROS_AS_BEFORE, GC_MAKE_GCPROS_NOOPS)
      (GC_MARK_STACK_CHECK_GCPROS, GC_USE_GCPROS_CHECK_ZOMBIES)
      (BYTE_MARK_STACK, GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6)
      (GCPRO7, UNGCPRO, RETURN_UNGCPRO):
      Remove.  All uses removed.  The code now assumes
      GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS.
      * src/bytecode.c (relocate_byte_stack):
      Rename from unmark_byte_stack, since it now only relocates.
      All callers changed.
      * src/frame.c (make_frame): Add an IF_LINT to pacify GCC 5.2
      with GCPROs removed.
      * src/systime.h: Use EMACS_LISP_H as the canary instead of GCPRO1.
      * test/automated/finalizer-tests.el (finalizer-basic)
      (finalizer-circular-reference, finalizer-cross-reference)
      (finalizer-error):
      * test/automated/generator-tests.el (cps-test-iter-close-finalizer):
      Remove tests, as they depend on gc-precise.
      60d1b187
  3. 16 Jul, 2015 1 commit
    • Paul Eggert's avatar
      Better heuristic for C stack overflow · a5522abb
      Paul Eggert authored
      Improve the heuristic for distinguishing stack overflows from
      other SIGSEGV causes (Bug#21004).  Corinna Vinschen explained that
      the getrlimit method wasn't portable to Cygwin; see:
      https://www.cygwin.com/ml/cygwin/2015-07/msg00092.html
      Corinna suggested pthread_getattr_np but this also has problems.
      Instead, replace the low-level system stuff with a simple
      heuristic based on known good stack addresses.
      * src/eval.c, src/lisp.h (near_C_stack_top): New function.
      * src/sysdep.c: Don't include <sys/resource.h>.
      (stack_direction): Remove.  All uses removed.
      (stack_overflow): New function.
      (handle_sigsegv): Use it instead of incorrect getrlimit heuristic.
      Make SEGV fatal in non-main threads.
      a5522abb
  4. 14 Jul, 2015 1 commit
    • Paul Eggert's avatar
      Clear gcprolist etc. after stack overflow · 2254b6c0
      Paul Eggert authored
      After stack overflow, command_loop calls init_eval, and this needs to
      clear gcprolist and byte_stack_list (Bug#20996).
      * src/alloc.c (init_alloc):
      Move gcprolist and byte_stack_list initialization from here ...
      * src/eval.c (init_eval): ... to here.
      2254b6c0
  5. 31 May, 2015 1 commit
    • Paul Eggert's avatar
      Remove unused DEFSYMs · 0c2a3cf6
      Paul Eggert authored
      Remove DEFSYMs that aren't used at the C level.  Also:
      * src/decompress.c (Qzlib_dll):
      * src/font.c (Qunicode_sip):
      * src/frame.c (Qtip_frame):
      * src/ftfont.c (Qserif):
      * src/gnutls.c (Qgnutls_dll):
      * src/xml.c (Qlibxml2_dll):
      Move from here ...
      * src/w32fns.c (syms_of_w32fns): ... to here,
      as these are used only on MS-Windows.
      0c2a3cf6
  6. 19 Apr, 2015 1 commit
    • Paul Eggert's avatar
      Refactor low-level printing for simplicity · 96bfe816
      Paul Eggert authored
      * src/print.c (PRINTDECLARE): Remove.  Move its contents into
      PRINTPREPARE; doable now that we assume C99.  All callers changed.
      (PRINTCHAR): Remove, as it adds more mystery than clarity.
      All callers changed.
      (strout): Assume that caller computes length.  All callers changed.
      (print_c_string): New function.
      (write_string, write_string_1): Compute length instead of asking
      the caller to compute it.  All callers changed.
      (write_string): Simplify by using write_string_1.
      (write_string_1): Simplify by using print_c_string.
      (Fterpri): Compute default val more clearly.
      (Fprin1_to_string, print_object):
      Assume C99 to avoid unnecessary nesting.
      (print_object): Prefer print_c_string to multiple printchar, or
      to calling strout with -1 length.  Coalesce into sprintf when
      this is easy.
      96bfe816
  7. 08 Apr, 2015 1 commit
  8. 05 Feb, 2015 1 commit
    • Stefan Monnier's avatar
      Add (:documentation <form>) for dynamically-generated docstrings · ad5a7c86
      Stefan Monnier authored
      * lisp/emacs-lisp/bytecomp.el:
      (byte-compile-initial-macro-environment): Use macroexp-progn.
      (byte-compile-cl-warn): Don't silence use of cl-macroexpand-all.
      (byte-compile-file-form-defvar-function): Rename from
      byte-compile-file-form-define-abbrev-table.
      (defvaralias, byte-compile-file-form-custom-declare-variable): Use it.
      (byte-compile): Use byte-compile-top-level rather than
      byte-compile-lambda so we can compile non-values.
      (byte-compile-form): Add warnings for failed uses of lexical vars via
      quoted symbols.
      (byte-compile-unfold-bcf): Improve message for failed inlining.
      (byte-compile-make-closure): Handle new format of internal-make-closure
      for dynamically-generated docstrings.
      
      * lisp/emacs-lisp/cconv.el (cconv--convert-function):
      Add `docstring' argument.
      (cconv-convert): Use it to handle the new (:documentation ...) form.
      (cconv-analyze-form): Handle the new (:documentation ...) form.
      
      * src/eval.c (Ffunction): Handle the new (:documentation ...) form.
      (syms_of_eval): Declare `:documentation'.
      ad5a7c86
  9. 25 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Count MANY function args more reliably · a3689d3c
      Paul Eggert authored
      * alloc.c (Fgc_status, purecopy, unbind_to, garbage_collect_1):
      * buffer.c (Fbuffer_list, Fkill_buffer):
      * callint.c (read_file_name, Fcall_interactively):
      * charset.c (Fset_charset_priority, syms_of_charset):
      * chartab.c (uniprop_encode_value_numeric):
      * coding.c (syms_of_coding):
      * composite.c (syms_of_composite):
      * data.c (wrong_range):
      * dbusbind.c (syms_of_dbusbind):
      * dired.c (file_attributes):
      * editfns.c (Fdecode_time, update_buffer_properties, format2):
      * eval.c (run_hook_with_args_2, apply1, call1, call2, call3)
      (call4, call5, call6, call7):
      * fileio.c (Finsert_file_contents, choose_write_coding_system)
      (Fcar_less_than_car, build_annotations, auto_save_error):
      * filelock.c (get_boot_time):
      * fns.c (internal_equal, nconc2, Fyes_or_no_p, Fwidget_apply):
      (maybe_resize_hash_table, secure_hash):
      * font.c (font_style_to_value, font_open_by_name, Flist_fonts):
      * fontset.c (fontset_add, Fset_fontset_font):
      * ftfont.c (ftfont_lookup_cache):
      * gtkutil.c (xg_get_font):
      * insdel.c (signal_before_change, signal_after_change):
      * keymap.c (append_key):
      * lread.c (load_warn_old_style_backquotes, Fload, init_lread):
      * minibuf.c (Fread_buffer):
      * print.c (print_preprocess):
      * process.c (Fformat_network_address, Fmake_network_process)
      (server_accept_connection):
      * sound.c (Fplay_sound_internal):
      * term.c (Fsuspend_tty, Fresume_tty):
      * window.c (window_list):
      * xdisp.c (run_redisplay_end_trigger_hook, add_to_log)
      (message_with_string):
      * xfaces.c (Fx_list_fonts):
      * xfont.c (syms_of_xfont):
      * xselect.c (x_handle_selection_request)
      (x_handle_selection_clear, x_clear_frame_selections)
      (x_clipboard_manager_error_1):
      Prefer CALLMANY and CALLN to counting args by hand.
      * doc.c (reread_doc_file): Remove unused code.
      * fns.c (concat2, concat3): Redo to avoid need for local-var vector.
      (cmpfn_user_defined, hashfn_user_defined, Fmaphash):
      Prefer call1 and call2 to Ffuncall.
      * keyboard.c (safe_run_hook_funcall, safe_run_hooks):
      Use struct literal rather than a local var, for simplicity.
      * keymap.c (where_is_internal): Use NULL rather than a pointer
      to unused args.
      * lisp.h (CALLMANY, CALLN): New macros.
      * sound.c (Fplay_sound_internal): Coalesce duplicate code.
      Fixes: bug#19634
      a3689d3c
  10. 22 Jan, 2015 1 commit
  11. 19 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Prefer memset to repeatedly assigning Qnil · b7f83add
      Paul Eggert authored
      * alloc.c (allocate_pseudovector): Catch more bogus values.
      * alloc.c (allocate_pseudovector):
      * callint.c (Fcall_interactively):
      * coding.c (syms_of_coding):
      * fringe.c (init_fringe):
      Verify that Qnil == 0.
      * callint.c (Fcall_interactively):
      * eval.c (Fapply, Ffuncall):
      * fns.c (mapcar1, larger_vector):
      * font.c (font_expand_wildcards):
      * fringe.c (init_fringe):
      Prefer memset to assigning zeros by hand.
      * callint.c (Fcall_interactively):
      Remove duplicate assignment of Qnil to args[i].
      * coding.c (syms_of_coding):
      Prefer LISP_INITIALLY_ZERO to assigning zeros by hand.
      * fileio.c (Ffile_selinux_context):
      Rewrite to avoid need for Lisp_Object array.
      * lisp.h (XLI_BUILTIN_LISPSYM): New macro.
      (DEFINE_LISP_SYMBOL_END): Use it.
      (NIL_IS_ZERO): New constant.
      (memsetnil): New function.
      b7f83add
  12. 13 Jan, 2015 1 commit
    • Dmitry Antipov's avatar
      Support const and noreturn DEFUN attributes. · ad9c4a40
      Dmitry Antipov authored
      * lib-src/make-docfile.c (struct global): New field 'flags'.
      (DEFUN_noreturn, DEFUN_const): New enum bitfields.
      (add_global): Now return pointer to global.
      (write_globals): Add _Noreturn and ATTRIBUTE_CONST attributes
      if requested by global's flags.
      (stream_match): New function.
      (scan_c_stream): Recognize 'attributes:' of DEFUN.
      
      * src/callint.c (Finteractive):
      * src/character.c (Fcharacterp, Fmax_char):
      * src.data.c (Feq, Fnull, Fconsp, Fatom, Flistp, Fnlistp, Fsymbolp)
      (Fstringp, Fchar_or_string_p, Fintegerp, Fnatnump, Fnumberp)
      (Ffloatp, Fbyteorder):
      * src/decompress.c (Fzlib_available_p):
      * src/fns.c (Fidentity):
      * src/frame.c (Fframe_windows_min_size):
      * src/gnutls.c (Fgnutls_error_p, Fgnutls_available_p):
      * src/window.c (Fwindow__sanitize_window_sizes):
      * src/xdisp.c (Ftool_bar_height):
      * src/xfaces.c (Fface_attribute_relative_p): Add const attribute.
      * src/emacs.c (Fkill_emacs):
      * src/eval.c (Fthrow):
      * src/keyboard.c (Ftop_level, Fexit_recursive_edit)
      (Fabor_recursive_edit): Add noreturn attribute.
      ad9c4a40
  13. 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
  14. 01 Jan, 2015 2 commits
  15. 04 Dec, 2014 2 commits
  16. 16 Sep, 2014 1 commit
    • Dmitry Antipov's avatar
      Always use matched specpdl entry to record call arguments (Bug#18473). · ccb767d6
      Dmitry Antipov authored
      * lisp.h (record_in_backtrace): Adjust prototype.
      * eval.c (record_in_backtrace): Return current specpdl level.
      (set_backtrace_args, set_backtrace_nargs): Merge.  Adjust all users.
      (eval_sub, Ffuncall): Record call arguments in matched specpdl
      entry and use that entry in call to backtrace_debug_on_exit.
      (apply_lambda): Likewise.  Get current specpdl level as 3rd arg.
      (do_debug_on_call): Get current specpdl level as 2nd arg.
      ccb767d6
  17. 11 Sep, 2014 1 commit
    • Dmitry Antipov's avatar
      Remove redundant GCPROs around Ffuncall and Fapply calls. This · 1dd12186
      Dmitry Antipov authored
      is safe because Ffuncall protects all of its arguments by itself.
      * charset.c (map_charset_for_dump): Remove redundant GCPRO.
      * eval.c (Fapply, apply1, call0, call1, call2, call3, call4, call5)
      (call6, call7): Likewise.  Use compound literals where applicable.
      (run_hook_with_args_2): Use compound literal.
      1dd12186
  18. 07 Sep, 2014 1 commit
    • Paul Eggert's avatar
      Use SAFE_ALLOCA etc. to avoid unbounded stack allocation. · b3bf18b3
      Paul Eggert authored
      This follows up on the recent thread in emacs-devel on alloca; see:
      http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html
      This patch also cleans up alloca-related glitches noted while
      examining the code looking for unbounded alloca.
      * alloc.c (listn):
      * callproc.c (init_callproc):
      Rewrite to avoid need for alloca.
      * buffer.c (mouse_face_overlay_overlaps)
      (report_overlay_modification):
      * buffer.h (GET_OVERLAYS_AT):
      * coding.c (make_subsidiaries):
      * doc.c (Fsnarf_documentation):
      * editfns.c (Fuser_full_name):
      * fileio.c (Ffile_name_directory, Fexpand_file_name)
      (search_embedded_absfilename, Fsubstitute_in_file_name):
      * fns.c (Fmake_hash_table):
      * font.c (font_vconcat_entity_vectors, font_update_drivers):
      * fontset.c (fontset_pattern_regexp, Ffontset_info):
      * frame.c (Fmake_terminal_frame, x_set_frame_parameters)
      (xrdb_get_resource, x_get_resource_string):
      * ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf):
      * ftxfont.c (...
      b3bf18b3
  19. 02 Sep, 2014 1 commit
  20. 27 Jul, 2014 1 commit
    • Martin Rudalics's avatar
      Complete pixelwise frame/window resizing, add horizontal scrollbar support. · 3477e270
      Martin Rudalics authored
      * frame.el (frame-notice-user-settings): Rewrite using
      frame-initial-frame-tool-bar-height.
      * menu-bar.el (menu-bar-horizontal-scroll-bar)
      (menu-bar-no-horizontal-scroll-bar): New functions.
      (menu-bar-showhide-scroll-bar-menu): Add bindings for horizontal
      scroll bars.
      * scroll-bar.el (scroll-bar-lines)
      (set-horizontal-scroll-bar-mode)
      (get-horizontal-scroll-bar-mode, horizontal-scroll-bar-mode)
      (scroll-bar-horizontal-drag-1, scroll-bar-horizontal-drag)
      (scroll-bar-toolkit-horizontal-scroll): New functions.
      (horizontal-scroll-bar-mode)
      (previous-horizontal-scroll-bar-mode)
      (horizontal-scroll-bar-mode-explicit): New variables.
      (horizontal-scroll-bar-mode): New option.
      (toggle-horizontal-scroll-bar): Do something.
      (top-level): Bind horizontal-scroll-bar mouse-1.
      * startup.el (tool-bar-originally-present): Remove variable.
      (command-line): Don't set tool-bar-originally-present.
      * window.el (window-min-height): Update doc-string.
      (window--dump-frame): Dump horizontal scroll bar values.
      (window--min-size-1): Handle minibuffer window separately.
      Count in margins and horizontal scroll bar.  Return safe value
      iff IGNORE equals 'safe.
      (frame-windows-min-size): New function (used by frame resizing
      routines).
      (fit-frame-to-buffer, fit-window-to-buffer): Count in horizontal
      scroll bars.
      (window--sanitize-window-sizes): New function.
      (window-split-min-size): Remove.
      (split-window): Count divider-width.  Don't use
      `window-split-min-size' any more.  Reword error messages.
      Sanitize windows sizes after splitting.
      * buffer.h (struct buffer): New fields scroll_bar_height and
      horizontal_scroll_bar_type.
      * buffer.c (bset_scroll_bar_height)
      (bset_horizontal_scroll_bar_type): New functions.
      (Fbuffer_swap_text): Handle old_pointm field.
      (init_buffer_once): Set defaults for scroll_bar_height and
      horizontal_scroll_bar_type.
      (syms_of_buffer): New variables scroll_bar_height and
      horizontal_scroll_bar_type.
      * dispextern.h (window_part): Rename ON_SCROLL_BAR to
      ON_VERTICAL_SCROLL_BAR.  Add ON_HORIZONTAL_SCROLL_BAR.
      (set_vertical_scroll_bar): Remove prototype.
      (x_change_tool_bar_height): Add prototype.
      * dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
      (window_to_frame_vpos, update_frame_1, scrolling, init_display):
      Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS
      and FRAME_LINES.
      (adjust_frame_glyphs_for_window_redisplay): Rearrange lines.
      (update_window): Start mode_line_row->y after horizontal scroll
      bar.
      (change_frame_size_1): Call adjust_frame_size.
      (init_display): When changing the size of a tty frame do not
      pass height of menu bar.
      (Qframe_windows_min_size): New symbol.
      * frame.h (struct frame): List tool bar fields after menu bar
      fields.  Add official, total_lines, horizontal_scroll_bars,
      config_scroll_bar_height and config_scroll_bar_lines fields.
      (FRAME_HAS_HORIZONTAL_SCROLL_BARS)
      (FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES)
      (FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS)
      (FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES)
      (FRAME_WINDOWS_HEIGHT): New macros.
      (SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT)
      (FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES)
      (FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and
      horizontal scroll bar.
      (frame_inhibit_resize, adjust_frame_size)
      (frame_windows_min_size): Add declarations.
      (Qscroll_bar_height, Qhorizontal_scroll_bars)
      (x_set_scroll_bar_default_height, x_set_left_fringe)
      (x_set_right_fringe, x_set_vertical_scroll_bars)
      (x_set_horizontal_scroll_bars, x_set_scroll_bar_width)
      (x_set_scroll_bar_height): Add external declarations.
      * frame.c: (frame_inhibit_resize, frame_windows_min_size)
      (adjust_frame_size): New functions.
      (make_frame): Initial horizontal_scroll_bars field.  Use
      SET_FRAME_LINES.  Don't allow horizontal scroll bar in
      minibuffer window.
      (make_initial_frame, make_terminal_frame): No horizontal scroll
      bar in initial and terminal frames.  Use adjust_frame_size.
      (Fframe_total_cols): Fix doc-string.
      (Fframe_total_lines, Fscroll_bar_height): New Lisp functions.
      (Fset_frame_height, Fset_frame_width, Fset_frame_size): Rewrite
      using adjust_frame_size.
      (Qscroll_bar_height, Qhorizontal_scroll_bars)
      (Qframe_windows_min_size): New symbols.
      (x_set_frame_parameters): Remove call of check_frame_size.
      (x_report_frame_params): Return scroll_bar_height value.
      (x_set_left_fringe, x_set_right_fringe): New functions.
      (adjust_frame_height, x_set_internal_border_width)
      (x_set_fringe_width): Remove.
      (x_set_internal_border_width, x_set_vertical_scroll_bars)
      (x_set_scroll_bar_width, x_set_right_divider_width)
      (x_set_bottom_divider_width): Rewrite using adjust_frame_size.
      (x_set_horizontal_scroll_bars, x_set_scroll_bar_height): New
      functions.
      (x_figure_window_size): Rewrite to make frame display the
      expected number of lines.
      (Vdefault_frame_scroll_bars): Rewrite doc-string.
      (Vdefault_frame_horizontal_scroll_bars)
      (Vframe_initial_frame_tool_bar_height)
      (frame_inhibit_implied_resize): New variables.
      * fringe.c (compute_fringe_widths): Remove.
      * gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define.
      (xg_create_horizontal_scroll_bar)
      (xg_update_horizontal_scrollbar_pos)
      (xg_set_toolkit_horizontal_scroll_bar_thumb)
      (xg_get_default_scrollbar_height)
      (xg_clear_under_internal_border): Extern.
      * gtkutil.c (xg_frame_resized): Don't call
      do_pending_window_change.
      (xg_frame_set_char_size): Use adjust_frame_size.
      (style_changed_cb): Call update_theme_scrollbar_height and
      x_set_scroll_bar_default_height.
      (x_wm_set_size_hint): Don't call check_frame_size.
      (update_theme_scrollbar_height)
      (xg_get_default_scrollbar_height)
      (xg_create_horizontal_scroll_bar)
      (xg_update_horizontal_scrollbar_pos)
      (xg_set_toolkit_horizontal_scroll_bar_thumb): New functions.
      (xg_create_scroll_bar): Set horizontal slot of bar.
      (xg_initialize): Call update_theme_scrollbar_height.
      (xg_clear_under_internal_border): No more static.
      * insdel.c (adjust_suspend_auto_hscroll): New function.
      (adjust_markers_for_delete, adjust_markers_for_insert)
      (adjust_markers_for_replace): Call adjust_suspend_auto_hscroll.
      * keyboard.c (readable_events, discard_mouse_events)
      (make_lispy_event): Handle horizontal scroll bar click events.
      (Fsuspend_emacs): When changing the size of a tty frame do not
      pass height of menu bar.
      (Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft)
      (Qright, Qleftmost, Qrightmost): New symbols.
      * menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of
      FRAME_LINES.
      * minibuf.c (read_minibuf): Initialize suspend_auto_hscroll.
      * nsfns.m (x_set_internal_border_width): New function.
      * nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar):
      Remove extended fringe code.
      (x_set_window_size, x_new_font): Don't call
      compute_fringe_widths.
      * term.c (Fresume_tty): When changing the size of a tty frame do
      not pass height of menu bar.
      (clear_tty_hooks, set_tty_hooks): Clear
      horizontal_scroll_bar_hook.
      (init_tty): Frame has no horizontal scroll bars.
      * termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio,
      scroll_bar_before_handle, scroll_bar_horizontal_handle,
      scroll_bar_after_handle, scroll_bar_left_arrow,
      scroll_bar_right_arrow, scroll_bar_to_leftmost and
      scroll_bar_to_rightmost entries.
      (enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT
      (struct terminal): Add set_horizontal_scroll_bar_hook.
      * w32console.c (initialize_w32_display): Clear
      horizontal_scroll_bar_hook.
      * w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of
      FRAME_X_DISPLAY.
      (x_clear_under_internal_border, x_set_internal_border_width):
      New functions.
      (x_set_menu_bar_lines): Rewrite using frame_inhibit_resize.  Set
      windows_or_buffers_changed when adding the menu bar.
      (x_set_tool_bar_lines): Rewrite using adjust_frame_size.
      (x_change_tool_bar_height, x_set_scroll_bar_default_height)
      (w32_createhscrollbar): New functions.
      (w32_createscrollbar): Rename to w32_createvscrollbar.
      (w32_createwindow): Init WND_HSCROLLBAR_INDEX.
      (w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by
      WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR.  Add
      WM_EMACS_SHOWCURSOR.
      (w32_wnd_proc): Handle WM_HSCROLL case.  In WM_WINDOWPOSCHANGING
      case do not artificially impose WM size hints.  Handle
      WM_EMACS_SHOWCURSOR case.  Replace WM_EMACS_CREATESCROLLBAR case
      by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR
      cases.
      (my_create_tip_window): Replace WND_SCROLLBAR_INDEX by
      WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX.
      (unwind_create_frame_1): Remove.
      (Fx_create_frame): Make both scrollbars the system standard
      width and height.  Use official field of frame structure to
      inhibit running window-configuration-change-hook.
      (x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
      pixelwise.  Handle frame's official field.
      (w32_frame_parm_handlers): Remove x_set_fringe_width
      entries. Add x_set_scroll_bar_height,
      x_set_horizontal_scroll_bars, x_set_left_fringe and
      x_set_right_fringe.
      * w32inevt.c (resize_event, maybe_generate_resize_event): Do not
      pass height of menu bar to change_frame_size.
      * w32menu.c (set_frame_menubar): Rewrite using
      frame_inhibit_resize.
      * w32term.h (struct w32_display_info): Add
      horizontal_scroll_bar_cursor and cursor_display_counter.
      (struct scroll_bar): Add horizontal.
      (HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
      (HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
      (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH)
      (HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
      (HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
      (HORIZONTAL_SCROLL_BAR_TOP_BORDER)
      (HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
      (HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros.
      (WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR): Define
      instead of WM_EMACS_CREATESCROLLBAR.
      (WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of
      WND_SCROLLBAR_INDEX.
      * w32term.c (horizontal_scroll_bar_min_handle)
      (horizontal_scroll_bar_left_border)
      (horizontal_scroll_bar_right_border): New integers.
      (x_set_frame_alpha): Replace x_highlight_frame by
      w32_focus_frame.
      (x_window_to_scroll_bar): New argument "type".  Update callers
      accordingly.
      (w32_set_horizontal_scroll_bar_thumb)
      (x_horizontal_scroll_bar_report_motion)
      (w32_set_horizontal_scroll_bar)
      (w32_horizontal_scroll_bar_handle_click)
      (x_horizontal_scroll_bar_report_motion): New functions.
      (w32_mouse_position): Discriminate horizontal and vertical
      scrollbar cases.
      (my_create_scrollbar): Replace with two new functions
      my_create_vscrollbar and my_create_hscrollbar.
      (x_scroll_bar_create): New argument "horizontal".  Update
      callers accordingly.
      (x_scroll_bar_remove, w32_condemn_scroll_bars)
      (w32_redeem_scroll_bar, x_scroll_bar_clear): Handle horizontal
      scroll bar case.
      (w32_read_socket): Handle WM_HSCROLL cae.
      (x_new_font): Don't recompute fringe widths.  Use
      frame_inhibit_resize.  Calculate new menu bar height iff we
      build without toolkit.  Always clear under internal border.
      (x_set_window_size): Don't check frame size or recompute
      fringes.  Reset fullscreen status before applying sizes.  Always
      resize as requested by pixelwise argument.  Don't call
      do_pending_window_change.
      (x_wm_set_size_hint): Add call for FRAME_SCROLL_BAR_AREA_HEIGHT.
      (w32_initialize_display_info): Initialize dpyinfo's
      horizontal_scroll_bar_cursor entry.
      (w32_create_terminal): Add set_horizontal_scroll_bar_hook.
      (w32_initialize): Init horizontal_scroll_bar_min_handle and
      horizontal_scroll_bar_left_border.
      (w32fullscreen_hook): Intermittently resize window to normal
      when switching from fullscreen to maximized state.
      (run_window_configuration_change_hook): Don't run it if frame is
      not official yet.
      (unwind_change_frame): Remove.
      (Fset_window_configuration): Rewrite using frame's official field.
      * widget.c (set_frame_size): Don't call compute_fringe_widths.
      (EmacsFrameSetCharSize): Obey frame_inhibit_resize.
      * window.h (struct window): New fields old_pointm,
      horizontal_scroll_bar, horizontal_scroll_bar_type, hscroll_whole,
      scroll_bar_height and suspend_auto_hscroll.
      (wset_horizontal_scroll_bar, wset_horizontal_scroll_bar_type):
      New functions.
      (sanitize_window_sizes): Extern.
      (MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P, WINDOW_PSEUDO_P)
      (WINDOW_TOPMOST_P, WINDOW_HAS_HORIZONTAL_SCROLL_BAR)
      (WINDOW_CONFIG_SCROLL_BAR_HEIGHT)
      (WINDOW_CONFIG_SCROLL_BAR_LINES)
      (WINDOW_SCROLL_BAR_LINES, WINDOW_SCROLL_BAR_AREA_HEIGHT): New
      macros.
      (WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS)
      (WINDOW_FRINGE_COLS, WINDOW_FRINGE_EXTENDED_P): Remove macros.
      (WINDOW_VERTICAL_SCROLL_BAR_TYPE)
      (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT)
      (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT)
      (WINDOW_HAS_VERTICAL_SCROLL_BAR): Minor rewrite.
      (WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT)
      (WINDOW_SCROLL_BAR_AREA_Y): Count in scroll bar height.
      * window.c (wset_old_pointm, Fwindow_scroll_bar_height)
      (Fwindow_old_point, sanitize_window_sizes): New functions.
      (Qwindow_sanitize_window_sizes): New symbol.
      (window_body_height): Count in horizontal scroll bar.
      (set_window_hscroll, Fscroll_left, Fscroll_right): Set
      suspend_auto_hscroll slot.
      (Fwindow_inside_edges): Count fringes pixelwise.
      (coordinates_in_window, Fcoordinates_in_window_p): Consider
      horizontal scroll bar.
      (check_frame_size, adjust_window_margins): Remove functions and
      corresponding calls.
      (set_window_buffer): Initialize old_pointm and horizontal scroll
      bars.
      (temp_output_buffer_show): Reset hscroll related fields.
      Initialize old_pointm.
      (make_parent_window): Initialize old_pointm.
      (make_window): Initialize old_pointm, horizontal scroll bar type,
      and scroll bar height.
      (resize_frame_windows): Don't count top margin in new sizes.
      Don't use safe sizes when shrinking a frame; let the window
      manager do the clipping.
      (Fsplit_window_internal): Inherit horizontal scroll bar type and
      height.
      (Fdelete_window_internal): Unchain old_pointm marker.
      (window_scroll_pixel_based, Fscroll_other_window): Adjust
      old_pointm.
      (Fwindow_text_width, Fwindow_text_height): New argument
      "pixelwise".
      (struct saved_window): New fields, old_pointm, hscroll_whole,
      suspend_auto_hscroll, scroll_bar_height and
      horizontal_scroll_bar_type.
      (Fset_window_configuration, save_window_save): Set new fields of
      saved_window.
      (apply_window_adjustment): Don't call adjust_window_margins.
      (set_window_margins): Don't change margins if new sizes don't
      fit into window.
      (set_window_scroll_bars): New argument "horizontal_type".
      Handle horizontal scroll bars.  Don't change scroll bars if they
      don't fit into window.
      (Fset_window_scroll_bars): New argument "horizontal_type".
      (Fwindow_scroll_bars): Return values for horizontal scroll bars.
      (compare_window_configurations): Compare horizontal scroll bar
      settings.
      * xdisp.c (window_text_bottom_y, window_box_height): Count in
      horizontal scroll bar height.
      (pixel_to_glyph_coords, init_xdisp): Use FRAME_TOTAL_LINES
      instead of FRAME_LINES.
      (remember_mouse_glyph): Case ON_SCROLL_BAR changed to
      ON_VERTICAL_SCROLL_BAR.
      (with_echo_area_buffer): Initialize old_pointm.
      (with_echo_area_buffer_unwind_data): Store old_pointm values in
      vector.
      (unwind_with_echo_area_buffer): Handle old_pointm.
      (update_tool_bar): Set do_update when the tool bar window has at
      least one line (since this is what the user sets).
      (MAX_FRAME_TOOL_BAR_HEIGHT): Remove macro.
      (redisplay_tool_bar): Return early when toolbar has zero lines.
      Call x_change_tool_bar_height.  Don't use max_tool_bar_height.
      (hscroll_window_tree): Handle suspension of auto_hscroll and
      old_pointm.
      (set_horizontal_scroll_bar): New function.
      (redisplay_window): Set ignore_mouse_drag_p when tool bar has
      more than one line.  Handle horizontal scroll bars.
      (note_mouse_highlight): Handle horizontal scrol bars.
      (expose_frame): Set dimensions of XRectangle from frame's text
      sizes.
      (Vvoid_text_area_pointer): Update doc-string.
      * xfns.c (x_set_menu_bar_lines): Use adjust_frame_size.
      (x_change_tool_bar_height, x_set_scroll_bar_default_height)
      (x_set_internal_border_width): New functions.
      (x_set_tool_bar_lines): Call x_change_tool_bar_height.
      (unwind_create_frame_1): Remove.
      (Fx_create_frame): Handle horizontal scroll bars.  Use official
      field of frame structure to inhibit running
      window-configuration-change-hook.
      (x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
      pixelwise.  Handle frame's official field.
      (x_frame_parm_handlers): Add x_set_scroll_bar_height,
      x_set_horizontal_scroll_bars, x_set_left_fringe,
      x_set_right_fringe.
      * xmenu.c (update_frame_menubar, free_frame_menubar): Use
      adjust_frame_size.
      * xterm.h (struct x_display_info): Add
      horizontal_scroll_bar_cursor and Xatom_Horizontal_Scrollbar
      slots.
      (struct scroll_bar): Add horizontal slot.
      (HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
      (HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
      (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH): New macros.
      (HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
      (HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
      (HORIZONTAL_SCROLL_BAR_TOP_BORDER)
      (HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
      (HORIZONTAL_SCROLL_BAR_MIN_HANDLE): Define.
      (x_clear_under_internal_border): Remove.
      * xterm.c (XTmouse_position): Handle horizontal scroll bars.
      (x_window_to_scroll_bar): New argument TYPE.  Update callers.
      (x_send_scroll_bar_event, x_scroll_bar_create): New arguments
      HORIZONTAL.  Update callers.
      (horizontal_action_hook_id): New action hook id.
      (x_horizontal_scroll_bar_to_input_event)
      (x_create_horizontal_toolkit_scroll_bar)
      (xt_horizontal_action_hook)
      (x_set_toolkit_horizontal_scroll_bar_thumb)
      (XTset_horizontal_scroll_bar, x_net_wm_state)
      (x_horizontal_scroll_bar_report_motion): New functions.
      (xg_scroll_callback, x_scroll_bar_handle_click): Handle
      horizontal scroll bars.
      (SCROLL_BAR_HORIZONTAL_NAME): Define.
      (XTset_vertical_scroll_bar): Attempt to clear areas not covered
      by scroll bar.
      (XTcondemn_scroll_bars, XTredeem_scroll_bar): Rewrite.  Handle
      horizontal scroll bars.
      (handle_one_xevent): Handle horizontal scroll bar events.  Call
      x_net_wm_state.
      (x_set_window_size_1, x_wm_set_size_hint): Don't call
      check_frame_size.
      (x_set_window_size): Don't call check_frame_size and
      do_pending_window_change.
      (x_term_init): Init horizontal_scroll_bar_cursor display info.
      (x_create_terminal): Add set_horizontal_scroll_bar_hook.
      (x_scroll_bar_set_handle): Add some checks when calling
      x_clear_area.
      3477e270
  21. 17 Jun, 2014 1 commit
  22. 10 Feb, 2014 1 commit
  23. 03 Feb, 2014 1 commit
  24. 25 Jan, 2014 1 commit
  25. 01 Jan, 2014 1 commit
  26. 08 Dec, 2013 1 commit
  27. 02 Dec, 2013 1 commit
    • Helmut Eller's avatar
      * lisp/emacs-lisp/debug.el (debugger-toggle-locals): New command. · f345395c
      Helmut Eller authored
      (debugger-mode-map): Bind it.
      (debugger--backtrace-base): New function.
      (debugger-eval-expression): Use it.
      (debugger-frame-number): Skip local vars when present.
      (debugger--locals-visible-p, debugger--insert-locals)
      (debugger--show-locals, debugger--hide-locals): New functions.
      * src/eval.c (Fbacktrace__locals): New function.
      (syms_of_eval): Defsubr it.
      f345395c
  28. 05 Nov, 2013 1 commit
    • Stefan Monnier's avatar
      * src/eval.c (handlerlist_sentinel): New variable. · 70de5e86
      Stefan Monnier authored
      (init_eval): Use it to ensure handlerlist is non-NULL.
      (unwind_to_catch): Make sure we never set handlerlist to NULL.
      (Fsignal): Adjust NULLness test of handlerlist.
      * src/lisp.h (PUSH_HANDLER): Assume handlerlist is non-NULL.
      
      Fixes: debbugs:15802
      70de5e86
  29. 29 Oct, 2013 1 commit
  30. 09 Oct, 2013 1 commit
    • Glenn Morris's avatar
      Doc tweaks for cond · fa022909
      Glenn Morris authored
      * doc/lispref/control.texi (Conditionals): Copyedits.
      
      * src/eval.c (Fcond): Doc tweak.
      fa022909
  31. 03 Oct, 2013 2 commits
    • Paul Eggert's avatar
      * eval.c (clobbered_eassert): New macro. · b52f569d
      Paul Eggert authored
      (internal_catch, internal_condition_case)
      (internal_condition_case_1, internal_condition_case_2)
      (internal_condition_case_n): Use it instead of eassert
      when the argument contains locals clobbered by longjmp.
      Don't use clobbered locals outside of clobbered_eassert.
      (internal_lisp_condition_case): Use a volatile variable
      to work around a local variable's getting clobbered.
      b52f569d
    • Stefan Monnier's avatar
      Introduce new bytecodes for efficient catch/condition-case in lexbind. · adf2aa61
      Stefan Monnier authored
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
      Optimize under `condition-case' and `catch' if
      byte-compile--use-old-handlers is nil.
      (disassemble-offset): Handle new bytecodes.
      
      * lisp/emacs-lisp/bytecomp.el (byte-pushcatch, byte-pushconditioncase)
      (byte-pophandler): New byte codes.
      (byte-goto-ops): Adjust accordingly.
      (byte-compile--use-old-handlers): New var.
      (byte-compile-catch): Use new byte codes depending on
      byte-compile--use-old-handlers.
      (byte-compile-condition-case--old): Rename from
      byte-compile-condition-case.
      (byte-compile-condition-case--new): New function.
      (byte-compile-condition-case): New function that dispatches depending
      on byte-compile--use-old-handlers.
      (byte-compile-unwind-protect): Pass a function to byte-unwind-protect
      when we can.
      
      * lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyse-form): Adjust for
      the new compilation scheme using the new byte-codes.
      
      * src/alloc.c (Fgarbage_collect): Merge scans of handlerlist and catchlist,
      and make them unconditional now that they're heap-allocated.
      
      * src/bytecode.c (BYTE_CODES): Add Bpushcatch, Bpushconditioncase
      and Bpophandler.
      (bcall0): New function.
      (exec_byte_code): Add corresponding cases.  Improve error message when
      encountering an invalid byte-code.  Let Bunwind_protect accept
      a function (rather than a list of expressions) as argument.
      
      * src/eval.c (catchlist): Remove (merge with handlerlist).
      (handlerlist, lisp_eval_depth): Not static any more.
      (internal_catch, internal_condition_case, internal_condition_case_1)
      (internal_condition_case_2, internal_condition_case_n):
      Use PUSH_HANDLER.
      (unwind_to_catch, Fthrow, Fsignal): Adjust to merged
      handlerlist/catchlist.
      (internal_lisp_condition_case): Use PUSH_HANDLER.  Adjust to new
      handlerlist which can only handle a single condition-case handler at
      a time.
      (find_handler_clause): Simplify since we only a single branch here
      any more.
      
      * src/lisp.h (struct handler): Merge struct handler and struct catchtag.
      (PUSH_HANDLER): New macro.
      (catchlist): Remove.
      (handlerlist): Always declare.
      adf2aa61
  32. 10 Sep, 2013 1 commit
  33. 06 Sep, 2013 1 commit
  34. 28 Aug, 2013 1 commit
  35. 12 Aug, 2013 1 commit
    • Paul Eggert's avatar
      Fix some fd issues when running subprocesses. · 94fcd171
      Paul Eggert authored
      Fix bugs that can leak files or file descriptors on errors.
      Don't unlink open temp files, as that's hard for users to diagnose
      when things go awry (e.g., temp disk exhausted).
      Don't bother to lock temp files.  Check for invalid recursion.
      * callproc.c (synch_process_fd): Remove.  All uses removed.
      (synch_process_tempfile): New var or macro.
      (CALLPROC_STDOUT, CALLPROC_STDERR, CALLPROC_PIPEREAD, CALLPROC_FDS):
      New constants.
      (record_kill_process): New arg, the temp name.  All callers changed.
      (delete_temp_file): Now just a simple wrapper around unlink.
      (call_process_kill): New arg, the call_process_fd array.
      Close them all.  Clear synch_process_pid.  Remove the temp file,
      or arrange for it to be removed.
      (call_process_cleanup) [MSDOS]: Arg no longer contains file name;
      that's been moved to synch_process_tempfile.  Caller changed.
      Do not remove the tempfile; that's now call_process_kill's
      responsibility.
      (call_process_cleanup) [!MSDOS]: Do not record unwind-protect for
      call_process_kill; the caller now does that.
      (call_process_cleanup): Do not close the process fd; that's now
      call_process_kill's responsibility.
      (Fcall_process): Implement via new function call_process, which
      has most of the old body of Fcall_process, but with a different API.
      (call_process): New function that does not open or close filefd if
      it is nonnegative.  Record which fds need to be closed, and let
      call_process_kill close (and remove the tempfile, on MSDOS) on error.
      Signal an error if invoked recursively (could be done via a hook).
      Simplify creation of the tempfile in the MSDOS case.
      Don't create the output file until after checking for the executable.
      Report any failure to open /dev/null.
      Don't open /dev/null for writing twice; once is enough.
      Don't create pipe if all output is being discarded or sent to file.
      Don't worry about setting up the coding system or reading from the
      pipe if all output is being discarded.
      Hoist fd_error local into top level, to lessen block nesting.
      Don't record deleted pid here; now done by Fcall_process_region.
      (Fcall_process) [MSDOS]: Report mktemp failure immediately,
      and note its success in synch_process_tempfile.
      Do not leak resources when child_setup fails.
      (Fcall_process) [!MSDOS && !WINDOWSNT]: Remove duplicate assignment
      to child_errno.  Remove unnecessary close of fd0; it's close-on-exec.
      (create_temp_file): Now returns open fd, with an additional
      Lisp_Object * argument to return the name.  All callers changed.
      Do not close the file; rewind it instead, and leave it open for
      the caller.  Do not lock the temp file.  Unwind-protect the file
      and the file-descriptor.
      (Fcall_process_region): If the input is /dev/null, unwind-protect it.
      If an asynchrounous process, record it here, not in call_process.
      (syms_of_callproc) [MSDOS]: Initialize synch_process_tempfile.
      * eval.c (set_unwind_protect): New function.
      * fileio.c (write_region): New function, generalized from the
      old Fwrite_region.  Do not lock temp files.
      (Fwrite_region): Use it.
      * lisp.h (set_unwind_protect, write_region): New decls.
      * process.c: Include <verify.h>.
      (make_process): Mark fds as initially closed.
      (deleted_pid_list): Now a list of pid-filename pairs.
      All uses changed.
      (close_process_fd): New function.
      (SUBPROCESS_STDIN, WRITE_TO_SUBPROCESS, READ_FROM_SUBPROCESS)
      (SUBPROCESS_STDOUT, READ_FROM_EXEC_MONITOR, EXEC_MONITOR_OUTPUT):
      New constants.  Verify that their number matches PROCESS_OPEN_FDS.
      (create_process, create_pty, Fmake_serial_process)
      (server_accept_connection): Record which fds need to be closed,
      and let deactivate_process close them.
      (Fmake_network_process): Do not discard the unwind-protect
      until it's safe to do so.
      (deactivate_process): Close the fds opened by create_process etc.
      (Fprocess_send_eof): Adjust to new way of recording open fds.
      Report an error if /dev/null can't be opened, instead of aborting.
      * process.h (PROCESS_OPEN_FDS): New constant.
      (struct Lisp_Process): New member open_fds.
      (record_kill_process, record_deleted_pid): Adjust signatures.
      (record_deleted_pid): Move decl here ...
      * syswait.h (record_deleted_pid): ... from here.
      
      Fixes: debbugs:15035
      94fcd171
  36. 02 Aug, 2013 1 commit
    • Stefan Monnier's avatar
      Make defvar affect the default binding outside of any let. · a104f656
      Stefan Monnier authored
      * src/eval.c (default_toplevel_binding): New function.
      (Fdefvar): Use it.
      (unbind_to, backtrace_eval_unrewind): Do a bit of CSE simplification.
      (Fdefault_toplevel_value, Fset_default_toplevel_value): New subrs.
      (syms_of_eval): Export them.
      * src/data.c (Fdefault_value): Micro cleanup.
      * src/term.c (init_tty): Use "false".
      * lisp/custom.el (custom-initialize-default, custom-initialize-set)
      (custom-initialize-reset, custom-initialize-changed): Affect the
      toplevel-default-value (bug#6275, bug#14586).
      * lisp/emacs-lisp/advice.el (ad-compile-function): Undo previous workaround
      for bug#6275.
      * test/automated/core-elisp-tests.el: New file.
      a104f656
  37. 27 Jul, 2013 1 commit