Commit graph

173691 commits

Author SHA1 Message Date
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
Stefan Kangas
3f3c08bcc7 Add before-save-hook to man page files
* doc/man/ebrowse.1:
* doc/man/emacs.1.in:
* doc/man/emacsclient.1:
* doc/man/etags.1: Add 'before-save-hook' that runs 'time-stamp' to
local variables.
2024-06-22 16:56:12 +02:00
Stefan Kangas
7b0e6cb3ff 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.
2024-06-22 16:56:12 +02:00
Eli Zaretskii
a7cb642a9f Merge from origin/emacs-29
7f7b28a250 ; Wayland SECONDARY selection problem
2024-06-22 08:23:18 -04:00
Eli Zaretskii
6491d11b53 ; Merge from origin/emacs-29
The following commit was skipped:

f3e80dd0f7 * admin/emacs-shell-lib: Backport to Bash 4.4 or older.
2024-06-22 08:23:18 -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
150e2b979c ; * src/xfns.c (unwind_create_frame): Add missing definition. 2024-06-22 15:14:19 +03: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
Eli Zaretskii
7f7b28a250 ; Wayland SECONDARY selection problem
* etc/PROBLEMS: Document problems with SECONDARY selection on
Wayland.  (Bug#71656)
2024-06-22 12:21:31 +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
Eli Zaretskii
4f03083499 ; Improve documentation of EditorConfig support
* doc/emacs/custom.texi (EditorConfig support): Improve wording
and indexing.
* doc/emacs/emacs.texi (Top): Update @detailmenu.
2024-06-22 09:01:12 +03:00
Stefan Monnier
60070d0d74 * doc/emacs/custom.texi (Directory Variables): Add menu 2024-06-21 15:54:28 -04: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
5bc76dbc9d * doc/emacs/custom.texi (EditorConfig support): Add URL 2024-06-21 10:37:55 -04: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
Po Lu
e7123edfe7 ; * src/keyboard.c (read_char): Typo in comment. 2024-06-21 15:13:03 +08:00
Po Lu
0ade6348f9 Fix execution of tool-bar commands read within minibuffer-error-handler
* src/keyboard.c (read_char): Arrange that the original event be
recorded when a posn is promoted to a prefix key and an END_TIME
is suppressing additions to this_command_keys.
2024-06-21 15:12:28 +08: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
Stefan Kangas
f3e80dd0f7 * admin/emacs-shell-lib: Backport to Bash 4.4 or older. 2024-06-20 23:12:31 +02: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
6c85b03111 Fix misspelled function name in comp.c
* src/comp.c (retrieve_block): Rename from 'retrive_block'.
Update all callers.
2024-06-20 16:01:33 +02:00
Po Lu
199fcbe2d3 Fix NS build
* src/nsfns.m (Fx_create_frame, ns_create_tip_frame): Remove
references to deleted variable.  (bug#71638)
2024-06-20 21:31:25 +08: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
Eli Zaretskii
74af691b90 Fix last change
* src/xdisp.c (handle_line_prefix): Set the 'align_visually_p'
only after pushing the iterator.
(pop_it): Reset the 'align_visually_p' flag.  (Bug#71605)
2024-06-20 13:42:04 +03:00
Eli Zaretskii
775aeabcfb Fix use of ':align-to' in 'wrap-prefix'
* src/dispextern.h (struct it): New flag 'align_visually_p'.
* src/xdisp.c (handle_line_prefix): Set the 'align_visually_p'
flag for 'wrap-prefix'.
(produce_stretch_glyph): If 'align_visually_p' flag is set, count
the :align-to offset from the beginning of the screen line, not
from BOL.  (Bug#71605)

* doc/lispref/display.texi (Truncation, Specified Space): Document
the special handling of ':align-to' in 'wrap-prefix'.
2024-06-20 12:52:06 +03:00
Po Lu
b8affdb7b5 * src/frame.c (gui_set_font): Reference image cache after reassignment. 2024-06-20 17:20:23 +08:00
Po Lu
e6169e9de1 ; * src/frame.c (make_frame): Typo. 2024-06-20 17:03:54 +08:00
Po Lu
cebca072c3 Correctly cache images when frames vary in their font metrics
* src/alloc.c (mark_frame): Mark this frame's image cache, if it
exist.
(mark_terminals): Cease marking T->image_cache.

* src/androidfns.c (unwind_create_frame, Fx_create_frame)
(android_create_tip_frame):

* src/haikufns.c (unwind_create_frame, haiku_create_frame)
(haiku_create_tip_frame):

* src/nsfns.m (unwind_create_frame):

* src/pgtkfns.c (unwind_create_frame, Fx_create_frame)
(x_create_tip_frame):

* src/xfns.c (unwind_create_frame, Fx_create_frame)
(x_create_tip_frame):

* src/w32fns.c (unwind_create_frame, Fx_create_frame)
(w32_create_tip_frame): Remove adjustments of the frame image
cache's reference count rendered redundant by the assignment of
image caches to individual frames rather than terminals.

* src/dispextern.h (struct image_cache) <scaling_col_width>: New
field.

* src/frame.c (gui_set_font): In lieu of clearing F's image
cache unconditionally, establish whether the column width as
considered by compute_image_size has changed, and if so, adjust
or reassign the frame's image cache.
(make_frame): Clear F->image_cache.

* src/frame.h (struct frame) <image_cache>: New field.
(FRAME_IMAGE_CACHE): Return F->image_cache.

* src/image.c (make_image_cache): Clear C->scaling_col_width.
(cache_image): Adjust to new means of assigning image caches to
frames.

* src/termhooks.h (struct terminal) <image_cache>: Delete field.

* src/xfaces.c (init_frame_faces): Do image cache assignment
with all new frames.
2024-06-20 17:03:36 +08: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
Stefan Kangas
499d5dd958 Update leuven-theme to latest upstream version
* etc/themes/leuven-dark-theme.el:
* etc/themes/leuven-theme.el: Update to latest upstream version
https://github.com/fniessen/emacs-leuven-theme/ commit
a504c1d20625fe373ad5ea4ff3d94ea3706cbb87 (2024-03-30).
2024-06-19 23:24:51 +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
d236b67622 Add doc for EditorConfig support
Also, remove the old `editorconfig.texi` since most of it is not
applicable to the (current) bundled version of the code anyway.

* etc/NEWS: Add entry for EditorConfig.
* doc/emacs/custom.texi (EditorConfig support): New node.
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