1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-09 15:50:40 -08:00
Commit graph

95091 commits

Author SHA1 Message Date
Stefan Kangas
fb11294d41 ; Fix typos 2024-06-23 16:40:06 +02:00
Michael Albinus
1728de5a77 Backport: 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)

(cherry picked from commit 8456cb9b69)
2024-06-23 13:59:57 +02:00
Eli Zaretskii
dd0fc6aff6 New branch emacs-30
* README:
* configure.ac:
* nt/README.W32:
* etc/refcards/ru-refcard.tex:
* msdos/sed2v2.inp:
* lisp/cus-edit.el (customize-changed-options-previous-release):
Cut the emacs-30 release branch.
2024-06-23 06:48:54 -04:00
Martin Rudalics
5f8a9cd4b6 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).
2024-06-23 10:26:57 +02:00
Jim Porter
5f9b5803be 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.
2024-06-22 23:09:00 -07:00
Eli Zaretskii
6f2036243f ; Doc fix in 'php-ts-mode'.
* lisp/progmodes/php-ts-mode.el (php-ts-mode-css-fontify-colors):
Doc fix.
2024-06-23 08:01:28 +03:00
Vincenzo Pupillo
2f1c882a16 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)
2024-06-23 07:57:52 +03:00
Vincenzo Pupillo
737fa7c529 Fix 'Customize' menu entry for 'php-ts-mode'
* lisp/progmodes/php-ts-mode.el (php-ts-mode-menu):
Replace menu entry with 'php-ts-mode' group.  (Bug#71723)
2024-06-23 07:50:55 +03:00
Vincenzo Pupillo
014aab9847 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)
2024-06-22 21:13:43 +03:00
Michael Albinus
a81417e576 Update Tramp version (don't merge to master)
* lisp/net/trampver.el (customize-package-emacs-version-alist):
Adapt Tramp version integrated in Emacs 29.4.
2024-06-22 19:11:13 +02:00
Stefan Kangas
1313b8966a Merge from origin/emacs-29
9a02fce714 Update files for Emacs 29.4
d96c54d388 * admin/authors.el: Update for Emacs 29.4
fd207432e5 * etc/NEWS: Update for Emacs 29.4
c645e1d820 org-link-expand-abbrev: Do not evaluate arbitrary unsafe ...
2024-06-22 18:44:19 +02:00
Eli Zaretskii
8520ec829d ; * lisp/editorconfig.el (editorconfig-indentation-alist): Fix :type. 2024-06-22 19:39:37 +03:00
Stefan Monnier
99161fb714 Fix non-existing editorconfig-set-indentation-python-mode
* 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.
2024-06-22 12:26:09 -04:00
Eli Zaretskii
2f39a4b28a Merge from origin/emacs-29
ce85d3811d Fix bug#49289 also for other auth-source backends
2024-06-22 08:23:18 -04:00
Eli Zaretskii
75fdeef7b4 Allow to expand truncated long lines in *Compilation* buffers
* lisp/progmodes/compile.el (compilation-button-map): Bind keys
in 'compilation-button-map' to allow expanding the truncated
text.  (Bug#71683)
2024-06-22 13:40:11 +03:00
Troy Brown
fb1b188e1a Eglot: Fix command execution (bug#71642)
* lisp/progmodes/eglot.el (eglot--lsp-interface-alist): Add
ExecuteCommandParams interface.
(eglot--execute): Fix handling of Command and CodeAction and add
ExecuteCommandParams.

Copyright-paperwork-exempt: yes
2024-06-22 12:46:36 +03:00
Vincenzo Pupillo
155cc89de0 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)
2024-06-22 12:42:10 +03:00
Manuel Giraud
11fb3510f4 Prevent auto-revert when deleting entry (bug#71264)
* lisp/dired.el (require): Require "autorevert" for
`auto-revert-mode' usage.
(dired-internal-do-deletions): Temporarily prevent auto-revert.
2024-06-22 11:52:32 +03:00
Vincenzo Pupillo
a4fe4ca93c 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)
2024-06-22 11:48:50 +03:00
Rudolf Adamkovič
e1ba4ebb49 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.
2024-06-22 11:30:51 +03:00
Ihor Radchenko
c645e1d820 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.
2024-06-22 00:54:36 +02:00
Stefan Kangas
31e3d5fe9b Fix emacs --geometry flag on macOS
* lisp/startup.el (command-line-ns-option-alist): Fix --geometry
flag on macOS.  (Bug#71669)
2024-06-21 20:07:50 +02:00
Mattias Engdegård
052d2cd258 ; eliminate backslash duplicate in regexp
* lisp/editorconfig-fnmatch.el (editorconfig-fnmatch--do-translate):
Remove superfluous backslash.
2024-06-21 17:20:42 +02:00
Stefan Monnier
45f6cfb89e Merge remote-tracking branch 'origin/scratch/emacs-editorconfig'
* doc/emacs/custom.texi (EditorConfig support): New node.
* lisp/editorconfig-conf-mode.el, lisp/editorconfig-core-handle.el,
* lisp/editorconfig-core.el, lisp/editorconfig-fnmatch.el,
* lisp/editorconfig-tools.el, lisp/editorconfig.el: New files.
2024-06-21 10:07:09 -04:00
Michael Albinus
50a237c468 Update Tramp version (don't merge to master)
* lisp/net/trampver.el (customize-package-emacs-version-alist):
Adapt Tramp version integrated in Emacs 29.4.
2024-06-21 15:56:58 +02:00
Eli Zaretskii
8218aa14ed ; Avoid byte-compiler warning in comint.el
* lisp/comint.el (subr-x): Actually require it (bug#71576).
2024-06-21 08:50:55 +03:00
Jim Porter
e22b072423 Ensure navigating by paragraphs in Eshell stops at prompts and paragraphs
The previous implementation in 6ae2b74ed2 only stopped at prompts,
which isn't the right behavior (bug#61545).

* lisp/eshell/em-prompt.el (eshell-forward-paragraph)
(eshell-backward-paragraph): Reimplement to handle prompts and
paragraphs (the latter by calling the original 'forward-paragraph').

* test/lisp/eshell/em-prompt-tests.el
(em-prompt-test/next-previous-prompt/multiline): Rename.
(em-prompt-test/forward-backward-paragraph-1): New function.
(em-prompt-test/forward-backward-paragraph)
(em-prompt-test/forward-backward-paragraph/multiline): New tests.
2024-06-20 19:01:20 -07:00
Jim Porter
1a55e957ae Limit the amount of text we examine when looking for password prompts
Both Comint and Eshell do this, and it can significantly slow down
commands that write a lot of output (bug#71576).

* lisp/comint.el (comint-password-prompt-max-length): New variable...
(comint-watch-for-password-prompt): ... use it.  Additionally, use the
matched result for the Emacs-based password prompt.

* lisp/eshell/esh-mode.el (eshell-password-prompt-max-length): New
variable...
(eshell-watch-for-password-prompt): ... use it.

* etc/NEWS: Announce this change.
2024-06-20 17:37:19 -07:00
Tomas Fabrizio Orsi
72f2b01e31 Allow giving "ping" flags with C-u M-x ping
* lisp/net/net-utils.el (ping): With a prefix argument, prompt the user
for flags to pass to the "ping" command.  (Bug#71438)
* etc/NEWS: Document the above change.

Copyright-paperwork-exempt: yes
2024-06-20 20:42:51 +02:00
Juri Linkov
a6296fda5e * lisp/hi-lock.el (hi-lock-revert-buffer-rehighlight): Restore same faces.
After reverting the buffer apply all previous patterns with exactly
the same faces as were assigned to patterns before.
2024-06-20 19:49:30 +03:00
Stefan Kangas
41cbfead7e Remove more references to Windows 95
* doc/lispref/frames.texi (Window System Selections):
* doc/misc/ediff.texi (Patch and Diff Programs):
* doc/misc/efaq-w32.texi (Third-party multibyte, Swap Caps NT)
(Subprocesses and floppy drive):
* etc/PROBLEMS:
* lisp/printing.el (pr-path-alist, pr-command):
* lisp/ps-print.el: Remove more references to Windows 95, which is not
supported by Emacs.
2024-06-20 13:30:11 +02:00
Stefan Monnier
b72826eef9 * lisp/editorconfig.el (editorconfig-version): Delete function
Better use a generic command like `C-h P` or `M-x list-packages`
which works uniformly for all packages.
2024-06-19 22:05:36 -04:00
Rodrigo Kassick
374f4235d5 Fix display-buffer-override-next-command (bug#71654)
* lisp/window.el (display-buffer-override-next-command):
display-buffer-overriding-action's car can be either a function or a
list of functions. When a function,
(push action (car display-buffer-overriding-action)) will create a
cons-cell (action . function) instead of a list. In the clear-fun
callback, trying to
(delq action (car display-buffer-overriding-action)) causes an
wrong-type-argument error.

Copyright-paperwork-exempt: yes
2024-06-19 23:27:49 +02:00
Philip Kaludercic
830b392e18
* lisp/which-key.el (which-key-is-verbose): Remove unused option 2024-06-19 22:54:40 +02:00
Stefan Monnier
8d0a7c718b Integrate feedback from Stefan Kangas and Michael Albinus
* lisp/editorconfig.el, lisp/editorconfig-tools.el, lisp/editorconfig-core.el:
* lisp/editorconfig-core-handle.el, lisp/editorconfig-conf-mode.el:
* lisp/editorconfig-fnmatch.el: Fix the reference to CONTRIBUTORS.
* doc/emacs/custom.texi (EditorConfig support):
* etc/NEWS: Improve wording and markup.
2024-06-19 16:18:58 -04:00
Stefan Monnier
8e143a2f30 (editorconfig-indentation-alist): Sync with upstream
The upstream version `editorconfig-indentation-alist` is a lot
more complete than what we got from the
copyright-covered commits.  The changes come from contributors
who (may) have not signed paperwork.  I have not tracked all of
the corresponding commits (there are many) but from what I can
tell, most of those are the sole (and "trivial") contribution
of its author, and in any case there is very little creativity
involved since it just lists the variables used by the
corresponding mode, so I believe it's perfectly OK to include
those here.  Many of them would be covered by our default
heuristic (which looks for vars of the form like `<mode>-basic-offset`),
but it's preferable to reduce changes with upstream.

* lisp/editorconfig.el (editorconfig-indentation-alist):
Synchronize with upstream.  Remove obsolete `sh-indentation`.
(editorconfig--get-indentation-web-mode): Update based on upstream
changes to `editorconfig-indentation-alist`.
2024-06-19 16:18:58 -04:00
Stefan Monnier
833b500a0e editorconfig-core-handle.el: Reduce allocation in parser
* lisp/editorconfig-core-handle.el (editorconfig-core-handle--parse-file):
Return a `editorconfig-core-handle`.
(editorconfig-core-handle): Simplify accordingly.
(editorconfig-core-handle--parse-file): Push `sections` and `props`
in reverse order to avoid the usual O(N²) complexity.
Work directly in the buffer instead of extracting "lines" from it, so
as to reduce memory allocation.  Similarly, use careful regexps so we
can extract trimmed strings without an explicit trim operation.
Use `eobp`.
(editorconfig-core-handle--string-trim): Delete function, not used any more.
2024-06-19 16:18:58 -04:00
Stefan Monnier
ee309f7754 editorconfig-fnmatch.el: Eliminate O(N^2) complexity
* lisp/editorconfig-fnmatch.el (editorconfig-fnmatch--do-translate):
Accumulate partial results in reverse order to pay a single O(N)
reverse at the end instead of N times O(N) concatenations.
2024-06-19 16:18:58 -04:00
Stefan Monnier
55e19499a6 editorconfig-core.el: Remove unneeded defaulting code
This code risks setting `tab-width` even when it's not
requested, and these rules are better handled in
`editorconfig--get-indentation` in any case.

* lisp/editorconfig-core.el (editorconfig-core-get-properties):
Delete function, unused.
(editorconfig-core-get-properties-hash): Comment out defaulting code.
2024-06-19 16:18:58 -04:00
Stefan Monnier
66d5bc292f editorconfig-core-handle.el: Don't use file names as glob pattern
Match relative file names against the glob pattern instead of
trying to construct a glob pattern that matches the absolute
file name (where the code failed to escape the possible
special chars).

* lisp/editorconfig-core-handle.el
(editorconfig-core-handle-section-get-properties): Delete `dir` arg.
(editorconfig-core-handle-get-properties-hash)
(editorconfig-core-handle-get-properties): Adjust call accordingly.
Use `declare` to mark it obsolete.
(editorconfig-core-handle--fnmatch-p): Delete `dir` arg.
2024-06-19 16:18:58 -04:00
Stefan Kangas
0f4fe99a38 lisp/editorconfig: Minor cosmetic fixes 2024-06-19 16:18:58 -04:00
Stefan Monnier
57b2439cb5 editorconfig.el: Miscellaneous minor changes
* lisp/editorconfig.el: Drop redundant `require`s of pcase, nadvice, rx.
Remove unnecessary (and incorrect) `defvar`s in `eval-when-compile`.
(find-library-name, lm-version): Move declarations to right after
the corresponding `require` so we have a reason to believe they're defined.
(editorconfig-version): Use `package-get-version` when available.

* lisp/editorconfig-core.el (editorconfig-core-get-nearest-editorconfig)
(editorconfig-core-get-properties, editorconfig-core-get-properties-hash):
* lisp/editorconfig-fnmatch.el (editorconfig-fnmatch-p):
Remove autoload cookies.
2024-06-19 16:18:58 -04:00
Stefan Monnier
0b3e688b23 lisp/editorconfig: Advise find-auto-coding i.s.o insert-file-contents
In Emacs<30, we can't use `auto-coding-functions`, but we can get
almost the same result by advising `find-auto-coding`.

* lisp/editorconfig.el (editorconfig-merge-coding-systems): Return nil
if there's no setting.  Don't merge if there's no need.
(editorconfig-set-coding-system-revert); Adjust accordingly.
(editorconfig--filename-codingsystem-hash): Delete var.
(editorconfig--advice-insert-file-contents): Delete function.
(editorconfig--advice-find-file-noselect); Simplify.
(editorconfig--advice-find-auto-coding): New function.
(editorconfig-mode): Use it.
2024-06-19 16:18:58 -04:00
Stefan Monnier
624ba9fce0 lisp/editorconfig: Use new Emacs-30 hooks
* lisp/editorconfig.el (editorconfig--get-coding-system)
(editorconfig--get-dir-local-variables): New functions.
(editorconfig-mode): Use them if possible.
(editorconfig-hack-properties-functions only)
(editorconfig-after-apply-functions): Define only when the old advice
is used, since the new hooks don't support them.
2024-06-19 16:18:50 -04:00
Stefan Monnier
f2803456f0 (editorconfig-set-local-variables): Get first, set later
In preparation for the use of Emacs-30's
`hack-dir-local-get-variables-functions`, split the job of
`editorconfig-set-local-variables` into getting an alist of settings
and then applying them.

Rename the `editorconfig-set-*` functions to `editorconfig--get-*`
and make them return an alist of settings rather than applying them
(except for `editorconfig-set-coding-system-revert` which arguably
belongs in `editorconfig-tools.el` anyway).

* lisp/editorconfig.el (editorconfig-indentation-alist): Flesh out the doc.
Use the new `editorconfig--get-indentation-*-mode` functions.
(editorconfig--get-indentation-web-mode): New function extracted from
`editorconfig-indentation-alist`.
(editorconfig--get-indentation-*-mode): Don't `boundp`-test the vars.
(editorconfig--default-indent-size-function): New function.
Test `boundp` here.
(editorconfig-indent-size-vars): New var.
(editorconfig--get-indentation, editorconfig--get-trailing-nl): Rewrite.
(editorconfig--add-hook-safe-p): New function.
Add it to the `safe-local-eval-function` property of `add-hook`.
(editorconfig-get-local-variables-functions): New hook.
(editorconfig--get-local-variables): Rewrite using it.
(editorconfig-set-local-variables): Test `editorconfig--should-set` here.
Rewrite it using `editorconfig--get-local-variables`.
2024-06-19 14:39:17 -04:00
Stefan Monnier
527a45abc3 lisp/editorconfig: Don't hook into read-only-mode-hook
Don't re-set variables just because `read-only-mode` is (de)activated,
and with Emacs-30's hooks it would be even less natural to do.
Also `buffer-read-only` can change without calling `read-only-mode`,
so better test it dynamically when we try to trim whitespace.

* lisp/editorconfig.el (editorconfig--delete-trailing-whitespace):
New function.
(editorconfig-set-trailing-ws): Use it.  Use `pcase`.
Also prefer `before-save-hook` and use `add/remove-hook` to
manipulate hooks, like god intended.
Don't test `buffer-read-only` any more.
(editorconfig-mode): Don't hook into `read-only-mode-hook` any more.
2024-06-19 14:39:17 -04:00
Stefan Monnier
25523847e7 (editorconfig--should-set): Eliminate lisp-indent-offset special case
Instead of treating `lisp-indent-offset` specially in
`editorconfig--should-set` (to obey `editorconfig-lisp-use-default-indent`),
use a new function `editorconfig-set-indentation-lisp-mode`
for Lisp modes.

* lisp/editorconfig.el (editorconfig--should-set): Remove `size` argument.
(editorconfig-set-indentation): Adjust calls accordingly.
(editorconfig-set-indentation-lisp-mode): New function.
(editorconfig-indentation-alist): Use it.
2024-06-19 14:39:17 -04:00
Stefan Monnier
3da6765c99 * lisp/editorconfig.el (editorconfig-mode): Remove :lighter
We generally don't want to eat up modeline space with lighters
for global and permanent major modes.
2024-06-19 14:39:17 -04:00
Stefan Monnier
812831ee2f * lisp/editorconfing.el: Cosmetic ELisp style changes
Prefer #' to quote function names.
Remove redundant :groups.
Silence compiler warnings.

* lisp/editorconfig.el: Remove post-trailer.
The var is already set via `.dir-locals.el` anyway.
(editorconfig-call-get-properties-function): Use condition-case-unless-debug.
2024-06-19 14:38:31 -04:00
Stefan Monnier
c5d86db811 Remove support for editorconfig-exclude-*
When using the new hook, we can't support `editorconfig-exclude-modes` for
the `charset` property.  Also there are already other ways to get
similar effects (e.g. setting `auto-coding-alist` or
`enable-dir-local-variables`), so it's not clear those configurations
will be needed in Emacs-30.

* lisp/editorconfig.el (editorconfig-exclude-modes)
(editorconfig-exclude-regexps): Remove custom vars.
(recentf): Remove workaround (presumably not needed thanks to the fix
to issue #246).
(editorconfig--disabled-for-filename)
(editorconfig--disabled-for-majormode): Delete functions.
(editorconfig--advice-find-file-noselect): Remove call to those functions.
(editorconfig-mode): Adjust docstring accordingly.

* lisp/editorconfig-tools.el (editorconfig-apply): Adjust accordingly.
2024-06-19 14:38:31 -04:00