Po Lu [Wed, 29 Dec 2021 10:37:04 +0000 (18:37 +0800)]
Translate state of XI2 entry events when sending them to xwidgets
* src/xwidget.c (xi_translate_notify_detail): New function.
(xwidget_motion_or_crossing): Translate detail and state of
GenericEvents before sending them to the widget.
Po Lu [Wed, 29 Dec 2021 01:53:42 +0000 (09:53 +0800)]
Add support for xwidgets to the PGTK port
* src/emacsgtkfixed.c (EMACS_FIXED_GET_CLASS): New function.
(struct GtkFixedPrivateL): New struct.
(emacs_fixed_gtk_widget_size_allocate):
(emacs_fixed_class_init): New functions.
* src/keyboard.h: Declare lispy_function_keys also when
HAVE_PGTK.
* src/pgtkterm.c (x_free_frame_resources): Destroy all xwidget
views.
(pgtk_scroll_run): Move xwidget views that overlap with the
scrolled area.
(pgtk_emacs_to_gtk_modifiers): Expose function.
* src/pgtkterm.h: Wrap in include guard.
(pgtk_emacs_to_gtk_modifiers): New prototype.
* src/xwidget.c (xw_forward_event_translate):
(xw_forward_event_from_view): New functions.
(Fmake_xwidget): Remove obsolete PGTK specific code.
(Fxwidget_perform_lispy_event): Convert modifiers correctly on
PGTK.
(define_cursors): Use GDK functions to define cursors on PGTK.
(xwidget_view_from_window): Disable on non-PGTK builds.
(xwidget_show_view):
(xwidget_hide_view): Implement on PGTK.
(xv_do_draw): Disable on non-PGTK builds.
(offscreen_damage_event): Queue xwidget views for draw.
(xwidget_expose): Disable on non-PGTK builds.
(xwidget_init_view):
(x_draw_xwidget_glyph_string):
(Fdelete_xwidget_view): Implement for PGTK.
(syms_of_xwidget): Don't initialize XID to widget table on PGTK.
(lower_frame_xwidget_views): Disable on PGTK.
* src/xwidget.h (struct xwidget_view): New fields for PGTK
builds.
(kill_frame_xwidget_views): Enable on PGTK.
Sean Whitton [Mon, 27 Dec 2021 19:58:25 +0000 (12:58 -0700)]
Improve rectangle-mark-mode documentation regarding mark activation
* doc/emacs/killing.texi: Describe how rectangle-mark-mode works when
Transient Mark mode is off. Qualify discussion of
rectangle-exchange-point-and-mark to say that it cycles the four
corners only when the region is active.
* lisp/rect.el (rectangle-mark-mode): State that rectangle-mark-mode
does not activate the mark when Transient Mark mode is off. Reword
sentence about how long the mode lasts to account for when Transient
Mark mode is off. (Bug#42663)
Po Lu [Tue, 28 Dec 2021 02:46:58 +0000 (10:46 +0800)]
Fix menu placement on multiple-display setups when using lwlib
* lwlib/xlwmenu.c (fit_to_screen):
(pop_up_menu): Adjust menu position based on dimensions of the
current monitor's workarea. (bug#52809)
* src/xfns.c (x_get_monitor_attributes): Stop testing for the
RandR extension here.
(xlw_monitor_dimensions_at_pos_1):
(xlw_monitor_dimensions_at_pos): New functions.
* src/xterm.c (x_term_init): Query for the RandR extension when
connecting to a display.
* src/xterm.h (xlw_monitor_dimensions_at_pos): New prototype.
* lisp/uniquify.el (uniquify--rename-buffer-advice)
(uniquify--create-file-buffer-advice): Don't add them as advice any more.
Adjust their calling convention accordingly.
Stefan Kangas [Mon, 27 Dec 2021 01:44:27 +0000 (02:44 +0100)]
admin.el: Move etc/NEWS to etc/NEWS.NN in one commit
This should preserve git history better for git blame, etc.
* admin/admin.el (admin-git-command): New variable.
(set-version): Move etc/NEWS to etc/NEWS.NN and prompt to commit
it immediately. (Bug#52420)
Stefan Kangas [Mon, 27 Dec 2021 19:25:50 +0000 (20:25 +0100)]
read-multiple-choice: Improve key formatting
* lisp/emacs-lisp/rmc.el (rmc--add-key-description): Improve
formatting of key missing in the description. Use face help-key-name
on terminals that can't display underline.
Po Lu [Mon, 27 Dec 2021 02:02:39 +0000 (10:02 +0800)]
Fix menu window persistence and entry/leave events on Lucid on XI2
* src/xmenu.c (x_activate_menubar): Always clear the XI2 grab on
Xt.
* src/xterm.c (handle_one_xevent): On XI2, ignore LeaveNotify
events coming from the shell widget and use `x_window_to_frame'
to find the frame when handling XI_Leave events.
Po Lu [Mon, 27 Dec 2021 01:16:18 +0000 (09:16 +0800)]
Fix Lucid popup menu being stuck on XI2 builds
* src/xmenu.c (x_activate_menubar): Make some changes
conditional on XI2.
(create_and_show_popup_menu): Clear XI2 grab before showing
popup.
* src/xterm.c (xi_grab_or_ungrab_device): Don't grab device
if popup is activated on Lucid.
Stefan Kangas [Sun, 26 Dec 2021 05:47:15 +0000 (06:47 +0100)]
read-multiple-choice: Display "SPC" instead of " "
* lisp/emacs-lisp/rmc.el (rmc--add-key-description): Improve display
of the keys TAB, RET, SPC, DEL, and ESC. This fixes a bug where " "
was highlighted in the description in a confusing way.
* test/lisp/emacs-lisp/rmc-tests.el
(test-rmc--add-key-description)
(test-rmc--add-key-description/with-attributes): Update tests for the
above change.
* lisp/emacs-lisp/rmc.el (rmc--show-help): Factor out new function
from read-multiple-choice.
(read-multiple-choice): Add new optional argument show-help.
* doc/lispref/commands.texi (Reading One Event): Document above new
optional argument.
Stefan Kangas [Sat, 25 Dec 2021 23:45:50 +0000 (00:45 +0100)]
read-multiple-choice: Add face when key not in name string
* lisp/emacs-lisp/rmc.el (rmc--add-key-description): Add face
property also when key is not in the name string.
* test/lisp/emacs-lisp/rmc-tests.el
(test-rmc--add-key-description/with-attributes)
(test-rmc--add-key-description/non-graphical-display): Update tests.
Po Lu [Sun, 26 Dec 2021 10:13:53 +0000 (18:13 +0800)]
Fix some issues with a recent change
* doc/lispref/commands.texi (Misc Events): Improve documentation
on pinch events.
* etc/NEWS: Update documentation status for some recent changes
and describe pinch events in more detail.
* lisp/face-remap.el (text-scale-pinch): Prevent pinch events
from being received in too quick succession.
Po Lu [Sun, 26 Dec 2021 06:44:53 +0000 (14:44 +0800)]
Add configure tests for faulty XI2 installations
* configure.ac: Detect cases where XI 2.4 headers are installed
without the correct event structures.
* src/xterm.c (handle_one_xevent): Don't use structures that
might not exist unless configure found them.
Po Lu [Sun, 26 Dec 2021 02:36:05 +0000 (10:36 +0800)]
Allow interpolating scrolls via the Page Down and Page Up keys
* lisp/pixel-scroll.el (pixel-scroll-precision-mode-map): Define
new commands.
(pixel-scroll-precision-interpolate-page): New user option.
(pixel-scroll-interpolate-down):
(pixel-scroll-interpolate-up): New functions.
* doc/misc/modus-themes.org (Overview): Update the description of the
themes.
(Enable and load): Reflow text.
(Customization Options): Update the code sample with all customization
options.
(Option for color-coding success state)
(Option for red-green color deficiency or deuteranopia): Document the
new user option 'modus-themes-deuteranopia'.
(Option for mode line presentation, Option for mode line padding):
Update documentation about mode line padding.
(Option for completion framework aesthetics): Minor rewording.
(Option for diff buffer looks): Update section to exclude the
discontinued "foreground-only" diff styles.
(Option for Org agenda constructs): Expand documentation pertaining to
the 'modus-themes-org-agenda' user option.
(Option for the headings' overall style, Option for scaled headings):
Document how heading scaling is now done directly with the
'modus-themes-headings' user option.
(Option for variable-pitch font in headings): Remove section on
'modus-themes-variable-pitch-headings'. Its functionality is merged
into 'modus-themes-headings'.
(A theme-agnostic hook for theme loading): Add section on how users
can add their own "foreground-only" diff styles.
(Full support for packages or face groups, Indirectly covered
packages): Update list of supported packages.
(Note on god-mode.el): Reflow text.
(Frequently Asked Questions): Remove invalid characters from heading.
(Acknowledgements): Update list of contributors to code, ideas, etc.
* etc/themes/modus-themes.el (modus-themes-operandi-colors)
(modus-themes-vivendi-colors): Update theme color palettes.
(modus-themes-variable-pitch-headings): Make it obsolete. Use
'modus-themes-headings' instead.
(modus-themes--headings-choice): Accept float to adjust heading
height.
(modus-themes-headings, modus-themes-org-agenda): Update doc strings
to cover new features.
(modus-themes-scale-headings, modus-themes-scale-1, modus-themes-scale-2)
(modus-themes-scale-3, modus-themes-scale-4, modus-themes-scale-5)
(modus-themes-scale-title, modus-themes-scale-small): Deprecate them.
Use 'modus-themes-headings' directly.
(modus-themes-org-habit): Remove long-deprecated user option
(modus-themes-mode-line): Update doc string about padding the mode
line.
(modus-themes-mode-line-padding): Deprecate user option. Use
'modus-themes-mode-line' directly.
(modus-themes-diffs): Update doc string to omit discontinued
"foreground-only" styles.
(modus-themes-completions): Remove outdated reference.
(modus-themes-intense-hl-line): Delete long-deprecated form.
(modus-themes-lang-checkers, modus-themes-hl-line)
(modus-themes-paren-match, modus-themes-syntax, modus-themes-links)
(modus-themes-region): Update syntax of code sample in doc string.
(modus-themes-success-deuteranopia): Deprecate it and alias it as
'modus-themes-deuteranopia'.
(modus-themes--variable-pitch, modus-themes--lang-check)
(modus-themes--prompt, modus-themes--paren)
(modus-themes--syntax-foreground, modus-themes--syntax-extra)
(modus-themes--syntax-string, modus-themes--syntax-comment)
(modus-themes--heading, modus-themes--agenda-structure)
(modus-themes--agenda-date, modus-themes--agenda-event)
(modus-themes--agenda-habit, modus-themes--org-block-delim)
(modus-themes--mode-line-padding, modus-themes--mode-line-attrs)
(modus-themes--diff, modus-themes--diff-deuteran)
(modus-themes--success-deuteran, modus-themes--link)
(modus-themes--link-color, modus-themes--scale, modus-themes--region)
(modus-themes--hl-line): Update private functions to parse the updated
user options and to simplify/refine their code.
(modus-themes-faces): Remove some faces, add a few others, and
generally clean up the code to avoid overusing private functions for
the expansion of attributes with user-facing options.
(modus-themes-custom-variables): Remove support for 'highlight-tail'
variable.