Po Lu [Mon, 20 Mar 2023 06:47:39 +0000 (14:47 +0800)]
Update Android port
* configure.ac: Add support for HarfBuzz on Android.
* java/INSTALL: Document where to get Emacs with HarfBuzz.
* lisp/subr.el (overriding-text-conversion-style, y-or-n-p):
Correctly set text conversion style if y-or-n-p is called inside
the minibuffer.
* src/sfnt.c (sfnt_read_cmap_format_8)
(sfnt_read_cmap_format_12): Fix typos.
(sfnt_read_24, sfnt_read_cmap_format_14): New function.
(sfnt_read_cmap_table_1, sfnt_read_cmap_table): Handle format 14
cmap tables.
(sfnt_read_default_uvs_table, sfnt_read_nondefault_uvs_table)
(sfnt_compare_table_offsets, sfnt_create_uvs_context)
(sfnt_free_uvs_context, sfnt_compare_uvs_mapping)
(sfnt_variation_glyph_for_char, sfnt_map_table, sfnt_unmap_table)
(sfnt_read_table, sfnt_test_uvs): New functions.
(main): Add UVS tests.
* src/sfnt.h (struct sfnt_cmap_format_14)
(struct sfnt_variation_selector_record)
(struct sfnt_default_uvs_table, struct sfnt_unicode_value_range)
(struct sfnt_nondefault_uvs_table, struct sfnt_uvs_mapping)
(struct sfnt_mapped_variation_selector_record)
(struct sfnt_table_offset_rec, struct sfnt_uvs_context)
(struct sfnt_mapped_table): New structures. Update prototypes.
* src/sfntfont-android.c (android_sfntfont_driver): Register
HarfBuzz callbacks where required.
* src/sfntfont.c (sfntfont_select_cmap): Look for a format 14
table. Save it in new arg FORMAT14.
(sfntfont_read_cmap): Adjust accordingly.
(struct sfnt_font_info): New field `uvs'. New fields `hb_font',
`fd' and `directory'.
(sfntfont_open): Open uvs context. Under HarfBuzz, don't close
the fd or subtable, but save them in the font info instead.
(sfntfont_close): Free UVS context. Close font fd and table
directory and HarfBuzz font.
(sfntfont_draw): Handle case where s->padding_p.
(sfntfont_get_variation_glyphs): New function.
(sfntfont_unmap_blob, sfntfont_get_font_table)
(sfntfont_begin_hb_font): New functions.
* src/sfntfont.h: Update prototypes.
* src/textconv.c (Fset_text_conversion_style): Fix doc string.
Stefan Kangas [Mon, 20 Mar 2023 05:30:32 +0000 (06:30 +0100)]
Merge from origin/emacs-29
ea87c54f359 ; * lisp/subr.el (setq-local): Add missing period (bug#62... 90362f87d58 ; Correct last commit, downcase node reference 38067f05b92 Enhance section about troubleshooting in Eglot manual. 6f82596b490 Fix Eglot's snippet insertion to follow the manual c54bda15e35 Reset abbrevs-changed after saving abbrevs (bug#62208) e8cee15f780 ; Fix markup in previous change e4a7d0cd6ea Document `keymap-unset' in lispref bb3e0ded9eb Don't add a key binding when REMOVE is non-nil a4a9ffdd80a Fix the documentation of various aspects of adding Xref h... a2222b9a9bf ; Minor wording fix in ELisp reference manual 5cf1de683b2 Fix python-fill-paragraph problems on filling strings (bu... 7385c991dff Also exempt eglot-inlay-hints-mode from desktop.el's fumb... 1961bdb52ed ; Add WebDAV entry to index in Tramp manual dfb36d36230 Refer to EWW instead of w3 and w3m 9d3fdf7e0d4 Fix Eglot's command generation for code actions
Stefan Kangas [Mon, 20 Mar 2023 05:30:30 +0000 (06:30 +0100)]
Merge from origin/emacs-29
028f1102738 Fix quoting of font-family in 'hfy-family' 4cb8a850b08 ; Tweak doc/misc/eglot.texi d5d4959ed7d Document how to construct JSONRPC arrays in Eglot manual 078cf512eef * test/infra/Dockerfile.emba: Use debian:bullseye. 61adb44318a * configure.ac: Fix native comp compatibility check (bug#... d814c249f44 * test/infra/Dockerfile.emba: Install clangd. 27edd7f88cb Remove 'package-vc--query-spec' 39fea115515 Do not store :lisp-dir in package descriptors 168165178f3 Use 'package-vc-selected-packages' to store package specs
João Távora [Sun, 19 Mar 2023 00:47:55 +0000 (00:47 +0000)]
Improve ergonomics of Eglot's inlay hints
Instead of deleting inlay hints instantly as soon as the affected
changes, make hint overlays span one character (instead of being
length 0). Give the overlays an "evaporate" property.
Given an inlay hints at position POS, its attached to [POS, POS+1] if
it's kind=1 (usually type hints) and [POS-1, POS] otherwise. For
kind=1 hints, the 'cursor position of the first such overlay is also
tweaked, so that's it's less akward to edit around it.
Michael Albinus [Sun, 19 Mar 2023 12:11:06 +0000 (13:11 +0100)]
Rename tramp-use-ssh-controlmaster-options to tramp-use-connection-share
* doc/misc/tramp.texi (Ssh setup): Use tramp-use-connection-share.
Describe its settings for PuTTY.
(Remote processes): Use tramp-use-connection-share.
* etc/NEWS: Renamed user option tramp-use-connection-share.
* lisp/net/tramp-integration.el
(tramp-compile-disable-ssh-controlmaster-options):
Use `tramp-use-connection-share'.
* lisp/net/tramp-sh.el (tramp-use-connection-share):
Rename from `tramp-use-ssh-controlmaster-options'. Make it a
defvaralias to `tramp-use-ssh-controlmaster-options'.
(tramp-ssh-controlmaster-options): Adapt docstring.
(tramp-methods) <plink, plinkx, pscp, psftp>: Adapt.
(tramp-ssh-controlmaster-options): Add plink implementation.
Jim Porter [Sun, 12 Mar 2023 07:53:34 +0000 (23:53 -0800)]
Don't over-normalize file names starting with "~" in Eshell
Previously, this would call 'expand-file-name' on the file name, but
that normalizes the value, turning something like "~/." into
"/home/user". As a result, Pcomplete didn't work for dotfiles after
"~/" (bug#28064).
* lisp/eshell/em-dirs.el (eshell-expand-user-reference): New
function...
(eshell-expand-user-reference): ... use it.
João Távora [Fri, 17 Mar 2023 22:37:27 +0000 (22:37 +0000)]
Don't take over mouse-1 binding on Eglot diagnostics (bug#62157)
It's better to give the user a variable to allow the overlay keymap to
be customized.
* lisp/progmodes/eglot.el (eglot--mouse-call): Accept second arg.
(eglot--mode-line-props): Adapt call to eglot--mouse-call
(eglot-diagnostics-map): New variable.
(eglot-code-actions-at-mouse): New command.
Gregory Heytings [Sat, 18 Mar 2023 10:49:29 +0000 (10:49 +0000)]
Avoid slowdowns in xmltok-scan-attributes
* lisp/nxml/xmltok.el (xmltok-scan-attributes): Limit the search
to 10000 characters, to avoid slowdowns due to the quadratic
complexity of the regexp. Suggested by Stefan Monnier.
Alan Mackenzie [Sat, 18 Mar 2023 10:12:24 +0000 (10:12 +0000)]
CC Mode: Eliminate duplicate function c-list-of-strings
Replace it with the existing c-string-list-p. Also put an autoload cookie in
front of c-string-list-p so that it will not be signalled as undefined by
loaddefs.el.
lisp/progmodes/cc-vars.el (c-string-list-p): Make this autoload.
(c-list-of-strings): Remove.
(c-font-lock-extra-types, c++-font-lock-extra-types)
(objc-font-lock-extra-types, java-font-lock-extra-types)
(idl-font-lock-extra-types, pike-font-lock-extra-types): In the autoload
cookies, replace c-list-of-strings with c-string-list-p.
Alan Mackenzie [Mon, 13 Mar 2023 16:42:02 +0000 (16:42 +0000)]
CC Mode: Allow lists of strings as safe values for *-font-lock-extra-types
* lisp/progmodes/cc-vars.el (c-list-of-strings): New function.
(c-font-lock-extra-types, c++-font-lock-extra-types)
(objc-font-lock-extra-types, java-font-lock-extra-types)
(idl-font-lock-extra-types, pike-font-lock-extra-types): Add a :safe entry
into each of thes defcustoms for c-list-of-string.
(Top level): Add an autoload entry for each of the above.
Alan Mackenzie [Sat, 18 Mar 2023 10:12:24 +0000 (10:12 +0000)]
CC Mode: Eliminate duplicate function c-list-of-strings
Replace it with the existing c-string-list-p. Also put an autoload cookie in
front of c-string-list-p so that it will not be signalled as undefined by
loaddefs.el.
lisp/progmodes/cc-vars.el (c-string-list-p): Make this autoload.
(c-list-of-strings): Remove.
(c-font-lock-extra-types, c++-font-lock-extra-types)
(objc-font-lock-extra-types, java-font-lock-extra-types)
(idl-font-lock-extra-types, pike-font-lock-extra-types): In the autoload
cookies, replace c-list-of-strings with c-string-list-p.
Manuel Giraud [Fri, 10 Mar 2023 20:54:00 +0000 (21:54 +0100)]
Fix 'find-ls-option-default-ls' for BSD/MacOS (bug#62096)
* lisp/find-dired.el (find-gnu-find-p): New variable to determine
if "find" is a GNU find.
(find-ls-option-default-ls): Use 'find-gnu-find-p' and adapt to a
value that works with the default "find" on *BSD and Darwin/MacOS.
Tested on OpenBSD and MacOS.
Manuel Giraud [Fri, 10 Mar 2023 20:54:00 +0000 (21:54 +0100)]
Fix 'find-ls-option-default-ls' for BSD/MacOS (bug#62096)
* lisp/find-dired.el (find-ls-option-default-ls): Adapt to
a value that works with the default "find" on *BSD and
Darwin/MacOS. Tested on OpenBSD and MacOS. Do not merge
to master.
Po Lu [Sat, 18 Mar 2023 03:59:17 +0000 (11:59 +0800)]
Work around pselect lossage on Android
* src/android.c (android_run_select_thread): New flag. Use it
rather than the rc of pselect and errno to determine whether or
not it has been interrupted.
(android_handle_sigusr1): Set said flag.
Po Lu [Sat, 18 Mar 2023 02:54:26 +0000 (10:54 +0800)]
Update Android port
* java/org/gnu/emacs/EmacsView.java (EmacsView)
(prepareForLayout): New function. Call this prior to mapping
the view.
(onGlobalLayout): New function. Register as global layout
listener.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow)
(notifyContentRectPosition): New function. Use specified
xPosition and yPosition when reporting the offsets of children
of the root window.
* java/org/gnu/emacs/EmacsWindowAttachmentManager.java
(registerWindow): Specify activity launch bounds if necessary.
* src/androidterm.c (handle_one_android_event): Send
MOVE_FRAME_EVENT where necessary.
João Távora [Fri, 17 Mar 2023 11:47:02 +0000 (11:47 +0000)]
Fix Eglot's snippet insertion to follow the manual
The manual states that YASnippet must only be installed to be useful.
Before this change, it would only work if the user happened to have
manually activated it before with 'yas-global-mode' or somesuch.
This makes Eglot's Yasnippet-activating behaviour similar to its
Flymake-activating behaviour.
Eli Zaretskii [Fri, 17 Mar 2023 08:14:41 +0000 (10:14 +0200)]
Fix the documentation of various aspects of adding Xref history
* lisp/progmodes/xref.el (xref-marker-ring-length)
(xref-set-marker-ring-length):
* lisp/progmodes/etags.el (tags-location-ring-length)
(find-tag-marker-ring): Add doc strings saying the variables are
unused.
* etc/NEWS: Enhance the description of the change which made Xref
marker stack unlimited in its length.
* doc/emacs/maintaining.texi (Looking Up Identifiers): Add back
text lost when xref forward history was added in bug#38797.
Explain the difference between 'C-M-,' and 'M-.'. Improve
wording (Bug#62229)
Jim Porter [Sun, 29 Jan 2023 01:04:11 +0000 (17:04 -0800)]
Simplify usage of 'while' forms in Eshell's iterative evaluation
Now, 'eshell-do-eval' rewrites 'while' forms to let-bind variables for
the command and test bodies. This means that external code, such as
command rewriting hooks, no longer has to worry about this, making it
easier to pass "normal" Lisp forms to 'eshell-do-eval' (bug#61954).
* lisp/eshell/esh-cmd.el (eshell-command-body, eshell-test-body): No
longer used outside of 'eshell-do-eval', so rename to...
(eshell--command-body, eshell--test-body): ... these.
(Command evaluation macros): Remove obsolete description about 'if'
and 'while' forms.
(eshell-rewrite-for-command, eshell-structure-basic-command): Remove
'eshell-command-body' and 'eshell-test-body'.
(eshell-do-eval): Reimplement handling of 'while' forms.
Jim Porter [Sat, 28 Jan 2023 23:06:31 +0000 (15:06 -0800)]
Simplify how Eshell's iterative evaluation handles 'if' forms
The previous implementation used 'eshell-test-body' and
'eshell-command-body' to track the condition and the then/else forms,
but those special variables are only needed for looping. 'if' only
evaluates each form once at most (bug#61954).
* lisp/eshell/esh-cmd.el (Command evaluation macros): Remove 'if' from
the notes about 'eshell-test-body' and 'eshell-command-body'.
(eshell-do-eval): Reimplement evaluation of 'if' forms.
(eshell-eval-command): Don't let-bind 'eshell-command-body' and
'eshell-test-body'; they're no longer needed here.
Jim Porter [Fri, 27 Jan 2023 07:18:42 +0000 (23:18 -0800)]
Simplify iteration in Eshell for loops
The previous code fixed an issue in Eshell's iterative evaluation
where deferred commands caused an infinite loop (see bug#12571).
However, with the fix to unwinding let forms in 'eshell-do-eval' (see
bug#59469), we can just write this code as we normally would
(bug#61954).
Po Lu [Fri, 17 Mar 2023 05:10:23 +0000 (13:10 +0800)]
Improve radio button appearance in Android menus
* java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu):
New field `lastGroupId'.
(Item): New field `isRadio'.
(addItem): New arg `isRadio'.
(inflateMenuItems): Apply an empty radio button group if
required.
* src/androidmenu.c (android_init_emacs_context_menu): Adjust
accordingly.
(android_menu_show): Likewise.
Po Lu [Fri, 17 Mar 2023 02:38:09 +0000 (10:38 +0800)]
Update Android port
* java/org/gnu/emacs/EmacsView.java (cancelPopupMenu): Dismiss
context menu correctly.
(isOpaque): New function.
* java/org/gnu/emacs/EmacsWindowAttachmentManager.java: Make
consumer list public.
kobarity [Sun, 12 Mar 2023 08:05:54 +0000 (17:05 +0900)]
Fix python-fill-paragraph problems on filling strings (bug#62142)
* lisp/progmodes/python.el (python-syntax--context-compiler-macro)
(python-syntax-context): Add single-quoted-string and
triple-quoted-string as TYPE argument.
(python-info-triple-quoted-string-p): New helper function.
(python-fill-paragraph)
(python-fill-string): Use it.
* test/lisp/progmodes/python-tests.el (python-syntax-context-1)
(python-fill-paragraph-single-quoted-string-1)
(python-fill-paragraph-single-quoted-string-2)
(python-fill-paragraph-triple-quoted-string-1)
(python-info-triple-quoted-string-p-1)
(python-info-triple-quoted-string-p-2)
(python-info-triple-quoted-string-p-3): New tests.
João Távora [Thu, 16 Mar 2023 10:41:53 +0000 (10:41 +0000)]
Emphasize emacs-29-specificity in this version of lisp/progmodes/eglot.el
Do not merge to master.
Before working on bugfixes to Eglot in its non-ELPA form delivered
with Emacs 29, it's important to distinguish between this emacs-29
version and the one in master, which will also get the bugfixes (via
routine gitmerge.el) but with a bumped version number.
* lisp/progmodes/eglot.el (Version): Emphasize Emacs 29, but hint this
is 1.12 + something.
(Package-Requires): Remove. Everything required is already in Emacs
29.
* lisp/progmodes/elixir-ts-mode.el: Only require heex-ts-mode once
elixir-ts-mode loads to avoid calling (treesit-ready-p 'heex)
during byte-compilation.
Standards-compliant web browsers should ignore this font-family.
MDN Web Docs says:
https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
Valid family names
Font family names must either be given quoted as strings, or unquoted as
a sequence of one or more identifiers. This means that punctuation
characters and digits at the start of each token must be escaped in
unquoted font family names.
It is a good practice to quote font family names that contain white
space, digits, or punctuation characters other than hyphens.
An unquoted font-family is valid as long as it doesn't start with a digit,
but MDN Web Docs also says:
The following example is technically valid but is not recommended:
font-family: Gill Sans Extrabold, sans-serif;
Document how to construct JSONRPC arrays in Eglot manual
Many language server configuration options are of the JSON array
datatype, for example argument lists for executables, but there wasn't
any example of that in the Eglot manual.