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.
Stefan Kangas [Thu, 23 Dec 2021 19:10:16 +0000 (20:10 +0100)]
Respect changes in eshell-hist-match-partial
* lisp/eshell/em-hist.el (eshell-hist--update-keymap): New function.
(eshell-hist-match-partial): Add :set property with above new
function.
(eshell-hist-mode-map): Update for eshell-hist-match-partial using
eshell-hist--update-keymap.
Michael Albinus [Fri, 24 Dec 2021 10:32:34 +0000 (11:32 +0100)]
Add tag :tramp-asynchronous-processes to tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process)
(tramp--test--deftest-direct-async-process)
(tramp-test30-make-process, tramp-test31-interrupt-process)
(tramp-test34-explicit-shell-file-name)
(tramp-test44-asynchronous-requests):
Add :tramp-asynchronous-processes tag.
(tramp--test-asynchronous-processes-p): New defun.
(tramp-test32-shell-command, tramp-test33-environment-variables):
Use it.
(tramp--test-expensive-test-p): Rename from
`tramp--test-expensive-test'. Make it a defun. Adapt all callees.
Changes:
- structure the result of mm-dissect-buffer of application/pkcs7-mime
like a multipart mail so there is no loosing of information of
verification and decryption results which can now be displayed by
gnus-mime-display-security
- adjust gnus-mime-display-part to handle application/pkcs7-mime like
multipart/encrypted or multipart/signed
- add dummy entries to mm-verify-function-alist and
mm-decrypt-function-alist so gnus-mime-display-security correctly
displays "S/MIME" and not "unknown protocol"
- don't just check for multipart/signed in
gnus-insert-mime-security-button but also for the pkcs7-mime mimetypes
to print "Encrypted" or "Signed" accordingly in the security button
- adjust mm-possibly-verify-or-decrypt to check for smime-type to ask
wether to verify or decrypt the part and not to always ask to decrypt
- adjust mm-view-pkcs7-decrypt and verify to call mm-sec-status so
success information can be displayed by gnus-mime-display-security
- adjust gnus-mime-security-verify-or-decrypt to handle pkcs7-mime
right with the done changes
Po Lu [Fri, 24 Dec 2021 06:22:21 +0000 (14:22 +0800)]
Grab the server when warping the client pointer
* src/xfns.c (Fx_set_mouse_absolute_pixel_position):
* src/xterm.c (x_make_frame_invisible): Avoid race conditions
where the client pointer is destroyed between when it is
obtained and when XIWarpPointer is called.
Po Lu [Fri, 24 Dec 2021 03:10:09 +0000 (11:10 +0800)]
Fix menu grabs on XI2 Motif builds
* src/xmenu.c (x_activate_menubar) [USE_MOTIF]: Clear XI grab.
* src/xterm.c (xi_grab_or_ungrab_device) [USE_MOTIF]: Always
ungrab if a popup is active.
Revert back to using monospaced fonts in the mode line
* lisp/faces.el (mode-line-active, mode-line-inactive): Revert
back to using monospaced fonts on the mode line (for now). The
main remaining usability problem is clicking on the very small "-"
characters in "U:--".
Stefan Kangas [Wed, 22 Dec 2021 21:15:57 +0000 (22:15 +0100)]
Make substitute-command-keys test less brittle
* test/lisp/help-tests.el (help-tests--test-keymap): New keymap
variable.
(help-tests-substitute-command-keys/keymaps): Make test less
brittle by using above new keymap.
Alan Third [Fri, 26 Nov 2021 12:54:07 +0000 (12:54 +0000)]
Add native HEIC support on macOS (bug#51381)
* lisp/image.el (image-type-header-regexps):
(image-type-file-name-regexps):
(image-type-auto-detectable): Add auto-detect code for heic.
* src/image.c (syms_of_image): Add heic as an image type under NS.
* src/nsimage.m (ns_can_use_native_image_api): Add heic to list of
possible image types in the native image support lookup.
Alan Third [Thu, 26 Aug 2021 18:25:48 +0000 (19:25 +0100)]
Allow resizing undecorated frames on macOS (bug#28512, bug#31795)
* src/nsterm.m (FRAME_DECORATED_FLAGS, FRAME_UNDECORATED_FLAGS):
Remove unused defines.
* src/nsterm.m ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]):
Since this is now the only place these defines are used just put them
inline and add NSWindowStyleMaskResizable for undecorated frames on
Cocoa.
Alan Third [Wed, 25 Aug 2021 18:50:27 +0000 (19:50 +0100)]
Make NS toolbar item ID more unique (bug#50160)
* src/nsmenu.m
([EmacsToolbar addDisplayItemWithImage:idx:tag:labelText:helpText:enabled:]):
Add the label to the identifier to avoid collisions between toolbar
items that use the same image.
Alan Third [Sun, 22 Aug 2021 20:50:09 +0000 (21:50 +0100)]
Make NS toolbar use NSString instead of C strings
* src/nsfns.m ([NSString stringWithLispString:]): Ensure that the lisp
object is actually a string.
* src/nsmenu.m (update_frame_tool_bar): Convert to NSString instead of
C strings.
([EmacsToolbar addDisplayItemWithImage:idx:tag:labelText:helpText:enabled:]):
No need to convert to NSString here anymore.
Alan Third [Sat, 21 Aug 2021 18:39:39 +0000 (19:39 +0100)]
Fix macfont backend color handling
* src/macfont.m (get_cgcolor): Replace use of ns_lookup_indexed_color.
(CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND):
(CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND):
(CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND): Fix call to get_cgcolor
and fix all callers.
Alan Third [Sun, 15 Aug 2021 09:46:43 +0000 (10:46 +0100)]
Further cleanup of NS color code
* src/dispextern.h (FACE_COLOR_TO_PIXEL): Remove define and fix all
callers.
* src/nsterm.h (struct nsfont_info): Remove color_table.
* src/nsterm.m ([NSColor colorWithUnsignedLong:]): Always assume the
input contains the correct alpha value.
(ns_lookup_indexed_color):
(ns_index_color):
(ns_color_index_to_rgba): Remove functions and fix all callers.
(ns_query_color): No longer set pixel to the lookup table index,
always just set it to the ARGB integer value.
(ns_defined_color): Ignore makeindex as we no longer set pixel to the
lookup table index.
(ns_initialize_display_info):
(ns_redisplay_interface): Remove lookup table.
(ns_term_init): Fix the alpha setting.
Alan Third [Sat, 14 Aug 2021 15:11:30 +0000 (16:11 +0100)]
Simplify NS color handling
* src/image.c (RGB_TO_ULONG):
(ARGB_TO_ULONG):
(RED_FROM_ULONG):
(RED16_FROM_ULONG):
(GREEN16_FROM_ULONG):
(BLUE16_FROM_ULONG): Define these here for NS too.
* src/nsfns.m (ns_set_foreground_color):
(ns_set_background_color): Use new EmacsColor methods.
* src/nsterm.h (struct ns_color_table): Replace this struct with a
built-in Objective C type.
(RGB_TO_ULONG):
(ARGB_TO_ULONG):
(ALPHA_FROM_ULONG):
(RED_FROM_ULONG):
(GREEN_FROM_ULONG):
(BLUE_FROM_ULONG):
(RED16_FROM_ULONG):
(GREEN16_FROM_ULONG):
(BLUE16_FROM_ULONG): These are no longer needed in the NS specific code.
(struct ns_display_info): Use an NSMutableArray instead of a custom struct.
* src/nsterm.m ([NSColor colorWithUnsignedLong:hasAlpha:]):
([NSColor unsignedLong]): New methods.
(ns_lookup_indexed_color):
(ns_index_color): Use the NSMutableArray lookup table.
(ns_term_init):
(ns_color_index_to_rgba):
(ns_query_color): Use the new EmacsColor methods.
(ns_initialize_display_info):
(ns_delete_display): Initialize and release the NSMutableArray lookup table.
Jonas Bernoulli [Wed, 22 Dec 2021 19:03:00 +0000 (20:03 +0100)]
Help outline-minor-mode avoid some false matches
* lisp/international/emoji.el (emoji--generate-file): Help
'outline-minor-mode' avoid false matches by quoting certain
characters when they appear at bol in a multi-line string.