1. 05 Mar, 2019 1 commit
    • Martin Rudalics's avatar
      Fix handling of minibuffer-only child frames (Bug#33498) · a552cc21
      Martin Rudalics authored
      * doc/lispref/frames.texi (Buffer Parameters): Describe how to
      make a minibuffer-only child frame.
      (Child Frames): Describe how minbuffer child frames are
      deleted.
      * src/frame.c (delete_frame): Handle deletion of minibuffer
      child frames (Bug#33498).  In the course, fix reassigning of
      'default-minibuffer-frame' with minibuffer-only frames.
      * lisp/frame.el (frame-notice-user-settings): Handle creation of
      initial minibuffer-only child frame.
      (make-frame): Handle creation of frame with a minibuffer-only
      child frame.
      a552cc21
  2. 04 Mar, 2019 2 commits
    • Martin Rudalics's avatar
      Prevent introducing invalid scroll bar width/height values (Bug#34569) · ad25316b
      Martin Rudalics authored
      * src/frame.c (store_frame_param): Don't store invalid values
      for scroll_bar_width/height.
      (x_report_frame_params): Don't report invalid values for
      scroll_bar_width/height.
      (x_set_scroll_bar_width, x_set_scroll_bar_height): Don't set
      invalid values for scroll_bar_width/height.
      ad25316b
    • Paul Eggert's avatar
      Simplify list creation in C code · 5c2563a5
      Paul Eggert authored
      The main new thing here is that C code can now say
      ‘list (a, b, c, d, e, f)’ instead of
      ‘listn (CONSTYPE_HEAP, 6, a, b, c, d, e, f)’,
      thus relieving callers of the responsibility of counting
      arguments (plus, the code feels more like Lisp).  The old
      list1 ... list5 functions remain, as they’re probably a bit
      faster for small lists.
      * src/alloc.c (cons_listn, pure_listn): New functions.
      (listn): Omit enum argument.
      All callers changed to use either new ‘list’ or ‘pure_list’ macros.
      * src/charset.c (Fdefine_charset_internal):
      * src/coding.c (detect_coding_system)
      (Fset_terminal_coding_system_internal):
      * src/frame.c (frame_size_history_add, adjust_frame_size):
      * src/gtkutil.c (xg_frame_set_char_size):
      * src/keyboard.c (command_loop_1):
      * src/nsfns.m (frame_geometry):
      * src/widget.c (set_frame_size):
      * src/xfaces.c (Fcolor_distance):
      * src/xfns.c (frame_geometry):
      * src/xterm.c (x_set_window_size_1):
      * src/xwidget.c (Fxwidget_size_request):
      Prefer list1i, list2i, etc. to open-coding them.
      * src/charset.c (Fset_charset_priority):
      * src/nsterm.m (append2):
      * src/window.c (window_list):
      * src/xfaces.c (Fx_list_fonts):
      Use nconc2 instead of open-coding it.
      * src/eval.c (eval_sub, backtrace_frame_apply):
      * src/kqueue.c (kqueue_generate_event):
      * src/nsterm.m (performDragOperation:):
      * src/pdumper.c (Fpdumper_stats):
      * src/w32.c (init_environment):
      Prefer list1, list2, etc. to open-coding them.
      * src/font.c (font_list_entities):
      Parenthesize to avoid expanding new ‘list’ macro.
      * src/gtkutil.c (GETSETUP): Rename from MAKE_FLOAT_PAGE_SETUP
      to get lines to fit.  Move outside the ‘list’ call, since it’s
      now a macro.
      * src/keymap.c (Fmake_keymap): Simplify.
      * src/lisp.h (list, pure_list): New macros.
      (list1i): New function.
      5c2563a5
  3. 27 Feb, 2019 1 commit
    • Paul Eggert's avatar
      DEFVAR_INT variables are now intmax_t · e828765d
      Paul Eggert authored
      Formerly they were fixnums, which led to problems when dealing
      with values that might not fit on 32-bit platforms, such as
      string-chars-consed or floats_consed.  64-bit counters should
      be good enough for these (for a while, anyway...).
      While we’re at it, fix some unlikely integer overflow bugs
      that have been in the code for a while.
      * lib-src/make-docfile.c (write_globals):
      * src/data.c (do_symval_forwarding, store_symval_forwarding):
      * src/eval.c (restore_stack_limits, call_debugger):
      * src/frame.h (struct frame.cost_calculation_baud_rate):
      * src/keyboard.c (last_auto_save, bind_polling_period, read_char):
      * src/lisp.h (struct Lisp_Intfwd.intvar):
      * src/lread.c (defvar_int):
      * src/pdumper.c (dump_fwd_int):
      * src/thread.h (struct thread_state.m_lisp_eval_depth):
      * src/undo.c (truncate_undo_list):
      * src/xselect.c (wait_for_property_change)
      (x_get_foreign_selection):
      * src/xterm.c (x_emacs_to_x_modifiers):
      DEFVAR_INT variables now have the C type intmax_t, not EMACS_INT.
      * src/data.c (store_symval_forwarding):
      * src/gnutls.c (Fgnutls_boot):
      * src/keyboard.c (bind_polling_period):
      * src/macros.c (pop_kbd_macro, Fexecute_kbd_macro):
      * src/undo.c (truncate_undo_list):
      Allow any integer that fits into intmax_t, instead of
      requiring it to be a Lisp fixnum.
      * src/dispnew.c (update_window):
      * src/frame.c (x_figure_window_size):
      * src/gnutls.c (init_gnutls_functions)
      (emacs_gnutls_handle_error):
      * src/keyboard.c (make_lisp_event):
      * src/nsterm.m (ns_dumpglyphs_image):
      * src/profiler.c (make_log):
      * src/scroll.c (calculate_scrolling)
      (calculate_direct_scrolling):
      * src/termcap.c (tputs):
      * src/xterm.c (x_draw_image_relief):
      Avoid implementation-defined behavior on conversion of
      out-of-range integers.
      * src/eval.c (when_entered_debugger): Now intmax_t.
      (max_ensure_room): New function, that avoids signed integer overflow.
      (call_debugger, signal_or_quit): Use it.
      * src/fileio.c (Fdo_auto_save):
      * src/keyboard.c (make_lisp_event):
      * src/term.c (calculate_costs):
      * src/xdisp.c (build_desired_tool_bar_string)
      (hscroll_window_tree, try_scrolling, decode_mode_spec)
      (x_produce_glyphs):
      Avoid signed integer overflow.
      * src/lisp.h (clip_to_bounds): Generalize to intmax_t.
      * src/pdumper.c (dump_emacs_reloc_immediate_emacs_int): Remove, ...
      (dump_emacs_reloc_immediate_intmax_t): ... replacing with this
      function.  All uses changed.
      * src/profiler.c (make_log): Omit args.  All callers changed.
      * src/termcap.c: Include stdlib.h, for atoi.
      Include intprops.h.
      * src/window.c (sanitize_next_screen_context_lines): New function.
      (window_scroll_pixel_based, window_scroll_line_based):
      Use it to avoid signed integer overflow.
      e828765d
  4. 15 Jan, 2019 1 commit
    • Daniel Colascione's avatar
      Add portable dumper · d12e5d00
      Daniel Colascione authored
      Add a new portable dumper as an alternative to unexec.  Use it by default.
      
      * src/dmpstruct.awk: New file.
      * src/doc.c (get_doc_string): use will_dump_p().
      * src/editfns.c (styled_format): silence compiler warning
      with UNINIT.
      * src/emacs-module.c (syms_of_module): staticpro ltv_mark.
      * src/emacs.c (gflags): new variable.
      (init_cmdargs): unwrap
      (string_starts_with_p, find_argument, dump_error_to_string)
      (load_pdump): new functions.
      (main): detect pdumper and --temacs invocation; actually load
      portable dump when detected; set gflags as appropriate; changes to
      init functions throughout to avoid passing explicit
      'initialized' argument.
      * src/eval.c (inhibit_lisp_code): remove unused variable.
      (init_eval_once_for_pdumper): new function.
      (init_eval_once): call it.
      * src/filelock.c: CANNOT_DUMP -> will_dump_p()
      * src/fingerprint-dummy.c: new file
      * src/fingerprint.h: new file
      * src/fns.c: CANNOT_DUMP -> will_dump_p(), etc.
      (weak_hash_tables): remove
      (hashfn_equal, hashfn_eql): un-staticify
      (make_hash_table): set new 'next_weak' hash table field; drop
      global weak_hash_tables logic.
      (copy_hash_table): drop global weak_hash_tables logic.
      (hash_table_rehash): new function.
      (hash_lookup, hash_put, hash_remove_from_table, hash_clear):
      rehash if needed.
      (sweep_weak_table): un-staticify; explain logic; bool-ify.
      (sweep_weak_hash_tables): remove function.
      * src/font.c (syms_of_font): remember pdumper stuff.
      * src/fontset.c (syms_of_fontset): remember pdumper stuff.
      * src/frame.c (make_initial_frame): don't reset Vframe_list.
      (init_frame_once_for_pdumper, init_frame_once): new functions.
      (syms_of_frame): remove redundant staticpro.
      * src/fringe.c (init_fringe_once_for_pdumper): new functin.
      (init_fringe_once): call it.
      * src/ftcrfont.c (syms_of_ftcrfont_for_pdumper): new function.
      (syms_of_ftcrfont): call it.
      * src/ftfont.c (syms_of_ftfont_for_pdumper): new function.
      (syms_of_ftfont): call it.
      * src/ftxont.c (syms_of_ftxfont_for_pdumper): new function.
      (syms_of_ftxfont): call it.
      * src/gmalloc.c: adjust for pdumper througout
      (DUMPED): remove weird custom dumped indicator.
      * src/gnutls.c (syms_of_gnutls): pdumper note for
      gnutls_global_initialized.
      * src/image.c (syms_of_image): add pdumper comment,
      initializer note.
      * src/insdel.c (prepare_to_modify_buffer_1): account
      for buffer contents possibly being in dump image.
      * src/keyboard.c (syms_of_keyboard_for_pdumper): new function.
      (syms_of_keyboard): staticpro more; call pdumper syms function.
      * src/lisp.h: add comments throughout
      (gflags): declare.
      (will_dump_p, will_bootstrap_p, will_dump_with_pdumper_p)
      (dumped_with_pdumper_p, will_dump_with_unexec_p)
      (dumped_with_unexec_p, definitely_will_not_unexec_p): new
      functions.
      (POWER_OF_2, ROUNDUP): move macros.
      (PSEUDOVECTOR_TYPE, PSEUDOVECTOR_TYPEP): take vectorlike header
      pointer instead of vector; constify.
      (Lisp_Hash_Table): add comment about need to rehash on access; add
      comment for next_weak.
      (HASH_KEY, HASH_VALUE, HASH_HASH, HASH_TABLE_SIZE): const-ify.
      (hash_table_rehash): declare.
      (hash_rehash_needed_p, hash_rehash_if_needed): new functions.
      (finalizers, doomed_finalizers): declare extern.
      (SUBR_SECTION_ATTRIBUTE): new macro.
      (staticvec, staticidx): un-static-ify.
      (sweep_weak_hash_tables): remove declaration.
      (sweep_weak_table): declare.
      (hashfn_eql, hashfn_equal): declare.
      (number_finalizers_run): new variable.
      (Vdead): externify when ENABLE_CHECKING.
      (gc_root_type): new enumeration.
      (gc_root_visitor): new struct.
      (visit_static_gc_roots): declare.
      (vectorlike_nbytes): declare.
      (vector_nbytes): define as trivial inline function wrapper for
      vectorlike_nbytes.
      (init_obarray_once): change signature.
      (primary_thread): extern-ify.
      (init_buffer): change signature.
      (init_frame_once): declare.
      * src/lread.c (readevalloop): adjust for new dumped predicates.
      (init_obarray_once): new function.
      (ndefsubr): new variable.
      (defsubr): increment it.
      (load_path_check): adjust for pdumper.
      (load_path_default): use pdumper functions; adjust for
      dump search.
      * src/macfont.m (macfont_init_font_change_handler): avoid
      shadowing global.
      (syms_of_macfont_for_pdumper): new function.
      (syms_of_macfont): call it.
      * src/menu.c (syms_of_menu): staticpro more stuff.
      * src/minibuf.c (Ftry_completion): rehash if needed.
      (init_minibuf_once_for_pdumper): new function.
      (init_minibuf_once): call it.
      * src/nsfont.m (syms_of_nsfns): staticpro more.
      * src/nsfont.m (syms_of_nsfont_for_pdumper): new function.
      (syms_of_nsfont): call it.
      * src/nsterm.m (syms_of_nsfont): remember pdumper stuff.
      * src/pdumper.c: new file.
      * src/pdumper.h: new file.
      * src/process.c (init_process_emacs): use new pdumper functions
      instead of CANNOT_DUMP.
      * src/profiler.c (syms_of_profiler_for_pdumper): new function.
      (syms_of_profiler_for_pdumper): call it.
      * src/search.c (syms_of_search_for_pdumper): new function.
      (syms_of_search_for_pdumper): call it.
      * src/sheap.c (bss_sbrk_did_unexec): remove.
      * src/sheap.h (bss_sbrk_did_unexec): remove.
      * src/syntax.c (syms_of_syntax): don't redundantly staticpro
      re_match_object.
      * src/sysdep.c: use will_dump_with_unexec_p() instead of bss
      hack thing.
      * src/syssignals.h (init_sigsegv): declare.
      * src/systime.h (init_timefns): remove bool from signature.
      * src/textprop.c (syms_of_textprop): move staticpro.
      * src/thread.c (main_thread_p): constify.
      * src/thread.h (main_thread_p): constify.
      * src/timefns.c (init_timefns): remove bool from signature.
      (syms_of_timefns_for_pdumper): new function.
      (syms_of_timefns): call it.
      * src/w32.c: rearrange code.
      * src/w32.h (w32_relocate): declare.
      * src/w32fns.c (syms_of_w32fns): add pdumper note.
      * src/w32font.c (syms_of_w32font_for_pdumper): new function.
      (syms_of_w32font): call it.
      * src/w32heap.c (using_dynamic_heap): new variable.
      (init_heap): use it.
      * src/w32menu.c (syms_of_w32menu): add pdumper note.
      * src/w32proc.c
      (ctrl_c_handler, mainCRTStartup, _start, open_input_file)
      (rva_to_section, close_file_data): move here.
      * src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper):
      new function.
      (syms_of_w32uniscribe): call it.
      * src/window.c (init_window_once_for_pdumper): new function.
      (init_window_once): call it; staticpro more stuff.
      * src/xfont.c (syms_of_xfont_for_pdumper): new function.
      (syms_of_xfont): call it.
      * src/xftfont.c (syms_of_xftfont_for_pdumper): new function.
      (syms_of_xftfont): call it.
      * src/xmenu.c (syms_of_xmenu_for_pdumper): new function.
      (syms_of_xmenu): call it.
      * src/xselect.c (syms_of_xselect_for_pdumper): new function.
      (syms_of_xselect): call it.
      * src/xsettings.c (syms_of_xsettings): add more pdumper notes.
      * src/term.c (syms_of_xterm): add pdumper note.
      
      * src/dispnew.c (init_faces_initial): new function.
      (init_display_interactive): rename from init_display; use
      will_dump_p instead of !initialized.  Initialize faces early for
      pdumper if needed.
      (init_display): new function.
      (syms_of_display_for_pdumper): new function.
      (syms_of_display): call it.
      
      * src/dbusbind.c (syms_of_dbusbind): Add TODO for bus reset
      on pdumper load.
      
      * src/data.c (Fdefalias): Use will_dump_p
      instead of Vpurify_flag.
      (Fmake_variable_buffer_local): silence compiler warning with -Og
      by making valcontents UNINIT.
      (arith_driver): silence compiler warning with UNINIT.
      
      * src/conf_post.h (ATTRIBUTE_SECTION): new macro.
      
      * src/composite.c (composition_gstring_put_cache): rehash hash
      table if needed.
      
      * src/coding.c (init_coding_once, syms_of_coding): remember
      pdumper stuff.
      
      * src/charset.h (charset_table_size, charset_table_user): declare.
      
      * src/charset.c (charset_table_used, charset_table_size): un-static.
      (init_charset_oncem, syms_of_charset): remember pdumper stuff.
      
      * src/category.c (category_table_version): remove obsolete
      variable.
      
      * src/callint.c (syms_of_callint): staticpro 'preserved_fns'
      (init_callproc): use will_dump_p instead of !CANNOT_DUMP.
      
      * src/bytecode.c (exec_byte_code): rehash table tables if needed
      
      * src/buffer.c (alloc_buffer_text, free_buffer_text): account for
      pdumper
      (init_buffer_once): add TODO; remember stuff for pdumper.
      (init_buffer): don't take initialized argument; adjust
      for pdumper.
      
      * src/atimer.c (init_atimer): initialize subr only if
      !initialized.
      
      * src/alloc.c: (vector_marked_p, set_vector_marked)
      (vectorlike_marked_p, set_vectorlike_marked, cons_marked_p)
      (set_cons_marked, string_marked_p, set_string_marked)
      (symbol_marked_p, set_symbol_marked, interval_marked_p)
      (set_interval_marked): new accessor routines.  Use them
      instead of raw GC access throughout.
      (Vdead): make non-static when ENABLE_CHECKING.
      (vectorlike_nbytes): rename of 'vector_nbytes'; take a vectorlike
      header as input instead of a vector.
      (number_finalizers_run): new internal C variable.
      (mark_maybe_object): check for pdumper objects.
      (valid_pointer_p): don't be gratuitously inefficient under rr(1).
      (make_pure_c_string): add support for size_byte = -2 mode
      indicating that string data points into Emacs image rodata.
      (visit_vectorlike_root): visits GC roots embedded in
      vectorlike objects.
      (visit_buffer_root): visits GC roots embedded in
      our totally-not-a-buffer buffer global objects.
      (visit_static_gc_roots): visit GC roots in the Emacs data section.
      (mark_object_root_visitor): root callback used for conventional GC
      marking
      (weak_hash_tables): new internal variable for tracking found weak
      hash tables during GC.
      (mark_and_sweep_weak_table_contents): new weak hash table marking.
      (garbage_collect_1): use new GC root visitor machinery.
      (mark_vectorlike): accept a vectorlike_header instead of a
      Lisp_Vector.
      (mark_frame, mark_window, mark_hash_table): new functions.
      (mark_object): initialize 'm'; check for pdumper objects and use
      new mark-bit accessors throughout.  Remove some object-specific
      marking code and move to helper functions above.
      (survives_gc_p): check for pdumper objects.
      (gc-sweep): clear pdumper mark bits.
      (init_alloc_once_for_pdumper): new helper function for early init
      called both during normal init and pdumper load.
      (init_alloc_once): pdumper integration.
      
      * src/Makefile.in: Rewrite dumping for pdumper; add pdumper.o;
      invoke temacs with --temacs command line option; build dmpstruct.h
      from dmpstruct.awk; stop relying on CANNOT_DUMP; clean up pdumper
      intermediate files during build.
      
      * nextstep/Makefile.in: build emacs.pdmp into NS packages
      
      * lisp/startup.el: account for new '--temacs' and '--dump-file'
      command line option.
      
      * lisp/loadup.el: rewrite early init to account for pdumper; use
      injected 'dump-mode' variable (set via the new '--temacs' option)
      instead of parsing command line.
      
      * lisp/cus-start.el: Check 'dump-mode' instead of 'purify-flag',
      since the new 'dump-mode'
      
      * lib-src/make-fingerprint.c: new program
      
      * lib-src/Makefile.in: built make-fingerprint utility program
      
      * configure.ac: Add --with-pdumper toggle to control pdumper
      support; add --with-unexec toggle to control unexec support.
      Add --with-dumping option to control which dumping strategy we use
      by default.  Adjust for pdumper throughout.  Check for
      posix_madvise.
      
      * Makefile.in: Add @DUMPING@ substitution; add pdumper mode.
      
      * .gitignore: Add make-fingerprint, temacs.in, fingerprint.c,
      dmpstruct.h, and pdumper dump files.
      d12e5d00
  5. 11 Jan, 2019 1 commit
    • Martin Rudalics's avatar
      Run window change functions during redisplay · e567ac14
      Martin Rudalics authored
      * doc/lispref/windows.texi (Window Sizes): Move (and rename)
      descriptions of 'window-pixel-height-before-size-change' and
      'window-pixel-width-before-size-change' to Window Hooks
      section.
      (Window Configurations): Remove warning against use of
      'save-window-excursion' in 'window-size-change-functions'.
      (Window Hooks): Rewrite section according to redesign of
      window change functions.
      * lisp/erc/erc-track.el (erc-window-configuration-change)
      (erc-modified-channels-update): Call latter directly from
      'window-configuration-change-hook' instead via
      'post-command-hook'.
      * lisp/frame.el (frame-size-changed-p): Change nomenclature
      in let bindings.
      * lisp/net/rcirc.el (rcirc-window-configuration-change)
      (rcirc-window-configuration-change-1): Call latter directly
      from 'window-configuration-change-hook' instead via
      'post-command-hook'.
      * lisp/window.el (window-pixel-width-before-size-change)
      (window-pixel-height-before-size-change): Defalias.
      (window--resize-mini-window, window-resize)
      (adjust-window-trailing-edge, delete-window)
      (delete-other-windows, balance-windows): Don't run
      'window-configuration-change-hook' any more from here.
      (split-window): Don't run 'window-configuration-change-hook'
      from here.  'run-window-scroll-functions' from here.
      (window--adjust-process-windows): Run from
      'window-configuration-change-hook' only.
      * src/frame.c (old_selected_frame): New Lisp variable.
      (make_frame): Initialize frame's change_stamp slot.
      (Fold_selected_frame): New function.
      * src/frame.h (struct frame): New slots old_selected_window,
      window_change, change_stamp and number_of_windows.
      (fset_old_selected_window): New inlined function.
      (FRAME_WINDOW_CHANGE, FRAME_OLD_SELECTED_WINDOW): New macros.
      * src/window.c (old_selected_window): New Lisp variable.
      (wset_old_buffer): New inlined function.
      (Fframe_old_selected_window, Fold_selected_window)
      (Fwindow_old_buffer): New functions.
      (Fwindow_old_pixel_width, Fwindow_old_pixel_height): Rename
      from Fwindow_pixel_width_before_size_change and
      Fwindow_pixel_height_before_size_change.  Update doc-strings.
      (Fwindow_old_body_pixel_width, Fwindow_old_body_pixel_height):
      New functions.
      (Fdelete_other_windows_internal): Set frame's window_change
      slot instead of running 'window-configuration-change-hook'.
      (Frun_window_configuration_change_hook): In doc-string tell
      that this function is no more needed.
      (Frun_window_scroll_functions): Amend doc-string.  Run with
      window's buffer current.
      (window_sub_list, window_change_record_windows)
      (window_change_record_frame, window_change_record)
      (run_window_change_functions_1, run_window_change_functions):
      New functions.
      (set_window_buffer): Set frame's window_change slot instead of
      running 'window-configuration-change-hook'.
      (make_window): Don't initialize pixel_width_before_size_change
      and pixel_height_before_size_change slots.
      (window_resize_apply, Fdelete_window_internal): Set frame's
      window_change slot.
      (Fsplit_window_internal): Set frame's window_change slot.
      Don't run 'window-scroll-functions' from here.
      * src/window.h (struct window): New slots old_buffer,
      change_stamp, old_pixel_width (renamed from
      pixel_width_before_size_change), old_pixel_height (renamed
      from pixel_height_before_size_change), old_body_pixel_width
      and old_body_pixel_height.
      * src/xdisp.c (init_iterator): Set frame's window_change slot
      when the body height or width changes.
      (prepare_menu_bars): Don't run_window_size_change_functions.
      (redisplay_internal): Don't run_window_size_change_functions,
      run_window_change_functions instead.
      e567ac14
  6. 09 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Use shortcuts for Flength · a8465033
      Paul Eggert authored
      When calculating the length of a Lisp object whose type is
      known, use a specialized length operation on it to save a bit
      of runtime overhead.
      * src/callint.c (Fcall_interactively):
      * src/minibuf.c (read_minibuf_unwind):
      Use ASIZE rather than Flength on values that must be vectors.
      * src/charset.c (Fsort_charsets):
      * src/coding.c (detect_coding_sjis):
      (Fdefine_coding_system_internal):
      * src/data.c (wrong_choice):
      * src/eval.c (Flet, eval_sub, Fapply, apply_lambda):
      * src/fns.c (sort_list):
      * src/font.c (font_vconcat_entity_vectors)
      (font_find_for_lface):
      * src/frame.c (Fmodify_frame_parameters):
      * src/fringe.c (get_logical_fringe_bitmap):
      * src/ftfont.c (ftfont_get_open_type_spec):
      * src/gtkutil.c (xg_print_frames_dialog):
      * src/lread.c (read1, read_vector):
      * src/keymap.c (Fkey_description):
      * src/kqueue.c (Fkqueue_add_watch):
      * src/macfont.m (macfont_get_open_type_spec):
      * src/menu.c (parse_single_submenu, x_popup_menu_1):
      * src/minibuf.c (Finternal_complete_buffer):
      * src/nsfont.m (ns_findfonts, nsfont_list_family):
      * src/process.c (Fmake_process):
      * src/search.c (Fset_match_data):
      * src/xfaces.c (Fx_family_fonts):
      Use list_length rather than Flength on values that must be lists.
      * src/fns.c (list_length): New function.
      (Flength): Use it.
      * src/nsfont.m (ns_findfonts):
      Use !NILP (x) rather than XFIXNUM (Flength (x)) != 0.
      * src/xdisp.c (store_mode_line_string):
      Use SCHARS rather than Flength on values that must be strings.
      a8465033
  7. 01 Jan, 2019 1 commit
  8. 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
  9. 13 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Pacify gcc -Og -Wuninitialized · a1e0868f
      Paul Eggert authored
      This addresses the -Og uninitialized variable warnings I ran
      into on Fedora 28, which uses 8.1.1 20180712 (Red Hat 8.1.1-5).
      It also changes some explicit initializations to UNINIT
      when the variable does not actually need to be initialized.
      * src/process.c (connect_network_socket):
      * src/sysdep.c (system_process_attributes):
      * src/xfns.c (x_real_pos_and_offsets):
      * src/xterm.c (get_current_wm_state) [USE_XCB]:
      Add UNINIT.
      * src/editfns.c (tzlookup):
      * src/fns.c (Fnconc):
      * src/font.c (font_parse_fcname):
      * src/frame.c (x_set_frame_parameters):
      Prefer UNINIT to explicit initialization.
      a1e0868f
  10. 12 Aug, 2018 1 commit
    • Eli Zaretskii's avatar
      ; Avoid compilation warnings under -Og · d9806a55
      Eli Zaretskii authored
      * src/w32.c (w32_read_registry):
      * src/font.c (font_parse_fcname):
      * src/fns.c (Fnconc):
      * src/editfns.c (tzlookup):
      * src/frame.c (x_set_frame_parameters): Avoid compiler warnings
      about maybe-uninitialized variables.
      d9806a55
  11. 08 Aug, 2018 1 commit
    • Tom Tromey's avatar
      More macro renamings for bignum · d1ec3a0a
      Tom Tromey authored
      * src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
      src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
      src/category.c, src/ccl.c, src/character.c, src/character.h,
      src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
      src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
      src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
      src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
      src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
      src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
      src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
      src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
      src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
      src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
      src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
      src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
      src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
      src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
      src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
      src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
      src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
      src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
      src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
      Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
      d1ec3a0a
  12. 20 Jul, 2018 1 commit
    • Paul Eggert's avatar
      Prefer NILP (x) to EQ (x, Qnil) · fb24ce37
      Paul Eggert authored
      This simplifies the code a bit, and also simplifies some
      potential future changes slightly (e.g., altering eq vs eql).
      * src/alloc.c (mark_object):
      * src/callint.c (fix_command):
      * src/chartab.c (Fchar_table_range, Fset_char_table_range):
      * src/dbusbind.c (XD_OBJECT_TO_DBUS_TYPE, xd_signature):
      * src/dired.c (Fsystem_users):
      * src/fileio.c (Fdo_auto_save):
      * src/fns.c (concat):
      * src/frame.c (get_frame_param, frame_inhibit_resize)
      (store_in_alist, store_frame_param, x_set_autoraise)
      (x_set_autolower, x_get_arg):
      * src/image.c (Fclear_image_cache):
      * src/intervals.c (intervals_equal):
      * src/intervals.h (DEFAULT_INTERVAL_P):
      * src/lread.c (substitute_object_recurse):
      * src/menu.c (digest_single_submenu)
      (find_and_call_menu_selection)
      (find_and_return_menu_selection):
      * src/nsfns.m (x_set_icon_name, Fx_create_frame):
      * src/nsmenu.m (ns_menu_show):
      * src/nsselect.m (ns_string_to_pasteboard_internal)
      (Fns_selection_exists_p, Fns_selection_owner_p):
      * src/process.c (Faccept_process_output)
      (wait_reading_process_output):
      * src/terminal.c (store_terminal_param):
      * src/textprop.c (verify_interval_modification):
      * src/xdisp.c (next_element_from_buffer):
      * src/xfaces.c (Finternal_set_lisp_face_attribute):
      * src/xfns.c (x_set_icon_type, Fx_synchronize):
      * src/xmenu.c (x_menu_show):
      * src/xselect.c (Fx_selection_owner_p)
      (Fx_selection_exists_p):
      * src/xwidget.c (xwidget_view_lookup):
      Prefer NILP (x) to EQ (x, Qnil).
      fb24ce37
  13. 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
  14. 11 Jun, 2018 2 commits
    • Daniel Colascione's avatar
      Add after-delete-frame-functions · 0626d5ab
      Daniel Colascione authored
      Instead of working around the behavior delete-frame-functions, just
      add an after-delete-frame-functions hook.
      
      * doc/lispref/frames.texi (Deleting Frames): Document
      `after-delete-frame-functions'.
      
      * etc/NEWS: Mention `after-delete-frame-functions'.
      
      * lisp/frame.el (blink-cursor--should-blink):
      (blink-cursor--rescan-frames, blink-frame-mode): Get rid of the
      ugly ignored-frame parameter and switch from
      `delete-frame-functions' to `after-delete-frame-functions'.
      
      * src/frame.c (syms_of_frame): New variable
      `after-delete-frame-functions'.
      (delete_frame): Use it.
      0626d5ab
    • Daniel Colascione's avatar
      New focus management interface · 2f6c6820
      Daniel Colascione authored
      focus-in-hook and focus-out-hook don't accurately reflect actual
      user-visible focus states.  Add a new focus interface and mark the old
      one obsolete.
      
      * doc/lispref/frames.texi (Input Focus): Document new focus
      functions.  Remove references to the now-obsolete focus hooks.
      
      * lisp/frame.el (frame-focus-state): New function.
      (after-focus-change-function): New variable.
      (focus-in-hook, focus-out-hook): Move to lisp from C;
      mark obsolete.
      
      * lisp/term/xterm.el (xterm-translate-focus-in)
      (xterm-translate-focus-out): Track tty focus in `tty-focus-state'
      terminal parameter; call `after-focus-change-function'.
      (xterm--suspend-tty-function): New function.
      
      * src/frame.c (Fhandle_switch_frame): Update docstring; don't call
      focus hooks.
      (focus-in-hook, focus-out-hook): Remove: moved to lisp.
      (syms_of_frame): Remove unread_switch_frame; add
      Vunread_switch_frame.
      
      * src/keyboard.c:
      (Finternal_handle_focus_in): New function.
      (make_lispy_event): Always report focus events to lisp; don't
      translate them to switch events sometimes.  Lisp can take care of
      creating synthetic switch-frame events via
      `internal-handle-focus-in'.
      
      * src/w32term.c (x_focus_changed): Remove switch-avoidance logic:
      just directly report focus changes to lisp.
      
      * src/xterm.c (x_focus_changed): Remove switch-avoidance logic:
      just directly report focus changes to lisp.
      2f6c6820
  15. 01 May, 2018 1 commit
    • Paul Eggert's avatar
      Port --enable-gcc-warnings to GCC 8 · 65ac2778
      Paul Eggert authored
      Backport from master.
      * lib-src/emacsclient.c (fail):
      Do not dereference a null pointer.
      * src/frame.c (delete_frame):
      Add a decl with UNINIT to work around GCC bug 85563.
      * src/menu.h (finish_menu_items):
      Do not use attribute const.
      * src/regex.c (analyze_first): Use FALLTHROUGH, not a comment.
      65ac2778
  16. 28 Apr, 2018 1 commit
    • Paul Eggert's avatar
      Port --enable-gcc-warnings to GCC 8 · 8c3215e7
      Paul Eggert authored
      * configure.ac: Do not use GCC 8’s new -Wcast-align flag.
      * lib-src/ebrowse.c (xmalloc):
      * lib-src/emacsclient.c (xmalloc, xstrdup):
      * lib-src/etags.c (xmalloc):
      * lib-src/make-docfile.c (xmalloc):
      * lib-src/movemail.c (xmalloc):
      * src/dispnew.c (new_glyph_pool):
      * src/regex.c (xmalloc):
      * src/term.c (tty_menu_create):
      * src/tparam.h (tparam):
      Use ATTRIBUTE_MALLOC.  Also see GCC bug 85562.
      * lib-src/emacsclient.c (fail):
      Do not dereference a null pointer.
      * src/frame.c (delete_frame):
      Add a decl with UNINIT to work around GCC bug 85563.
      * src/menu.h (finish_menu_items):
      Do not use attribute const.
      * src/regex.c (analyze_first): Use FALLTHROUGH, not a comment.
      8c3215e7
  17. 07 Mar, 2018 1 commit
    • Glenn Morris's avatar
      Replace some obsolete aliases in documentation · 19afff31
      Glenn Morris authored
      * doc/emacs/text.texi (Nroff Mode):
      * doc/misc/efaq.texi (How to add fonts):
      * lisp/gnus/nnheader.el (nnheader-insert-file-contents):
      * lisp/progmodes/pascal.el (pascal-outline-mode):
      Doc fixes re obsolete aliases.
      ; * src/frame.c (do_switch_frame): Comment.
      19afff31
  18. 13 Feb, 2018 1 commit
    • Glenn Morris's avatar
      Stop keeping multiple doc copies for items defined multiple times · 4bee1b8b
      Glenn Morris authored
      It was always a nuisance to keep all the copies in sync.
      * src/doc.c (Fsnarf_documentation): Don't skip entire files.
      Instead, skip individual doc strings starting with "SKIP".
      * doc/lispref/internals.texi (Writing Emacs Primitives):
      Mention this skipping.
      * lisp/term/ns-win.el, lisp/term/pc-win.el, src/dosfns.c:
      * src/frame.c, src/nsfns.m, src/nsmenu.m, src/nsterm.m:
      * src/w16select.c, src/w32fns.c, src/w32menu.c, src/w32select.c:
      * src/w32term.c, src/xmenu.c: Remove duplicated doc strings.
      * src/xfns.c: Merge in information from doc string duplicates.
      4bee1b8b
  19. 12 Feb, 2018 1 commit
    • Eli Zaretskii's avatar
      Avoid aborts in cm.c due to too small TTY frame · a22820a3
      Eli Zaretskii authored
      * src/frame.c (frame_windows_min_size): Limit TTY frames to a
      minimum height large enough to allow for a menu bar, the mode
      line, one text line and one echo-area line.  This avoids aborts in
      cm.c:cmcheckmagic.  (Bug#30320)
      a22820a3
  20. 18 Jan, 2018 1 commit
    • Martin Rudalics's avatar
      Fix some tooltip related problems · e462308f
      Martin Rudalics authored
      Replace 'tooltip' frame parameter with a 'tooltip' member in
      the frame structure.  For GTK+ builds use 'tip_last_frame' to
      find the frame for which the currently visible tooltip was
      made.  For modeline help-echoing have tooltips show applicable
      actions only.
      
      * lisp/bindings.el (mode-line-default-help-echo): New function
      as default value of homonymous option.
      * src/dispextern.h (tip_frame, tip_window): Remove
      declarations.
      * src/frame.c (make_frame): Initialize new frame structure
      member 'tooltip'.
      (Fframe_list, other_frames): Rewrite with new macro
      FRAME_TOOLTIP_P.
      * src/frame.h (struct frame): New member 'tooltip'.
      (FRAME_TOOLTIP_P): New macro.
      * src/gtkutil.c (xg_prepare_tooltip, xg_hide_tooltip): Rewrite
      using boolean return values.
      * src/nsfns.m (tip_frame): Remove declaration.
      * src/w32fns.c (w32_display_monitor_attributes_list)
      (w32_display_monitor_attributes_list_fallback): Rewrite with
      new macro FRAME_TOOLTIP_P.
      (tip_last_string, tip_last_frame, tip_last_parms): New Lisp
      scalars replacing Lisp vector last_show_tip_args.
      (x_create_tip_frame): Set new frame's 'tooltip' structure
      member to true.
      (x_hide_tip): Additionally test tip_frame for liveness.
      (Fx_show_tip): Handle last_show_tip_args to tip_last_frame,
      tip_last_string and tip_last_parms conversion.
      (syms_of_w32fns): staticpro tip_last_frame, tip_last_string
      and tip_last_parms instead of last_show_tip_args.
      * src/w32term.c (w32_read_socket, x_new_font): Rewrite with
      new macro FRAME_TOOLTIP_P.
      * src/w32term.h (tip_window): Add external declaration.
      * src/xdisp.c (x_consider_frame_title, prepare_menu_bars)
      (should_produce_line_number): Rewrite with new macro
      FRAME_TOOLTIP_P.
      (note_mode_line_or_margin_highlight): If
      `mode-line-default-help-echo' specifies a function, call it to
      produce help echo string.
      * src/xfns.c (x_make_monitor_attribute_list)
      (Fx_display_monitor_attributes_list): Rewrite with
      new macro FRAME_TOOLTIP_P.
      (tip_last_string, tip_last_frame, tip_last_parms): New Lisp
      scalars replacing Lisp vector last_show_tip_args.
      (x_create_tip_frame): Set new frame's 'tooltip' structure
      member to true.
      (x_hide_tip): Rewrite with additional tests of frames for
      liveness and taking into account that for GTK+ tips the
      reference frame is now stored in tip_last_frame instead of
      tip_frame.
      (Fx_show_tip): Handle last_show_tip_args to tip_last_frame,
      tip_last_string and tip_last_parms conversion.  For GTK+ store
      FRAME argument in tip_last-frame.
      (syms_of_xfns): staticpro tip_last_frame, tip_last_string
      and tip_last_parms instead of last_show_tip_args.
      * src/xterm.c (x_update_begin, handle_one_xevent, x_new_font)
      (x_set_window_size): Rewrite with new macro FRAME_TOOLTIP_P.
      * src/xterm.h (tip_window): Add external declaration.
      * etc/NEWS: Mention new modeline tooltips behavior.
      e462308f
  21. 01 Jan, 2018 1 commit
  22. 15 Dec, 2017 2 commits
    • Paul Eggert's avatar
      FOR_EACH_FRAME no longer assumes frame-list · e019c35d
      Paul Eggert authored
      This cleans up a recent fix related to Bug#29661.
      Suggested by Stefan Monnier in:
      https://lists.gnu.org/r/emacs-devel/2017-12/msg00544.html
      * src/frame.c (next_frame, prev_frame, delete_frame):
      Restore debugging checks that Vframe_list is non-nil,
      as FOR_EACH_FRAME no longer has these checks.
      (delete_frame): Remove no-longer-needed checks that Vframe_list is
      non-nil, as FOR_EACH_FRAME no longer assumes that.
      * src/frame.h (FOR_EACH_FRAME): Do not assume Vframe_list is non-nil.
      e019c35d
    • Martin Rudalics's avatar
      Don't run FOR_EACH_FRAME when there's no frame left (Bug#29961) · 9bf66c6b
      Martin Rudalics authored
      This does not fix Bug#29961 but avoids that Emacs segfaults when
      trying to shut down because it lost connection to the X server.
      
      * src/dispnew.c (check_glyph_memory):
      * src/frame.c (delete_frame): Don't run FOR_EACH_FRAME when
      there's no frame left (Bug#29961).
      9bf66c6b
  23. 12 Dec, 2017 1 commit
    • Paul Eggert's avatar
      Narrow pointer bounds when appropriate · 4295050e
      Paul Eggert authored
      This typically occurs in a storage manager, where the caller
      is expected to access only the newly-allocated object,
      instead of using the returned value to access unrelated
      parts of the heap.
      * src/alloc.c (allocate_string, allocate_string_data)
      (compact_small_strings, find_string_data_in_pure)
      (sweep_strings, setup_on_free_list, allocate_vectorlike
      (pure_alloc):
      * src/bytecode.c (exec_byte_code):
      * src/callint.c (Fcall_interactively):
      * src/dispnew.c (scrolling):
      * src/editfns.c (styled_format):
      * src/frame.c (xrdb_get_resource, x_get_resource_string):
      * src/fringe.c (Fdefine_fringe_bitmap):
      * src/gmalloc.c (malloc, realloc, aligned_alloc):
      Narrow pointer bounds when appropriate.
      * src/alloc.c (SDATA_OF_STRING):
      * src/lisp.h (make_lisp_symbol) [__CHKP__]:
      Widen bounds here, though.
      * src/bytecode.c, src/callint.c, src/dispnew.c, src/editfns.c:
      * src/emacs.c, src/frame.c, src/fringe.c:
      Include ptr-bounds.h.
      * src/ptr-bounds.h (ptr_bounds_clip): New function.
      4295050e
  24. 26 Nov, 2017 1 commit
  25. 18 Nov, 2017 1 commit
  26. 11 Nov, 2017 1 commit
    • Eli Zaretskii's avatar
      Fix comparisons with tip_frame in GTK builds · 7657a867
      Eli Zaretskii authored
      * src/xterm.c (x_update_begin, x_new_font):
      * src/xfns.c (Fx_display_monitor_attributes_list):
      * src/frame.c (Fframe_list) [USE_GTK]: Don't consider tip_frame a
      tooltip frame unless its 'tooltip' parameter is non-nil.  (Bug#26747)
      7657a867
  27. 29 Oct, 2017 1 commit
    • Martin Rudalics's avatar
      Fix minibuffer window related docs and strings (Bug#28978) · 4189d0ef
      Martin Rudalics authored
      * src/frame.c (Vdefault_minibuffer_frame): Fix doc-string.
      * src/window.c (Fminibuffer_selected_window): Fix doc-string.
      * doc/lispref/frames.texi (Buffer Parameters): Rewrite
      description of `minibuffer' parameter.
      * doc/lispref/minibuf.texi (Minibuffer Windows): Reorder
      entries and partly rewrite section.
      (Minibuffer Misc): Clarify description of
      `minibuffer-selected-window'.
      * etc/NEWS: Mention new semantics of 'minibuffer' frame
      parameter.
      4189d0ef
  28. 02 Oct, 2017 2 commits
    • Eli Zaretskii's avatar
      Fix the --without-x build · d09ac150
      Eli Zaretskii authored
      * src/frame.c (Ficonify_frame) [HAVE_WINDOW_SYSTEM]: Use
      frame_parent only in GUI builds to avoid compilation errors in
      --without-x builds.  (Bug#28611)
      d09ac150
    • Paul Eggert's avatar
      Prefer HTTPS to HTTP for gnu.org · 5172fa02
      Paul Eggert authored
      This fixes some URLs I omitted from my previous pass,
      notably those in lists.gnu.org.  Although lists.gnu.org
      does not yet support TLS 1.1, TLS 1.0 is better than nothing.
      * lisp/erc/erc.el (erc-official-location):
      * lisp/mail/emacsbug.el (report-emacs-bug):
      Use https:, not http:.
      5172fa02
  29. 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
  30. 03 Sep, 2017 1 commit
  31. 23 Aug, 2017 1 commit
    • Alan Third's avatar
      Add ability to change macOS WM theme (bug#27973) · 7baa50ec
      Alan Third authored
      * src/frame.c (make_frame, frame_parms, syms_of_frame)
      [NS_IMPL_COCOA]: Add ns-appearance and ns-transparent-titlebar
      options.
      * src/frame.h (ns_appearance_type) [NS_IMPL_COCOA]: Add enum to
      represent NSAppearance options.
      (struct frame) [NS_IMPL_COCOA]: Add ns_appearance and
      ns_transparent_titlebar frame parameters.
      * src/nsfns.m (ns_frame_parm_handlers) [NS_IMPL_COCOA]: Add
      ns_set_appearance and ns_set_transparent_titlebar handlers.
      (Sx_create_frame): Handle ns-appearance and ns-transparent-titlebar
      frame parameters.
      (Qdark): Add new symbol for use with ns-appearance.
      * src/nsterm.h (ns_set_appearance, ns_set_transparent_titlebar)
      [NS_IMPL_COCOA]: Add prototypes.
      * src/nsterm.m (ns_set_appearance, ns_set_transparent_titlebar)
      [NS_IMPL_COCOA]: New functions.
      (initFrameFromEmacs) [NS_IMPL_COCOA]: Handle ns-appearance and
      ns-transparent-titlebar frame parameters.
      * doc/lispref/frames.texi (Window Management Parameters): Document
      ns-apperance and ns-transparent-titlebar.
      7baa50ec
  32. 01 Oct, 2017 1 commit
    • Martin Rudalics's avatar
      Improve handling of iconification of child frames (Bug#28611) · b03b4f6d
      Martin Rudalics authored
      * src/frame.c (Ficonify_frame): Handle `iconify-child-frame' option.
      (syms_of_frame): New symbols Qiconify_top_level and Qmake_invisible.
      (iconify_child_frame): New option.
      * lisp/cus-start.el (iconify-child-frame): Add customization
      properties.
      * doc/lispref/frames.texi (Child Frames): Describe new option
      `iconify-child-frame'.  Don't index "top-level frame" twice.
      b03b4f6d
  33. 25 Jun, 2017 2 commits
    • Paul Eggert's avatar
      Port recent frame changes to GCC 7 · b2f81598
      Paul Eggert authored
      * src/frame.c (keep_ratio): New arg P.  Caller changed.  Since it
      is non-null, it avoids a GCC 7 warning that FRAME_PARENT_FRAME
      might return null.  This also avoids a run-time test.
      b2f81598
    • Martin Rudalics's avatar
      Provide additional support for child frames · 1886246f
      Martin Rudalics authored
      Provide mouse dragging and resizing of frames.  Allow resizing
      frames proportionally.  Provide additional functionality for
      child frames.  Minor bug fixes.
      
      * lisp/frame.el (frame-border-width, frame-pixel-width)
      (frame-pixel-height): Alias to `frame-internal-border-width',
      `frame-native-width' and `frame-native-height'.
      (frame-inner-width, frame-inner-height, frame-outer-width)
      (frame-outer-height): New functions.
      * lisp/minibuffer.el (completion-auto-help): Fix typo.
      * lisp/mouse.el (mouse-drag-line, mouse-drag-mode-line)
      (mouse-drag-header-line): Allow moving a frame by dragging the
      mode line of its bottommost window (on a minibuffer-less frame)
      or the header line of its topmost window.
      (mouse-drag-vertical-line): Mention argument in doc-string.
      (mouse-resize-frame, mouse-drag-frame, mouse-drag-left-edge)
      (mouse-drag-top-left-corner, mouse-drag-top-edge)
      (mouse-drag-top-right-corner, mouse-drag-right-edge)
      (mouse-drag-bottom-right-corner, mouse-drag-bottom-edge)
      (mouse-drag-bottom-left-corner): New functions for resizing a
      frame by dragging its internal border together with
      corresponding key bindings.
      * lisp/tooltip.el (tooltip-frame-parameters): Add
      'no-special-glyphs' to default parameters and update version
      tag.
      * lisp/window.el (frame-auto-hide-function): Add choice to make
      frame invisible and update version tag.
      (window--delete): Handle 'auto-hide-function' frame parameter.
      (window--maybe-raise-frame): Respect 'no-focus-on-map' and
      'no-accept-focus' frame parameters.
      (display-buffer--action-function-custom-type): Add
      `display-buffer-in-child-frame'.
      (display-buffer): Mention `display-buffer-in-child-frame' in
      doc-string.
      (display-buffer-in-child-frame): New action function for
      `display-buffer'.
      (window--sanitize-margin): Return zero when MARGIN cannot be
      sanitized.
      (fit-frame-to-buffer): Major rewrite to handle child frames and
      'fit-frame-to-buffer-sizes' and 'fit-frame-to-buffer-margins'
      frame parameters.
      (window-largest-empty-rectangle--maximums-1)
      (window-largest-empty-rectangle--maximums)
      (window-largest-empty-rectangle--disjoint-maximums)
      (window-largest-empty-rectangle): New functions.
      
      * src/dispextern.h (WINDOW_WANTS_MODELINE_P)
      (WINDOW_WANTS_HEADER_LINE_P): Remove.  Functionality is now
      provided by corresponding functions window_wants_modeline and
      window_wants_header_line in window.c.  Adjust users.
      * src/dispnew.c (adjust_glyph_matrix)
      (buffer_posn_from_coords): Use window_wants_modeline and
      window_wants_header_line instead of WINDOW_WANTS_MODELINE_P and
      WINDOW_WANTS_HEADER_LINE_P.
      * src/frame.c (keep_ratio): New function.
      (adjust_frame_size): Call keep_ratio for each of F's child
      frames.
      (make_frame): Initialize no_special_glyphs slot.
      (frame_internal_border_part): New function.
      (Fframe_pixel_width, Fframe_pixel_height, Fborder_width): Rename
      to Fframe_native_width, Fframe_native_height mand
      Fframe_internal_border_width.
      (frame_parm_table): Add Qno_special_glyphs entry.
      (frame_float_type): New enumeration type.
      (frame_float): New function to handle frame size and position
      ratios.
      (x_set_frame_parameters): Handle size and position ratios.
      (x_set_no_special_glyphs): New function
      (x_figure_window_size): Handle size and position ratios.
      (syms_of_frame): Add Qdisplay_monitor_attributes_list,
      Qno_special_glyphs, Qframe_edges, Qkeep_ratio, Qwidth_only,
      Qheight_only, Qleft_only and Qtop_only.
      * src/frame.h (internal_border_part): New enumeration type.
      (struct frame): New slot no_special_glyphs.
      (FRAME_NO_SPECIAL_GLYPHS): New macro.
      * src/gtkutil.c (xg_frame_restack): Return immediately for
      GTK versions before 2.18.0.
      * src/keyboard.c (internal_border_parts): New array constant.
      (make_lispy_position): For frames with border dragging enabled
      return internal border part.
      (syms_of_keyboard): New symbols Qdrag_internal_border,
      Qleft_edge, Qtop_left_corner, Qtop_edge, Qtop_right_corner,
      Qright_edge, Qbottom_right_corner, Qbottom_edge and
      Qbottom_left_corner.
      * src/minibuf.c (read_minibuf_unwind): When exiting the
      minibuffer deal with frames that have the 'minibuffer-exit'
      parameter set.
      (syms_of_minibuf): New symbol Qminibuffer_exit.
      * src/nsfns.m (frame_parm_handler): Add entry for
      x_set_no_special_glyphs.
      (Fx_create_frame): Handle 'no-special-glyphs' parameter.
      Intitialize new cursor types for dragging frame borders.
      * src/nsterm.h (struct ns_output): Add new cursor types for
      dragging frame borders.
      * src/w32fns.c (w32_frame_parm_handlers): Add entry for
      x_set_no_special_glyphs.
      (Fx_create_frame): Handle 'no-special-glyphs' parameter.
      Intitialize new cursor types for dragging frame borders.
      * src/w32term.h (struct w32_output): Add new cursor types for
      dragging frame borders.
      * src/window.c (coordinates_in_window)
      (Fwindow_line_height, window_internal_height): Use
      window_wants_modeline and window_wants_header_line instead of
      WINDOW_WANTS_MODELINE_P and WINDOW_WANTS_HEADER_LINE_P.
      (Fwindow_lines_pixel_dimensions): New function.
      (window_parameter): New function.
      (Fwindow_parameter): Call window_parameter.
      (window_wants_mode_line, window_wants_header_line): New
      functions replacing the macros WINDOW_WANTS_MODELINE_P and
      WINDOW_WANTS_HEADER_LINE_P from dispextern.h.
      (syms_of_window): New symbols Qmode_line_format and
      Qheader_line_format.
      * src/window.h: Reorganize and re-comment macros.  Use
      window_wants_modeline and window_wants_header_line instead of
      WINDOW_WANTS_MODELINE_P and WINDOW_WANTS_HEADER_LINE_P.
      (MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P): Minor rewrite.
      (WINDOW_BUFFER): New macro.
      (WINDOW_BOX_LEFT_EDGE_COL, WINDOW_BOX_RIGHT_EDGE_COL): Remove.
      * src/xdisp.c (window_text_bottom_y, window_box_height)
      (window_box, start_display)
      (compute_window_start_on_continuation_line)
      (try_cursor_movement, redisplay_window)
      (try_window_reusing_current_matrix, try_window_id)
      (display_line, expose_window): Use window_wants_modeline and
      window_wants_header_line instead of WINDOW_WANTS_MODELINE_P and
      WINDOW_WANTS_HEADER_LINE_P.
      (pos_visible_p, display_mode_lines): Respect W's
      'mode-line-format' and 'header-line-format' window parameters.
      (init_iterator): Use window_wants_modeline and
      window_wants_header_line instead of WINDOW_WANTS_MODELINE_P and
      WINDOW_WANTS_HEADER_LINE_P.  For tip frames respect
      no_special_glyphs value.
      (note_mouse_highlight): Set frame border cursors when on
      internal border.
      (x_draw_right_divider, x_draw_bottom_divider): Try to improve
      drawing of window dividers.
      * src/xfns.c (mouse_cursor): Add entries for border parts.
      (mouse_cursor_types): Add entries for cursor types to drag
      frame borders.
      (INSTALL_CURSOR): Add entries for new cursor types to drag
      frame borders.
      (Fx_create_frame): Handle 'no-special-glyphs' parameter.
      (x_frame_parm_handlers): Add entry for
      x_set_no_special_glyphs.
      (Vx_window_left_edge_shape, Vx_window_top_left_corner_shape)
      (Vx_window_top_edge_shape, Vx_window_top_right_corner_shape)
      (Vx_window_right_edge_shape)
      (Vx_window_bottom_right_corner_shape)
      (Vx_window_bottom_edge_shape)
      (Vx_window_bottom_left_corner_shape): New variables.
      (x_frame_restack): Call xg_frame_restack only for GTK versions
      starting with 2.18.0.
      * src/xterm.c (x_free_frame_resources): Remove new cursors for
      dragging frame borders.
      * src/xterm.h (struct x_output): Add new cursor types for
      dragging frame borders.
      
      * doc/lispref/display.texi (Size of Displayed Text): Document
      `window-lines-pixel-dimensions'.
      * doc/lispref/elisp.texi (Top): Add entry for "Mouse Dragging
      Parameters".
      * doc/lispref/frames.texi (Frame Size): Replace
      frame-pixel-width/-height by frame-native-width/-height.  Add
      frame-inner-width/-height and frame-outer-width/-height docs.
      (Position Parameters): Describe specifying position as ratios.
      Clarify remark about positions relative to bottom/ridge display
      edge.
      (Size Parameters): Describe specifying sizes as ratios.
      Describe 'fit-frame-to-buffer-margins' and
      'fit-frame-to-buffer-sizes' parameters.
      (Layout Parameters): Describe 'no-special-glyphs' parameter.
      (Frame Interaction Parameters): Describe 'auto-hide-function',
      'minibuffer-exit' and 'keep-ratio' parameters.
      (Mouse Dragging Parameters): New section describing
      'drag-internal-border', 'drag-with-header-line',
      'drag-with-mode-line', 'snap-width', 'top-visible' and
      'bottom-visible' parameters.
      (Management Parameters): Mention that `override-redirect' has
      no effect on MS Windows.
      (Font and Color Parameters): Mention child frames for `alpha'
      parameter.
      (Child Frames): Rewrite section with description and cross
      references to new frame parameters added.
      * doc/lispref/modes.texi (Mode Line Basics): Mention
      'mode-line-format' and 'header-line-format' window parameters.
      * doc/lispref/windows.texi (Resizing Windows): Mention effect
      of `fit-frame-to-buffer-margins' for child frames.
      (Display Action Functions): New action function
      `display-buffer-in-child-frame'.
      (Quitting Windows): Mention `make-frame-invisible' as optional
      value of `frame-auto-hide-function' and `auto-hide-function'
      frame paameter.
      (Coordinates and Windows): Describe new function
      `window-largest-empty-rectangle'.
      (Window Parameters): Describe new parameters 'mode-line-format'
      and 'header-line-format'.  Index all window parameters described
      in this section.
      1886246f
  34. 30 Apr, 2017 1 commit
    • Martin Rudalics's avatar
      Fix `delete-frame' behavior including Bug#26682 · 0943cc18
      Martin Rudalics authored
      * src/frame.c (other_frames): Accept two arguments now.  Don't
      care about minibuffer window.  Don't care about visibility when
      called from delete_frame with FORCE true (Bug#26682).
      (delete_frame, Fmake_frame_invisible): Adjust other_frames
      calls.
      * src/w32term.c (w32_read_socket): Don't add a move frame event
      for an invisible frame.
      * lisp/frame.el (handle-delete-frame): Don't kill Emacs when
      attempting to delete a surrogate minibuffer frame.
      0943cc18
  35. 19 Apr, 2017 1 commit
    • Alan Third's avatar
      Add new frame functionality to NS port · aca21d42
      Alan Third authored
      * lisp/frame.el (frame-restack): Call ns-frame-restack.
      * src/keyboard.c (kbd_buffer_get_event) [HAVE_NS]: Enable
      MOVE_FRAME_EVENT handling.
      * src/frame.h:
      * src/frame.c: Enable 'z-group', 'undecorated' and 'parent' frame
      definitions.
      * src/nsfns.m: Add x_set_z_group, x_set_parent_frame and
      x_set_undecorated (Cocoa only) to handler struct.
      (Fx_create_frame): Handle 'z-group', 'parent-frame' and 'undecorated'
      frame parameter.
      (Fns_frame_restack): New function.
      * src/nsmenu.m (free_frame_tool_bar, update_frame_tool_bar):
      FRAME_TOOLBAR_HEIGHT is no longer a variable.
      * src/nsterm.h (NS_PARENT_WINDOW_LEFT_POS, NS_PARENT_WINDOW_TOP_POS):
      Add #defines to find the screen position of the parent frame.
      (NS_TOP_POS): Remove defun.
      (EmacsView): Remove redundant toolbar variables and add createToolbar
      method.
      (FRAME_NS_TITLEBAR_HEIGHT, FRAME_TOOLBAR_HEIGHT): Always calculate the
      values instead of storing them in a variable.
      * src/nsterm.m (x_set_offset, windowDidMove): Take parent frame
      position into account when positioning frames.
      (initFrameFromEmacs): Remove toolbar creation code and handle new
      frame parameters.
      (x_set_window_size): Remove toolbar height calculation.
      (x_set_z_group):
      (x_set_parent_frame):
      (x_set_undecorated) [NS_IMPL_COCOA]: New function.
      (x_destroy_window): Detach parent if child closes.
      (updateFrameSize): Change NSTRACE message to reflect new reality and
      no longer reset frame size.
      (windowWillResize): Don’t change NS window name when the titlebar
      is invisible.
      (createToolbar): Move toolbar creation code into it’s own method.
      (toggleFullScreen): FRAME_TOOLBAR_HEIGHT and FRAME_NS_TITLEBAR_HEIGHT
      are no longer variables.
      (windowDidMove): Fire MOVE_FRAME_EVENT Emacs event.
      aca21d42