Stefan Kangas [Sat, 16 Sep 2023 12:34:20 +0000 (14:34 +0200)]
Add missing builtin package declarations
* lisp/finder.el (finder--builtins-alist): Add new package
directories 'leim' and 'obsolete' as part of the 'emacs' package.
Add new package directory 'use-package' as part of the
'use-package' package.
* lisp/net/eudc-capf.el:
* lisp/net/eudcb-ecomplete.el:
* lisp/net/eudcb-macos-contacts.el:
* lisp/net/eudcb-mailabbrev.el: Declare library as part of the
'eudc' package.
* lisp/mail/ietf-drums-date.el: Declare library as part of the
'ietf-drums' package.
* lisp/image/image-dired-dired.el:
* lisp/image/image-dired-external.el:
* lisp/image/image-dired-tags.el:
* lisp/image/image-dired-util.el: Declare library as part of the
'image-dired' package.
* lisp/emacs-lisp/oclosure.el:
* lisp/keymap.el:
* lisp/progmodes/c-ts-common.el: Declare library as part of the
'emacs' package. (Bug#62751)
Eli Zaretskii [Sat, 16 Sep 2023 11:36:49 +0000 (07:36 -0400)]
Merge from origin/emacs-29
755ae813a6a ; Declare some treesit.c functions in typescript-ts-mode.el. 89fa204b706 Fix loss of encrypted data in plstore.el d9a1175a611 Close SQL database when corresponding 'sqlite-mode' buffe... cbd8fac283a Fix Unicode normalization of characters 825be05b379 Support one-time passwords in Tramp f880b94e649 Fix the 'C' and 'c' categories of characters 58fd212d8a2 Fix Emoji zooming commands 8970cdd009a ; Fix last change. ba924be4522 ; * etc/DEBUG: Improve the redisplay section. e110312ad95 ; * doc/lispref/minibuf.texi (Text from Minibuffer): Ment... 65f4810003b tsx-ts-mode--font-lock-compatibility-bb1f97b: Improve 6fe11b88ed0 Avoid using --display in emacsclient to reuse frames on PGTK 2fc7463c0e5 ; * INSTALL: Don't advertise -O3. (Bug#65988) 29055412f2d ; Fix doc string of 'lsh' 738d8543337 Support emacsclient on Windows with server on GNU or Unix... f0a89fa1d0e ; * lisp/saveplace.el (save-place-ignore-files-regexp): F... c9cb8ee0fc0 Fix defcustom in saveplace.el (Bug#65977) 5ec8be1d589 ; * lisp/subr.el (string-suffix-p, string-prefix-p): Doc ... 809305e6d8f Fix 'window-text-pixel-size' when there are several image... ea14b0dcc20 : Doc fix. 01e8a0c6cbf Doc fix for prettify-symbols-unprettify-at-point 0065621d0d3 (report_overlay_modification): Fix bug#65929 6cc6455e931 Fix SVG colors (bug#56182) 9396d73942e * doc/emacs/text.texi (Outline Minor Mode): Add a note ab... a65d1a5a167 Improve documentation of 'list-abbrevs' 5dcc4b7eab1 Tweak s-p-f for js-ts-mode 1fb2fb501f3 typescript-ts-mode, tsx-ts-mode: Fix syntax properties fo... 946b395e7e1 * lisp/progmodes/c-ts-mode.el (c++-ts-mode): Provide (bug... 33ee3e588fd Fix regression of treesit_cursor_helper_1 d11d81dfcc6 ; Fix doc typos (Bug#65868) 6554ec22465 Update docs for passing of Thien-Thi Nguyen 5ab2792d5c1 Update defvar usage tips example in manual 35d88c657e1 Document using Flymake together with Eglot 3f04efe9e7d ; * src/font.h (struct font): Comment about use of averag... 459b5f6b6d1 ; * admin/authors.el (authors-aliases): Update. 0c029ae8bcb ; tweak etc/TODO item
Jens Schmidt [Tue, 30 May 2023 21:00:56 +0000 (23:00 +0200)]
Fix loss of encrypted data in plstore.el
* lisp/plstore.el (plstore--insert-buffer): Fix loss of encrypted
data when a plstore gets opened and saved without being decrypted
between these steps. (Bug#63627)
Earl Hyatt [Sat, 19 Aug 2023 22:26:45 +0000 (18:26 -0400)]
Make using Edmacro easier for long sequences of keys
* lisp/edmacro.el (edmacro-set-macro-to-region-lines)
(edmacro-reverse-key-order): New command and user option to
make working with longer lists of keys, such as from
'kmacro-edit-lossage', easier.
(edit-kbd-macro): Move regexps used to identify parts of
buffer to internal variables.
(edmacro--macro-lines-regexp, edmacro-mode-font-lock-keywords):
Allow noting whether the most recent line of keys is displayed
first.
(edmacro-mode-map): Bind the new command to 'C-c C-r'.
(edmacro-mode): Describe the new command in the mode
documentation string.
* doc/emacs/kmacro.texi (Edit Keyboard Macro): Mention
'edmacro-insert-key' and the newly added
'edmacro-set-macro-to-region-lines' and
'edmacro-reverse-key-line-order'.
* etc/NEWS (Edmacro): Add section describing the new features.
Eli Zaretskii [Sat, 16 Sep 2023 09:17:23 +0000 (12:17 +0300)]
Fix Unicode normalization of characters
* lisp/international/ucs-normalize.el
(ucs-normalize-composition-exclusions, check-range): Update from
Unicode 15.0 data. (Bug#65996)
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part1)
(ucs-normalize-tests--failing-lines-part2): Update to reflect
changes in ucs-normalize.el.
* admin/notes/unicode: Mention the updates in ucs-normalize.el.
Po Lu [Sat, 16 Sep 2023 02:38:46 +0000 (10:38 +0800)]
Update Android port
* java/org/gnu/emacs/EmacsContextMenu.java (display): Return
false if the list of menu buttons is empty, lest Android cease
displaying menus on the assumption that Emacs is defective.
* src/fns.c (sort_list): Render sentence motion commands
functional within commentary
* src/sfntfont.c (sfntfont_list_family): Sort and deduplicate
the returned family list and make it a list of symbols.
(syms_of_sfntfont) <Qstring_lessp>: New defsym.
Stefan Monnier [Fri, 15 Sep 2023 18:44:59 +0000 (14:44 -0400)]
(mutually_exclusive_p): Fix the regression from commit 6fad73d7cc53
Commit 6fad73d7cc53 throws away some useful optimization because
it misfired in some cases (as seen in bug#657260). Here we try to
recover those useful optimizations with a slightly more careful
algorithm.
* src/regex-emacs.c (mutually_exclusive_aux): Rename from
`mutually_exclusive_p`. Add two new args. Improve the
case where we need to recurse.
(mutually_exclusive_p): New function defined on top of it.
* test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization):
Re-enable the test.
* src/regex-emacs.c (mutually_exclusive_exactn)
(mutually_exclusive_charset): New functions, extracted from
`mutually_exclusive_p`.
(mutually_exclusive_p): Use them.
* lisp/progmodes/typescript-ts-mode.el
(tsx-ts-mode--font-lock-compatibility-bb1f97b):
Test the more complex query, because the current one leads to
false positives (mentioned in bug#65470).
Davide Masserut [Thu, 24 Aug 2023 16:33:39 +0000 (18:33 +0200)]
Avoid using --display in emacsclient to reuse frames on PGTK
Using hard-coded display values can cause PGTK graphical frames to
open using the wrong backend or not open at all.
* Makefile.in (install-etc): Use --reuse-frame instead of
--display=$DISPLAY. (Bug#65509)
Stefan Kangas [Fri, 15 Sep 2023 08:52:03 +0000 (10:52 +0200)]
Mark two tests as expensive
* test/lisp/calendar/todo-mode-tests.el
(todo-test-add-and-delete-file):
* test/lisp/simple-tests.el (simple-tests-shell-command-39067):
Mark tests taking more than 10 seconds to run on a MacBook Pro from
2015 as expensive.
Eli Zaretskii [Fri, 15 Sep 2023 07:02:00 +0000 (10:02 +0300)]
Support emacsclient on Windows with server on GNU or Unix systems
* lisp/server.el (server-process-filter): If 'tty-name' is literally
"CONOUT$", assume the client runs on MS-Windows and force the
frame type to GUI. This allows to run emacsclient on MS-Windows
when the server runs on a Posix host. (Bug#65812)
Po Lu [Fri, 15 Sep 2023 02:30:12 +0000 (10:30 +0800)]
Correct bug#65919
* src/process.c (child_signal_notify): Expunge call to
non-reentrant function from signal handler.
* src/xfns.c (setup_xi_event_mask): Cease selecting for
XI_FocusIn and XI_FocusOut under X toolkit builds.
* src/xterm.c (xi_handle_interaction, xi_handle_focus_change)
(xi_handle_focus_change): Make conditional on GTK 3 or no
toolkit builds.
(xi_handle_delete_frame, x_free_frame_resources): Adjust
correspondingly.
(handle_one_xevent) <EnterNotify, LeaveNotify>: Examine
EnterNotify and LeaveNotify events for focus changes
irrespective of whether XI2 is enabled under the X toolkit and
GTK 2.x.
Po Lu [Thu, 14 Sep 2023 08:53:04 +0000 (16:53 +0800)]
Avert a crash in the Android last resort font driver
* java/org/gnu/emacs/EmacsFontDriver.java (FONT_INVALID_CODE):
New constant.
(hasChar, encodeChar): Accept a jint character code rather than
a jchar.
* java/org/gnu/emacs/EmacsSdk23FontDriver.java (hasChar)
(encodeChar): Return 0 or FONT_INVALID_CODE if the character is
not representable in a Java char.
Stefan Kangas [Wed, 13 Sep 2023 20:45:02 +0000 (22:45 +0200)]
Doc fix for prettify-symbols-unprettify-at-point
* lisp/progmodes/prog-mode.el
(prettify-symbols-unprettify-at-point): Document that it has to be
set before enabling 'prettify-symbols-mode'. (Bug#65884)
Yuan Fu [Thu, 14 Sep 2023 02:16:04 +0000 (19:16 -0700)]
Fix treesit-font-lock-fontify-region wrt local parsers
* lisp/treesit.el (treesit--update-ranges-local): Minor change.
(treesit-font-lock-fontify-region): Don't try to fontify if node is
nil. Don't use alist-get to get the root node for a language: there
might be multiple root nodes (from multiple local parsers) for the
same language.
(treesit-major-mode-setup): Remove existing local parsers when major
mode is activated.
Po Lu [Thu, 14 Sep 2023 01:57:09 +0000 (09:57 +0800)]
Improve the Android last resort font driver
* java/org/gnu/emacs/EmacsSdk7FontDriver.java (Sdk7Typeface):
Rename fileName to familyName and cease attempting to infer a
style from it.
(EmacsSdk7FontDriver): Employ preset typefaces rather than
enumerating each typeface within the system fonts directory.
(draw): Circumvent kerning difficulties by advancing past each
character individually.
Yuan Fu [Thu, 14 Sep 2023 01:14:03 +0000 (18:14 -0700)]
Improve docstring for treesit-language-at
* lisp/treesit.el (treesit-language-at-point-function)
(treesit-language-at): Several people has confused over this, make it
extra clear than treesit-language-at requires
treesit-language-at-point-function to work.
Stefan Monnier [Wed, 13 Sep 2023 22:49:55 +0000 (18:49 -0400)]
(report_overlay_modification): Fix bug#65929
Somehow the new overlay code in Emacs-29 changed slightly
the test to decide when to run the `modification-hooks` of overlays,
with the consequence that these hook functions end up being executed
also when text is deleted right after an empty overlay, which is
contrary to Emacs-28 behavior as well as contrary to the Texinfo doc.
* src/buffer.c (report_overlay_modification): Better reproduce the
Emacs-28 code.
Stephen Berman [Wed, 13 Sep 2023 21:43:54 +0000 (23:43 +0200)]
Fix last Ibuffer change and improve feedback messages
* lisp/ibuf-macs.el (define-ibuffer-op): Emit grammatically
correct message on finishing operation, and don't operate when
there are no marked buffer lines and point is not on a buffer
line. (bug#64230, Message #21)
* lisp/ibuffer.el (ibuffer-map-lines): Take acting on only one
buffer line and using non-nil 'ibuffer-expert' into account.
Jim Porter [Wed, 13 Sep 2023 18:50:39 +0000 (11:50 -0700)]
When waiting for processes in Eshell, wait until all the I/O is complete
This should fix bug#59103, bug#65590, and bug#65601.
* lisp/eshell/esh-proc.el (eshell-sentinel): Set ':eshell-handles' to
nil when finished with I/O.
(eshell-wait-for-process): Wait until ':eshell-handles' is nil.
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Split the first line of
generated docstrings if either the struct name or a field name is very
long. This reduces the likelihood of "docstring wider than 80
characters" errors. (Bug#65790)
* lisp/emacs-lisp/cl-macs.el (cl-defsubst): Split the first line of
the docstring into 2 lines if the function name is very long.
Additionally, remove the word "inlining" in the generated docstring as
it is not very useful and increases the likelihood of "docstring wider
than 80 characters" errors. (Bug#65790)
Eli Zaretskii [Wed, 13 Sep 2023 14:23:03 +0000 (17:23 +0300)]
Improve documentation of 'list-abbrevs'
* doc/emacs/abbrevs.texi (Editing Abbrevs): Describe how system
abbrevs are shown by 'list-abbrevs'. Suggested by Shynur Xie
<one.last.kiss@outlook.com>. (Bug#65907)
Po Lu [Wed, 13 Sep 2023 13:39:22 +0000 (21:39 +0800)]
Reorganize Android permissions documentation
* doc/emacs/android.texi (Android Environment): Illustrate the
behavior of modern Android versions first. Reported by Stefan
Kangas <stefankangas@gmail.com>.
Po Lu [Wed, 13 Sep 2023 01:24:16 +0000 (09:24 +0800)]
Facilitate opening content:// files without a linked file name
* java/org/gnu/emacs/EmacsOpenActivity.java
(checkReadableOrCopy): If FILE is NULL, return a matching
content URI if possible, else generate a file name with the URI
as a reference.
(onCreate): Catch SecurityException around calls to
openFileDescriptor.
typescript-ts-mode, tsx-ts-mode: Fix syntax properties for regexp and jsx
Propertize regexps as strings and JSX elements as generic strings.
* lisp/progmodes/typescript-ts-mode.el (ts-ts--s-p-query)
(tsx-ts--s-p-query): New variables.
(ts-ts--syntax-propertize, tsx-ts--syntax-propertize)
(ts-ts--syntax-propertize-captures): New functions.
(typescript-ts-mode, tsx-ts-mode): Use them (bug#65470).
Yuan Fu [Tue, 12 Sep 2023 07:36:07 +0000 (00:36 -0700)]
Avoid unnecessary tree-sitter reparse when setting the same range
* src/treesit.h (Lisp_TS_Parser)
* src/treesit.c (make_treesit_parser): Remove has_range field, add
last_set_ranges field.
(Ftreesit_parser_set_included_ranges): Return early if the new range
is the same as the old one.
(Ftreesit_parser_included_ranges): Change has_range to
last_set_ranges.
Yuan Fu [Tue, 12 Sep 2023 03:59:50 +0000 (20:59 -0700)]
Make sure undefined tree-sitter thing doesn't raise an error
A previous change should've achived this, but that wasn't enough.
This one actually achieves the intended effect, namely,
treesit-node-match-p doesn't raise an error if IGNORE-MISSING is
non-nil, and traverse functions don't raise error by default.
* src/treesit.c (treesit_traverse_validate_predicate): Remove
ignore_missing parameter, return error symbol.
(Ftreesit_node_match_p)
(Ftreesit_search_subtree)
(Ftreesit_search_forward)
(Ftreesit_induce_sparse_tree): Check returned error symbol.
(syms_of_treesit): New symbol.
Jim Porter [Tue, 12 Sep 2023 05:05:38 +0000 (22:05 -0700)]
Ensure that Eshell doesn't consider a process complete until stderr is done
This will hopefully help resolve some timing issues with subprocesses
in Eshell. There's now much less chance of output going missing when
using redirects.
* lisp/eshell/esh-proc.el (eshell-gather-process-output): Set
':eshell-stderr-live'...
(eshell-sentinel): ... use it.
Stefan Monnier [Tue, 12 Sep 2023 16:55:54 +0000 (12:55 -0400)]
(read-char-from-minibuffer): Allow use of `quoted-insert` (bug#65805)
* lisp/subr.el (read-char-from-minibuffer-map): No need to remap
`self-insert-command` any more.
(read-char-from-minibuffer): Use `post-command-hook` to exit as soon as
a char is provided.
Po Lu [Tue, 12 Sep 2023 02:37:55 +0000 (10:37 +0800)]
Extract font foundry metadata from the OS/2 table
* src/sfnt.c (sfnt_table_names): Append an entry for OS/2
tables.
(sfnt_read_OS_2_table): New function.
(main): Introduce a new test for the OS/2 table reader.
* src/sfnt.h (sfnt_read_OS_2_table): New declaration.
* src/sfntfont.c (sfnt_decode_foundry_name): Delete function.
(sfnt_enum_font_1): Read the font's OS/2 table and extract the
foundry name from there. Use `misc' if absent.
(sfntfont_desc_to_entity, sfntfont_open): Cease interning
desc->designer, as that is now a symbol.
(syms_of_sfntfont) <Qmisc>: New defsym Qmisc. (bug#65865)
Yuan Fu [Mon, 11 Sep 2023 19:47:32 +0000 (12:47 -0700)]
Fix regression of treesit_cursor_helper_1
* src/treesit.c (treesit_cursor_helper_1)
(treesit_cursor_first_child_for_byte): Use
ts_tree_cursor_goto_first_child_for_byte first, and
ts_tree_cursor_goto_first_child second.
Alan Third [Mon, 11 Sep 2023 16:18:31 +0000 (17:18 +0100)]
Remove check for appdefined events on the queue (bug#65843)
It seems this was likely a bug in macOS 10.10.1. I have no way to find
out when it was fixed, but hopefully before 10.10.5, the most recent
release of that version.
* src/nsterm.m (ns_send_appdefined): Remove check for whether previous
appdefined events have been lost.
Alan Third [Fri, 8 Sep 2023 18:33:06 +0000 (19:33 +0100)]
Fix crash on child frame creation (bug#65817)
* src/nsterm.m ([EmacsView initFrameFromEmacs:]): Reorder the way the
frame and layers are created.
([EmacsView makeBackingLayer]): Change to the newly renamed method
below.
([EmacsLayer initWithColorSpace:doubleBuffered:]):
([EmacsLayer initWithDoubleBuffered:]): Rename the method and remove
the colorspace argument as it's no longer able to be set on initial
creation.
* src/nsterm.h: Use new method prototype.
Stephen Berman [Mon, 11 Sep 2023 14:15:29 +0000 (16:15 +0200)]
Avoid confusing message in Ibuffer (bug#64230)
* lisp/ibuffer.el (ibuffer-map-lines): With `ibuffer-auto-mode'
enabled, Ibuffer counts the automatically popped up (and hence not
user-marked) buffer "*Ibuffer confirmation*". Since Ibuffer
reports how many user-marked buffers were acted upon, and in this
case the reported count would be too high by one, decrement the
count to avoid the confusing message.