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.
Juri Linkov [Thu, 27 Jun 2024 18:08:28 +0000 (21:08 +0300)]
* lisp/hi-lock.el: More fixes for revert-buffer (bug#57534)
(hi-lock-set-pattern): Put the text property 'regexp' on the lighter string.
(hi-lock-revert-buffer-rehighlight): Get the real regexp from the
text property 'regexp'. This fixes the case when the original
regexp gets lost after e.g. 'M-s . M-s h r'.
Instead of detecting invalidated overlays, use the same condition
as in 'hi-lock-set-pattern', and always re-highlight overlays,
because even when overlays stays on their original positions,
there is a need to highlight more matches possibly added after revert.
Andrea Corallo [Thu, 27 Jun 2024 13:32:03 +0000 (15:32 +0200)]
Fix two tests for --without-all build
* test/src/image-tests.el
(image-tests-image-mask-p/error-on-nongraphical-display)
(image-tests-image-metadata/error-on-nongraphical-display): xpm images
are not supported in all configurations so use xbm for non graphical
display tests.
F. Jason Park [Thu, 13 Jun 2024 06:10:00 +0000 (23:10 -0700)]
Change ERC version to 5.6.1-git
* doc/misc/erc.texi: Change ERCVER to 5.6.1.
* lisp/erc/erc.el: (erc-version): Change working version to 5.6.1-git.
Do the same for the package Version header. Don't bother updating
`customize-package-emacs-version-alist' until needed.
Eli Zaretskii [Thu, 27 Jun 2024 09:42:43 +0000 (12:42 +0300)]
Fix handling of non-nil 'dired-movement-style'
* lisp/dired.el (dired--move-to-next-line): Treat any non-nil
value of 'dired-movement-style' except 'cycle' as 'bounded'.
(dired-movement-style): Mention this in the doc string.
(Bug#71770)
Sebastian Miele [Wed, 19 Jun 2024 13:48:59 +0000 (15:48 +0200)]
kill-whole-line: Honor visibility; fix kill-ring when read-only (bug#65734)
* lisp/simple.el (kill-whole-line): Use visibility state before
performing any edits as reference instead of expecting that visibility
cannot change. First of the two calls to `kill-region' may trigger
`after-change-functions' that might alter the visibility state.
Make sure that we populate the `kill-ring' with the contents of the
whole line when buffer is in `read-only-mode'.
Juri Linkov [Thu, 27 Jun 2024 06:52:06 +0000 (09:52 +0300)]
* lisp/hi-lock.el (hi-lock-file-patterns-policy): Add value 'always'.
(hi-lock-mode): Update docstring.
(hi-lock-find-patterns): Return t for value 'always'.
(hi-lock-revert-buffer-rehighlight): Rewrite to correctly handle
all possible cases (bug#57534).
Po Lu [Thu, 27 Jun 2024 03:06:59 +0000 (11:06 +0800)]
Prevent crashes and related issues if initial activity is destroyed on Android
* java/org/gnu/emacs/EmacsWindow.java
(EmacsWindow) <initialWindowCreated>: New variable.
(EmacsWindow): If the initial frame has not yet been created,
set attachmentToken to -1.
* java/org/gnu/emacs/EmacsWindowManager.java (registerWindow):
When the window's attachment token is -1 (i.e., it is the
default window), start EmacsActivity rather than
EmacsMultitaskActivity. Catch exceptions around startActivity.
Eshel Yaron [Wed, 26 Jun 2024 16:51:32 +0000 (18:51 +0200)]
Use 'revert-function' in *xref* buffer
* lisp/progmodes/xref.el (xref--xref-buffer-mode-map): Cease
binding 'g' to 'xref-revert-buffer'.
(xref--xref-buffer-mode): Set 'revert-buffer-function' to...
(xref--revert-buffer): ...this. New function, renamed from...
(xref-revert-buffer): ...this. Make it an alias of
'revert-buffer'.
* etc/NEWS: Announce it.
* doc/emacs/maintaining.texi (Xref Commands): Update docs.
Eshel Yaron [Wed, 26 Jun 2024 09:06:52 +0000 (11:06 +0200)]
Minor improvements to new Completion Preview commands
* lisp/completion-preview.el (Commentary): Mention
`completion-preview-partial-insert' and elaborate about
`completion-preview-insert-sexp'.
(completion-preview--barf-if-no-preview): New function.
(completion-preview-insert, completion-preview-complete):
Use it.
(completion-preview-partial-insert): Rename arg to FUN; only
compute (+ end (length aft)) once; bind 'deactivate-mark' to
nil while inserting/deleting to allow commands that use this
function to work as expected with 'shift-select-mode';
improve behavior when called with point not at the start of
the completion preview overlay (e.g. when point is in the
middle of a multi-word symbol and this function is called
via 'completion-preview-insert-word'); add the base part of
the completion candidate to when calling exit-function.
(completion-preview-insert-word): Improve docsting, rename
argument ARG to N.
(completion-preview-insert-sexp): Likewise, and also remove
second argument INTERACTIVE.
(completion-preview--active-p): Rename to...
(completion-preview-active-p): ...this. Make this function
public so users can leverage it for their own commands.
Extend docstring to explain how to do that.
* test/lisp/completion-preview-tests.el
(completion-preview-insert-calls-exit-function)
(completion-preview-insert-word): Break long lines.
(completion-preview-insert-sexp)
(completion-preview-insert-nonsubword)
(completion-preview-insert-subword): Fix docstrings.
(completion-preview-insert-mid-symbol): New test.
Po Lu [Wed, 26 Jun 2024 04:08:55 +0000 (12:08 +0800)]
Avert crash in store_mode_line_string on Android 5.0 and earlier
* src/xdisp.c (store_mode_line_string)
[__ANDROID_API__ < 22]: Call strlen on STRING if the limit
would otherwise be SIZE_MAX, or if the address of the string
is within PRECISION bytes of UINTPTR_MAX, in which case it
cannot possibly be larger than PRECISION.
Stephen Berman [Tue, 25 Jun 2024 10:38:03 +0000 (12:38 +0200)]
Fix tabbing between widgets (bug#70594)
* lisp/wid-edit.el (widget-move): Don't error when tabbing in a
buffer with only one active widget and 'widget-skip-inactive'
enabled. Improve code by handling forward and backward movement
in a single loop.
This fixes the change from 768e92b9, which accidentally would call
'custom-reevaluate-setting' on user options before they were registered,
initialising their default value to nil. When the 'defcustom'
expressions were evaluated later on, they were not properly initialised
as their variables were already bound to some value (nil).
Po Lu [Tue, 25 Jun 2024 03:37:09 +0000 (11:37 +0800)]
Fix latent side-effects of respecting field boundaries in text conversion
* src/textconv.c (textconv_query, get_extracted_text)
(get_surrounding_text): Restore selected window in addition to
excursion.
(locate_and_save_position_in_field): Restore excursion lest the
current buffer differ from the selected window's contents, to
prevent redisplay from clobbering the current buffer when called
while the current buffer is at variance with the selected
window's contents, as seen with dired-other-window.
Jonas Bernoulli [Mon, 24 Jun 2024 18:34:53 +0000 (20:34 +0200)]
Add missing builtin package declarations
* lisp/editorconfig-conf-mode.el:
* lisp/editorconfig-core-handle.el:
* lisp/editorconfig-core.el:
* lisp/editorconfig-fnmatch.el:
* lisp/editorconfig-tools.el: Declare library as part of the
'editorconfig' package.
This fixes two bugs, one of them restoring compatibility with the
version that ships with Emacs 29, making emoji-insert usable again.
The other changes are of cosmetic nature. The only exception is a new
command, whose creation lead to the discovery of one of the bugs, and
remains unused until a package author actually binds it in a prefix.
I.e., unless someone actually uses this, the risk of a regression is
close to zero, and even if it is used, it can only affect the prefix
that binds it.
Update options that depend on 'which-key-dont-use-unicode'
* lisp/which-key.el (which-key-dont-use-unicode): Add a custom setter
that re-evaluates a manual list of options use
'which-key-dont-use-unicode' to determine their default value.