1. 11 Apr, 2017 1 commit
    • Martin Rudalics's avatar
      Frame movement, focus and hook related changes · ea6c880a
      Martin Rudalics authored
      New hook `move-frame-functions'.  Run `focus-in-hook'
      after switching to frame that gets focus.  Don't run
      XMoveWindow for GTK.
      
      * lisp/frame.el (handle-move-frame, frame-size-changed-p): New
      functions.
      
      * src/frame.c (do_switch_frame): Simplify code.
      (Fhandle_switch_frame): Switch frame before running
      `handle-focus-in'.
      (Vfocus_in_hook, Vfocus_out_hook): Clarify doc-strings.
      (Vmove_frame_functions): New hook variable.
      * src/keyboard.c (kbd_buffer_get_event): Handle
      MOVE_FRAME_EVENT.  Handle SELECT_WINDOW_EVENT separately.
      (head_table): Add Qmove_frame entry.
      (syms_of_keyboard): Add Qmove_frame.
      (keys_of_keyboard): Define key for `move-frame'.
      * src/termhooks.h (event_kind): Add MOVE_FRAME_EVENT.
      * src/w32term.c (w32_read_socket): Create MOVE_FRAME_EVENT.
      * src/window.c (run_window_size_change_functions): Record size of
      FRAME's minibuffer window too.
      * src/xterm.c (handle_one_xevent): Create MOVE_FRAME_EVENT.
      (x_set_offset): For GTK call gtk_widget_move instead of
      XMoveWindow.
      ea6c880a
  2. 02 Mar, 2017 2 commits
    • Paul Eggert's avatar
      Restore XFLOATINT but with restricted args · 56aaaf9b
      Paul Eggert authored
      Turn instances of extract_float into XFLOAT_DATA when possible,
      and to a resurrected XFLOATINT when the arg is a number.
      The resurrected XFLOATINT is more like XFLOAT and XINT in
      that is valid only if its arg is a number.  This clarifies
      the ways in which floats can be extracted at the C level.
      * src/editfns.c (styled_format):
      * src/floatfns.c (extract_float, Fexpt):
      Use XFLOATINT rather than open-coding it.
      * src/fns.c (internal_equal):
      * src/image.c (imagemagick_load_image):
      * src/xdisp.c (resize_mini_window):
      Prefer XFLOAT_DATA to extract_float on values known to be floats.
      * src/frame.c (x_set_screen_gamma):
      * src/frame.h (NUMVAL):
      * src/image.c (x_edge_detection, compute_image_size):
      * src/lread.c (read_filtered_event):
      * src/window.c (Fset_window_vscroll):
      * src/xdisp.c (handle_single_display_spec, try_scrolling)
      (redisplay_window, calc_pixel_width_or_height, x_produce_glyphs)
      (on_hot_spot_p):
      Prefer XFLOATINT to extract_float on values known to be numbers.
      * src/lisp.h (XFLOATINT): Bring back this function, except
      it now assumes its argument is a number.
      56aaaf9b
    • Paul Eggert's avatar
      Remove XFLOATINT · d0d26c13
      Paul Eggert authored
      * src/lisp.h (XFLOATINT): Remove this alias for extract_float.
      All callers changed to use extract_float.
      * src/frame.h (NUMVAL): Now an inline function, not a macro.
      d0d26c13
  3. 03 Feb, 2017 4 commits
    • Noam Postavsky's avatar
      Fix scrolling with partial lines · b9be4c14
      Noam Postavsky authored
      * src/xdisp.c (partial_line_height): New function.
      (try_scrolling):
      * src/window.c (window_scroll_pixel_based): Use it for calculating the
      pixel scroll margin correctly in a window with partial lines.
      b9be4c14
    • Noam Postavsky's avatar
      Make limit on scroll-margin variable · e27a91cd
      Noam Postavsky authored
      * src/xdisp.c (maximum-scroll-margin): New variable.
      * lisp/cus-start.el: Make it customizable.
      * etc/NEWS: Mention it.
      * doc/emacs/display.texi (Auto Scrolling):
      * doc/lispref/windows.texi (Textual Scrolling): Document it.
      * src/window.c (window_scroll_pixel_based): Use it instead of hardcoding
      division by 4 (Bug #5718).
      e27a91cd
    • Noam Postavsky's avatar
      Don't count mode line for scroll-margin limit · c92fc7a2
      Noam Postavsky authored
      * src/window.c (window_scroll_margin): Use window_box_height to avoid
      counting header line, scrollbars for scroll-margin limit (Bug #5718).
      c92fc7a2
    • Noam Postavsky's avatar
      Refactor uses of scroll_margin to a function · d17e92da
      Noam Postavsky authored
      Its effective range needs to be clamped between 0 and (window height /
      4), so it's better to have this constraint in a single place.
      
      * src/window.c (window_scroll_margin): New function.
      (window_scroll_pixel_based, window_scroll_line_based):
      (Frecenter, Fmove_to_window_line):
      * src/xdisp.c (try_scrolling, try_cursor_movement):
      (redisplay_window, try_window, try_window_id): Use it.
      d17e92da
  4. 01 Feb, 2017 1 commit
    • Paul Eggert's avatar
      Remove immediate_quit. · 33be5003
      Paul Eggert authored
      The old code that sets and clears immediate_quit was
      ineffective except when Emacs is running in terminal mode, and
      has problematic race conditions anyway, so remove it.  This
      will introduce some hangs when Emacs runs in terminal mode,
      and these hangs should be fixed in followup patches.
      * src/keyboard.c (immediate_quit): Remove.  All uses removed.
      33be5003
  5. 26 Jan, 2017 1 commit
    • Paul Eggert's avatar
      Replace QUIT with maybe_quit · b3a3ed52
      Paul Eggert authored
      There’s no longer need to have QUIT stand for a slug of C statements.
      Use the more-obvious function-call syntax instead.
      Also, use true and false when setting immediate_quit.
      These changes should not affect the generated machine code.
      * src/lisp.h (QUIT): Remove.  All uses replaced by maybe_quit.
      b3a3ed52
  6. 01 Jan, 2017 1 commit
  7. 22 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Pacify --enable-gcc-warnings · b10bd719
      Paul Eggert authored
      * src/charset.c (load_charset_map):
      * src/coding.c (decode_coding_object):
      * src/frame.c (make_frame):
      * src/window.c (Frecenter):
      Mark locals with UNINIT to silence false alarms from
      -Wmaybe-uninitialized.
      * src/lisp.h (SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD)
      (SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD):
      Check and assume that values are nonnull.  This pacifies
      -Wmaybe-uninitialized in Fmake_variable_buffer_local and
      Fmake_local_variable.
      b10bd719
  8. 01 Dec, 2016 1 commit
  9. 17 Oct, 2016 1 commit
    • Martin Rudalics's avatar
      Fix frame focus redirection with shared minibuffer windows (Bug#24500) · 421c0512
      Martin Rudalics authored
      * src/frame.c (do_switch_frame): Redirect frame focus also when
      the frame switched to has its minibuffer window on the selected
      frame.
      * src/window.c (candidate_window_p): To qualify as candidate
      it's not sufficient for the window's frame to just share the
      minibuffer window - it must be active as well.
      421c0512
  10. 05 Sep, 2016 1 commit
    • Eli Zaretskii's avatar
      Avoid assertion violations when scrolling narrowed buffer · 6acff252
      Eli Zaretskii authored
      * src/window.c (window_scroll_pixel_based):
      * src/xdisp.c (pos_visible_p): Don't allow simulated redisplay to
      start outside the accessible portion of the buffer.  This avoids
      assertion violations when some Lisp narrows the buffer to less
      than the current window, and then attempts to scroll the buffer.
      6acff252
  11. 03 Aug, 2016 2 commits
  12. 02 Aug, 2016 1 commit
  13. 27 Jun, 2016 1 commit
    • Eli Zaretskii's avatar
      Fix 'move-to-window-line' when EOB is on last screen line · defdee72
      Eli Zaretskii authored
      * src/window.c (displayed_window_lines): Fix an off-by-one error
      when the bottom of the last display line is exactly at window's
      last pixel.  Remove kludgey fix for TTY frames that is no longer
      needed.  (Bug#15760)
      (Fmove_to_window_line): Doc fix.
      
      * doc/lispref/positions.texi (Screen Lines): Clarify and make more
      accurate the documentation of 'move-to-window-line'.
      defdee72
  14. 08 Jun, 2016 1 commit
  15. 30 May, 2016 1 commit
    • Paul Eggert's avatar
      Omit IF_LINT code that no longer seems needed · 237244bb
      Paul Eggert authored
      Nowadays GCC is smarter, or the Emacs code has mutated, or both,
      and now is as good a time as any to remove uses of IF_LINT that
      now seem to be unnecessary.
      * lib-src/emacsclient.c (set_local_socket):
      * lib-src/movemail.c (main) [MAIL_USE_MAILLOCK && HAVE_TOUCHLOCK]:
      * src/buffer.c (fix_start_end_in_overlays, fix_overlays_before):
      * src/casefiddle.c (casify_region):
      * src/charset.c (load_charset_map):
      * src/coding.c (decode_coding_object, encode_coding_object):
      * src/data.c (Fmake_variable_buffer_local, Fmake_local_variable)
      (cons_to_unsigned, cons_to_signed):
      * src/frame.c (make_frame, x_set_frame_parameters):
      * src/keyboard.c (read_event_from_main_queue):
      * src/regex.c (regex_compile):
      * src/syntax.c (back_comment):
      * src/window.c (Frecenter):
      * src/xfaces.c (Fx_list_fonts):
      Remove IF_LINT that no longer seems necessary.
      * src/image.c (png_load_body, jpeg_load_body): Simplify use of IF_LINT.
      * src/keyboard.c (read_char): Use IF_LINT (volatile) rather than
      a pragma dance to pacify GCC -Wclobbered.
      * src/xdisp.c (x_produce_glyphs): Rewrite to avoid need for IF_LINT.
      
      * src/xterm.c (x_connection_closed): Now _Noreturn, which should
      mean we do not need IF_LINT any more.
      (x_io_error_quitter): Now _Noreturn.  Put an 'assume (false)’
      at the end, to forestall warnings from older compilers.
      237244bb
  16. 27 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rename C names to match Lisp symbols better · f41f573e
      Paul Eggert authored
      This was inspired by commit e65c3079,
      which fixed a bug where the C name for a symbol disagreed with the
      symbol name itself.  Fix other instances of disagreements that I found.
      Although this doesn’t fix a bug, it should make code easier to follow.
      The remaining disagreements are idiosyncratic: Qminus, Qplus,
      Qsans__serif, Qbackquote, Qcomma, Qcomma_at, Qcomma_dot.
      All uses changed.
      * src/alloc.c (QAutomatic_GC): Rename from Qautomatic_gc.
      * src/dbusbind.c (QCsystem): Rename from QCdbus_system_bus.
      (QCsession): Rename from QCdbus_session_bus.
      (QCtimeout): Rename from QCdbus_timeout.
      (QCbyte): Rename from QCdbus_type_byte.
      (QCboolean): Rename from QCdbus_type_boolean.
      (QCint16): Rename from QCdbus_type_int16.
      (QCuint16): Rename from QCdbus_type_uint16.
      (QCint32): Rename from QCdbus_type_int32.
      (QCuint32): Rename from QCdbus_type_uint32.
      (QCint64): Rename from QCdbus_type_int64.
      (QCuint64): Rename from QCdbus_type_uint64.
      (QCdouble): Rename from QCdbus_type_double.
      (QCstring): Rename from QCdbus_type_string.
      (QCobject_path): Rename from QCdbus_type_object_path.
      (QCsignature): Rename from QCdbus_type_signature.
      (QCunix_fd): Rename from QCdbus_type_unix_fd.
      (QCarray): Rename from QCdbus_type_array.
      (QCvariant): Rename from QCdbus_type_variant.
      (QCstruct): Rename from QCdbus_type_struct.
      (QCdict_entry): Rename from QCdbus_type_dict_entry.
      (QCserial): Rename from QCdbus_registered_serial.
      (QCmethod): Rename from QCdbus_registered_method.
      (QCsignal): Rename from QCdbus_registered_signal.
      * src/emacs-module.c (Qinternal__module_call):
      Rename from Qinternal_module_call.
      * src/frame.c (Qwindow__pixel_to_total):
      Rename from Qwindow_pixel_to_total.
      * src/gnutls.c (QChostname): Rename from QCgnutls_bootprop_hostname.
      (QCpriority): Rename from QCgnutls_bootprop_priority.
      (QCtrustfiles): Rename from QCgnutls_bootprop_trustfiles.
      (QCkeylist): Rename from QCgnutls_bootprop_keylist.
      (QCcrlfiles): Rename from QCgnutls_bootprop_crlfiles.
      (QCmin_prime_bits): Rename from QCgnutls_bootprop_min_prime_bits.
      (QCloglevel): Rename from QCgnutls_bootprop_loglevel.
      (QCcomplete_negotiation): Rename from QCgnutls_complete_negotiation.
      (QCverify_flags): Rename from QCgnutls_bootprop_verify_flags.
      (QCverify_error): Rename from QCgnutls_bootprop_verify_error.
      * src/w32fns.c (Qfont_parameter): Rename from Qfont_param.
      (Qgnutls): Rename from Qgnutls_dll.
      (Qlibxml2): Rename from Qlibxml2_dll.
      (Qzlib): Rename from Qzlib_dll.
      * src/w32select.c (Qutf_16le_dos): Rename from QUNICODE.
      * src/window.c (Qwindow__resize_root_window):
      Rename from Qwindow_resize_root_window.
      (Qwindow__resize_root_window_vertically):
      Rename from Qwindow_resize_root_window_vertically.
      (Qwindow__sanitize_window_sizes):
      Rename from Qwindow_sanitize_window_sizes.
      (Qwindow__pixel_to_total): Rename from Qwindow_pixel_to_total.
      * src/xdisp.c (Qredisplay_internal_xC_functionx):
      Rename from Qredisplay_internal.
      * src/xfns.c (Qfont_parameter): Rename from Qfont_param.
      * src/xselect.c (Q_EMACS_TMP_): Rename from QEMACS_TMP.
      f41f573e
  17. 26 Mar, 2016 1 commit
    • Martin Rudalics's avatar
      Safely run window size change functions · cad9d76e
      Martin Rudalics authored
      * src/window.c (run_window_size_change_functions): Use
      safe_call1 when running a size change function.
      (grow_mini_window, shrink_mini_window): Report error when
      minibuffer window cannot be resized.
      cad9d76e
  18. 20 Mar, 2016 1 commit
  19. 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
  20. 23 Feb, 2016 2 commits
    • Paul Eggert's avatar
      Minor cleanups for async DNS etc. · 82848cf6
      Paul Eggert authored
      * src/frame.h (FRAME_WINDOW_CONFIGURATION_CHANGED):
      Omit unnecessary parens.
      * src/gnutls.c (gnutls_try_handshake, emacs_gnutls_deinit)
      (gnutls_verify_boot):
      Use bool for boolean.
      (ATTRIBUTE_FORMAT_PRINTF): Add printf attribute.
      * src/process.c (free_dns_request, Fmake_network_process):
      Allocate and free async request control block all in one go.
      (set_network_socket_coding_system, finish_after_tls_connection)
      (connect_network_socket):
      Now static.
      (conv_numerical_to_lisp): 2nd arg is now int, not unsigned.
      (Fmake_network_process): Use list1 for brevity.
      (wait_for_socket_fds): 2nd arg is now const ptr.
      * src/process.h (struct Lisp_Process.dns_request):
      Now struct gaicb *, not struct gaicb **, since there was always
      exactly one.  All uses changed.
      * src/window.c, src/window.h (run_window_configuration_change_hook):
      Now static.
      82848cf6
    • Martin Rudalics's avatar
      Fix `window-configuration-change-hook' and `window-size-change-functions' · 8e7712c7
      Martin Rudalics authored
      (1) Run `window-configuration-change-hook' if and only if at least
      one window was deleted or created or shows another buffer since
      last redisplay.
      
      (2) Run `window-size-change-functions' if and only if at least
      one window changed its size since last redisplay (in a few cases
      `window-size-change-functions' will also run when no window
      changed its size).
      
      (3) Provide two functions `window-pixel-height-before-size-change'
      and `window-pixel-width-before-size-change' that allow to easily
      detect which window changed size.
      
      * src/frame.h (struct frame): New boolean member
      window_configuration_changed.
      (FRAME_WINDOW_SIZES_CHANGED): Remove macro.
      (FRAME_WINDOW_CONFIGURATION_CHANGED): New macro.
      * src/frame.c (adjust_frame_size): Don't run
      `window-configuration-change-hook'.
      * src/window.h (struct window): New fields
      pixel_width_before_size_change and pixel_height_before_size_change.
      (WINDOW_INTERNAL_P): New macro.
      * src/window.c (Fwindow_pixel_width_before_size_change)
      (Fwindow_pixel_height_before_size_change): New functions.
      (Fdelete_other_windows_internal, Fwindow_resize_apply)
      (resize_frame_windows, Fsplit_window_internal)
      (Fdelete_window_internal, grow_mini_window)
      (shrink_mini_window, Fresize_mini_window_internal): Don't call
      FRAME_WINDOW_SIZES_CHANGED.
      (window_size_changed, window_set_before_size_change_sizes)
      (run_window_size_change_functions): New functions.
      (make_window): Initialize pixel_width_before_size_change and
      pixel_height_before_size_change.
      (Fdelete_window_internal): Don't call
      run_window_configuration_change_hook.
      (struct saved_window): Add pixel_height_before_size_change and
      pixel_width_before_size_change.
      (Fset_window_configuration): Try to identify window configuration
      changes correctly so run_window_configuration_change_hook and
      run_window_size_change_functions run only if configuration and size
      really changed.
      (save_window_save): Set the pixel_height_before_size_change and
      pixel_width_before_size_change fields.
      (Vwindow_size_change_functions): Move here definiton from xdisp.c.
      * src/xdisp.c (prepare_menu_bars, redisplay_internal): Call
      run_window_size_change_functions.
      (Vwindow_size_change_functions): Move definition to window.c.
      * src/xfns.c (x_set_menu_bar_lines): Don't call
      run_window_configuration_change_hook.
      * doc/lispref/windows.texi (Window Sizes): Document new
      functions `window-pixel-height-before-size-change' and
      `window-pixel-width-before-size-change'.
      (Window Configurations): Mention that this may trigger
      execution of `window-size-change-functions' although no window
      changed size.
      (Window Hooks): Update descriptions of `window-size-change-functions'
      and `window-configuration-change-hook'.
      8e7712c7
  21. 24 Jan, 2016 1 commit
    • Alan Mackenzie's avatar
      Expunge "allow" + infinitive without direct object from source and doc. · fbce4757
      Alan Mackenzie authored
      Do the same for "permit", "enable", and "prevent".
      
      * doc/emacs/mule.texi:
      * doc/lispref/control.texi:
      * doc/lispref/display.texi:
      * doc/lispref/frames.texi:
      * doc/lispref/functions.texi:
      * doc/lispref/nonascii.texi:
      * doc/lispref/streams.texi:
      * doc/lispref/windows.texi:
      * doc/misc/dbus.texi:
      * doc/misc/eww.texi:
      * doc/misc/flymake.texi:
      * doc/misc/octave-mode.texi:
      * doc/misc/org.texi:
      * doc/misc/reftex.texi:
      * doc/misc/tramp.texi:
      * doc/misc/wisent.texi:
      * etc/NEWS:
      * lisp/autorevert.el:
      * lisp/cedet/mode-local.el:
      * lisp/cedet/semantic/senator.el:
      * lisp/cedet/semantic/wisent.el:
      * lisp/dos-fns.el:
      * lisp/frameset.el:
      * lisp/gnus/gnus-agent.el:
      * lisp/gnus/mm-util.el:
      * lisp/international/characters.el:
      * lisp/ldefs-boot.el:
      * lisp/mail/mailclient.el:
      * lisp/man.el:
      * lisp/mh-e/mh-search.el:
      * lisp/net/tramp-cmds.el:
      * lisp/net/tramp-gvfs.el:
      * lisp/org/org-crypt.el:
      * lisp/org/org-element.el:
      * lisp/org/org-feed.el:
      * lisp/org/org.el:
      * lisp/org/ox-ascii.el:
      * lisp/org/ox-icalendar.el:
      * lisp/org/ox-publish.el:
      * lisp/org/ox.el:
      * lisp/play/gamegrid.el:
      * lisp/play/gomoku.el:
      * lisp/progmodes/antlr-mode.el:
      * lisp/progmodes/python.el:
      * lisp/progmodes/vhdl-mode.el:
      * lisp/strokes.el:
      * lisp/textmodes/ispell.el:
      * lisp/tree-widget.el:
      * lisp/vc/pcvs.el:
      * lisp/window.el:
      * src/lisp.h:
      * src/w32.c:
      * src/w32heap.c:
      * src/w32term.c:
      * src/window.c:
      * src/xfaces.c:
      
      Replace solecisms like "This allow to do something" with a correct
      alternative, such as "This allow you to do something", "This allows
      something to be done" or "This allows the doing of something".
      fbce4757
  22. 22 Jan, 2016 1 commit
    • Paul Eggert's avatar
      xwidgets style cleanup · 7c3d742c
      Paul Eggert authored
      Adjust the newly-added Xwidgets code so that it uses a more-typical
      Emacs style.  This should not affect behavior, except that in
      a few places it adds runtime checks that Lisp arguments are of
      the proper type, and in one place it uses more-precise arithmetic.
      * src/buffer.c, src/dispnew.c, src/emacs.c, src/emacsgtkfixed.c:
      * src/emacs.c, src/print.c, src/window.c, src/xdisp.c, src/xterm.c:
      Include xwidget.h unconditionally.
      * src/buffer.c (Fkill_buffer):
      * src/dispnew.c (update_window):
      * src/emacs.c (main):
      * src/print.c (print_object):
      * src/window.c (Fdelete_window_internal):
      * src/xdisp.c (handle_single_display_spec, push_it, pop_it)
      (get_next_element, set_iterator_to_next, next_element_from_xwidget)
      (dump_glyph, calc_pixel_width_or_height, BUILD_GLYPH_STRINGS_XW)
      (BUILD_GLYPH_STRINGS, x_produce_glyphs, get_window_cursor_type):
      * src/xterm.c (x_draw_glyph_string, x_draw_bar_cursor):
      Call xwidget functions and macros without worrying about
      HAVE_XWIDGETS when the code is a no-op on non-xwidget
      platforms.
      * src/dispextern.h (XWIDGET_GLYPH, struct glyph_string.xwidget)
      (IT_XWIDGET, GET_FROM_XWIDGET, struct it.u.xwidget)
      (struct it.xwidget):
      * src/lisp.h (PVEC_XWIDGET, PVEC_XWIDGET_VIEW):
      Always define.
      * src/emacsgtkfixed.h: Omit unnecessary comment.
      * src/keyboard.c: Fix spacing.
      * src/xdisp.c (BUILD_XWIDGET_GLYPH_STRING, produce_xwidget_glyph):
      Define to be a no-op if not HAVE_XWIDGETS.
      * src/xwidget.c: Include xwidget.h first (after config.h)
      to make sure that it can stand by itself.
      (Fmake_xwidget, Fxwidget_webkit_execute_script):
      Fix typo in doc string.
      (Fmake_xwidget): Check type of args.
      (Fmake_xwidget, offscreen_damage_event)
      (webkit_document_load_finished_cb, webkit_download_cb)
      (webkit_new_window_policy_decision_requested_cb)
      (webkit_navigation_policy_decision_requested_cb)
      (xwidget_osr_draw_cb, xwidget_osr_event_forward)
      (xwidget_osr_event_set_embedder, xwidget_init_view):
      Omit unnecessary casts.
      * src/xwidget.c (Fmake_xwidget, xwidget_hidden)
      (xwidget_show_view, xwidget_hide_view)
      (x_draw_xwidget_glyph_string, xwidget_start_redisplay, xwidget_touch)
      (xwidget_touched):
      * src/xwidget.h (struct xwidget.kill_without_query)
      (struct xwidget_view.redisplayed, struct xwidget_view.hidden):
      Use bool for boolean.
      * src/xwidget.c (store_xwidget_event_string, Fxwidget_size_request):
      Simplify by using list functions.
      (WEBKIT_FN_INIT): Omit unnecessary test for nil.
      (Fxwidget_resize): Check type of integer args
      before doing any work.  Check that they are nonnegative.
      (Fxwidget_set_adjustment): Check type of integer arg.
      Avoid redundant call to gtk_scrolled_window_get_vadjustment.
      Simplify.  Use double, not float.
      (Fxwidget_info, Fxwidget_view_info): Simplify by using CALLN.
      (valid_xwidget_spec_p): Simplify.
      (xwidget_spec_value): Omit unused arg FOUND.  All callers changed.
      * src/xwidget.h: Include lisp.h first, so that includers do
      not need to worry about doing that before including this file.
      Make this .h file safe to include even on non-HAVE_XWIDGETS
      configurations, to simplify the includers.
      (x_draw_xwidget_glyph_string, syms_of_xwidget, valid_xwidget_spec_p)
      (xwidget_end_redisplay, lookup_xwidget)
      (xwidget_view_delete_all_in_window, kill_buffer_xwidgets):
      Now a no-op if !HAVE_XWIDGETS, to simplify callers.
      (struct glyph_matrix, struct glyph_string, struct xwidget)
      (struct xwidget_view, struct window):
      New forward or incomplete decls, so that includers need not
      assume the corresponding .h files are already included, or that
      HAVE_XWIDGETS is defined.
      (struct xwidget_type, xwidget_from_id): Remove; unused.
      7c3d742c
  23. 19 Jan, 2016 1 commit
    • Joakim Verona's avatar
      Support for the new Xwidget feature. · 7c1f66a9
      Joakim Verona authored
      * configure.ac:
      (HAVE_XWIDGETS, WIDGET_OBJ, EMACS_CONFIG_FEATURES):
      * xterm.c (x_draw_glyph_string, x_draw_bar_cursor):
      * xdisp.c:
      (handle_display_spec, handle_single_display_spec, push_it)
      (pop_it, set_iterator_to_next, dump_glyph)
      (calc_pixel_width_or_height, fill_xwidget_glyph_string)
      (BUILD_XWIDGET_GLYPH_STRING, BUILD_GLYPH_STRINGS)
      (produce_xwidget_glyph, x_produce_glyphs)
      (get_window_cursor_type):
      * window.c (Fdelete_window_internal):
      * termhooks.h (e):
      * print.c (print_object):
      * lisp.h (ptrdiff_t):
      * keyboard.c (kbd_buffer_get_event, make_lispy_event)
      (syms_of_keyboard):
      * emacs.c (main):
      * dispnew.c (update_window, scrolling_window):
      * dispextern.h (g, i):
      * Makefile.in (XWIDGETS_OBJ, WEBKIT_CFLAGS, WEBKIT_LIBS)
      (GIR_LIBS, ALL_CFLAGS, base_obj, LIBES):
      * keyboard.c (kbd_buffer_get_event):
      * emacsgtkfixed.c (emacs_fixed_gtk_widget_size_allocate)
      (emacs_fixed_class_init): Add case for an xwidget view.
      
      * xwidget.c, xwidget.h, xwidget.el: New files for xwidgets
      Co-authored-by: default avatarGrégoire Jadi  <daimrod@gmail.com>
      
      Various improvements to the Xwidget feature.
      * xwidgets.c:
      * emacsgtkfixed.c:
      * xwidget.el:
      7c1f66a9
  24. 18 Jan, 2016 2 commits
  25. 15 Jan, 2016 1 commit
  26. 01 Jan, 2016 1 commit
  27. 14 Dec, 2015 1 commit
    • Alan Mackenzie's avatar
      Replace GROUP argument in six window primitives by new functions. · e8937de5
      Alan Mackenzie authored
      * doc/lispref/windows.texi (Window Start and End, Textual Scrolling)
      * doc/lispref/positions.texi (Screen Lines): Remove optional GROUP argument
      from description of six window functions.  Add in description of new functions
      window-group-start, window-group-end, set-window-group-start,
      pos-visible-in-window-group-p, recenter-group and move-to-window-group-line,
      together with the six variables indirecting to the pertinent group
      functions.
      
      * src/window.c
      * src/keyboard.c: Revert the commit from 2015-11-11 12:02:48, in so far as it
      applies to these two files, which added the GROUP argument to six window
      primitives.
      
      * lisp/follow.el (follow-mode): Use updated variable names for the indirected
      functions.
      
      * lisp/isearch.el (isearch-update, isearch-done, isearch-string-out-of-window)
      (isearch-back-into-window, isearch-lazy-highlight-new-loop)
      (isearch-lazy-highlight-search, isearch-lazy-highlight-update): Replace calls
      to window primitives (e.g. window-start) with a GROUP argument by calls to
      new functions (e.g. window-group-start).
      
      * lisp/ispell.el (ispell-command-loop): Replace call to
      pos-visible-in-window-p with pos-visible-in-window-group-p.
      
      * lisp/window.el (window-group-start, window-group-end)
      (set-window-group-start, recenter-group, pos-visible-in-window-group-p)
      (selected-window-group, move-to-window-group-line): New functions.
      (window-group-start-function, window-group-end-function)
      (set-window-group-start-function, recenter-group-function)
      (pos-visible-in-window-group-p-function, selected-window-group-function)
      (move-to-window-group-line-function): New variables.
      e8937de5
  28. 04 Dec, 2015 1 commit
    • Alan Mackenzie's avatar
      First commit to scratch/follow. Make Isearch work with Follow Mode, etc. · 64c57303
      Alan Mackenzie authored
      doc/lispref/window.texi (Basic Windows): Add paragraph defining "Group of
      Windows" and new @defun selected-window-group.
      (Window Start and End): Describe new &optional parameter GROUP and
      ...-group-function for window-start, window-end, set-window-start, and
      pos-visible-in-window-p.
      (Textual Scrolling) Describe the same for recenter.
      doc/lispref/positions.texi (Screen Lines): Describe the same for
      move-to-window-line.
      
      src/window.c (Fwindow_start, Fwindow_end, Fset_window_start)
      (Fpos_visible_in_window_p, Frecenter, Fmove_to_window_line): To each, add ar
      new optional parameter "group".  At the beginning of each, check whether the
      corresponding ...-group-function is set to a function, and if so execute this
      function in place of the normal processing.
      (syms_of_window): Define symbols for the six new variables below.
      (window-start-group-function, window-end-group-function)
      (set-window-start-group-function, recenter-group-function)
      (pos-visible-in-window-p-group-function, move-to-window-line-group-function):
      New permanent local buffer local variables.
      src/keyboard.c (Fposn_at_point): Add extra parameter in call to
      Fpos_visible_in_window_p.
      
      lisp/window.el (selected-window-group-function): New permanent local buffer
      local variable.
      (selected-window-group): New function.
      
      lisp/follow.el (follow-mode): Set the ...-group-function variables at mode
      enable, kill them at mode disable.  Add/remove follow-after-change to/from
      after-change-functions.
      (follow-start-end-invalid): New variable.
      (follow-redisplay): Manipulate follow-start-end-invalid.
      (follow-after-change, follow-window-start, follow-window-end)
      (follow-set-window-start, follow-pos-visible-in-window-p)
      (follow-move-to-window-line, follow-sit-for): New functions.
      
      lisp/isearch.el (isearch-call-message): New macro.
      (isearch-update, with-isearch-suspended, isearch-del-char)
      (isearch-search-and-update, isearch-ring-adjust): Invoke above new macro.
      (with-isearch-suspended): Rearrange code such that isearch-call-message is
      invoked before point is moved.
      (isearch-message): Add comment about where point must be at function call.
      (isearch-search): Remove call to isearch-message.
      (isearch-lazy-highlight-window-group): New variable.
      (isearch-lazy-highlight-new-loop): Unconditionally start idle timer.  Move
      the battery of tests to ...
      (isearch-lazy-highlight-maybe-new-loop): New function, started by idle timer.
      Note: (sit-for 0) is still called.
      (isearch-lazy-highlight-update): Check membership of
      isearch-lazy-highlight-window-group.  Don't set the `window' overlay
      property.
      (isearch-update, isearch-done, isearch-string-out-of-window)
      (isearch-back-into-window, isearch-lazy-highlight-maybe-new-loop)
      (isearch-lazy-highlight-search, isearch-lazy-highlight-update)
      (isearch-lazy-highlight-update): Call the six amended primitives (see
      src/window.c above) with the new `group' argument set to t, to cooperate
      with Follow Mode.
      64c57303
  29. 23 Nov, 2015 1 commit
  30. 21 Nov, 2015 1 commit
    • Eli Zaretskii's avatar
      Call 'window-size-change-functions' for mini-windows · 3ca44a1a
      Eli Zaretskii authored
      * src/window.c (grow_mini_window, shrink_mini_window): Set the
      frame's 'window_sizes_changed' flag.
      * src/xdisp.c (redisplay_internal): Call the hooks on
      'window-size-change-functions' if the call to 'echo_area_display'
      sets the frame's 'window_sizes_changed' flag.
      (syms_of_xdisp) <window-size-change-functions>:
      Update doc string to indicate the mini-window resizes trigger a
      call to the hooks, and don't promise that will happen "before
      redisplay".  (Bug#19576, Bug#21333)
      
      * doc/lispref/windows.texi (Window Hooks): Update the description
      of 'window-size-change-functions'.
      3ca44a1a
  31. 11 Nov, 2015 1 commit
    • Alan Mackenzie's avatar
      First commit to scratch/follow. Make Isearch work with Follow Mode, etc. · 2c56fc2a
      Alan Mackenzie authored
      doc/lispref/window.texi (Basic Windows): Add paragraph defining "Group of
      Windows" and new @defun selected-window-group.
      (Window Start and End): Describe new &optional parameter GROUP and
      ...-group-function for window-start, window-end, set-window-start, and
      pos-visible-in-window-p.
      (Textual Scrolling) Describe the same for recenter.
      doc/lispref/positions.texi (Screen Lines): Describe the same for
      move-to-window-line.
      
      src/window.c (Fwindow_start, Fwindow_end, Fset_window_start)
      (Fpos_visible_in_window_p, Frecenter, Fmove_to_window_line): To each, add ar
      new optional parameter "group".  At the beginning of each, check whether the
      corresponding ...-group-function is set to a function, and if so execute this
      function in place of the normal processing.
      (syms_of_window): Define symbols for the six new variables below.
      (window-start-group-function, window-end-group-function)
      (set-window-start-group-function, recenter-group-function)
      (pos-visible-in-window-p-group-function, move-to-window-line-group-function):
      New permanent local buffer local variables.
      src/keyboard.c (Fposn_at_point): Add extra parameter in call to
      Fpos_visible_in_window_p.
      
      lisp/window.el (selected-window-group-function): New permanent local buffer
      local variable.
      (selected-window-group): New function.
      
      lisp/follow.el (follow-mode): Set the ...-group-function variables at mode
      enable, kill them at mode disable.  Add/remove follow-after-change to/from
      after-change-functions.
      (follow-start-end-invalid): New variable.
      (follow-redisplay): Manipulate follow-start-end-invalid.
      (follow-after-change, follow-window-start, follow-window-end)
      (follow-set-window-start, follow-pos-visible-in-window-p)
      (follow-move-to-window-line, follow-sit-for): New functions.
      
      lisp/isearch.el (isearch-call-message): New macro.
      (isearch-update, with-isearch-suspended, isearch-del-char)
      (isearch-search-and-update, isearch-ring-adjust): Invoke above new macro.
      (with-isearch-suspended): Rearrange code such that isearch-call-message is
      invoked before point is moved.
      (isearch-message): Add comment about where point must be at function call.
      (isearch-search): Remove call to isearch-message.
      (isearch-lazy-highlight-window-group): New variable.
      (isearch-lazy-highlight-new-loop): Unconditionally start idle timer.  Move
      the battery of tests to ...
      (isearch-lazy-highlight-maybe-new-loop): New function, started by idle timer.
      Note: (sit-for 0) is still called.
      (isearch-lazy-highlight-update): Check membership of
      isearch-lazy-highlight-window-group.  Don't set the `window' overlay
      property.
      (isearch-update, isearch-done, isearch-string-out-of-window)
      (isearch-back-into-window, isearch-lazy-highlight-maybe-new-loop)
      (isearch-lazy-highlight-search, isearch-lazy-highlight-update)
      (isearch-lazy-highlight-update): Call the six amended primitives (see
      src/window.c above) with the new `group' argument set to t, to cooperate
      with Follow Mode.
      2c56fc2a
  32. 10 Nov, 2015 1 commit
    • Paul Eggert's avatar
      Spelling fixes · c92dbd6d
      Paul Eggert authored
      * lisp/net/soap-inspect.el (soap-inspect-xs-simple-type):
      Fix misspelling in output.
      c92dbd6d
  33. 24 Oct, 2015 1 commit
    • Eli Zaretskii's avatar
      Update frame title when scrolling the selected window · 41518e5b
      Eli Zaretskii authored
      * src/window.c (wset_update_mode_line): New function, sets either the
      window's update_mode_line flag or the global update_mode_lines
      variable.
      (Fset_window_start, set_window_buffer, window_scroll_pixel_based)
      (window_scroll_line_based): Call it instead of only setting the
      window's update_mode_line flag.
      41518e5b