1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00
Commit Graph

174923 Commits

Author SHA1 Message Date
Andrea Corallo
4b76af4928 ; * Clean-up compilation warning in cc-vars.el
* lisp/progmodes/cc-vars.el (c-offsets-alist): Move definition to
clean-up byte-compiler warning.
2024-09-25 10:23:03 +02:00
Juri Linkov
0f424b16c3 * lisp/hi-lock.el (hi-lock-revert-buffer-rehighlight): Fix lighter.
Add '(car pattern)' as the LIGHTER argument of 'highlight-regexp'.
This fixes the case when in a file buffer with fundamental-mode:
`C-s M-s ' the M-s h r RET`, revert the buffer with 'C-x x g',
get the prompt for unhighlight with 'M-s h u'.  This showed
a raw regexp instead of the human-readable lighter (bug#57534).
2024-09-25 09:57:16 +03:00
Alan Mackenzie
c2d6f191d4 CC Mode: Separate indentation of enums from that of brace lists
This will allow enums to be indented as in the GNU coding
standards without affecting brace lists.

* lisp/progmodes/cc-align.el
(c-lineup-arglist-intro-after-paren)
(c-lineup-arglist-close-under-paren)
(c-lineup-whitesmith-in-block)
(c-lineup-after-whitesmith-blocks): Amend doc strings to
indicate they can be used for enum-* syntactic symbols too.

* lisp/progmodes/cc-engine.el (c-looking-at-decl-block)
(c-backward-typed-enum-colon, c-backward-over-enum-header):
Rename c-after-brace-list-key to c-after-enum-list-key and
c-brace-list-key to c-enum-list-key.
(c-at-enum-brace): New function.
(c-inside-bracelist-p): Don't check for enums any more.
(c-add-stmt-syntax): New cond arm for enums.
(c-guess-continued-construct CASE B.6) New code for enum-open.
(c-guess-basic-syntax CASE 5A.3, CASE 7B, CASE 9, CASE 9B)
(CASE 9C, CASE 9D): Use the new function c-at-enum-brace, and
use enum-* syntactic symbols rather than brace-list-* ones
where appropriate.
(c-used-syntactic-symbols): New dynamic variable.
(c-evaluate-offset): Add handling for a different syntactic
symbol as the cdr of a c-offsets-alist element.

* lisp/progmodes/cc-fonts.el (c-get-fontification-context):
Add a call to c-at-enum-brace since c-inside-bracelist-p no
longer handles enums.
(c-font-lock-enum-body, c-font-lock-enum-tail): Condense calls
to c-backward-over-enum-header to c-at-enum-brace.
(c-basic-matchers-after): Replace a c-brace-list-decl-kwds with
c-enum-list-kwds.

* lisp/progmodes/cc-langs.el (c-enum-list-kwds)
(c-enum-list-key): New names for c-brace-list-decl-kwds and
c-brace-list-key.
(c-after-enum-list-kwds, c-after-enum-list-key): New names for
c-after-brace-list-decl-kwds and c-after-brace-list-key.
(c-enum-list-key, c-after-enum-list-key): Add code to
use a value of an old name, should a derived mode still use
that.
(c-defun-type-name-decl-kwds, c-typedef-decl-kwds)
(c-typeless-decl-kwds, c-prefix-spec-kwds)
(c-brace-id-list-kwds, c-enum-clause-introduction-re): Use
c-enum-list-kwds rather than c-brace-list-decl-kwds.

* lisp/progmodes/cc-styles.el (c-read-offset): Add "a
syntactic symbol" into an error message text.

* lisp/progmodes/cc-vars.el (c-valid-offset): Allow for a
syntactic symbol as the parameter.
(c-offsets-alist): Add new syntactic symbols enum-open,
enum-close, enum-intro, and enum-entry.

* doc/misc/cc-mode.texi (Syntactic Symbols): Add a note that
anchor points are briefly documented in cc-vars.el.  Correct
the suffix "-block-intro" to "-intro".  Remove "an enum or"
from the descriptions of the brace-list-* syntactic symbols.
Add in new descriptions for the enum-* syntactic symbols.
(Brace List Symbols): Remove references to enums.  Add a note
that enums are no longer brace-lists.
(Enum Symbols): A new subsection documenting the new enum-*
syntactic symbols.
(c-offsets-alist): Document the new possibility, syntactic
symbol, for the cdr of an alist entry.
(Brace/Paren Line-Up, List Line-Up): Note that the new enum
syntactic symbols can be handled by these lineup functions.
2024-09-24 20:45:29 +00:00
Stefan Monnier
e8f5df5175 Declare nested backquotes unsupported in Pcase patterns (bug#72328)
The current behavior is inconsistent with that of the normal backquote
macro, so to avoid surprises, warn about the use of nested backquotes.

* lisp/emacs-lisp/pcase.el (pcase--expand-\`): Warn about nested backquotes.

* lisp/emacs-lisp/testcover.el (testcover-analyze-coverage)
(testcover-analyze-coverage-wrapped-form): Avoid nested backquotes
2024-09-24 14:01:26 -04:00
Sean Whitton
ce601de1ca diff-apply-buffer: Improve failure message
* lisp/vc/diff-mode.el (diff-apply-buffer): Say "hunk", not
"hunks", when there was only one failed hunk.
2024-09-24 16:17:17 +01:00
Eli Zaretskii
e7260d4eb3 ; Fix shr-tests when Emacs was built without libxml2
* test/lisp/net/shr-tests.el (shr-test/zoom-image): Skip if
libxml2 is not available.  (Bug#73440)
2024-09-23 18:30:00 +03:00
Michael Albinus
40e0257b10 Extend tramp-otp-password-prompt-regexp
* lisp/net/tramp.el (tramp-otp-password-prompt-regexp): Add TACC
HPC prompt.
2024-09-23 16:52:01 +02:00
Michael Albinus
dda7abb177 * doc/misc/tramp.texi (Frequently Asked Questions): Improve indices. 2024-09-23 09:53:17 +02:00
Eli Zaretskii
3fb966dc63 ; Fix dnd-tests on MS-Windows
* test/lisp/dnd-tests.el (dnd-tests-get-local-file-uri): Fix test
on MS-Windows.
2024-09-22 12:57:08 +03:00
Cecilio Pardo
e8f0baf354 Fix multi-file drag-and-drop on MS-Windows
Pass all dropped files to 'dnd-handle-multiple-urls' in
one call instead on doing multiple calls (Bug#73258).
* lisp/term/w32-win.el (w32-dropped-file-to-url): New function to
convert file name to a url for dnd.
(w32-handle-dropped-file): Changed to use 'w32-dropped-file-to-url'.
(w32-drag-n-drop): Changed to pass all files to
'dnd-handle-multiple-urls'/
2024-09-22 12:45:42 +03:00
Joseph Turner
0f4c09d267
; Add test for deleting multiple pairs at once
* test/lisp/electric-tests.el (electric-pair-backspace-2):
New test.  (Bug#72437)
2024-09-22 10:10:35 +02:00
Eshel Yaron
a7192fd7b7
Teach Electric Pair mode about prefix arguments
* lisp/elec-pair.el (electric-pair--insert): New arg TIMES.
(electric-pair-inhibit-if-helps-balance)
(electric-pair-post-self-insert-function)
(electric-pair-open-newline-between-pairs-psif)
(electric-pair-skip-if-helps-balance): Respect prefix arg.
(electric-pair-delete-pair): Delete ARG chars, not just 1.
* test/lisp/electric-tests.el (autowrapping-multi-1)
(autowrapping-multi-2): New tests.
* doc/emacs/programs.texi (Matching): Mention prefix arg
support in Electric Pair mode documentation.
* etc/NEWS: Announce it.  (Bug#72437)
2024-09-22 10:10:35 +02:00
Mattias Engdegård
f5bf007df1 ; * lisp/midnight.el (midnight-mode): forward-declare midnight-delay 2024-09-21 19:34:16 +02:00
Alan Mackenzie
086cb1b590 CC Mode: fix minor errors in the fontification of enums.
1: Fix the typing of a space on the { line in an enum
specification which is the first item in a buffer.  This
defontified the enum's identifiers.
2: Fix the typing of a space on the line of the enum's last
identifier.  This defontified that identifier for
jit-lock-context-time.

* lisp/progmodes/cc-engine.el (c-forward-declarator): Cease
rejecting the identifier if there are no further tokens before
LIMIT.

* lisp/progmodes/cc-mode.el (c-fl-decl-start): Accept a
backward search as succeeding if it hits point-min.
2024-09-21 16:46:32 +00:00
Manuel Giraud
4745bafa6a Don't activate midnight-mode when loading 'midnight'
* lisp/midnight.el (midnight-mode): Call 'midnight-delay-set' again
when the mode is activated.
(midnight-delay-set): Only start the timer if the mode is turned
on.  (Bug#73291)
* etc/NEWS: Document the change in behaviour.
2024-09-21 15:01:44 +02:00
Stefan Kangas
dac1a48240 Delete redundant declarations of 'electric' variables
* lisp/progmodes/js.el (electric-layout-rules):
* lisp/progmodes/octave.el (electric-layout-rules):
* lisp/progmodes/python.el (electric-indent-inhibit):
* lisp/textmodes/rst.el (electric-indent-inhibit): Delete redundant
declarations; 'electric' is preloaded since Emacs 24.4.
2024-09-21 14:48:02 +02:00
Stefan Kangas
3cad879c9d Add Python keywords "aiter" and "anext"
* lisp/progmodes/python.el (python-font-lock-keywords-level-2)
(python--treesit-builtins): Add "aiter" and "anext" keywords,
introduced in Python 3.10.
2024-09-21 14:29:40 +02:00
Stefan Kangas
7aa5876cdf Add all exceptions up to Python 3.13 as keywords
* lisp/progmodes/python.el
(python-font-lock-keywords-maximum-decoration)
(python--treesit-exceptions): Add all built-in exceptions in Python 3.13
as keywords.  Missing from the list was "BaseExceptionGroup",
"EncodingWarning", "ModuleNotFoundError", and "PythonFinalizationError".
2024-09-21 14:20:29 +02:00
Stefan Kangas
29a7607117 Add subword-mode toggle to python-mode menu
* lisp/progmodes/python.el (python-mode-map): Add subword-mode
toggle to menu.
2024-09-21 14:08:09 +02:00
Stefan Kangas
dfecd6037d Support electric-layout-mode in python-base-mode
* lisp/progmodes/python.el (python-base-mode): Add support for
'electric-layout-mode'.
2024-09-21 14:08:09 +02:00
Eli Zaretskii
7a404e6d51 Fix merging of NEWS from emacs-30. 2024-09-21 07:44:32 -04:00
Eli Zaretskii
ff2cc0fc23 Merge from origin/emacs-30
ecfebb5abb ; Always set 'emoji--insert-buffer'
35e356f958 Fix font-lock of last character before EOB under 'whitesp...
01ebe6de89 Fix 'whitespace-mode' with 'missing-newline-at-eof'
2024-09-21 07:32:38 -04:00
Eli Zaretskii
abc051c431 ; Merge from origin/emacs-30
The following commit was skipped:

eced135120 Fix 'replace-regexp' in WDired
2024-09-21 07:32:38 -04:00
Eli Zaretskii
7a8f2a0bec Merge from origin/emacs-30
b7f6cde419 Disable xwidgets with recent webkitgtk versions (Bug#66068)
a6dafbc2bc ; * lisp/editorconfig.el (editorconfig-indentation-alist)...
0834106a62 Fix treesit--merge-ranges (bug#73324)
76c6b4d279 Fix midnight-mode documentation
f778252220 ; Fix my email address
db22efca8d editorconfig.el: Fix too naive sync from upstream
0f12d6dd23 ; * etc/NEWS: Announce 'doc-view-mpdf--use-svg'.
29d50e245f * lisp/progmodes/eglot.el (eglot--signal-textDocument/did...

# Conflicts:
#	etc/NEWS
#	lisp/treesit.el
2024-09-21 07:32:31 -04:00
Eli Zaretskii
1cf6ff4362 ; Merge from origin/emacs-30
The following commit was skipped:

7ef805d6a4 Disable fontset-related workaround on non-Android systems
2024-09-21 07:30:19 -04:00
Eli Zaretskii
83b0e604ce Merge from origin/emacs-30
4b9a8fd607 etags-regen-file-extensions: Add .pm
956f14ae5e * src/treesit.c (treesit_debug_print_parser_list): Fix co...
300d05ecb4 Type-check argument to network-lookup-address-info
0f0f21b7f2 ; Improve doc strings of options related to numbered backups
f0daa2f215 Conservative heuristic for tree-sitter parser ranges (bug...
035024b4e5 ; Fix treesit.c printing
8771310a10 ; * admin/notes/unicode: Need to run textsec-tests (bug#7...
4c6f45fa8e Re-enable GC mark trace buffer by default
c607701589 ; * src/haiku_support.cc: Correct last change.
ae22ad7f62 ; Add even more tests for previous commit
460b9d705a Fix treesit_sync_visible_region's range fixup code (bug#7...
81347c1aaf ; * etc/PROBLEMS: Fix last change (bug#73207).
a82b7f3e82 Document unavailability of frame geometry on Wayland
2024-09-21 07:30:19 -04:00
Scott Bell
ecfebb5abb ; Always set 'emoji--insert-buffer'
* lisp/international/emoji.el (emoji-list): Always set insert buffer.
(Bug#73390)

Copyright-paperwork-exempt: yes
2024-09-21 14:01:41 +03:00
Stefan Monnier
35e356f958 Fix font-lock of last character before EOB under 'whitespace-mode'
* lisp/whitespace.el (whitespace-color-on): Don't use OVERRIDE in
font-lock-keywords; instead, use 'prepend' in the call to
'font-lock-add-keywords'.  (Bug#73332)
2024-09-21 13:46:54 +03:00
Eli Zaretskii
01ebe6de89 Fix 'whitespace-mode' with 'missing-newline-at-eof'
* lisp/whitespace.el (whitespace-post-command-hook): Refontify
when point moves if 'missing-newline-at-eof' is in
'whitespace-active-style'.  (Bug#73332)
2024-09-21 13:41:21 +03:00
Eli Zaretskii
4c5ab949fb ; * lisp/emacs-lisp/lisp.el (delete-pair-push-mark): Add :version. 2024-09-21 13:23:50 +03:00
Paul Nelson
a48672c6bb Add option for delete-pair to mark end of region
* lisp/emacs-lisp/lisp.el (delete-pair-push-mark): New user option.
(delete-pair): Use it.  (Bug#73284)

* etc/NEWS: Announce the new user option.
2024-09-21 13:20:59 +03:00
Eli Zaretskii
39d2cc36b2 ; * etc/NEWS: Fix last change. 2024-09-21 12:42:43 +03:00
Vincenzo Pupillo
b0523dffab Add user option to enable Doxygen syntax highlighting (bug#72814)
Both 'c-ts-mode' and 'java-ts-mode' have a new user option,
'c-ts-mode-enable-doxygen' and 'java-ts-mode-enable-doxygen'
(defaults to nil) which allow to enable syntax highlighting
of comment blocks based on the Doxygen grammar.

* lisp/progmodes/c-ts-mode.el: Add the 'c-ts-mode-enable-doxygen'
user option variable to disable doxygen grammar.
Notifies the user if doxygen grammar is not available.
* lisp/progmodes/c-ts-mode.el (c-ts-mode, c++-ts-mode): Use the
new 'c-ts-mode-enable-doxygen' option.
* lisp/progmodes/java-ts-mode.el: Add the
'java-ts-mode-enable-doxygen' user option variable to disable
doxygen grammar.  Notifies the user if doxygen grammar is not
available.
* lisp/progmodes/java-ts-mode.el (java-ts-mode): Use the new
'java-ts-mode-enable-doxygen' option.

* etc/NEWS: Document the change.
2024-09-21 12:39:34 +03:00
Eli Zaretskii
a513f2a4dd Fix 'regexp-replace' in WDired
* src/search.c (Freplace_match): Remove the test that
search_regs.num_regs != num_regs.  It is deemed unnecessary now,
and could produce false positives.  (Bug#73018)
2024-09-21 12:30:49 +03:00
Eli Zaretskii
eced135120 Fix 'replace-regexp' in WDired
* src/search.c (Freplace_match): Revert the search.c part of the
change from Apr 7, 2024, which aims to fix bug#65451, but causes
bug#73018.  Do not merge to master.

* test/src/editfns-tests.el
(editfns-tests--before/after-change-functions): Expect this test
to fail.
2024-09-21 12:26:24 +03:00
Peter Oliver
b7f6cde419 Disable xwidgets with recent webkitgtk versions (Bug#66068)
* configure.ac: Accept only webkit2gtk-4.* versions less than 2.41.92.
2024-09-21 11:58:42 +03:00
Michael Albinus
39ac8ddafd * test/infra/gitlab-ci.yml (.tree-sitter-template): Add treesit.el. 2024-09-21 10:22:41 +02:00
Michael Albinus
2f80e62e6e Use (sit-for 0) in Tramp
* lisp/net/tramp.el (tramp-wait-for-regexp): Use (sit-for 0) in
order to avoid performace regression.
2024-09-21 10:22:13 +02:00
Eli Zaretskii
a6dafbc2bc ; * lisp/editorconfig.el (editorconfig-indentation-alist): Doc fix. 2024-09-21 10:21:21 +03:00
Yuan Fu
f9fa75c1ef
Add accessors for treesit-font-lock-settings
Since each SETTING in treesit-font-lock-settings is considered an opaque
object, provide accessor functions for each field.

* lisp/treesit.el:
(treesit-font-lock-settings): Update docstring.
(treesit-font-lock-setting-query):
(treesit-font-lock-setting-enable):
(treesit-font-lock-setting-feature):
(treesit-font-lock-setting-override): New functions.
(treesit--font-lock-setting-feature): Remove function.
(treesit--font-lock-setting-enable): Rename to
treesit--font-lock-setting-clone-enable to avoid confusion with
treesit-font-lock-setting-enable.
(treesit-add-font-lock-rules): Use renamed function.
(treesit-font-lock-fontify-region): Add a comment.
* doc/lispref/modes.texi (Parser-based Font Lock): Update manual.
2024-09-20 21:08:18 -07:00
Yuan Fu
4c4e26be7c
; * admin/MAINTAINERS: Add yuan to maintainer file. 2024-09-20 21:06:36 -07:00
Yuan Fu
0834106a62
Fix treesit--merge-ranges (bug#73324)
* lisp/treesit.el (treesit--merge-ranges): Make sure that old
ranges that intersects with START-END are actually discarded.
* test/src/treesit-tests.el (treesit-range-merge): New test.
2024-09-20 20:54:23 -07:00
Stefan Kangas
1103134a0e ; Delete bug fix from etc/NEWS
* etc/NEWS: Delete bug fix item.  No correct program will see a
difference in behavior; at worst, the error message when calling
`(error)` is now better.
Reported by Mattias Engdegård <mattias.engdegard@gmail.com>.
2024-09-21 03:43:38 +02:00
David Fussner
117d93a477 Fix regexps for TeX xref backend
* lisp/textmodes/tex-mode.el (tex-thingatpt-exclude-chars): Remove
variable.
(tex-thingatpt--beginning-of-symbol, tex-thingatpt--end-of-symbol):
Use hard-coded characters instead of variable.  (Bug#53749)
2024-09-21 03:35:27 +02:00
Stefan Kangas
76c6b4d279 Fix midnight-mode documentation
* lisp/midnight.el (Commentary): Document that 'midnight-mode' should be
enabled using the function, instead of by merely loading the library.
In Emacs 31, doing the latter will no longer work.  (Bug#73291)
2024-09-21 02:22:43 +02:00
Stefan Kangas
f778252220 ; Fix my email address 2024-09-21 02:17:27 +02:00
Stefan Monnier
db22efca8d editorconfig.el: Fix too naive sync from upstream
* lisp/editorconfig.el (editorconfig--get-indentation-nxml-mode):
New function.
(editorconfig-indentation-alist): Use it to fix bug#73359.
2024-09-20 14:58:45 -04:00
Eli Zaretskii
0f12d6dd23 ; * etc/NEWS: Announce 'doc-view-mpdf--use-svg'. 2024-09-20 21:50:12 +03:00
Stefan Monnier
29d50e245f * lisp/progmodes/eglot.el (eglot--signal-textDocument/didOpen): Fix bug#72696 2024-09-20 14:42:22 -04:00
Po Lu
7ef805d6a4 Disable fontset-related workaround on non-Android systems
* src/fontset.c (fontset_find_font) [!HAVE_ANDROID]: Don't
refuse to cache font objects whose registries do not agree with
the font specs.  (bug#73363)

Do not merge to master.
2024-09-20 22:30:07 +08:00