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.
Po Lu [Mon, 24 Jun 2024 04:04:05 +0000 (12:04 +0800)]
Fix omission of updates to child frames on Android
* java/org/gnu/emacs/EmacsView.java (onAttachedFromWindow):
Force a layout cycle rather than report exposure immediately.
(prepareForLayout): Delete function.
* java/org/gnu/emacs/EmacsWindow.java (mapWindow): Remove
redundant calls to prepareForLayout.
* src/androidterm.c (handle_one_android_event): Do not swap
buffers when exposure is registered by a frame only partially
updated.
Damien Cassou [Fri, 14 Jun 2024 08:46:42 +0000 (10:46 +0200)]
Add jsdoc support to js-ts-mode
* lisp/progmodes/js.el (js--treesit-font-lock-settings): Add jsdoc
font-lock settings.
(js--treesit-jsdoc-beginning-regexp): New variable to match the
beginning of a jsdoc block.
(js-ts-mode): Add jsdoc support. Save the 'javascript parser to
`treesit-primary-parser'. Configure `treesit-range-settings' to
use a jsdoc parser within a JavaScript file.
(js-ts-language-at-point): New function to return either 'jsdoc or
'javascript depending on where the point is.
Stefan Kangas [Sun, 23 Jun 2024 15:34:38 +0000 (17:34 +0200)]
Delete obsolete file process.cocci
* admin/coccinelle/process.cocci: Delete file. This semantic patch was
converting code to use the PVAR macro, which was removed by Paul Eggert
on 2012-08-17 (commit 6a09a33b5551).
Martin Rudalics [Sun, 23 Jun 2024 08:26:57 +0000 (10:26 +0200)]
Fix a bug in 'switch-to-buffer'
* lisp/window.el (switch-to-buffer): When asked to switch to the
buffer of the selected window,
'switch-to-buffer-obey-display-actions' is non-nil and
'pop-to-buffer' uses the selected window, don't try to restore
window start and point from 'window-prev-buffers' (Bug#71616).
Jim Porter [Thu, 20 Jun 2024 03:59:59 +0000 (20:59 -0700)]
Fix zooming images in SHR
Previously, for images with no alt-text, the zoomed image wouldn't get
properly inserted. For images with alt-text, both the zoomed and
unzoomed image would be displayed at once (bug#71666).
* lisp/net/shr.el (shr-sliced-image): New face.
(shr-zoom-image): Reimplement using
'next/previous-single-property-change', and don't bother deleting any of
the text.
(shr-image-fetched): Clean up any overlays when deleting the old region.
(shr-put-image): Ensure we always have a non-empty string to put the
image on. For sliced images, just use "*", since we'll repeat it, so we
can't preserve the original buffer text exactly anyway. Apply an
overlay to sliced images to prevent unsightly text decorations.
(shr-tag-img): Move the placeholder space insertion where it should be
and explain what it's doing.
* test/lisp/net/shr-tests.el (shr-test--max-wait-time)
(shr-test-wait-for): New helper functions.
(shr-test/zoom-image): New test.
Vincenzo Pupillo [Sat, 22 Jun 2024 21:11:17 +0000 (23:11 +0200)]
Colorize CSS property value like `css--fontify-region'
If the value of a property is text representing a CSS color,
it will be fontified such that its background is the color
itself. 'php-ts-mode-css-fontify-colors' can be used to
disable this behaviour.
* lisp/progmodes/php-ts-mode.el (php-ts-mode-css-fontify-colors):
New custom var.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--colorize-css-value):
New function.
* lisp/progmodes/php-ts-mode.el (php-ts-mode): Use the new
function. (Bug#71724)
Stefan Kangas [Sat, 22 Jun 2024 22:16:42 +0000 (00:16 +0200)]
Add assignment form as `etc/copyright-assign.txt`
This change was discussed in:
https://lists.gnu.org/r/emacs-devel/2023-12/msg00326.html
* etc/copyright-assign.txt: New file copied from
https://www.gnu.org/s/gnulib/Copyright/request-assign.future
* doc/emacs/trouble.texi (Copyright Assignment):
* etc/TODO: Point to above new file.
Michael Albinus [Sat, 22 Jun 2024 17:52:06 +0000 (19:52 +0200)]
Minor changes in tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp--test-shell-file-name):
Use connection-local value.
(tramp--test-shell-command-switch): New defun.
(tramp-test28-process-file)
(tramp-test34-explicit-shell-file-name): Use it.
(tramp--test-supports-processes-p): Simplify.
(tramp--test-check-files): Use `tramp-compat-seq-keep'.
(tramp-test45-asynchronous-requests): Don't let-bind `shell-file-name'.
(tramp-test45-asynchronous-requests): Adjust timer.
(tramp-test45-asynchronous-requests): Add another test message.
Michael Albinus [Sat, 22 Jun 2024 17:49:45 +0000 (19:49 +0200)]
Tramp: Fix bug#71709, and other minor changes
* lisp/net/tramp-message.el (tramp-backtrace): Print also in batch mode.
* lisp/net/tramp.el (tramp-skeleton-file-exists-p): Check for
property only.
(tramp-skeleton-make-process): Don't set `default-directory'.
(tramp-handle-make-process): Set it. (Bug#71709)
Vincenzo Pupillo [Sat, 22 Jun 2024 14:22:16 +0000 (16:22 +0200)]
Fix for grammar change of keyword "virtual" in tree-sitter-cpp
The new rule works with both the new (>= 0.22.1) and the
old (<= 0.22.0) grammar libraries.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--keywords): Removed
the keyword "virtual".
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
New font lock rule. (Bug#71518)
Stefan Kangas [Sat, 22 Jun 2024 16:42:06 +0000 (18:42 +0200)]
Replace literal whitespace with `\s`
* test/lisp/vc/log-edit-tests.el (log-edit-fill-entry-confinement)
(log-edit-fill-entry-space-substitution)
(log-edit-fill-entry-initial-wrapping): Replace literal space character
with '\s', to avoid tripping up merge scripts.
* lisp/editorconfig.el (editorconfig--get-indentation-python-mode):
New function.
(editorconfig-indentation-alist): Use it.
(editorconfig-indent-size-vars): Improve docstring.
(editorconfig--default-indent-size-function): Add docstring.
Ihor Radchenko [Fri, 21 Jun 2024 13:45:25 +0000 (15:45 +0200)]
org-link-expand-abbrev: Do not evaluate arbitrary unsafe Elisp code
* lisp/org/ol.el (org-link-expand-abbrev): Refuse expanding %(...)
link abbrevs that specify unsafe function. Instead, display a
warning, and do not expand the abbrev. Clear all the text properties
from the returned link, to avoid any potential vulnerabilities caused
by properties that may contain arbitrary Elisp.
Stefan Kangas [Sat, 22 Jun 2024 14:50:12 +0000 (16:50 +0200)]
Use UTC when generating man page timestamps
* doc/man/ebrowse.1:
* doc/man/emacs.1.in:
* doc/man/emacsclient.1:
* doc/man/etags.1: Add 'time-stamp-time-zone' to local variables to
prefer UTC when generating timestamp.
Vincenzo Pupillo [Fri, 21 Jun 2024 21:24:33 +0000 (23:24 +0200)]
Support for indentation of PHP alternative syntax control structures
For some control structures, PHP provides an alternative syntax.
A new rule has been added to handle this syntax.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--indent-styles):
New rule for PHP alternative syntax. (Bug#71710)
Vincenzo Pupillo [Sun, 16 Jun 2024 14:32:53 +0000 (16:32 +0200)]
Fix font lock regex for user defined constant in PHP
The old regex also captured functions with two or more
uppercase characters. This new regex fixes that issue.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--font-lock-settings):
New regex that match only user-defined constants. (Bug#71593)
Make Compilation mode recognize non-legacy Kotlin/Gradle errors
The Compilation mode recognizes Kotlin/Gradle errors but only in
the now legacy format. The current format, which has been in wide
use for about a year, is not supported. This change adds support
for the current format.
* etc/compilation.txt: (symbols): Add examples of non-legacy
Kotlin/Gradle warnings and errors.
* lisp/progmodes/compile.el: (compilation-error-regexp-alist-alist):
Rename 'gradle-kotlin' to 'gradle-kotlin-legacy' and add
'grade-kotlin' that matches the errors and warnings outputted by
the current (non-legacy) Kotlin/Gradle. (Bug#70797)
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data): Rename 'gradle-kotlin' to
'gradle-kotlin-legacy' and add two test cases for the newly added,
non-legacy Kotlin/Gradle warnings and errors.