1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-05 11:21:04 -08:00
Commit graph

174952 commits

Author SHA1 Message Date
Mattias Engdegård
09d63ba32b * lisp/custom.el (defface): Add missing attributes to doc string. 2024-09-27 19:26:52 +02:00
Alan Mackenzie
0a1628bf69 CC Mode: Parse C++ lambda functions more correctly
This fixes bug#72695.

* lisp/progmodes/cc-align.el (c-lineup-topmost-intro-cont): Do
not indent further a line following a closing brace of a
requires clause.

* lisp/progmodes/cc-engine.el (c-forward-keyword-clause):
Separate the handling of "any-paren-kwds" into
"type-paren-kwds" and "nontype-paren-kwds", simplifying the
handling of the latter.
(c-forward-primary-expression): Recognize (...) followed by {
as a primary expression.
(c-looking-at-or-maybe-in-bracelist): No longer recognize an
enum list as a brace list.  Remove the handling of enum lists.
(c-looking-at-c++-lambda-expression)
(c-backward-over-lambda-expression): New functions.
(c-c++-vsemi-p): Don't recognize the end of requires clauses as
virtual semicolons.
(c-guess-basic-syntax): CASE 5U - new cond arm to recognize
being after a requires clause.  These lines now get syntax
topmost-intro-cont rather than topmost-intro, and their anchor
positions are now on the topmost-intro line rather than the
previous topmost-intro-cont.
Throughout the file: simplify handling of
c-fun-name-substitute-key, where there is no need to check for
a following _ character, and introduce c-requires-clause-key
for greater accuracy in parsing, even though both of these are
just "requires".

* lisp/progmodes/cc-fonts.el (c-get-fontification-context):
Tidy up the handling of c-fun-name-substitue-key, as in
cc-engine.el.

* lisp/progmodes/cc-langs.el (c-lambda-spec-kwds)
(c-lambda-spec-key): New lang vars.
(c-fun-name-substitute-key): Now an adorned expression.
(c-requires-clause-kwds, c-requires-clause-key): New lang vars.
2024-09-27 13:42:40 +00:00
Michael Albinus
d98a2b70d7 * lisp/mail/emacsbug.el (submit-emacs-patch): Insert empty X-Debbugs-Cc
(Bug##57877)
2024-09-27 09:33:51 +02:00
Eli Zaretskii
57c552b8b9 ; * src/cm.c (cmgoto): Fix last change. 2024-09-27 09:19:19 +03:00
Jeremy Bryant
bfbed2f3ee ; * src/cm.c (cmgoto): Add function documentation (bug#73487). 2024-09-27 09:17:29 +03:00
Eli Zaretskii
ff4082284a ; * lisp/emacs-lisp/easy-mmode.el (easy-mmode--prev): Doc fix. 2024-09-27 08:49:46 +03:00
Eli Zaretskii
8e08e37166 ; * etc/NEWS: Fix recently added entry. 2024-09-27 08:47:13 +03:00
Eli Zaretskii
42eb2265e6 ; * lisp/progmodes/python.el (python-interpreter): Fix :version. 2024-09-27 08:44:35 +03:00
Stefan Kangas
bdfeb45bfc Bind "J" to bookmark-jump in bookmark-bmenu-mode
* lisp/bookmark.el (bookmark-bmenu-mode-map): Bind "J" to bookmark-jump.
2024-09-27 07:12:05 +02:00
Stefan Kangas
7f0a252f21 Prefer python3 for python-interpreter
* lisp/progmodes/python.el (python-interpreter): Prefer "python3" when
it exists, to be consistent with python-shell-interpreter.
2024-09-27 07:01:23 +02:00
Spencer Baugh
e776903b31 Move to start of current header in diff-{file,hunk}-prev
If point was after a file or hunk header, the diff-file-prev and
diff-hunk-prev commands would move to the start of that header.
But if point was *within* the header, they would not move, and
would report "No previous file" or "No previous hunk".  This
differs from the behavior of most other movement commands,
e.g. backward-sexp or backward-sentence.

This commit fixes diff-file-prev and diff-hunk-prev, as well as
other easy-mmode-define-navigation BASE-prev commands.  Now
these commands move to the start of the containing "thing" just
like other movement commands.

* lisp/emacs-lisp/easy-mmode.el (easy-mmode--prev):
Move to start of current match first. (bug#73172)
* etc/NEWS: Document the behavior change.
2024-09-27 04:27:55 +03:00
Spencer Baugh
da1416fc69 Move easy-mmode-define-navigation logic to helper functions
The functions defined by easy-mmode-define-navigation are useful
even if the easy-mmode-define-navigation macro is not used.
Let's take a step towards exposing them by moving them out as
helpers.

This also makes the macro much easier to modify and work on.

* lisp/emacs-lisp/easy-mmode.el (easy-mmode--prev)
(easy-mmode--next): Add (bug#73172).
(easy-mmode-define-navigation): Use easy-mmode--prev and
easy-mmode--next.
2024-09-27 04:25:54 +03:00
Stefan Monnier
c95620ffbf (pcase-tests-quote-optimization): Fix warning
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-quote-optimization):
Fix confusing code.
2024-09-26 17:03:28 -04:00
Stefan Monnier
4591d93a8e * lisp/emacs-lisp/pcase.el (pcase--expand-\`): Improve warning message
And also move the warning "out of the way" so it doesn't
confuse optimizations.
2024-09-26 16:40:54 -04:00
Sean Whitton
37bed70f4c ; * etc/NEWS: Don't say that C-c M-r can undo whole commits. 2024-09-26 20:03:09 +01:00
Gerd Möllmann
b9d103c16e ; Fix build error with last change in python.el 2024-09-26 17:35:38 +02:00
Stefan Kangas
2f485e68ff Add Python "*.pth" files to auto-mode-alist
* lisp/progmodes/python.el (python--auto-mode-alist-regexp): New
variable.
(auto-mode-alist, python-ts-mode): Use above new variable.
2024-09-26 17:04:31 +02:00
Andrea Corallo
4c567892e0 * Clean-up unused condition-case
* lisp/emacs-lisp/comp.el (comp--native-compile): Remove unused
condition-case.
2024-09-26 16:32:27 +02:00
Eli Zaretskii
c86e7a29e7 ; Fix documentation of last change
* lisp/vc/diff-mode.el (diff-ask-before-revert-and-kill-hunk): Add
':version' tag.
(diff-revert-and-kill-hunk, diff-apply-buffer): Doc fixes.

* etc/NEWS:
* doc/emacs/files.texi (Diff Mode): Fix last change; add indexing.
2024-09-26 14:24:18 +03:00
Sean Whitton
f2e3e563d4 New command diff-revert-and-kill-hunk
* lisp/vc/diff-mode.el (diff-revert-and-kill-hunk): New
command (bug#73407).
(diff-ask-before-revert-and-kill-hunk): New user option.
(diff-apply-buffer): New optional BEG, END and REVERSE
arguments.  Return nil if buffers were saved, or the number of
failed applications.
(diff-mode-map): Bind the new command to C-c M-r.
(diff-mode-menu): New entry for the new command.
* doc/emacs/files.texi (Diff Mode):
* etc/NEWS: Document the change.
2024-09-26 11:51:21 +01:00
Eli Zaretskii
8ffb680d09 Revert "; Recommend GNU Find for 'find-dired'"
This reverts commit 5f8c2d5bf9.
It was committed by mistake on this branch.
2024-09-26 10:30:15 +03:00
Eli Zaretskii
5f8c2d5bf9 ; Recommend GNU Find for 'find-dired'
* lisp/find-dired.el (find-dired): Doc fix (bug#73455).
2024-09-26 10:28:20 +03:00
Stefan Kangas
89abbb843a Deprecate 'Homepage' header in favor of 'URL'
* doc/lispref/tips.texi (Library Headers): Document the 'Homepage'
header as deprecated in favor of 'URL'.
2024-09-26 02:04:03 +02:00
Jeremy Bryant
0c861b820b ; * src/cm.c (calccost): Fix typo. (Bug#73485) 2024-09-26 01:47:04 +02:00
Alan Mackenzie
3a0db55b50 * etc/NEWS: Describe the change to enum handling in CC Mode 2024-09-25 21:06:07 +00:00
Eli Zaretskii
f28793822d ; Improve use of ngettext 2024-09-25 20:33:30 +01:00
Robert Pluim
a06a720902 ; Really disable 'button-mode' in 'emacs-news-mode'
* lisp/textmodes/emacs-news-mode.el (emacs-news-mode): Call
'button-mode' with -1 arg.
2024-09-25 16:59:24 +02:00
Robert Pluim
1b1b922992 Test 'network-lookup-address-info' argument type checking
* test/src/process-tests.el (lookup-hints-values): Pass in
non-string values, which should result in type errors.
2024-09-25 16:59:23 +02:00
Michael Albinus
29c610a832 ; Tramp cosmetic change
* lisp/net/tramp.el (tramp-file-name-handler):
Adapt `tramp-verbose' when completing host names.
2024-09-25 11:36:28 +02:00
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