This attribute keyword has been non-working in defface for 14 years,
thus warning about it is both safe and decent.
* lisp/emacs-lisp/bytecomp.el (bytecomp--check-cus-face-spec):
Warn and suggest :inverse-video to be used instead.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-defface-spec):
Add a test case.
* etc/NEWS: Notify the user.
Sean Allred [Sun, 29 Sep 2024 01:00:32 +0000 (04:00 +0300)]
project--vc-list-files: Use '--sparse' with 'git ls-files'
When dealing with exceptionally large Git repositories, the
performance of `project-find-file` can suffer dramatically as
the list of files is collected for completion. This adds insult
to injury when you consider cases where the developer has
configured the repository to use a sparse checkout where the
vast majority of these files are not even present on disk and
are not valid candidates for completion.
* lisp/progmodes/project.el (project--vc-list-files):
Pass 'sparse' to 'git ls-files' when Git is recent enough.
Filter out file names that end with '/' (bug#73320).
Morgan Willcock [Tue, 24 Sep 2024 19:19:08 +0000 (20:19 +0100)]
Require ert-x for use by 'ert-font-lock-deftest-file'
This fixes a void-function error when 'ert-font-lock-deftest-file'
is called when ert-x has not already been loaded.
* lisp/emacs-lisp/ert-font-lock.el (ert): Require ert-x so that
'ert-resource-file' is available for use within
'ert-font-lock-deftest-file'. (Bug#73254)
Fix php-ts-mode font-lock for latest PHP grammar (bug#73516)
Version 0.23 of the PHP grammar introduced some changes that
affect the font lock.
* lisp/progmodes/php-ts-mode.el
(php-ts-mode--language-source-alist): Update php, html, js and css
grammars version.
(php-ts-mode--parent-html-heuristic): Fix docstring
(php-ts-mode--test-namespace-name-as-prefix-p): New function.
(php-ts-mode--test-namespace-aliasing-clause-p): New function.
(php-ts-mode--test-namespace-use-group-clause-p): New function.
(php-ts-mode--font-lock-settings): Use the new functions.
Stefan Monnier [Fri, 27 Sep 2024 14:35:18 +0000 (10:35 -0400)]
eieio.texi: Fix bug#73505
* doc/misc/eieio.texi (Introduction): Remove "missing features" which
aren't missing any more.
(Generics, Methods): Delete sections.
(Inheritance): Adjust reference accordingly.
(Static Methods): Merge into the parent node.
(Writing Methods): Refer to the ELisp manual for `cl-defmethod/defgeneric`.
Thomas Voss [Wed, 25 Sep 2024 00:17:49 +0000 (02:17 +0200)]
Align columns in which-key with wide characters properly
In the case that a character takes up multple columns (such as
`…' when used as a truncation character), make sure that the
columns are still aligned properly.
* lisp/which-key.el (which-key--pad-column): Use `string-width'
instead of `length'. (Bug#73463)
Use black-on-white by default for doc-view-svg-face.
* lisp/doc-view.el (doc-view-svg-face): Define black on white as
default value instead of using the current theme's values.
* etc/NEWS: Adjust entry for doc-view-svg-face.
etags-regen-file-extensions: Enable for more extensions
* lisp/progmodes/etags-regen.el (etags-regen-file-extensions):
Add more extensions, but remove "a". From the ones recognized by
etags, also omit "t", "ml", "l", "def" and "inc", see
https://lists.gnu.org/archive/html/emacs-devel/2024-09/msg00735.html.
(etags-regen--all-files): Use 'string-match-p' for performance.
Bind 'case-fold-search' to t to match extensions in any case.
Insert correct commit data into VC package descriptions
* lisp/emacs-lisp/package-vc.el (package-vc-commit): Rename
argument from PKG to PKG-DESC.
(package-vc--generate-description-file): Update the "extras"
section of the package description with the revision string at
generation time.
Warn about bad face specs in `defface` at compile time
* lisp/emacs-lisp/bytecomp.el (byte-compile--custom-declare-face):
Byte-compile `defface` forms, or the byte-compile handler won't
be called.
(bytecomp--check-cus-face-spec): New.
(bytecomp--custom-declare): Call it.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-defface-spec):
New tests.
Alan Mackenzie [Fri, 27 Sep 2024 13:42:40 +0000 (13:42 +0000)]
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.
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.
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.
Sean Whitton [Tue, 24 Sep 2024 08:38:43 +0000 (09:38 +0100)]
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.
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).
Alan Mackenzie [Tue, 24 Sep 2024 20:45:29 +0000 (20:45 +0000)]
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.
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'/
Alan Mackenzie [Sat, 21 Sep 2024 16:46:32 +0000 (16:46 +0000)]
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.
Manuel Giraud [Sat, 21 Sep 2024 12:51:21 +0000 (14:51 +0200)]
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.
Stefan Kangas [Sat, 21 Sep 2024 12:13:47 +0000 (14:13 +0200)]
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".
Stefan Monnier [Thu, 19 Sep 2024 15:50:26 +0000 (11:50 -0400)]
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)
Eli Zaretskii [Sat, 21 Sep 2024 10:41:21 +0000 (13:41 +0300)]
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)
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.
Eli Zaretskii [Sat, 21 Sep 2024 09:30:49 +0000 (12:30 +0300)]
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)