1. 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
  2. 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
  3. 20 Mar, 2016 1 commit
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 18 Jan, 2016 2 commits
  10. 15 Jan, 2016 1 commit
  11. 01 Jan, 2016 1 commit
  12. 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
  13. 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
  14. 23 Nov, 2015 1 commit
  15. 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
  16. 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
  17. 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
  18. 24 Oct, 2015 2 commits
    • 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
    • Eli Zaretskii's avatar
      An even better fix for bug#21739 · 7a6968b4
      Eli Zaretskii authored
      * src/window.c (set_window_buffer): If the window is the frame's
      selected window, set update_mode_lines, not the window's
      update_mode_line flag.  (Bug#21739)
      * src/buffer.c (Fkill_buffer): Undo last change.
      (set_update_modelines_for_buf): Function deleted.
      7a6968b4
  19. 21 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Include-file cleanup for src directory · 63cfb75f
      Paul Eggert authored
      Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707).
      In a few cases, add ‘#include "foo.h"’ if the file needs foo.h
      but does not include it directly.  As a general rule, a source
      file should include foo.h if it needs the interfaces that foo.h
      defines.
      * src/alloc.c: Don’t include process.h.  Include dispextern.h,
      systime.h.
      * src/atimer.c: Don’t include blockinput.h.
      * src/buffer.c: Include coding.h, systime.h.  Don’t include
      keyboard.h, coding.h.
      * src/callint.c: Don’t include commands.h, keymap.h.
      * src/callproc.c: Don’t include character.h, ccl.h, composite.h,
      systty.h, termhooks.h.
      * src/casetab.c: Don’t include character.h.
      * src/category.c: Don’t include charset.h, keymap.h.
      * src/ccl.h: Don’t include character.h.
      * src/character.c: Don’t include charset.h.
      * src/charset.c: Don’t include disptab.h.
      * src/chartab.c: Don’t include ccl.h.
      * src/cm.c: Don’t include frame.h, termhooks.h.
      * src/cmds.c: Don’t include window.h, dispextern.h.
      * src/coding.c: Don’t include window.h, frame.h.
      * src/composite.c: Include composite.h.  Don’t include window.h,
      font.h.
      * src/data.c: Don’t include syssignal.h, termhooks.h, font.h.
      * src/dbusbind.c: Don’t include frame.h.
      * src/decompress.c: Don’t include character.h.
      * src/dired.c: Don’t include character.h, commands.h, charset.h.
      * src/dispnew.c: Don’t include character.h, indent.h, intervals.h,
      process.h, timespec.h.  Include systime.h.
      * src/doc.c: Include coding.h.  Don’t include keyboard.h.
      * src/editfns.c: Include composite.h.  Don’t include frame.h.
      * src/emacs.c: Include fcntl.h, coding.h.  Don’t include
      commands.h, systty.h..
      * src/fileio.c: Don’t include intervals.h, dispextern.h.
      Include composite.h.
      * src/filelock.c: Don’t include character.h, systime.h.
      * src/fns.c: Don’t include time.h, commands.h, keyboard.h,
      keymap.h, frame.h, blockinput.h, xterm.h.  Include composite.h.
      * src/font.c: Include termhooks.h.
      * src/font.h: Don’t include ccl.h, frame.h.  Add forward decls of
      struct composition_it, struct face, struct glyph_string.
      * src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h,
      intervals.h, window.h, termhooks.h.
      * src/frame.c: Don’t include character.h, commands.h, font.h.
      * src/frame.h: Don’t include dispextern.h.
      * src/fringe.c: Don’t include character.h.
      * src/ftcrfont.c: Don’t include dispextern.h, frame.h,
      character.h, charset.h, fontset.h.
      * src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h,
      fontset.h.
      * src/ftxfont.c: Don’t include dispextern.h, character.h,
      charset.h, fontset.h.
      * src/gfilenotify.c: Don’t include frame.h, process.h.
      * src/gtkutil.c: Include dispextern.h, frame.h, systime.h.
      Don’t include syssignal.h, buffer.h, charset.h, font.h.
      * src/gtkutil.h: Don’t include frame.h.
      * src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h.
      Don’t include character.h.
      * src/indent.c: Don’t include keyboard.h, termchar.h.
      * src/inotify.c: Don’t include character.h, frame.h.
      * src/insdel.c: Include composite.h.  Don’t include blockinput.h.
      * src/intervals.c: Don’t include character.h, keyboard.h.
      * src/intervals.h: Don’t include dispextern.h, composite.h.
      * src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h.
      Include coding.h.
      * src/keyboard.h: Don’t incldue systime.h.
      * src/keymap.c: Don’t include charset.h, frame.h.
      * src/lread.c: Include dispextern.h and systime.h.
      Don’t include frame.h.  Include systime.h.
      * src/macros.c: Don’t include commands.h, character.h, buffer.h.
      * src/menu.c: Include character.h, coding.h.  Don’t include
      dispextern.h.
      * src/menu.h: Don’t include systime.h.
      * src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h,
      intervals.h, termhooks.h.
      * src/print.c: Include coding.h.  Don’t include keyboard.h,
      window.h, dispextern.h, termchar.h, termhooks.h, font.h.
      Add forward decl of struct terminal.
      * src/process.c: Don’t include termhooks.h, commands.h,
      dispextern.h, composite.h.
      * src/region-cache.c: Don’t include character.h.
      * src/scroll.c: Don’t include keyboard.h, window.h.
      * src/search.c: Don’t include category.h, commands.h.
      * src/sound.c: Don’t include dispextern.h.
      * src/syntax.c: Don’t include command.h, keymap.h.
      * src/sysdep.c: Don’t include window.h, dispextern.h.
      * src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’,
      * src/term.c: Don’t include systty.h, intervals.h, xterm.h.
      * src/terminal.c: Include character.h.
      Don’t include charset.h, coding.h.
      * src/textprop.c: Don’t include character.h.
      * src/undo.c: Don’t include character.h, commands.h, window.h.
      * src/unexsol.c: Don’t include character.h, charset.h.
      * src/widget.c: Include widget.h.  Don’t include keyboard.h,
      window.h, dispextern.h, blockinput.h, character.h, font.h.
      * src/widgetprv.h: Don’t include widget.h.
      * src/window.c: Don’t include character.h, menu.h, intervals.h.
      * src/xdisp.c: Include composite.h, systime.h.  Don’t include
      macros.h, process.h.
      * src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h,
      intervals.h.
      * src/xfns.c: Don’t include menu.h, character.h, intervals.h,
      epaths.h, fontset.h, systime.h, atimer.h, termchar.h.
      * src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h.
      * src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h.
      * src/xgselect.c: Don’t include timespec.h, frame.h.
      Include systime.h.
      * src/xgselect.h: Don’t include time.h.
      Use a forward decl to struct timespec instead.
      * src/xmenu.c: Don’t include keymap.h, character.h, charset.h,
      dispextern.h.  Include systime.h.
      * src/xml.c: Don’t include character.h.
      * src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h.
      * src/xselect.c: Don’t include dispextern.h, character.h,
      buffer.h, process.h.
      * src/xsmfns.c: Don’t include systime.h, sysselect.h.
      * src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h,
      intervals.h process.h, keymap.h, xgselect.h.  Include composite.h.
      63cfb75f
  20. 07 Oct, 2015 1 commit
  21. 30 Sep, 2015 4 commits
  22. 16 Sep, 2015 2 commits
    • Paul Eggert's avatar
      Omit unnecessary \ before paren in C docstrings · 032ce1c7
      Paul Eggert authored
      Although \( is needed in docstrings in Elisp code, it is not needed in
      docstrings in C code, since C function definitiions do not start with
      a parenthesis.  The backslashes made the docstrings a bit harder to
      read and to format in columns.  Also, some C docstrings had ( in
      column 1 and this did not appear to be causing any problems.  So,
      simplify C docstrings by replacing \( with ( and \) with ).
      032ce1c7
    • Paul Eggert's avatar
      Add -Wswitch to --enable-gcc-warnings · 8865587c
      Paul Eggert authored
      Make --enable-gcc-warnings a bit pickier, by also using -Wswitch.
      * configure.ac (WERROR_CFLAGS): Don’t add -Wno-switch.
      * lib-src/etags.c (main, consider_token, C_entries):
      * src/coding.c (encode_invocation_designation):
      * src/data.c (Ftype_of):
      * src/eval.c (Fdefvaralias, default_toplevel_binding)
      (Fbacktrace__locals, mark_specpdl):
      * src/lisp.h (record_xmalloc):
      * src/syntax.c (scan_lists, scan_sexps_forward):
      * src/window.c (window_relative_x_coord):
      * src/xdisp.c (push_it, pop_it):
      * src/xterm.c (xg_scroll_callback, x_check_fullscreen):
      Error out or do nothing (as appropriate) if a switch statement
      with an enum value does not cover all of the enum.
      * src/dispextern.h (struct iterator_stack_entry.u.comp):
      Remove unused member discovered by using -Wswitch.
      * src/lisp.h (record_xmalloc): Add a ‘+ 0’ to pacify -Wswitch.
      * src/vm-limit.c (check_memory_limits):
      Simplify warning-diagnostic computation by using a table.
      8865587c
  23. 27 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Assume GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS · 60d1b187
      Paul Eggert authored
      This removes the need for GCPRO1 etc.  Suggested by Stefan Monnier in:
      http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00918.html
      * doc/lispref/internals.texi (Writing Emacs Primitives):
      * etc/NEWS:
      Document the change.
      * src/alloc.c (gcprolist, dump_zombies, MAX_ZOMBIES, zombies)
      (nzombies, ngcs, avg_zombies, max_live, max_zombies, avg_live)
      (Fgc_status, check_gcpros, relocatable_string_data_p, gc-precise):
      * src/bytecode.c (mark_byte_stack) [BYTE_MARK_STACK]:
      * src/eval.c (gcpro_level) [DEBUG_GCPRO]:
      * src/lisp.h (struct handler.gcpro, struct gcpro, GC_MARK_STACK)
      (GC_USE_GCPROS_AS_BEFORE, GC_MAKE_GCPROS_NOOPS)
      (GC_MARK_STACK_CHECK_GCPROS, GC_USE_GCPROS_CHECK_ZOMBIES)
      (BYTE_MARK_STACK, GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6)
      (GCPRO7, UNGCPRO, RETURN_UNGCPRO):
      Remove.  All uses removed.  The code now assumes
      GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS.
      * src/bytecode.c (relocate_byte_stack):
      Rename from unmark_byte_stack, since it now only relocates.
      All callers changed.
      * src/frame.c (make_frame): Add an IF_LINT to pacify GCC 5.2
      with GCPROs removed.
      * src/systime.h: Use EMACS_LISP_H as the canary instead of GCPRO1.
      * test/automated/finalizer-tests.el (finalizer-basic)
      (finalizer-circular-reference, finalizer-cross-reference)
      (finalizer-error):
      * test/automated/generator-tests.el (cps-test-iter-close-finalizer):
      Remove tests, as they depend on gc-precise.
      60d1b187
  24. 19 Aug, 2015 1 commit
    • Martin Rudalics's avatar
      Move window edge functions to Elisp. · f5a14da1
      Martin Rudalics authored
      * src/window.c (Fwindow_edges, Fwindow_pixel_edges)
      (Fwindow_absolute_pixel_edges, Fwindow_inside_edges)
      (Fwindow_inside_pixel_edges, Fwindow_inside_absolute_pixel_edges):
      Move to window.el.
      (calc_absolute_offset): Remove.
      * lisp/frame.el (frame-edges): New function.
      * lisp/window.el (window-edges, window-pixel-edges)
      (window-absolute-pixel-edges): Move here from window.c.
      (window-body-edges, window-body-pixel-edges)
      (window-absolute-body-pixel-edges): Move here from window.c and
      rename "inside" to "body".  Keep old names as aliases.
      (window-absolute-pixel-position): New function.
      f5a14da1
  25. 31 May, 2015 1 commit
    • Paul Eggert's avatar
      Remove unused DEFSYMs · 0c2a3cf6
      Paul Eggert authored
      Remove DEFSYMs that aren't used at the C level.  Also:
      * src/decompress.c (Qzlib_dll):
      * src/font.c (Qunicode_sip):
      * src/frame.c (Qtip_frame):
      * src/ftfont.c (Qserif):
      * src/gnutls.c (Qgnutls_dll):
      * src/xml.c (Qlibxml2_dll):
      Move from here ...
      * src/w32fns.c (syms_of_w32fns): ... to here,
      as these are used only on MS-Windows.
      0c2a3cf6
  26. 14 May, 2015 1 commit
  27. 14 Apr, 2015 2 commits
    • Paul Eggert's avatar
      Fix think-o in previous patch · 7744cc7e
      Paul Eggert authored
      * src/window.c (count_windows, get_leaf_windows):
      Don't optimize count_windows incorrectly.
      7744cc7e
    • Paul Eggert's avatar
      Avoid some int overflows in window.c · b80c5ebc
      Paul Eggert authored
      * src/print.c (print_object):
      * src/window.c (sequence_number):
      * src/window.h (struct window.sequence_number):
      Don't assume window sequence number fits in int.
      * src/window.c (window_select_count):
      * src/window.h (struct window.use_time, window_select_count):
      Don't assume window use time fits in int.
      * src/window.c (Fsplit_window_internal):
      Don't assume user-supplied integer, or sum, fits in int.
      (Fset_window_configuration, count_windows, get_leaf_windows)
      (save_window_save, Fcurrent_window_configuration):
      Use ptrdiff_t for object counts.
      (Fset_window_configuration): Omit unused local 'n'.
      (count_windows): Simplify by writing in terms of get_leaf_windows.
      (get_leaf_windows): Don't store through FLAT if it's null.
      (extract_dimension): New static function.
      (set_window_margins, set_window_fringes, set_window_scroll_bars):
      Use it to avoid undefined behavior when converting user-supplied
      integer to 'int'.
      b80c5ebc
  28. 12 Apr, 2015 1 commit
    • Paul Eggert's avatar
      Use bool for boolean in window.c · 30379713
      Paul Eggert authored
      * src/window.c:	Omit unnecessary static function decls.
      (adjust_window_count, select_window, Fselect_window)
      (window_body_width, Fwindow_body_height, Fwindow_body_width)
      (set_window_hscroll, check_window_containing, Fwindow_at)
      (Fwindow_end, Fset_window_start, Fpos_visible_in_window_p)
      (unshow_buffer, replace_window, recombine_windows)
      (add_window_to_list, candidate_window_p, next_window)
      (Fnext_window, Fprevious_window, window_loop, check_all_windows)
      (Fget_buffer_window, Fdelete_other_windows_internal)
      (replace_buffer_in_windows_safely, set_window_buffer)
      (Fset_window_buffer, Fforce_window_update)
      (temp_output_buffer_show, make_parent_window)
      (window_resize_check, window_resize_apply, Fwindow_resize_apply)
      (resize_frame_windows, Fsplit_window_internal)
      (Fdelete_window_internal, grow_mini_window, shrink_mini_window)
      (Fresize_mini_window_internal, mark_window_cursors_off)
      (window_scroll, window_scroll_pixel_based)
      (window_scroll_line_based, scroll_command, Fscroll_other_window)
      (Fscroll_left, Fscroll_right, displayed_window_lines, Frecenter)
      (Fmove_to_window_line, Fset_window_configuration)
      (delete_all_child_windows, apply_window_adjustment)
      (set_window_fringes, set_window_scroll_bars)
      (Fset_window_vscroll, foreach_window, foreach_window_1)
      (compare_window_configurations, Fcompare_window_configurations):
      Prefer 'bool', 'true', and 'false' for booleans.
      * src/window.h (WINDOW_MODE_LINE_LINES)
      (WINDOW_HEADER_LINE_LINES): Omit unnecessary "!!" on bool value.
      30379713
  29. 10 Apr, 2015 1 commit
  30. 09 Feb, 2015 1 commit
    • Eli Zaretskii's avatar
      Speed up vertical-motion when screen coordinates are known · 403cb178
      Eli Zaretskii authored
       src/indent.c (Fvertical_motion): Accept an additional argument
       CUR-COL and use it as the starting screen coordinate.
       src/window.c (window_scroll_line_based, Fmove_to_window_line): All
       callers of vertical-motion changed.
      
       doc/lispref/positions.texi (Screen Lines): Update the documentation of
       vertical-motion to document the new additional argument.
      403cb178
  31. 07 Feb, 2015 1 commit
    • Martin Rudalics's avatar
      Try to improve handling of fullwidth/-height frames. · d1655783
      Martin Rudalics authored
      * frame.el (frame-notice-user-settings): Update
      `frame-size-history'.
      (make-frame): Update `frame-size-history'.  Call
      `frame-after-make-frame'.
      * faces.el (face-set-after-frame-default): Remove call to
      frame-can-run-window-configuration-change-hook.
      * frame.c (frame_size_history_add): New function.
      (frame_inhibit_resize): Consider frame_inhibit_implied_resize
      only after frame's after_make_frame slot is true.  Inhibit
      resizing fullwidth-/height frames in one direction only.  Update
      frame_size_history.
      (adjust_frame_size): Call frame_size_history_add.
      (make_frame): Initalize after_make_frame slot.
      (Fmake_terminal_frame): Adjust adjust_frame_size call.
      (Fcan_run_window_configuration_change_hook): Rename to
      Fframe_after_make_frame.  Set after_make_frame slot.  Return
      second argument.
      (x_set_frame_parameters): Postpone handling fullscreen parameter
      until after width and height parameters have been set.  Apply
      width and height changes only if can_x_set_window_size is true.
      Update frame_size_history.
      (Qadjust_frame_size_1, Qadjust_frame_size_2)
      (Qadjust_frame_size_3, QEmacsFrameResize, Qframe_inhibit_resize)
      (Qx_set_fullscreen, Qx_check_fullscreen, Qx_set_window_size_1)
      (Qxg_frame_resized, Qxg_frame_set_char_size_1)
      (Qxg_frame_set_char_size_2, Qxg_frame_set_char_size_3)
      (Qxg_change_toolbar_position, Qx_net_wm_state)
      (Qx_handle_net_wm_state, Qtb_size_cb, Qupdate_frame_tool_bar)
      (Qfree_frame_tool_bar): New symbol for updating
      frame_size_history.
      (Qtip_frame, Qterminal_frame): New symbols.
      (Vframe_adjust_size_history): Rename to frame_size_history.
      * frame.h (struct frame): Rename
      can_run_window_configuration_change_hook slot to
      after_make_frame.
      (frame_size_history_add): Extern.
      * gtkutil.c (xg_frame_resized): Call frame_size_history_add.
      Don't set FRAME_PIXEL_WIDTH and FRAME_PIXEL_HEIGHT here.
      (xg_frame_set_char_size): Try to preserve the status of
      fullwidth/-height frames.  Call frame_size_history_add.
      (tb_size_cb, update_frame_tool_bar, free_frame_tool_bar)
      (xg_change_toolbar_position): Call frame_size_history_add.
      * w32fns.c (x_change_tool_bar_height): Handle frame's fullscreen
      status.
      (Fx_create_frame): Process fullscreen parameter after frame has
      been resized.
      (x_create_tip_frame): Pass Qtip_frame to adjust_frame_size.
      (Fx_frame_geometry): Don't pollute pure storage.
      * w32term.c (w32_read_socket): For WM_WINDOWPOSCHANGED,
      WM_ACTIVATE and WM_ACTIVATEAPP set frame's visibility before
      calling w32fullscreen_hook.  For WM_DISPLAYCHANGE call
      w32fullscreen_hook immediately.
      (x_fullscreen_adjust, x_check_fullscreen): Remove.
      (w32fullscreen_hook): Call change_frame_size just as with a
      "normal" frame resize operation.  Call do_pending_window_change.
      (x_set_window_size): Try to handle fullwidth and fullheight more
      accurately.  Don't rely on w32_enable_frame_resize_hack.
      (w32_enable_frame_resize_hack): Remove variable.
      * widget.c (EmacsFrameResize): Remove dead code.  Call
      frame_size_history_add
      * window.c (run_window_configuration_change_hook): Check
      f->after_make_frame instead of
      f->can_run_window_configuration_change_hook.
      * xfns.c (x_change_tool_bar_height): Handle frame's fullscreen status.
      (Fx_create_frame): Process fullscreen parameter after frame has
      been resized.
      (Fx_frame_geometry): Don't pollute pure storage.
      * xterm.c (x_net_wm_state, x_handle_net_wm_state): Call
      frame_size_history_add.
      (do_ewmh_fullscreen): Handle x_frame_normalize_before_maximize.
      (x_check_fullscreen): Count in menubar when calling
      XResizeWindow.  Wait for ConfigureNotify event.  Call
      frame_size_history_add.
      (x_set_window_size_1): Remove PIXELWISE argument.  Try to handle
      changing a fullheight frame's width or a fullwidth frame's
      height.  Call frame_size_history_add.
      (x_set_window_size): Simplify xg_frame_set_char_size and
      x_set_window_size_1 calls.
      (x_frame_normalize_before_maximize): New variable.
      d1655783
  32. 01 Feb, 2015 1 commit