1. 01 Jan, 2020 1 commit
  2. 26 Apr, 2019 1 commit
    • Alexander Gramiak's avatar
      Rename generic x_* identifiers · a411517f
      Alexander Gramiak authored
      * src/image.c: Rename x_* procedures to image_*.
      
      * src/frame.c: Rename x_* procedures to gui_*. Rename
      xrdb_get_resource to gui_display_get_resource. Rename x_get_arg to
      gui_display_get arg.
      
      * src/frame.h: Rename can_x_set_window_size to can_set_window_size.
      
      * src/xfaces.c: Rename realize_x_face to realize_gui_face. Rename
      x_supports_face_attributes_p to gui_supports_face_attributes_p.
      
      * src/keyboard.c:
      * src/lisp.h:
      * src/nsterm.m:
      * src/w32term.c:
      * src/xterm.c: Rename x_get_keysym_name to get_keysym_name.
      
      * src/nsfns.c:
      * src/nsterm.m: Rename x_* procedures to ns_*.
      
      * src/w32fns.c:
      * src/w32term.c: Rename x_* procedures to w32_*.
      
      * src/termhooks.h (query_colors, get_focus_frame, focus_frame_hook)
      (frame_visible_invisible_hook, iconify_frame_hook)
      (set_window_size_hook, set_frame_offset_hook, set_frame_alpha_hook)
      (set_new_font_hook, set_bitmap_icon_hook, implicit_set_name_hook)
      (activate_menubar_hook, change_tool_bar_height_hook)
      (set_scroll_bar_default_width_hook)
      (set_scroll_bar_default_height_hook, get_string_resource_hook): New
      terminal hooks to replace backend-specific x_* procedures.
      
      * src/dispextern.h (clear_under_internal_border): New RIF procedure.
      
      * src/alloc.c:
      * src/frame.c:
      * src/xdisp.c: Use FRAME_OUTPUT_DATA instead of FRAME_X_OUTPUT.
      
      * src/frame.c:
      * src/w32term.c:
      * src/w32fns.c: Use FRAME_NATIVE_WINDOW instead of FRAME_X_WINDOW.
      a411517f
  3. 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
  4. 01 Jan, 2019 1 commit
  5. 17 Aug, 2018 1 commit
    • Andy Moreton's avatar
      Pacify -Wcast-function-type warnings in GCC 8.1 · cc5325b0
      Andy Moreton authored
      * src/image.c: Move attributes into DEF_DLL_FN call.
      * src/dynlib.c (dynlib_addr): Use get_proc_addr.
      * src/w32.h: (get_proc_addr): New function.
      (LOAD_DLL_FN): Use it.
      (DEF_DLL_FN): Allow function attributes after argument
      list.  Add function pointer type used by LOAD_DLL_FN.
      * src/w32.c (open_process_token, get_token_information)
      (lookup_account_sid, get_sid_sub_authority)
      (get_sid_sub_authority_count, get_security_info)
      (get_file_security, set_file_security)
      (set_named_security_info)
      (get_security_descriptor_owner, get_security_descriptor_group)
      (get_security_descriptor_dacl, is_valid_sid, equal_sid)
      (get_length_sid, copy_sid, get_native_system_info)
      (get_system_times, create_symbolic_link)
      (is_valid_security_descriptor, convert_sd_to_sddl)
      (convert_sddl_to_sd, get_adapters_info, reg_open_key_ex_w)
      (reg_query_value_ex_w, expand_environment_strings_w)
      (init_environment, create_toolhelp32_snapshot)
      (process32_first, process32_next, open_thread_token)
      (impersonate_self, revert_to_self, get_process_memory_info)
      (get_process_working_set_size, global_memory_status)
      (global_memory_status_ex, init_winsock)
      (maybe_load_unicows_dll, globals_of_w32): Use get_proc_addr.
      * src/w32fns.c (setup_w32_kbdhook, Ffile_system_info)
      (get_dll_version, w32_reset_stack_overflow_guard)
      (w32_backtrace, globals_of_w32fns): Use get_proc_addr.
      * src/w32font.c (get_outline_metrics_w, get_text_metrics_w)
      (get_glyph_outline_w, get_char_width_32_w): Use get_proc_addr.
      * src/w32heap.c (init_heap): Use get_proc_addr.
      * src/w32menu.c (globals_of_w32menu): Use get_proc_addr.
      * src/w32proc.c (init_timers, sys_kill, w32_compare_strings):
      Use get_proc_addr.
      * src/w32uniscribe.c (syms_of_w32uniscribe): Use get_proc_addr.
      cc5325b0
  6. 10 Jun, 2018 1 commit
    • Paul Eggert's avatar
      Use native alignment to access Lisp object data · 0303fab3
      Paul Eggert authored
      Instead of using __builtin_assume_aligned (P, GCALIGNMENT) to
      tell GCC that P has alignment 8, use (T *) P where T is the
      type of the pointed-to object, to tell GCC that P has native
      alignment.  This is simpler, matches the intent better, and
      should help simplify future improvements.  Some of these
      changes are to pacify gcc -Wnull-dereference, since GCC is
      smarter about pointers now that Emacs no longer uses
      __builtin_assume_aligned; these minor changes should improve
      code efficiency slightly.  On Fedora 28 x86-64 with default
      optimization this patch shrinks the size of the Emacs text
      segment by 0.36%.
      * src/conf_post.h (__has_builtin, __builtin_assume_aligned):
      Remove; no longer used.
      * src/dbusbind.c (XD_OBJECT_TO_DBUS_TYPE):
      Pacify -Wnull-dereference by using XCAR instead of CAR_SAFE
      and XCDR instead of CDR_SAFE when this is safe.
      * src/fileio.c (Fexpand_file_name):
      * src/font.c (clear_font_cache):
      Pacify -Wnull-dereference by removing unnecessary NILP test.
      * src/keyboard.c (xevent_start): New function.
      (read_char, read_key_sequence): Pacify -Wnull-dereference by
      using xevent_start instead of EVENT_START.
      * src/lisp.h (lisp_h_XUNTAG): Remove; XUNTAG is always a macro
      now, since it can no longer be implemented as a function.
      (XUNTAG): New third argument CTYPE.  All uses changed.
      Cast result to CTYPE * instead of using __builtin_assume_aligned.
      Simplify by using LISP_WORD_TAG.
      (LISP_WORD_TAG): New macro.
      (TAG_PTR): Use it.
      * src/menu.c (x_popup_menu_1):
      Pacify -Wnull-dereference by using XCAR instead of Fcar and
      XCDR instead of Fcdr where this is safe.
      0303fab3
  7. 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
  8. 01 Jan, 2018 1 commit
  9. 30 Sep, 2017 1 commit
  10. 02 May, 2017 1 commit
    • Eli Zaretskii's avatar
      Avoid compilation warnings · 5f75304f
      Eli Zaretskii authored
      * src/w32fns.c (Fx_file_dialog, w32_parse_and_hook_hot_key):
      * src/w32term.c (x_draw_glyph_string):
      * src/w32fns.c (compute_tip_xy):
      * src/w32font.c (w32font_text_extents):
      * src/w32menu.c (set_frame_menubar):
      * src/search.c (Freplace_match): Avoid compiler warnings in
      optimized builds.
      5f75304f
  11. 01 Jan, 2017 1 commit
  12. 24 Jul, 2016 1 commit
    • Paul Eggert's avatar
      ‘signal’ no longer returns · 50cc08bf
      Paul Eggert authored
      Although for decades ‘signal’ has been documented to not return,
      a corner case in the Lisp debugger causes ‘signal’ to return.
      Remove the corner case and adjust Emacs internals accordingly.
      An alternative would be to document the corner case, but this
      would complicate the Lisp API unnecessarily.  (Bug#24047)
      * src/eval.c (signal_or_quit): New function, with most of the
      old contents of Fsignal.
      (quit): New function, which uses signal_or_quit and which
      might return.  All keyboard-based callers of Fsignal (Qquit,
      Qnil) changed to use this new function instead.
      (Fsignal): Use signal_or_quit.  Now _Noreturn.  All callers
      changed.
      (xsignal): Move to lisp.h.
      * src/lisp.h (xsignal): Now an inline function, as it's now
      just an alias for Fsignal.
      50cc08bf
  13. 21 Jun, 2016 1 commit
    • Ken Brown's avatar
      Fix compiler warnings in Cygwin-w32 build · 560c4ab1
      Ken Brown authored
      * src/conf_post.h (DebPrint) [!EMACSDEBUG]: Add empty do-while
      loop to avoid compiler warnings about empty body of 'if'
      statement.
      
      * src/image.c [HAVE_NTGUI] (DefaultDepthOfScreen): Disable unused
      macro.
      (x_create_bitmap_from_data): Declare 'frame'.
      (x_create_bitmap_from_file): Don't declare unused variable
      'dpyinfo'.
      
      * src/lisp.h (AUTO_STRING_WITH_LEN): Avoid initialization to
      prevent "jump-misses-init" compiler warnings.
      
      * src/w32fns.c (check_w32_winkey_state): Define and use only if
      WINDOWSNT.
      (Fx_show_tip): Declare 'f'.
      (Fx_file_dialog): Declare 'filter_a' only if not NTGUI_UNICODE.
      (w32_strerror): Use format specifier %d for sprintf argument of
      type int.
      (emacs_abort): Cast sprintf argument of type DWORD to unsigned
      int, and use format specifier %x, for compatibility with Cygwin.
      (unicode_append_menu) [NTGUI_UNICODE]:
      * src/w32menu.c [NTGUI_UNICODE] (get_menu_item_info)
      (set_menu_item_info, unicode_append_menu)
      (unicode_message_box):
      * src/menu.c [NTGUI_UNICODE] (unicode_append_menu): Define as
      functions rather than macros to avoid "address will always
      evaluate as true" compiler warnings.
      
      * src/w32font.c (w32_to_x_charset): Use format specifier %d for
      sprintf argument of type int.
      
      * src/w32term.c (x_draw_glyphless_glyph_string_foreground): Cast
      sprintf argument of type int to unsigned int to match %X format
      specifier.
      (w32_scroll_bar_handle_click):
      (w32_horizontal_scroll_bar_handle_click): Declare 'f'.
      
      * src/w32term.h (FRAME_DISPLAY_INFO): Explicitly discard unused
      argument.
      560c4ab1
  14. 21 May, 2016 1 commit
    • Eli Zaretskii's avatar
      Fix compiler warnings in the MinGW build · cb5af792
      Eli Zaretskii authored
      * configure.ac [mingw32]: Don't add -Wpointer-sign, and add
      -Wno-pointer-sign, to keep the noise level down.
      
      * nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable
      -Wredundant-decls, as that produces a lot of noise due to
      redeclaration of time-related functions by gnulib.
      * nt/runemacs.c (set_user_model_id): Fix argument type of
      'SetCurrentProcessExplicitAppUserModelID'.
      
      * src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't
      declare 'dpyinfo', as it is unused.
      (xpm_load): Fix warnings about pointer signedness.
      * src/w32proc.c (IsValidLocale, init_winsock): Remove redundant
      prototypes.
      (sys_spawnve): Avoid warnings about discarding 'const' qualifier.
      (sys_select): Provide prototype.
      (g_b_init_compare_string_w): Move declaration to file scope.
      * src/w32heap.c (dumped_data_commit): Now static.
      (FREEABLE_P): Avoid warnings about pointer comparison with integer.
      (mmap_realloc): Cast to 'char *' for arithmetics on void pointers.
      * src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr)
      (evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear):
      Provide prototypes.
      * src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove
      redundant prototypes.
      (w32_get_internal_run_time, map_w32_filename): Provide prototype.
      (init_environment, sys_ctime): Avoid warnings about discarding
      'const' qualifier.
      Include utimens.h.
      (sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir)
      (sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock)
      (sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide
      prototypes.
      (sys_rename_replace): Use %d to avoid compiler warnings.
      (_wsa_errlist): Make the message text 'const char *', to avoid
      compilation warnings.
      (dynlib_reset_last_error): Move prototype to file scope.
      (w32_get_resource): First argument is now 'const char *'.
      * src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype.
      (otf_features): Second argument is no 'const char *'.
      * src/w32term.c (free_frame_menubar, x_wm_set_size_hint)
      (x_set_window_size): Remove redundant prototypes.
      (XChangeGC, XGetGCValues, w32_draw_underwave)
      (w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave)
      (x_calc_absolute_position, x_destroy_window): Now static.
      (menubar_selection_callback): Move prototype to file scope.
      * src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant
      declaration.
      (w32_to_x_charset): Fix warnings about discarding 'const' qualifier.
      (w32font_full_name): Fix warnings about implicit conversion of
      'float' to 'double'.
      * src/w32reg.c (w32_get_rdb_resource): Fix warnings about
      discarding 'const' qualifier.
      * src/w32menu.c (syms_of_w32menu, globals_of_w32menu)
      (set_frame_menubar): Remove redundant prototypes.
      (menubar_selection_callback, w32_menu_display_help): Provide
      prototypes.
      (simple_dialog_show): Avoid warnings about discarding 'const'
      qualifier.
      * src/w32fns.c (syms_of_w32fns, globals_of_w32fns)
      (free_frame_menubar, w32_strerror, x_set_menu_bar_lines)
      (x_set_tool_bar_lines, x_set_internal_border_width): Remove
      redundant prototypes.
      (current_popup_menu): Remove redundant declaration.
      (colormap_t): Member 'name' is now 'const char *'.
      (add_system_logical_colors_to_map): Fix signed/unsigned warnings.
      (x_decode_color, x_set_border_pixel)
      (x_clear_under_internal_border, x_set_name, hook_w32_key)
      (reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now
      static.
      (w32_load_cursor, w32_key_to_modifier, map_keypad_keys)
      (w32_msg_worker, w32_last_error): Provide prototypes.
      (funhook, lookup_vk_code): Avoid warnings about missing
      parentheses.
      (x_default_font_parameter, Fw32_notification_notify): Avoid
      warnings about discarding 'const' qualifier.
      (Fx_create_frame): Avoid warnings about empty body of 'else'.
      (x_screen_planes): Ifdef away unused function.
      (Fx_show_tip): Remove unused variables.
      (Fw32_battery_status): Avoid warnings about implicit promotion
      from float to double.
      (Fw32_notification_notify): Initialize 'timeout'.
      * src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only
      define the TIMER_SETTIME_RUNNING value if it will be used.
      * src/w32notify.c (send_notifications): Ifdef away an empty if
      clause.  Remove unused variable.
      (watch_end, watch_completion): Provide prototypes.
      * src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused.
      * src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix
      warning with pointer signedness.
      * src/gnutls.c (gnutls_x509_crt_get_signature)
      (gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and
      don't load them from the GnuTLS library, as they are no longer
      used.
      * src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't
      define, as it's unused.
      * src/unexw32.c (open_input_file, open_output_file)
      (close_file_data): Remove redundant prototypes.
      (_start): provide prototype.
      (mainCRTStartup): Move prototype to file level.
      (find_section): Use type-cast to shut up compiler warnings.
      (offset_to_section, relocate_offset): Now static.
      (find_section): First argument is now a 'const char *'.
      (offset_to_section): Ifdef away, as it's unused.
      * src/w32heap.h (find_section): Adjust prototype.
      * src/dynlib.c (dynlib_reset_last_error): Provide prototype.
      * src/dired.c (directory_files_internal_w32_unwind): Avoid
      warnings about missing prototypes.
      (is_slow_fs) [WINDOWSNT]: Provide prototype at file level.
      (directory_files_internal) [WINDOWSNT]: Fix warnings about pointer
      signedness.
      * src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]:
      Fix warnings about pointer signedness.
      * src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's
      unused.
      * src/sysdep.c (_getpid): Remove redundant prototype.
      (sys_subshell) [DOS_NT]: Don't define 'status', it's unused.
      [!MSDOS]: Don't define 'st', it's unused.
      (init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused.
      (str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness.
      * src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define
      n_to_read, as it is not used.
      (MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused.
      * src/w32font.h (syms_of_w32font): Remove redundant prototype.
      * src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro.
      * src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are
      not used by DOS_NT builds, to avoid compiler warnings.
      * src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant
      declaration.
      * src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut
      up compiler warnings.
      * src/w32term.h (x_set_window_size, x_get_focus_frame)
      (x_make_frame_visible, x_make_frame_invisible, x_iconify_frame)
      (x_set_frame_alpha, x_activate_menubar, x_bitmap_icon)
      (x_free_frame_resources, x_real_positions)
      (display_x_get_resource): Remove redundant prototypes.
      
      * lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp)
      (sys_rename, gettimeofday): Provide prototypes.
      * lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant
      declarations.
      * lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'.
      (xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname)
      (close_winsock, initialize_sockets, w32_set_user_model_id)
      (w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add
      prototypes.
      (w32_get_resource) [WINDOWSNT]: Fix a warning about signedness
      difference.
      (w32_set_user_model_id): Update prototype of
      SetCurrentProcessExplicitAppUserModelID to avoid compiler
      warnings.
      (start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to
      shut up compiler warnings.
      * lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
      cb5af792
  15. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  16. 01 Jan, 2016 1 commit
  17. 12 Dec, 2015 1 commit
    • Martin Rudalics's avatar
      Fix frame height calculations with added menu bar on Windows (Bug#22105) · 06f00d39
      Martin Rudalics authored
      * doc/lispref/frames.texi (Parameter Access): Mention pitfalls
      when simultaneously specifying multiple parameters for
      `modify-frame-parameters' that all may change the frame's size.
      * src/w32fns.c (x_set_menu_bar_lines): Don't set
      windows_or_buffers_changed here.
      (my_create_tip_window, Fx_show_tip): Call AdjustWindowRect
      with third argument false.
      * src/w32menu.c (set_frame_menubar): Set
      windows_or_buffers_changed here.
      * src/w32term.c (x_set_window_size): Determine third argument of
      AdjustWindowRect from whether the frame has a menu bar and not
      from whether it wants one.
      06f00d39
  18. 22 Oct, 2015 1 commit
    • Eli Zaretskii's avatar
      Include file cleanup for w32 files in src directory · d4352f81
      Eli Zaretskii authored
      * src/w32xfns.c: Don't include keyboard.h, window.h, charset.h,
      fontset.h, blockinput.h.
      * src/w32uniscribe.c: Don't include dispextern.h, character.h,
      charset.h, fontset.h.
      * src/w32term.c: Don't include systty.h, systime.h, charset.h,
      character.h, ccl.h, dispextern.h, disptab.h, intervals.h,
      process.h, atimer.h, keymap.h, w32heap.h.  Include bitmap/gray.xbm
      in an ifdef-ed away block.
      Include fcntl.h for CYGWIN.
      (set_frame_param): Remove unused function.
      * src/w32select.c: Don't include charset.h and composite.h.
      (setup_config, Fw32_get_clipboard_data): Avoid compiler warnings
      due to pointer signedness mismatches.
      * src/w32reg.c (w32_get_string_resource): Avoid compiler warnings
      due to pointer signedness mismatches.
      * src/w32proc.c: Include unistd.h.  Don't include systime.h,
      process.h, dispextern.h.
      (sys_spawnve, Fw32_short_file_name, Fw32_long_file_name)
      (Fw32_application_type): Avoid compiler warnings due to pointer
      signedness mismatches.
      * src/w32menu.c: Don't include keymap.h, termhooks.h, window.h,
      character.h, charset.h, dispextern.h.
      (simple_dialog_show, add_menu_item): Avoid compiler warnings due
      to pointer signedness mismatches.
      * src/w32inevt.c: Don't include dispextern.h, window.h,
      termhooks.h, w32heap.h.
      * src/w32font.c: Don't include dispextern.h, character.h,
      charset.h, fontset.h, font.h.
      (intern_font_name, add_font_entity_to_list)
      (registry_to_w32_charset, w32_to_x_charset, fill_in_logfont)
      (list_all_matching_fonts): Avoid compiler warnings due to pointer
      signedness mismatches.
      * src/w32fns.c: Don't include character.h, intervals.h,
      dispextern.h, epaths.h, charset.h, ccl.h, fontset.h, systime.h,
      termhooks.h, w32heap.h, bitmap/gray.xbm, font.h, w32font.h.
      (w32_color_map_lookup, add_system_logical_colors_to_map)
      (x_decode_color, x_set_name, FPRINTF_WM_CHARS, Fxw_color_defined_p)
      (Fxw_color_values, x_display_info_for_name, Fset_message_beep)
      (x_create_tip_frame, Fx_file_dialog, Fsystem_move_file_to_trash)
      (w32_parse_hot_key, Ffile_system_info, w32_kbd_patch_key): Avoid
      compiler warnings, mainly due to pointer signedness mismatches.
      (unwind_create_frame_1): Remove unused function.
      * src/w32console.c: Don't include character.h, disptab.h, frame.h,
      window.h, termhooks.h, dispextern.h.
      (w32con_write_glyphs, w32con_write_glyphs_with_face): Fix pointer
      signedness mismatch.
      * src/w32.c: Include c-strcase.h and systty.h.  Don't include
      w32heap.h.
      d4352f81
  19. 29 Jan, 2015 1 commit
    • Eli Zaretskii's avatar
      Use bool for boolean in w32menu.c, w32font.c, w32uniscribe.c. · 0761ec16
      Eli Zaretskii authored
       src/w32uniscribe.c (uniscribe_list, uniscribe_match): Use bool where
       appropriate.
       src/w32font.c (struct font_callback_data, w32font_list_internal)
       (w32font_driver, w32font_match_internal): Use bool where appropriate.
       src/w32menu.c (x_activate_menubar, set_frame_menubar)
       (w32_dialog_show, initialize_frame_menubar, w32_menu_show)
       (is_simple_dialog): Use bool where appropriate.
      0761ec16
  20. 14 Jan, 2015 1 commit
  21. 13 Jan, 2015 1 commit
    • Eli Zaretskii's avatar
      Fix problems with 32-bit wide-int build exposed by MinGW · 5aa618b0
      Eli Zaretskii authored
       lisp.h (XPNTR): Move definition to after XTYPE, to avoid
       compilation error in an unoptimized build when !USE_LSB_TAG.
       src/w32heap.c (DUMPED_HEAP_SIZE): For 32-bit wide-int build, use the
       same larger value as for the 64-bit build.
       src/w32term.h (SCROLL_BAR_PACK): Cast the result to UINT_PTR to
       avoid compiler warnings.
       src/w32proc.c (Fw32_get_codepage_charset, Fw32_set_keyboard_layout):
       Avoid compiler warnings about cast from integer to pointer of
       different size.
       src/w32menu.c (menubar_selection_callback, w32_menu_show): Cast to
       UINT_PTR instead of EMACS_INT, to avoid compiler warnings about
       casting from integer to pointer of different size.
       (add_menu_item): Pass the help-echo string as a pointer to
       Lisp_String, not as a Lisp_Object.
       (w32_menu_display_help): Use make_lisp_ptr to reconstruct a Lisp
       string object from its C pointer.
       src/w32fns.c (w32_msg_pump) <WM_EMACS_UNREGISTER_HOT_KEY>: Use
       make_lisp_ptr instead of XIL, to reconstruct a Lisp_Cons from its
       C pointer.
       <WM_EMACS_TOGGLE_LOCK_KEY>: msg.lparam is now a C integer.
       (Fx_create_frame): Type-cast the result of XFASTINT to avoild
       compiler warnings about size differences.
       (Fw32_unregister_hot_key): Pass the tail of w32_grabbed_keys as a
       pointer to a Lisp_Cons struct, not as a disguised EMACS_INT.
       (Fw32_toggle_lock_key): Pass the new state of the key as a C
       integer; use -1 for nil.  Doc fix.
       src/.gdbinit (xgetsym): New subroutine.
       (xsymname, xsymbol): Use it.
       (xprintsym): No need to call xgetptr.
      5aa618b0
  22. 12 Jan, 2015 1 commit
    • Martin Rudalics's avatar
      Adjust frame heights to real height of tool bar. · fb35f1f7
      Martin Rudalics authored
      * frame.el (frame-notice-user-settings): Remove code dealing with
      frame-initial-frame-tool-bar-height.  Turn off `tool-bar-mode'
      only if `window-system-frame-alist' or `default-frame-alist' ask
      for it.
      (make-frame): Update frame-adjust-size-history if needed.
      * dispnew.c (change_frame_size_1): Pass Qchange_frame_size to
      adjust_frame_size.
      * frame.c (frame_default_tool_bar_height): New variable.
      (adjust_frame_size): Possibly add requested adjustment to
      Vframe_adjust_size_history.
      (make_frame): Initialize tool_bar_redisplayed_once slot.
      (Fset_frame_height, Fset_frame_width, Fset_frame_size): Clarify
      doc-string.  Call adjust_frame_size unconditionally (the frame's
      text size may remain unaltered but the pixel size may change).
      (x_figure_window_size): If frame_default_tool_bar_height was
      set, use it instead of calculating the tool bar height from
      DEFAULT_TOOL_BAR_IMAGE_HEIGHT.  Don't set
      Vframe_initial_frame_tool_bar_height.
      (Qchange_frame_size, Qxg_frame_set_char_size)
      (Qset_window_configuration, Qx_create_frame_1)
      (Qx_create_frame_2): New symbols.
      (Vframe_initial_frame_tool_bar_height): Remove.
      (Vframe_adjust_size_history): New history variable for debugging
      frame size adjustments.
      * frame.h (struct frame): New boolean slot
      tool_bar_redisplayed_once.
      (frame_default_tool_bar_height): Extern.
      * gtkutil.c (xg_frame_set_char_size): Pass Qxg_frame_set_char_size
      to adjust_frame_size.
      * nsfns.m (Fx_create_frame): Pass Pass Qx_create_frame_1 and
      Qx_create_frame_2 to adjust_frame_size.
      * w32fns.c (x_change_tool_bar_height): Call adjust_frame_size with
      inhibit 1 when we have not redisplayed the tool bar yet.
      (Fx_create_frame): Pass Pass Qx_create_frame_1 and
      Qx_create_frame_2 to adjust_frame_size.
      * w32menu.c (set_frame_menubar): Simplify adjust_frame_size
      call.
      * window.c (Fset_window_configuration): Pass
      Qset_window_configuration to adjust_frame_size.
      * xdisp.c (redisplay_tool_bar): Assign new height to
      frame_default_tool_bar_height.
      (redisplay_internal): If we haven't redisplayed this frame's
      tool bar, call redisplay_tool_bar early so we can adjust the
      frame size accordingly.
      * xfns.c (x_change_tool_bar_height): Call adjust_frame_size with
      inhibit 1 when we have not redisplayed the tool bar yet.
      (Fx_create_frame): Pass Pass Qx_create_frame_1 and
      Qx_create_frame_2 to adjust_frame_size.
      fb35f1f7
  23. 05 Jan, 2015 1 commit
    • Eli Zaretskii's avatar
      MS-Windows followup to previous commit · 5b5dab12
      Eli Zaretskii authored
       src/w32proc.c, src/w32.h, src/w32fns.c, src/w32font.c, src/w32menu.c:
       src/w32notify.c, src/w32proc.c, src/w32select.c, src/w32term.c:
       src/w32uniscribe.c: Remove declarations of Q* variables that
       represent symbols.
      5b5dab12
  24. 01 Jan, 2015 2 commits
  25. 26 Dec, 2014 1 commit
    • Eli Zaretskii's avatar
      MS-Windows followup to stpcpy changes. · d6552628
      Eli Zaretskii authored
       src/w32proc.c (sys_spawnve, get_lcid_callback): Use strcpy instead
       of strcat.
       src/w32menu.c (add_menu_item): Use stpcpy instead of strcat.
       src/w32.c (sys_readdir, stat_worker, symlink): Use strcpy instead of
       strcat.
      
       nt/gnulib.mk (stpcpy, string): Sync with the latest change in
       lib/gnulib.mk.
      d6552628
  26. 07 Nov, 2014 1 commit
    • Martin Rudalics's avatar
      Improve inhibiting of implied frame resizes. · 1c50b3ad
      Martin Rudalics authored
      * frames.texi (Size and Position): Rewrite description of
      `frame-inhibit-implied-resize'.
      * cus-start.el (frame-resize-pixelwise): Fix group.
      (frame-inhibit-implied-resize): Add entry.
      * dispnew.c (change_frame_size_1): Fix call of
      adjust_frame_size.
      * frame.c (Qsize, Qframe_position, Qframe_outer_size)
      (Qframe_inner_size, Qexternal_border_size, Qtitle_height)
      (Qmenu_bar_external, Qmenu_bar_size, Qtool_bar_external)
      (Qtool_bar_size): New constants.
      (frame_inhibit_resize, adjust_frame_size): New argument to
      handle case where frame_inhibit_implied_resize is a list.
      (Fmake_terminal_frame, Fset_frame_height, Fset_frame_width)
      (Fset_frame_size, x_set_left_fringe, x_set_right_fringe)
      (x_set_right_divider_width, x_set_bottom_divider_width)
      (x_set_vertical_scroll_bars, x_set_horizontal_scroll_bars)
      (x_set_scroll_bar_width, x_set_scroll_bar_height): Update
      callers.
      (frame-inhibit-implied-resize): Rewrite doc-string.
      * frame.h (frame_inhibit_resize, adjust_frame_size): Fix
      external declarations.
      (Qframe_position, Qframe_outer_size)
      (Qframe_inner_size, Qexternal_border_size, Qtitle_height)
      (Qmenu_bar_external, Qmenu_bar_size, Qtool_bar_external)
      (Qtool_bar_size): Extern them.
      * gtkutil.c (FRAME_TOTAL_PIXEL_HEIGHT, FRAME_TOTAL_PIXEL_WIDTH)
      (xg_height_or_width_changed): Remove.
      (xg_frame_set_char_size): Adjust adjust_frame_size calls.
      (menubar_map_cb, xg_update_frame_menubar, free_frame_menubar)
      (tb_size_cb, update_frame_tool_bar, free_frame_tool_bar)
      (xg_change_toolbar_position): Call adjust_frame_size directly.
      * nsfns.m (x_set_internal_border_width, Fx_create_frame): Fix
      calls of adjust_frame_size.
      * w32fns.c (x_set_internal_border_width, x_set_menu_bar_lines)
      (Fx_create_frame, x_create_tip_frame): Adjust adjust_frame_size
      calls.
      (x_set_tool_bar_lines, x_change_tool_bar_height): Make sure that
      frame can get resized when tool-bar-lines parameter changes from
      or to zero.
      (Fw32_frame_menu_bar_size): Return fourth value.
      (Fw32_frame_rect): Block input around system calls
      (Fx_frame_geometry): New function.
      * w32menu.c (set_frame_menubar): Adjust adjust_frame_size call.
      * w32term.c (x_new_font): Adjust adjust_frame_size call.
      * widget.c (EmacsFrameSetCharSize): Adjust frame_inhibit_resize
      call.
      * window.c (Fset_window_configuration): Adjust adjust_frame_size
      call.
      * xfns.c (x_set_menu_bar_lines, x_set_internal_border_width)
      (Fx_create_frame): Adjust adjust_frame_size calls.
      (x_set_tool_bar_lines, x_change_tool_bar_height): Make sure that
      frame can get resized when tool-bar-lines parameter changes from
      or to zero.
      (Fx_frame_geometry): New function.
      * xmenu.c (update_frame_menubar): On Lucid call
      adjust_frame_size with one pixel less height to avoid that
      repeatedly adding/removing the menu bar grows the frame.
      (free_frame_menubar): On Motif arrange to optionally preserve
      the old frame height when removing the menu bar.
      * xterm.c (x_new_font): Adjust adjust_frame_size call.
      1c50b3ad
  27. 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
  28. 04 Jun, 2014 1 commit
    • Dmitry Antipov's avatar
      Use terminal-specific hooks to display menus. · cfd794af
      Dmitry Antipov authored
      * termhooks.h (struct terminal): New field menu_show_hook.
      * menu.h (<anonymous enum>): Bit flags for menu hooks.
      (x_menu_show, w32_menu_show, ns_menu_show, tty_menu_show):
      Adjust prototypes.
      * menu.c (Fx_popup_menu): Use bit flags and menu_show_hook.
      * nsmenu.m (ns_menu_show):
      * w32menu.c (w32_menu_show):
      * xmenu.c (x_menu_show):
      * term.c (tty_menu_show): Adjust to use bit flags.
      (set_tty_hooks): Set menu_show_hook.
      * xterm.c (x_create_terminal):
      * nsterm.m (ns_create_terminal):
      * msdos.c (initialize_msdos_display):
      * w32term.c (w32_create_terminal): Likewise.
      cfd794af
  29. 03 Jun, 2014 1 commit
    • Eli Zaretskii's avatar
      Fix MS-Windows build broken by menu changes on 2014-06-02. · 0031c953
      Eli Zaretskii authored
       src/w32menu.c (w32_menu_show): Fix a typo that broke compilation.
       src/menu.h (enum button_type, struct _widget_value) [HAVE_NTGUI]:
       Define instead of including ../lwlib/lwlib.h, which causes
       compilation errors due to missing X11 headers.
      0031c953
  30. 02 Jun, 2014 1 commit
    • Dmitry Antipov's avatar
      Use common memory management functions for lwlib and refactor users. · 5668fb88
      Dmitry Antipov authored
      * lwlib/lwlib.h (widget_value): Do not maintain a free list any more.
      (malloc_widget_value, free_widget_value): Remove prototypes.
      * lwlib/lwlib.c (malloc_widget_value, free_widget_value):
      (widget_value_free_list, malloc_cpt): Remove.
      (free_widget_value_tree, copy_widget_value_tree): Adjust users.
      * src/menu.h (xmalloc_widget_value): Replaced by ...
      (make_widget_value): ... new prototype.
      * src/menu.c (xmalloc_widget_value): Replaced by ...
      (make_widget_value): ... new function.
      (free_menubar_widget_value_tree, digest_single_submenu): Adjust users.
      * src/gtkutil.c (malloc_widget_value, free_widget_value):
      (widget_value_free_list, malloc_cpt): Remove old lwlib-compatible code.
      * src/keyboard.h (enum button_type, struct _widget_value):
      * src/gtkutil.h, src/nsgui.h, src/w32gui.h (malloc_widget_value):
      (free_widget_value): Likewise.
      * src/nsmenu.m (ns_update_menubar, ns_menu_show):
      * src/w32menu.c (set_frame_menubar, w32_menu_show, w32_dialog_show):
      * src/xmenu.c (set_frame_menubar, xmenu_show, x_dialog_show): Adjust users.
      * src/xterm.h (XtParent) [USE_GTK]: Remove unused macro.
      5668fb88
  31. 29 May, 2014 1 commit
    • Dmitry Antipov's avatar
      * xmenu.c (xdialog_show): Remove prototype, rename to · f1b44793
      Dmitry Antipov authored
      x_dialog_show, remove 2nd arg because it's always zero
      and simplify accordingly.
      (xw_popup_dialog): Adjust user.
      * w32menu.c (w32_dialog_show): Adjust prototype, remove
      2nd arg because it's always zero and simplify accordingly.
      (w32_popup_dialog): Adjust user.
      f1b44793
  32. 04 Feb, 2014 1 commit
    • Eli Zaretskii's avatar
      Fix bug #16636 with simple dialogs on MS-Windows. · e139a33c
      Eli Zaretskii authored
       src/w32menu.c (w32_popup_dialog): Don't condition the whole function
       on HAVE_DIALOGS.  If the dialog is "simple", pop up a message box
       to show it; otherwise return 'unsupported--w32-dialog' to signal
       to the caller that emulation with menus is necessary.  This
       resurrects code inadvertently deleted by the 2013-10-08 commit.
       (syms_of_w32menu): DEFSYM Qunsupported__w32_dialog.
       src/w32term.h (w32_popup_dialog): Prototype is no longer conditioned
       by HAVE_DIALOGS.
       src/menu.c (Fx_popup_dialog): Don't condition the call to
       w32_popup_dialog on HAVE_DIALOGS.  If w32_popup_dialog returns a
       special symbol 'unsupported--w32-dialog', emulate the dialog with
       a menu by calling x-popup-menu.
       src/menu.h (Qunsupported__w32_dialog): New extern variable.
      e139a33c
  33. 01 Jan, 2014 1 commit
  34. 17 Dec, 2013 1 commit
    • Eli Zaretskii's avatar
      Fix some warnings in w32 specific code. · af025ae8
      Eli Zaretskii authored
       src/w32term.c (w32_initialize): Declare the argument of
       set_user_model as const.
       src/w32menu.c <MessageBoxW_Proc>: Fix argument declarations.
       (w32_menu_show): Constify some arguments passed to MessageBox.
       src/w32uniscribe.c (uniscribe_font_driver): Use LISP_INITIALLY_ZERO
       to initialize Lisp objects.
       src/w32font.c (w32font_driver): Use LISP_INITIALLY_ZERO to
       initialize Lisp objects.
       src/frame.c (x_set_frame_parameters) [HAVE_X_WINDOWS]: Declare and
       use variables used only on X under that condition.
       src/fileio.c (Fcopy_file) [!WINDOWSNT]: Don't declare on Windows
       variables not used there.
      af025ae8
  35. 30 Nov, 2013 1 commit
    • Martin Rudalics's avatar
      Support resizing frames and windows pixelwise. · 880e6158
      Martin Rudalics authored
      * dispextern.h (enum window_part): Add ON_SCROLL_BAR,
      ON_RIGHT_DIVIDER and ON_BOTTOM_DIVIDER.
      (struct glyph_matrix): Replace window_left_col and
      window_top_line by window_pixel_left and window_pixel_top.
      (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P): Minor
      rewrite.
      (enum face_id): Add WINDOW_DIVIDER_FACE_ID.
      (draw_window_divider, move_it_to, x_draw_right_divider)
      (x_draw_bottom_divider, change_frame_size): Add or fix
      declarations.
      * dispnew.c (change_frame_size_1): Change prototype.
      (adjust_glyph_matrix, required_matrix_width)
      (adjust_frame_glyphs_for_window_redisplay): Use pixel
      values instead of lines and columns.
      (marginal_area_string): Use WINDOW_FRINGES_WIDTH instead of
      WINDOW_TOTAL_FRINGE_WIDTH.
      (handle_window_change_signal, do_pending_window_change)
      (init_display): Adjusts calls of change_frame_size.
      (change_frame_size, change_frame_size_1): Handle pixelwise
      changes.
      * frame.c (Qright_divider_width, Qbottom_divider_width): New
      Lisp objects.
      (set_menu_bar_lines_1, set_menu_bar_lines, make_frame)
      (make_terminal_frame, Fmake_terminal_frame, Fframe_parameters)
      (x_set_internal_border_width, x_set_vertical_scroll_bars)
      (x_set_scroll_bar_width, x_figure_window_size): Handle pixel
      values.
      (set_frame_param): New function.
      (Fframe_text_cols, Fframe_text_lines, Fframe_total_cols)
      (Fframe_text_width, Fframe_text_height, Fscroll_bar_width)
      (Ffringe_width, Fborder_width, Fright_divider_width)
      (Fbottom_divider_width): New functions, defsubr them.
      (Fset_frame_height, Fset_frame_width, Fset_frame_size): New
      argument pixelwise.
      (struct frame_parm_table): New members Qright_divider_width and
      Qbottom_divider_width.
      (x_set_frame_parameters): Handle parameters for pixelwise sizes.
      (x_report_frame_params): Handle Qright_divider_width and
      Qbottom_divider_width.
      (x_set_right_divider_width, x_set_bottom_divider_width): New
      functions.
      (frame_resize_pixelwise): New option.
      * frame.h (struct frame): Add tool_bar_height, menu_bar_height,
      new_pixelwise, right_divider_width and bottom_divider_width;
      remove total_lines; rename text_lines, text_cols, new_text_lines
      and new_text_cols to text_height, text_width, new_height and
      new_width respectively.
      (FRAME_LINES, FRAME_COLS): Rename to FRAME_TEXT_HEIGHT and
      FRAME_TEXT_WIDTH respectively.
      (FRAME_MENU_BAR_HEIGHT, FRAME_TOOL_BAR_HEIGHT)
      (FRAME_RIGHT_DIVIDER_WIDTH, FRAME_BOTTOM_DIVIDER_WIDTH)
      (FRAME_TEXT_TO_PIXEL_WIDTH, FRAME_PIXEL_TO_TEXT_WIDTH): New
      macros.
      (FRAME_TOP_MARGIN_HEIGHT, FRAME_LEFT_SCROLL_BAR_AREA_WIDTH)
      (FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH, FRAME_SCROLL_BAR_AREA_WIDTH)
      (SET_FRAME_COLS, SET_FRAME_WIDTH, SET_FRAME_HEIGHT)
      (FRAME_TEXT_COLS_TO_PIXEL_WIDTH, FRAME_PIXEL_WIDTH_TO_TEXT_COLS)
      (FRAME_TEXT_COLS_TO_PIXEL_WIDTH): Rewrite macros.
      (FRAME_TOTAL_COLS_ARG): Remove macro.
      * fringe.c (draw_fringe_bitmap_1): Handle right divder.
      * gtkutil.c (xg_frame_resized, xg_frame_set_char_size)
      (x_wm_set_size_hint): Handle frame pixel sizes.
      * indent.c (compute_motion, Fcompute_motion): Call
      window_body_width instead of window_body_cols.
      * keyboard.c (Qright_divider, Qbottom_divider): New symbols.
      (make_lispy_position): Handle right and bottom dividers.
      (Fsuspend_emacs): Pixelize call of change_frame_size.
      * keyboard.h: Extern Qright_divider, Qbottom_divider.
      * lisp.h: Extern set_frame_param.
      * nsfns.m (x_set_tool_bar_lines): Pixelize call of
      x_set_window_size.
      (Fx_create_frame): Add entry for vertical_drag_cursor.  Pixelize
      call of change_frame_size.
      * nsterm.h (struct ns_output): Add vertical_drag_cursor.
      * nsterm.m (ns_update_window_end): Optionally draw right
      divider.
      (x_set_window_size): Add argument pixelwise.  Call
      check_frame_size and change_frame_size with pixelwise zero.
      (ns_draw_window_divider): New function.
      (ns_redisplay_interface): Add ns_draw_window_divider.
      (updateFrameSize:): Call change_frame_size with pixelwise zero.
      (x_new_font): Call x_set_window_size with pixelwise zero.
      * print.c (print_object): For a window print its sequence
      number again.
      * term.c (Fresume_tty): Pixelize call of change_frame_size.
      * w32fns.c (x_set_mouse_color): Handle vertical drag cursor.
      (x_set_menu_bar_lines, x_set_tool_bar_lines): Calculate pixelwise.
      (w32_createwindow): Use scroll bar area width.
      (w32_wnd_proc): Handle bottom divider width.  For
      WM_WINDOWPOSCHANGING return zero if we resize pixelwise.
      (Fx_create_frame): Default divider width parameters.  Caclulate
      sizes pixelwise.  Add vertical drag cursor support.
      (x_create_tip_frame): Default divider widths to zero.  Pixelize
      call to change_frame_size.
      (Fx_show_tip): Add handling of divider widths.  Pixelize window
      position and sizes.
      (Fw32_frame_rect): New function.
      (frame_parm_handler w32_frame_parm_handlers): Add divider
      widths.
      (Vx_window_vertical_drag_shape): Add variable.
      * w32inevt.c (resize_event, maybe_generate_resize_event):
      Pixelize change_frame_size calls.
      * w32menu.c (set_frame_menubar): Pixelize x_set_window_size
      call.
      * w32term.c (w32_draw_window_divider): New function.
      (x_update_window_end): Handle right divider.
      (w32_draw_fringe_bitmap, x_scroll_run)
      (w32_set_vertical_scroll_bar): Pixelize scrollbar widths.
      (w32_read_socket): Handle SIZE_MAXIMIZED separately.  Calculate
      new frame sizes pixelwise.
      (x_new_font): Pixelize call to x_set_window_size.
      (x_check_fullscreen): Pixelize call to change_frame_size.
      (x_set_window_size_1, x_set_window_size): New argument
      pixelwise.  Calculate pixelwise.
      (x_wm_set_size_hint): Use scroll bar area width.
      (w32_redisplay_interface): Add w32_draw_window_divider.
      * w32term.h (struct w32_output): Add vertical drag cursor.
      * widget.c (set_frame_size, update_wm_hints)
      (EmacsFrameResize, EmacsFrameSetValues): Pixelize calls of
      change_frame_size.
      (EmacsFrameSetCharSize): Pixelize call of x_set_window_size.
      * window.c (sequence_number): Restore.
      (Fwindow_pixel_width, Fwindow_pixel_height)
      (Fwindow_mode_line_height, Fwindow_header_line_height)
      (window_pixel_to_total, Frun_window_scroll_functions)
      (Fset_window_new_pixel, window_resize_apply_total)
      (Fwindow_resize_apply_total): New functions.
      (window_body_height, window_body_width): Rename from
      window_body_lines.  New argument PIXELWISE.  Calculate
      pixelwise.
      (Fwindow_body_height, Fwindow_body_width): New argument
      PIXELWISE.
      (coordinates_in_window, window_relative_x_coord): Use window's
      pixel width instead of total width.
      (replace_window, recombine_windows): Initialize pixel values.
      (resize_root_window, resize_frame_windows, grow_mini_window)
      (shrink_mini_window): New argument PIXELWISE.  Calculate
      pixelwise.
      (Fdelete_other_windows_internal, adjust_window_margins)
      (window_resize_check, window_resize_apply)
      (Fdelete_window_internal, Fresize_mini_window_internal)
      (Fwindow_text_width, Fwindow_text_height): Calculate pixelwise.
      (check_frame_size): Rename arguments.  New argument PIXELWISE.
      Calculate pixelwise.
      (set_window_buffer): Make samebuf bool.  Run configuration change
      hook only if buffer changed.
      (Fset_window_buffer): Rewrite doc-string.
      (make_window): Initialize new_pixel slot.
      (Fwindow_resize_apply): Check pixel size of root window.
      (Fsplit_window_internal): Call 2nd argument pixel_size.
      Calculate pixelwise.
      (Fscroll_left, Fscroll_right): Call window_body_width instead of
      window_body_cols.
      (save_window_data): New slots frame_text_width,
      frame_text_height, frame_menu_bar_height, frame_tool_bar_height.
      (saved_window): New slots pixel_left, pixel_top, pixel_height,
      pixel_width.
      (Fcurrent_window_configuration, Fset_window_configuration)
      (save_window_save, compare_window_configurations): Handle new
      slots in save_window_data and saved_window.
      (Fset_window_scroll_bars): Fix doc-string.
      (window_resize_pixelwise): New variable.
      (coordinates_in_window, Fcoordinates_in_window_p): Handle
      dividers.
      (make_parent_window): Adjust sequence_number.
      (Fwindow_right_divider_width, Fwindow_bottom_divider_width): New
      functions.
      * window.h (struct window): New members new_pixel, pixel_left,
      pixel_top, pixel_width, pixel_height.  Restore sequence_number.
      (wset_new_pixel): New function.
      (WINDOW_PIXEL_WIDTH, WINDOW_PIXEL_HEIGHT)
      (MIN_SAFE_WINDOW_PIXEL_WIDTH, MIN_SAFE_WINDOW_PIXEL_HEIGHT)
      (WINDOW_LEFT_PIXEL_EDGE, WINDOW_RIGHT_PIXEL_EDGE)
      (WINDOW_TOP_PIXEL_EDGE, WINDOW_BOTTOM_PIXEL_EDGE)
      (WINDOW_BOTTOMMOST_P, WINDOW_BOX_LEFT_PIXEL_EDGE)
      (WINDOW_BOX_RIGHT_PIXEL_EDGE, WINDOW_MARGINS_COLS)
      (WINDOW_MARGINS_WIDTH, WINDOW_RIGHT_DIVIDER_WIDTH)
      (WINDOW_BOTTOM_DIVIDER_WIDTH): New macros.
      (WINDOW_TOTAL_FRINGE_WIDTH): Rename to WINDOW_FRINGES_WIDTH.
      (WINDOW_TOTAL_WIDTH, WINDOW_TOTAL_HEIGHT): Remove macros.
      (WINDOW_RIGHT_EDGE_X, WINDOW_LEFT_EDGE_X, WINDOW_TOP_EDGE_Y)
      (WINDOW_BOTTOM_EDGE_Y, WINDOW_FULL_WIDTH_P, WINDOW_LEFTMOST_P)
      (WINDOW_RIGHTMOST_P, WINDOW_BOX_LEFT_EDGE_X)
      (WINDOW_BOX_RIGHT_EDGE_X, WINDOW_FRINGE_COLS)
      (WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT):
      Rewrite.
      (resize_frame_windows, grow_mini_window, shrink_mini_window)
      (window_body_width, check_frame_size): Adapt external declarations.
      * xdisp.c (last_max_ascent): New integer.
      (window_text_bottom_y): Handle bottom divider.
      (window_box_width, window_box_height): Calculate pixelwise.
      (get_glyph_string_clip_rects): Handle right divider.
      (remember_mouse_glyph): When windows are resized pixelwise
      proceed with width and height set to 1.
      (init_iterator): Use WINDOW_PIXEL_WIDTH instead of
      WINDOW_TOTAL_WIDTH.
      (move_it_to): Calculate and return maximum x position
      encountered.
      (Fwindow_text_pixel_size): New function.
      (resize_mini_window, update_tool_bar): Calculate pixelwise.
      (tool_bar_lines_needed): Rename to tool_bar_height.  Calculate
      pixelwise.
      (Ftool_bar_lines_needed): Rename to Ftool_bar_height.  Calculate
      pixelwise.
      (redisplay_tool_bar): Calculate pixelwise.
      (redisplay_window): Calculate pixelwise.  Handle dividers.
      (draw_glyphs, x_clear_end_of_line, note_mouse_highlight)
      (x_draw_vertical_border): Handle dividers.
      (define_frame_cursor1): Handle vertical drag cursor.
      (x_draw_right_divider, x_draw_bottom_divider): New functions.
      (expose_window): Calculate pixelwise.  Handle dividers.
      (init_xdisp): Initialize pixel values.
      * xfaces.c (Qwindow_divider): New face.
      (realize_basic_faces): Realize it.
      * xfns.c (x_set_mouse_color): Handle vertical_drag_cursor.
      (x_set_menu_bar_lines, x_set_tool_bar_lines): Calculate pixelwise.
      (x_set_scroll_bar_default_width): Default actual width to 16.
      (Fx_create_frame): Set sizes pixelwise.
      (x_create_tip_frame): Default divider widths to zero.  Pixelize
      call of change_frame_size.
      (Fx_show_tip): Handle divider widths.  Initial pixel position
      and sizes.
      (frame_parm_handler x_frame_parm_handlers): Add divider widths.
      (Vx_window_vertical_drag_shape): New option.
      * xmenu.c (free_frame_menubar): Pixelize call of
      x_set_window_size.
      * xterm.c (x_draw_window_divider): New function.
      (x_update_window_end): Optionally draw right divider.
      (x_draw_fringe_bitmap, x_scroll_run, x_scroll_bar_create)
      (XTset_vertical_scroll_bar): Use scroll bar pixel width.
      (handle_one_xevent, x_new_font): Calculate pixelwise.
      (x_set_window_size_1, x_set_window_size): New argument
      pixelwise.  Calculate pixelwise.
      (x_wm_set_size_hint): Pixelize call of check_frame_size.
      (struct x_redisplay_interface): Add x_draw_window_divider.
      * xterm.h (struct x_output): Add vertical_drag_cursor.
      
      * cus-start.el (frame-resize-pixelwise)
      (window-resize-pixelwise): New entries.
      * emacs-lisp/debug.el (debug): Use window-total-height instead
      of window-total-size.
      * frame.el (tool-bar-lines-needed): Defalias to tool-bar-height.
      * help.el (describe-bindings-internal): Call help-buffer
      (temp-buffer-max-width): New option.
      (resize-temp-buffer-window, help-window-setup)
      (with-help-window): Rewrite.
      * mouse.el (mouse-drag-line): Rewrite.  Add key bindings for
      dragging dividers.
      * window.el (frame-char-size, window-min-pixel-height)
      (window-safe-min-pixel-height, window-safe-min-pixel-width)
      (window-min-pixel-width, window-safe-min-pixel-size)
      (window-combination-p, window-safe-min-size)
      (window-resizable-p, window--size-to-pixel)
      (window--pixel-to-size, window--resize-apply-p): New functions.
      (window-safe-min-height): Fix doc-string.
      (window-size, window-min-size, window--min-size-1)
      (window-sizable, window-sizable-p, window--min-delta-1)
      (window-min-delta, window--max-delta-1, window-max-delta)
      (window--resizable, window--resizable-p, window-resizable)
      (window-full-height-p, window-full-width-p, window-at-side-p)
      (window--in-direction-2, window-in-direction)
      (window--resize-reset-1, window--resize-mini-window)
      (window-resize, window-resize-no-error)
      (window--resize-child-windows-normal)
      (window--resize-child-windows, window--resize-siblings)
      (window--resize-this-window, window--resize-root-window)
      (window--resize-root-window-vertically)
      (adjust-window-trailing-edge, enlarge-window, shrink-window)
      (maximize-window, minimize-window, delete-window)
      (quit-restore-window, window-split-min-size, split-window)
      (balance-windows-2, balance-windows)
      (balance-windows-area-adjust, balance-windows-area)
      (window--state-get-1, window-state-get, window--state-put-1)
      (window--state-put-2, window-state-put)
      (display-buffer-record-window, window--display-buffer): Make
      functions handle pixelwise sizing of windows.
      (display-buffer--action-function-custom-type)
      (display-buffer-fallback-action): Add
      display-buffer-in-previous-window.
      (display-buffer-use-some-window): Resize window to height it had
      before.
      (fit-window-to-buffer-horizontally): New option.
      (fit-frame-to-buffer): Describe new values.
      (fit-frame-to-buffer-bottom-margin): Replace with
      fit-frame-to-buffer-margins.
      (window--sanitize-margin): New function.
      (fit-frame-to-buffer, fit-window-to-buffer): Rewrite completely
      using window-text-pixel-size.
      880e6158
  36. 29 Nov, 2013 1 commit
    • Stefan Monnier's avatar
      * configure.ac (HAVE_MENUS): Remove. · 7cdf484b
      Stefan Monnier authored
      * src/xmenu.c (Fmenu_or_popup_active_p):
      * src/window.c (Fset_window_configuration):
      * src/menu.c (Fx_popup_menu, Fx_popup_dialog):
      * src/keyboard.c (record_menu_key, read_char_x_menu_prompt):
      * src/fns.c (Fyes_or_no_p):
      * src/editfns.c (Fmessage_box, Fmessage_or_box):
      * src/alloc.c (make_save_ptr_ptr):
      * src/xdisp.c, src/w32menu.c, src/term.c, src/xterm.h, src/xterm.c:
      Remove HAVE_MENUS.
      7cdf484b
  37. 04 Nov, 2013 1 commit
    • Paul Eggert's avatar
      Port to stricter C99 platforms. · 91f2d272
      Paul Eggert authored
      Especially, C99 prohibits nesting a struct X inside struct Y if
      struct X has a flexible array member.
      Also, merge from gnulib, incorporating:
      2013-11-03 intprops: port to Oracle Studio c99
      * lib/intprops.h: Update from gnulib.
      * src/alloc.c (struct sdata): New type.
      (sdata): Implement in terms of struct sdata.
      Remove u member; all uses replaced by next_vector, set_next_vector.
      (SDATA_SELECTOR, SDATA_DATA, SDATA_DATA_OFFSET): Adjust to sdata change.
      (SDATA_DATA_OFFSET): Now a constant, not a macro.
      (struct sblock): Rename first_data member to data, which is now
      a flexible array member.  All uses changed.
      (next_vector, set_next_vector, large_vector_vec): New functions.
      (vector_alignment): New constant.
      (roundup_size): Make it a multiple of ALIGNOF_STRUCT_LISP_VECTOR, too.
      (struct large-vector): Now merely a NEXT member, since the old approach
      ran afoul of stricter C99.  All uses changed to use
      large_vector_vec or large_vector_offset.
      (large_vector_offset): New constant.
      * src/dispnew.c: Include tparam.h, for tgetent.
      Do not include term.h; no longer needed.
      * src/gnutls.c (Fgnutls_boot): Don't continue after calling a _Noreturn.
      * src/lisp.h (ENUM_BF) [__SUNPRO_C && __STDC__]: Use unsigned int.
      (struct Lisp_Vector): Use a flexible array member for contents,
      instead of a union with a member that is an array of size 1.
      All uses changed.
      (ALIGNOF_STRUCT_LISP_VECTOR): New constant, to make up for the
      fact that the struct no longer contains a union.
      (struct Lisp_Misc_Any, struct Lisp_Marker, struct Lisp_Overlay)
      (struct Lisp_Save_Value, struct Lisp_Free):
      Use unsigned, not int, for spacers, to avoid c99 warning.
      (union specbinding): Use unsigned, not bool, for bitfield, as
      bool is not portable to pre-C99 hosts.
      91f2d272
  38. 29 Sep, 2013 1 commit
  39. 24 Sep, 2013 1 commit
    • Dmitry Antipov's avatar
      Use union for the payload of struct Lisp_Vector. · d6d9cbc1
      Dmitry Antipov authored
      This helps to avoid a few glitches dictated by C's aliasing rules.
      * lisp.h (struct Lisp_Vector): Use union for next and
      contents member.  Adjust comment.  Change related users.
      * alloc.c (next_in_free_list, set_next_in_free_list): Remove.
      Related users changed.
      * buffer.c, bytecode.c, ccl.c, character.h, chartab.c, composite.c:
      * composite.h, disptab.h, fns.c, fontset.c, indent.c, keyboard.c:
      * lread.c, msdos.c, process.c, w32menu.c, window.c, xdisp.c:
      * xfaces.c, xfont.c, xmenu.c: Related users changed.
      d6d9cbc1