Po Lu [Fri, 15 Apr 2022 12:22:26 +0000 (12:22 +0000)]
Fix default registry of Haiku font backend
* src/haiku_support.h (struct haiku_zoom_event): Fix coding
style.
(enum haiku_font_specification): Move FSPECs over here.
* src/haikufont.c (haikufont_apply_registry)
(haikufont_get_fallback_entity, haikufont_pattern_to_entity)
(haikufont_spec_or_entity_to_pattern, haikufont_list): Use
`iso10646-1' as the default registry instead of `utf8', which is
not a registry.
Po Lu [Fri, 15 Apr 2022 11:57:14 +0000 (11:57 +0000)]
Clean up keysyms from Haiku headers
* src/haiku_support.cc (keysym_from_raw_char): Add keysym
numbers here and use those instead.
* src/haiku_support.h: Delete all the X11 keysym definitions.
* doc/misc/vtable.texi (Making A Table): Adjust color documentation.
* lisp/emacs-lisp/vtable.el (make-vtable): Mix more.
(vtable--compute-colors): Mix both foreground and background colors.
(vtable--make-color-face, vtable--face-blend): New functions.
(vtable--insert-line): Adjust usage.
* lisp/emacs-lisp/vtable.el (vtable): Add a keymap cache.
(make-vtable): Allow dragging the divider.
(vtable-insert): Don't put the table keymap over the entire line
-- avoid the divider, which has its own keymap.
(vtable--drag-resize-column): Adjust to the in-buffer divider
dragging.
Fix off-by-one error in text-property-search-backward
* lisp/emacs-lisp/text-property-search.el
(text-property-search-backward): Fix off-by-one error -- this
would result in not finding the previous (non-)match when at the
first character in a field.
Update project-kill-buffer-conditions to match buffer-match-p
* project.el (project-kill-buffer-conditions): Document the
deprecation of the use of derived-mode
(project--buffer-check): Have `major-mode' behave like `derived-mode'
did previously, and issue a warning of `derived-mode' is used.
Po Lu [Fri, 15 Apr 2022 02:38:19 +0000 (02:38 +0000)]
Make Haiku scroll bar behave more like other programs
* haiku_support.cc (class EmacsScrollBar): New field
`repeater_start'.
(Pulse): Wait for time to pass repeater_delay.
(MouseDown): Set it to the current time + the system repeater
delay.
Eli Zaretskii [Thu, 14 Apr 2022 17:40:24 +0000 (20:40 +0300)]
Fix mouse clicks in hscrolled window with variable-height fonts
* src/xdisp.c (move_it_in_display_line_to): Fix calculation of
height of a screen-line that is completely hscrolled out of view.
Reported by Yasushi SHOJI <yasushi.shoji@gmail.com>.
* lisp/emacs-lisp/vtable.el (vtable--insert-header-line): Allow
resizing by dragging headers.
(vtable--drag-resize-column): New function.
(vtable-narrow-current-column): Refactor out common bits.
(vtable--alter-column-width): To here.
(vtable-widen-current-column): Rewrite to use
vtable-narrow-current-column.
* lisp/net/ldap.el (ldap-ldapsearch-args): Change -LL to -LLL to
suppress ldif version output.
(ldap-search-internal): Remove skipping of version output. Remove
redundand ws skipping.
* lisp/net/eudc-vars.el (eudc-ldap-no-wildcard-attributes): New
defcustom.
* doc/misc/eudc.texi (LDAP Configuration): Mention it.
* lisp/net/eudcb-ldap.el (eudc-ldap-format-query-as-rfc1558): Use it.
(eudc-ldap-get-field-list): Set scope and sizelimit, instead of
overriding the whole ldap-host-parameters-alist.
* lisp/net/ldap.el (ldap-search-internal): Allow "size limit exceeded"
exit code. Allow empty attribute values.
Po Lu [Thu, 14 Apr 2022 13:14:32 +0000 (13:14 +0000)]
Fix races with child frame locks on Haiku
* src/haiku_support.cc
(CHILD_FRAME_LOCK_INSIDE_LOOPER_CALLBACK): New macro.
(FrameMoved, WorkspacesChanged): Lock child frame data with that
macro instead.
Po Lu [Thu, 14 Apr 2022 11:02:13 +0000 (19:02 +0800)]
Keep track of keyboard state during drag and drop
* src/xterm.c (x_dnd_cleanup_drag_and_drop): Deselect for
keyboard state changes.
(x_dnd_begin_drag_and_drop): Select for keyboard state changes
when XKB is available.
(x_dnd_update_state, handle_one_xevent): Use current XKB state
if it is available.
(x_term_init): Reformat code a little.
Po Lu [Thu, 14 Apr 2022 08:02:12 +0000 (16:02 +0800)]
Minor fixes to menus on XI2
* src/xfns.c (Fx_create_frame): Populate `xi_masks'.
* src/xmenu.c (x_activate_menubar)
(create_and_show_popup_menu, x_menu_show): Only clear input
extension grabs if we (or the toolkit) actually selected for
XI_ButtonPress events.
* src/xterm.c (xi_frame_selected_for): New function.
(xi_populate_device_from_info, handle_one_xevent): Store device
use instead of just whether or not it's a master device.
(x_dnd_begin_drag_and_drop): Clean up block_input stuff.
* src/xterm.h: Update prototypes.
(struct xi_device_t): Rename `master_p' to `use'.
* lisp/emacs-lisp/vtable.el (vtable-narrow-current-column)
(vtable-widen-current-column): Allow using the prefix to say how
much to narrow/widen the columns.
* lisp/emacs-lisp/vtable.el (vtable--insert-header-line): Don't
insert the divider at the end.
(vtable-narrow-current-column, vtable-widen-current-column): Don't
error out when being called on the divider.
* doc/misc/vtable.texi (Making A Table): Document it.
* lisp/emacs-lisp/vtable.el (vtable): Add a divider slot.
(make-vtable): Accept :divider and :divider-width arguments.
(vtable--insert-line, vtable--insert-header-line): Display the
divider.
Sean Whitton [Tue, 12 Apr 2022 18:38:32 +0000 (11:38 -0700)]
Document additions of cl-with-gensyms and cl-once-only
* NEWS: Document additions of cl-with-gensyms and cl-once-only.
* doc/misc/cl.texi (Macro-Writing Macros): New section.
(Creating Symbols): Add to the concept index under the name "gensym".
(Obsolete Setf Customization): Use cl-once-only rather than
macroexp-let2, and fix a quotation bug in one example.
* doc/misc/vtable.texi (Making A Table): Document it.
* lisp/emacs-lisp/vtable.el (vtable): Add :row-colors.
(make-vtable): Ditto.
(vtable--compute-colors, vtable--color-blend): New functions.
(vtable--insert-line): Take a line number argument and adjust
callers.
Michael Albinus [Wed, 13 Apr 2022 14:40:32 +0000 (16:40 +0200)]
Adapt Tramp manual
* doc/misc/tramp.texi (Ssh setup): New subsection "Using ssh
config include for host name completion". (Bug#54885)
Precise, that list-system-processes and process-attributes are
about system processes.
Po Lu [Wed, 13 Apr 2022 11:13:38 +0000 (19:13 +0800)]
Move raw event selection on GTK+ 2 to a more appropriate place
* src/xfns.c (setup_xi_event_mask): Stop selecting for
RawKeyPress on the root window.
* src/xterm.c (x_new_focus_frame): Select here instead, once a
frame becomes focused.
Po Lu [Wed, 13 Apr 2022 03:13:28 +0000 (11:13 +0800)]
Bump minimum GTK for PGTK builds
* configure.ac: Require GTK 3.20 or later if building with PGTK.
It has already been required for some time now, but the
requirement was not reflected in the configure script.
* src/pgtkterm.c (pgtk_any_window_to_frame): Remove version
check.
* lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Only fill as
strings inside strings (bug#31656).
(lisp--fill-line-simple): New function to do simple sexp-based
filling.
Po Lu [Wed, 13 Apr 2022 02:54:56 +0000 (10:54 +0800)]
Clean up PGTK code more
* src/pgtkterm.c (STORE_KEYSYM_FOR_DEBUG): Delete macro.
(x_find_modifier_meanings): Delete function.
(get_modifier_values, pgtk_gtk_to_emacs_modifiers)
(pgtk_emacs_to_gtk_modifiers): Use GDK's own modifier mask
constants instead of detecting our own from the keymap. This
does mean a specific "meta" key will no longer be detected on X
Windows, but that interface doesn't exist on Wayland, and X
users should use the X port anyway.
(key_press_event): Avoid decoding input text.
(pgtk_term_init): Stop computing modifiers.
(syms_of_pgtkterm): Delete obsolete comment.
* src/pgtkterm.h (struct pgtk_display_info): Delete modifier
masks.
* lisp/help-fns.el (describe-mode--minor-modes): New function
(bug#2473).
(describe-mode): Rewritten to include local minor mode links first,
then the major mode, and then global minor mode links, and then
all the minor modes.
Po Lu [Wed, 13 Apr 2022 00:47:00 +0000 (00:47 +0000)]
Fix freezes when trying to accelerate menu bar on Haiku
* src/haiku_support.cc (class EmacsWindow): New field
`menus_begun'.
(MenusBeginning): Don't send menu bar open events when that is
set, instead set it to true.
(BMenuBar_start_tracking): Stop locking the menu bar here and
send a special BE_MENU_BAR_OPEN event instead.
* src/haiku_support.h (struct haiku_menu_bar_state_event):
Delete field `no_lock'.
* src/haikumenu.c (Fhaiku_menu_bar_open):
* src/haikuterm.c (haiku_read_socket): Update accordingly.
* src/image.c (svg_load_image): Don't include the spec in the
error message, because this is commonly the entire SVG string, and
this will fill up the *Messages* buffer quickly.
Sean Whitton [Tue, 12 Apr 2022 15:59:22 +0000 (17:59 +0200)]
Fix eager macroexpansion cycle in cl-once-only
* lisp/emacs-lisp/cl-macs.el (cl-once-only): Use different cl-loop
syntax, with no functional change, but such that the loop does not
expand into cl-psetq.
Po Lu [Tue, 12 Apr 2022 13:29:02 +0000 (21:29 +0800)]
Fix keyboard event device attribution on GTK+ 2
* src/xfns.c (setup_xi_event_mask): Select for raw keypress
events on GTK 2.
* src/xterm.c (handle_one_xevent): Set pending keystroke time
when a raw event is received.
* src/xterm.h (struct x_display_info): New flag
`pending_keystroke_time_special_p'.
Po Lu [Tue, 12 Apr 2022 08:36:42 +0000 (16:36 +0800)]
Disallow drag and drop inside a menu-entry
* src/xterm.c (x_dnd_cleanup_drag_and_drop): Always free DND
targets even if waiting for finish.
(x_dnd_begin_drag_and_drop): Free targets correctly when
signalling error and prevent activating drag-and-drop inside a
menu or popup. (It doesn't work.)