Stefan Kangas [Sun, 30 Jun 2024 23:44:38 +0000 (01:44 +0200)]
Backport file backup FAQ item to Emacs <28
* doc/misc/efaq.texi (Not writing files to the current directory):
Backport recommendation to Emacs 27 or older.
Problem reported by David Hedlund <davidh@gnu.org>.
Eli Zaretskii [Sun, 30 Jun 2024 19:25:31 +0000 (22:25 +0300)]
More updates of documentation for Emacs 30
* etc/NEWS: Improve wording and move/mark entries.
* doc/lispref/positions.texi (List Motion): Document
'forward-sentence-function'.
* doc/lispref/functions.texi (What Is a Function): Document
'primitive-function-p' and 'cl-functionp'.
* doc/emacs/misc.texi (Saving Emacs Sessions): Improve wording and
indexing.
* doc/lispref/tips.texi (Documentation Tips): Adapt to the new
value of 'emacs-lisp-docstring-fill-column'.
* doc/emacs/fixit.texi (Spelling): Document
'flyspell-check-changes'.
Po Lu [Sun, 30 Jun 2024 08:26:39 +0000 (16:26 +0800)]
Respect --disable-build-details in Android builds
* java/Makefile.in (BUILD_DETAILS, GEN_BUILD_DETAILS): New
variables.
(install_tmp): Tolerate failures in generation of metadata files
and prefix commands for such generation with GEN_BUILD_DETAILS.
* lisp/version.el (android-read-build-system)
(android-read-build-time): Return nil if metadata file does not
exist.
Po Lu [Sun, 30 Jun 2024 04:10:21 +0000 (12:10 +0800)]
Enable caching values generated by the Android build system
* build-aux/ndk-build-helper-1.mk:
* build-aux/ndk-build-helper-2.mk:
* build-aux/ndk-build-helper.mk: Do not generate file names with
redundant directory separators, to port to systems where the
semantics of this are undefined.
* configure.ac: Provide a cache file to the recursive invocation
of configure if one is specified for the initial.
* cross/ndk-build/Makefile.in (my-dir): Better conform to the
original ndk-build by generating directory names with no
trailing separator.
* m4/ndk-build.m4 (ndk_resolve_import_module, ndk_SEARCH_MODULE):
Cache the names of Android.mk files and the commands produced
from them.
Paul Eggert [Sat, 29 Jun 2024 23:36:34 +0000 (00:36 +0100)]
Assume setlocale exists
Like locale.h, it was standardized by C89, is universally
available now, and some code already assumes it.
* configure.ac: Do not check for setlocale.
* src/emacs.c (setlocale) [!HAVE_SETLOCALE]: Remove.
(fixup_locale, synchronize_locale, Vprevious_system_time_locale)
(synchronize_system_time_locale): Define even if !HAVE_SETLOCALE.
* src/sysdep.c (emacs_setlocale): Simplify by assuming HAVE_SETLOCALE.
Paul Eggert [Sat, 29 Jun 2024 23:20:42 +0000 (00:20 +0100)]
Do not worry about whether locale.h is includable
* src/emacs.c, src/lread.c, src/sysdep.c: Remove preconditions
from including locale.h. It was standardized in C89, is universal
now, and some code already assumes it.
Yuan Fu [Sat, 29 Jun 2024 07:16:36 +0000 (00:16 -0700)]
Fix treesit crash (bug#71681)
To reproduce the problem:
0. emacs -Q
1. eval: (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode))
2. C-x v L
3. in the *vc-change-log* buffer move point to the commit 20af58d3a13
4. type D
5. crash caused by diff-font-lock-syntax fontification that uses treesit
Emacs: 6f2036243f2 (2024-06-23, latest master)
Tree-sitter: 3da7deed (2024-06-08, version 0.22.6)
The immediate cause of the crash is that tree-sitter accessed a node's
tree, but the tree is already deleted. Commenting out the
ts_tree_delete line in treesit_ensure_parsed can "fix" the crash.
What happended, I think, is this:
1. Buffer modified, parser->need_reparse set to true,
parser->timestamp incremented.
2. A node is created from the parser, this node has the old tree but
the new timestamp (bad!).
3. Parser re-parses (treesit_ensure_parsed), new tree created, old
tree deleted.
4. Ftreesit_query_capture accessed the old node, and the old tree,
crash.
We shouldn't bump the parser timestamp when we set
parser->need_reparse to true; instead, we should bump the timestamp
when we actually reparsed and created a new tree.
Paul Eggert [Sat, 29 Jun 2024 22:14:54 +0000 (23:14 +0100)]
Remove unused m4/printf-posix-rpl.m4
* m4/printf-posix-rpl.m4: Remove unused file.
This is leftover from an old Android branch,
and the m4 macros are no longer needed in the master branch.
Stefan Kangas [Sat, 29 Jun 2024 19:58:53 +0000 (21:58 +0200)]
Complete to "nil" in directory local variables skeleton
* lisp/autoinsert.el (auto-insert-alist): Make "nil" a completion
candidate for the directory local variables skeleton. The "nil" value
means "any mode" in the context of directory local variable files.
Stefan Kangas [Sat, 29 Jun 2024 19:30:19 +0000 (21:30 +0200)]
Support grep.el better in `python-base-mode`
* lisp/progmodes/python.el (python-base-mode): When mode is first
enabled, add *.py alias to 'grep-files-aliases', and add common Python
tooling directories to 'grep-find-ignored-directories'.
Stefan Kangas [Sat, 29 Jun 2024 14:48:49 +0000 (16:48 +0200)]
Document security fixes in FAQ
* doc/misc/efaq.texi (New in Emacs 29): Recommend using Emacs 29.4.
* doc/misc/efaq.texi (Security risks with Emacs): New item with a
recommendation to upgrade Emacs for improved security.
George Huebner [Tue, 18 Jun 2024 22:14:41 +0000 (17:14 -0500)]
Fix: make 'xwidget-webkit-scroll-backward' scroll backwards
* lisp/xwidget.el (xwidget-webkit-scroll-backward): Move
hyphen out of %-formatter, changing semantics from a padding
specifier to a negative sign. (Bug#71792)
Vincenzo Pupillo [Tue, 25 Jun 2024 09:29:54 +0000 (11:29 +0200)]
Add jsdoc support to php-ts-mode in <script> element
In the <script> element, enable jsdoc embedding in JavaScript.
* lisp/progmodes/php-ts-mode.el
(php-ts-mode--language-source-alist): Add jsdoc to parser recipe.
(php-ts-mode): Add jsdoc parser check and a new rule for
'treesit-range-settings'. Update the commentary section.
(Bug#71771)
Po Lu [Sat, 29 Jun 2024 12:02:45 +0000 (20:02 +0800)]
Fix typo incurring leaks of face structures
* src/xfaces.c (free_realized_face): Always free realized face
structures, and avoid sending X requests when the display is not
available, not when it is.
* src/w32fns.c (Fx_create_frame, w32_create_tip_frame): Do not
register the Uniscribe font driver when unavailable.
(pfnSHFileOperationW): New function pointer.
(Fsystem_move_file_to_trash): Load UNICOWS.DLL if not yet
loaded. Call SHFileOperationW through said function pointer.
(pfnShellExecuteExW): New function pointer.
(Fw32_shell_execute) [!CYGWIN]: Load UNICOWS.DLL if not yet
loaded. Call ShellExecuteExW through said function pointer.
(pfnShell_NotifyIconW): New function pointer.
(add_tray_notification, delete_tray_notification): Call
Shell_NotifyIconW through said function pointer.
(Fw32_notification_notify): Load UNICOWS.DLL.
(Fw32_notification_close): Return if Shell_NotifyIconW is
unavailable, as when UNICOWS.DLL has yet to be loaded.
(load_unicows_dll_for_w32fns): New function.
* src/w32notify.c (pfnReadDirectoryChangesW): New function
pointer.
(watch_completion, remove_watch, Fw32notify_add_watch)
(Fw32notify_rm_watch, Fw32notify_valid_p): Call
ReadDirectoryChangesW through said function pointer, and assert
its presence.
(globals_of_w32notify): Load ReadDirectoryChangesW from
KERNEL32.DLL.
* src/w32uniscribe.c (pfnScriptItemize, pfnScriptShape)
(pfnScriptPlace, pfnScriptGetGlyphABCWidth, pfnScriptFreeCache)
(pfnScriptGetCMap): New function pointers.
(uniscribe_close, uniscribe_shape, uniscribe_encode_char)
(uniscribe_check_otf_1): Call Uniscribe functions through the
same.
(syms_of_w32uniscribe_for_pdumper): Load Uniscribe library and
required functions from the same, and if unavailable, return
while leaving uniscribe_available intact. On Cygwin, simply
assign USP10.DLL functions to the said new function pointers.
Eshel Yaron [Sat, 29 Jun 2024 09:51:10 +0000 (11:51 +0200)]
Inherit text props in Completion Preview insertion commands
When completing with Completion Preview mode commands,
inherit text properties from surrounding text similarly to
other completion commands, such as 'completion-at-point'.
* lisp/completion-preview.el (completion-preview-insert)
(completion-preview-partial-insert)
(completion-preview-complete): Use 'insert-and-inherit'
instead of 'insert' to insert text for completion.
* test/lisp/completion-preview-tests.el
(completion-preview-insert-inherits-text-properties): New
test.
Juri Linkov [Fri, 28 Jun 2024 06:42:43 +0000 (09:42 +0300)]
* lisp/hi-lock.el: More fixes related to revert-buffer.
(hi-lock-set-pattern): Use the same propertized string
for 'overlay-put' property to allow 'remove-overlays'
to remove it while using 'eq' on the property value.
https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg01001.html
* lisp/completion-preview.el
(completion-preview-partial-insert): Abort change group
rather than deleting entire temporary insertion, so as to
avoid recording no-op undo entries. Move 'deactivate-mark'
let-binding outside of 'catch' form.