1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

11408 commits

Author SHA1 Message Date
Po Lu
0ff70f12a5 Merge remote-tracking branch 'origin/master' into feature/android 2023-07-21 07:58:30 +08:00
Alan Mackenzie
c601148ded CC Mode (some languages): handle string lines ending in \\
In C, C++, Objective C, and Pike modes, regard \\ in a string
at EOL as a backslash followed by an escaped newline.  In the
other languages, this remains regarded as an escaped backslash
followed by an invalid string terminator.

* lisp/progmodes/cc-defs.el (c-is-escaped, c-will-be-escaped):
Amend to observe the changed notion of escaped newlines.

* lisp/progmodes/cc-langs.el (c-string-escaped-newlines):
Unused, removed.
(c-escaped-newline-takes-precedence): New lang const and var.
(c-string-innards-re-alist): Amend, using the above new lang
var.
2023-07-20 19:33:42 +00:00
Eli Zaretskii
e72afa9dbf Fix defface's with no customization data
* lisp/net/shr.el (shr-h4, shr-h5, shr-h6):
* lisp/cedet/semantic/decorate/include.el
(semantic-decoration-on-includes):
* lisp/progmodes/make-mode.el (makefile-shell):
* lisp/time.el (display-time-date-and-time):
* lisp/nxml/nxml-mode.el (nxml-text, nxml-delimiter)
(nxml-element-colon): Add face definitions (bug#64655).
2023-07-20 19:25:43 +03:00
Matthias Meulien
3c041e3e96 Custom var python-interpreter-args (bug#64397)
* lisp/progmodes/python.el (python-interpreter): Mention
new variable in documentation.
(python-interpreter-args): New custom variable.
(python-shell-interpreter, python-shell-interpreter-args)
(python-shell-interpreter-interactive-arg): Improve
documentation.
(python--list-imports, python--do-isort)
(python-fix-imports): Make process use customisable
arguments.
2023-07-20 19:00:46 +03:00
Po Lu
7196d2d18e Merge remote-tracking branch 'origin/master' into feature/android 2023-07-20 19:52:01 +08:00
João Távora
7ff41bf8ed Eglot: fix textDocument/onTypeFormatting for 'newline' command
In the newline command, last-input-event is 13 (carriage return), but
most, if not all, language servers that support
documentOnTypeFormattingProvider expect 10 (linefeed) to be the
trigger, so convert 13 to 10 for the purposes of the
textDocument/onTypeFormatting request.

Also make this common edit silent in the mode-line/messages.

* lisp/progmodes/eglot.el (eglot--post-self-insert-hook): Convert
linefeed to carriage return.
(eglot-format): Pass SILENT to eglot--apply-text-edits.
(eglot--apply-text-edits): Take new optional SILENT arg.

* etc/EGLOT-NEWS: Mention change
2023-07-20 05:08:18 -05:00
Po Lu
324d66e390 Merge remote-tracking branch 'origin/master' into feature/android 2023-07-18 08:09:01 +08:00
Brian Leung
7446a8c34e Eglot: check correct capability name in eglot-imenu (bug#64682)
* lisp/progmodes/eglot.el (eglot-imenu): Declare the correct name of
the server capability providing textDocument/documentSymbol.

Without this change, eglot-imenu always aborts even when used with
servers supporting textDocument/documentSymbol.
2023-07-17 14:36:51 +01:00
Po Lu
d78d7aa783 Merge remote-tracking branch 'origin/master' into feature/android 2023-07-16 08:18:13 +08:00
Eli Zaretskii
77fa417d10 Merge from origin/emacs-29
d09de2f49d Ignore quit while getting interprogram paste in kill-new
afdf54a531 * lisp/progmodes/gdb-mi.el: Fix interactive invocation of...
b54febef5d Fix NetBSD build with and without ncurses
c5fb730159 ; * lisp/paren.el (show-paren-function): Fix last change ...
ea696ea4b9 ; Fix last change.
b0181dafb9 Improve documentation of 'enable-local-variables' in Emac...
eb7c45ca43 ; Fix copy-paste in Widget Manual (Bug#64610)
aedbc3006e ; * doc/misc/eshell.texi (Aliases): Remove stray "@end ta...
673992d28e ; * lisp/progmodes/sql.el (sql-interactive-mode): Remove ...
2023-07-15 05:30:28 -04:00
Wang Diancheng
afdf54a531 * lisp/progmodes/gdb-mi.el: Fix interactive invocation of 'gud-go'.
Bug#64590.

Copyright-paperwork-exempt: yes
2023-07-15 11:38:36 +03:00
Matthias Meulien
a047fb8494 Fix "Improve Python imports management commands"
* lisp/progmodes/python.el (python--list-imports): Prefer to
use an exit status >1.
(python--list-imports-check-status): New function to check
status of Python script.
(python--do-isort): Fix wrong status check introduced with
6295d7abdd.  (Bug#64406)
2023-07-15 11:24:34 +03:00
Spencer Baugh
300f9d23c1 ; Fix last change (bug#64533)
* lisp/progmodes/which-func.el (which-func-display): Fix quoting
in the doc string.

* etc/NEWS: Announce 'which-func-display'.
2023-07-15 11:00:54 +03:00
Spencer Baugh
dcad72a779 Support displaying function name in the header line
In some languages, the function name as displayed in the mode-line by
which-func-mode can be quite long.  It's useful to be able to display
it in the header-line instead.  Let's support that.

* lisp/progmodes/which-func.el (which-func-display)
(which-func--use-header-line, which-func--use-mode-line):
Add. (Bug#64533)
(which-func-try-to-enable): Support 'which-func--use-header-line'.
(which-func--disable): Add, to support 'which-func--use-header-line'.
(which-func-ff-hook, which-func-update-1): Use 'which-func--disable'.
2023-07-15 10:54:25 +03:00
YugaEgo
673992d28e ; * lisp/progmodes/sql.el (sql-interactive-mode): Remove FIXME (bug#64602). 2023-07-14 08:27:00 +03:00
Po Lu
a65960c5b9 Merge remote-tracking branch 'origin/master' into feature/android 2023-07-14 07:58:49 +08:00
Spencer Baugh
e5be6c7ae3 Fix flymake mode line scrolling with pixel-scroll-precision-mode
When pixel-scroll-precision-mode is enabled, scrolling the mouse
wheel will yield wheel-{up,down} events.  Flymake now binds the
new events in addition to the old mouse-wheel-{up,down}-event.

* lisp/progmodes/flymake.el:(flymake--mode-line-counter-scroll-prev)
(flymake--mode-line-counter-scroll-next)
flymake--mode-line-counter-map): New.
(flymake--mode-line-counter): Use new keymap and include
'flymake--diagnostic-type' as a property in the mode-line.
(Bug#64428)
2023-07-13 16:58:15 +03:00
Eshel Yaron
e0244f5804 ; * lisp/progmodes/project.el (project-current): Doc fix.
Avoid saying that 'project-current' asks specifically for a
directory, as it can also ask for a project's directory by other
identifiers, such as the project's name, when 'project-prompter'
is set to a different value than the default
'project-prompt-project-dir'.  (Bug#64266)
2023-07-13 09:14:28 +03:00
Po Lu
4e2fda28ed Merge remote-tracking branch 'origin/master' into feature/android 2023-07-13 08:33:27 +08:00
João Távora
bc1e7b9b8e Eglot: fix advertisement of textDocument.codeAction.resolveSupport
See https://github.com/joaotavora/eglot/issues/1255.

* lisp/progmodes/eglot.el (eglot-client-capabilities):
Use correct format for textDocument.codeAction.resolveSupport.
2023-07-12 10:16:26 +01:00
Po Lu
dc7ecc6e31 Merge remote-tracking branch 'origin/master' into feature/android 2023-07-11 08:19:32 +08:00
João Távora
3b7273f4ae Eglot: add support for :codeAction/resolve
See https://github.com/emacs-grammarly/eglot-grammarly/issues/7.

* lisp/progmodes/eglot.el (eglot--lsp-interface-alist): Augment
CodeAction type.
(eglot-execute): Consider :codeAction/resolve
(eglot-client-capabilities): Advertise
textDocument.codeAction.resolveSupport
2023-07-11 00:09:20 +01:00
Juri Linkov
d8238df35a * lisp/progmodes/project.el (project-prompt-project-name): Fix order.
Reverse choices in this recently added new command to follow exactly
the same order as in the old function 'project-prompt-project-dir'.
2023-07-10 20:43:13 +03:00
João Távora
b56f46c9de Eglot: fix eglot--sig-info again
See https://github.com/joaotavora/eglot/issues/1253

* lisp/progmodes/eglot.el (eglot--sig-info): Fall back to regexp
technique if no parameters or poor parameter information.
2023-07-10 14:06:42 +01:00
João Távora
d0f65fbdbb Eglot: fix eglot--sig-info
See https://github.com/joaotavora/eglot/issues/1253

* lisp/progmodes/eglot.el (eglot--sig-info): Fix.
2023-07-10 13:09:48 +01:00
Po Lu
f812d92f67 Merge remote-tracking branch 'origin/master' into feature/android 2023-07-09 08:40:38 +08:00
Eli Zaretskii
375dac936f Merge from origin/emacs-29
600b90ed56 Mark failing icalendar test as unstable (bug#56241)
f8a918c977 ; * src/coding.c (Fcoding_system_put): Improve doc string.
40f84e906f ; * doc/lispref/keymaps.texi (Key Binding Commands): Fix ...
502a780031 ; Improve documentation of 'vertical-motion' in ELisp manual
0d90873fa4 ; * src/indent.c (Fvertical_motion): Doc fix.
9b38773a20 ; * lisp/dired.el (dired-no-confirm): Doc fix.  (Bug#64493)
a30ebe7a55 ; Improve documentation of key-binding commands
c3fefb2b3a Improve natnump shortdoc
244d4c837a correct info documentation of benchmark-call
67def1f550 * lisp/progmodes/grep.el (rgrep): Fix docstring.
8da2091362 ; Fix documentation of minibuffer-completion commands
aa030698ce ; Fix typos in documented names of keymap-* functions
a9b46bb25d Include a help-echo for flymake's modeline counters
37ed3d15f3 Avoid errors in completion due to 'completion-regexp-list'
15ff876177 ; * lisp/register.el (register-val-describe): Doc fix.
fe7b909c16 ; Fix two typos in recent changes in the manual
7a74b8c327 C Mode: Don't fontify foo globally as type due to "struct...
823bf6bdb1 * lisp/rect.el (rectangle--duplicate-right): Fix rectangl...
e339d0080d ; * test/lisp/misc-tests.el (ert): require misc to avoid ...

# Conflicts:
#	lisp/rect.el
2023-07-08 05:46:10 -04:00
Po Lu
7af686767a Merge remote-tracking branch 'origin/master' into feature/android 2023-07-07 08:45:07 +08:00
Harald Jörg
3cea0a8490 ; cperl-mode: Refine syntax of attributes
Attributes may start with underscore, and must be separated.
Thanks to Mattias Engdegård for pointing out a regex mistake.

* lisp/progmodes/cperl-mode.el (defconst): Fix bad grouping and
allow attributes to start with an underscore in
cperl--single-attribute-rx.  Adjust cperl--attribute-list-rx
accordingly.
(cperl-find-sub-attrs): Allow attributes to start with an underscore.

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-attribute-list-rx): Add new test cases for valid and
invalid attribute lists.
2023-07-06 17:29:42 +02:00
Matthias Meulien
6295d7abdd Improve Python imports management commands
* lisp/progmodes/python.el (python--list-imports): Handle import
errors.
(python--do-isort): Specialize error message.  (Bug#64406)
2023-07-06 10:27:14 +03:00
Wang Diancheng
cb90624945 Fix target-async and background execution in gdb-mi.el
* lisp/progmodes/gdb-mi.el (gdb-target-async-checked): New
variable.
(gdb-non-stop-setting): Change the value back to default to
non-nil on systems other than MS-Windows.
(gdb-non-stop-handler): Try to set mi-async first, falling back to
target-async by calling 'gdb-set-mi-async-handler'.
(gdb-set-mi-async-handler, gdb-try-check-target-async-support):
New functions.
(gdb-check-target-async): Set 'gdb-non-stop' here...
(gdb-starting): ...and here.
(gdb-stopped): Call 'gdb-try-check-target-async-support' when the
program stops for the first time.  (Bug#64186)  (Bug#63084)

Copyright-paperwork-exempt: yes
2023-07-06 09:58:18 +03:00
Po Lu
2443f4ec77 Merge remote-tracking branch 'origin/master' into feature/android 2023-07-05 08:45:06 +08:00
Harald Jörg
0e6ac3ffd4 ; cperl-mode: Avoid excessive regexp backtracking (Bug#8077)
* lisp/progmodes/cperl-mode.el (defconst): Add a word-start
assertion to cperl--single-attribute-rx
(cperl-after-sub-regexp): Dito
(cperl-init-faces): shorten matches of incomplete sub declarations
2023-07-04 17:43:59 +02:00
Alan Mackenzie
753aaeb99c objc-mode: Handle (de)propertization of < and >.
* lisp/progmodes/cc-langs.el
(c-get-state-before-change-functions)
(c-before-font-lock-functions): Separate the C and objc
versions, and add (to the first) c-unmark-<>-around-region and
c-before-change-check-<>-operators, (to the second)
c-unmark-<>-around-region and c-restore-<>-properties into the
objc versions of these lang variables.
2023-07-04 15:29:53 +00:00
Alan Mackenzie
793a416653 objc-mode: Fix exceptions in fontification.
These exceptions ("Invalid search bound (wrong side of point)")
were observed in test suite file class-24.m when moving point
up and down a line at a time.

* lisp/progmodes/cc-engine.el (c-forward-declarator): In the
c-syntactic-re-search-forward ~30 lines from the end of the
function amend the regexp for objc-mode such that "@end"
terminates the search, but "<" doesn't.

* lisp/progmodes/cc-fonts.el
(c-make-font-lock-search-function): supply a non-nil
CHECK-POINT argument to c-make-font-lock-search-form.
2023-07-04 12:43:31 +00:00
Po Lu
79207a055f Merge remote-tracking branch 'origin/master' into feature/android 2023-07-04 08:52:29 +08:00
Harald Jörg
766784f186 cperl-mode.el: Add support for new Perl syntax in Perl 5.36 and 5.38
Perl 5.38 was released on 2023-07-03.  This patch supports the new features
for 5.36 and 5.38 for font-lock, indentation, and imenu index creation.

* lisp/progmodes/cperl-mode.el (cperl-praise): Mention classes.
(defconst): Fix typo in docstring of cperl--single-attribute-rx.
Add "class" to cperl--package-rx, and adjust its docstring.
New rx sequence cperl--class-for-imenu-rx to capture classes,
use this in cperl--imenu-entries-rx.
Add "method" to cperl--sub-name-for-imenu-rx.
Add "class" to cperl--block-declaration-rx.
(cperl-sub-keywords): Add "method".
(cperl-mode): Add "ADJUST" to defun-prompt-regexp.
(cperl-after-block-p): Add new keywords for Perl 5.36 and 5.38.
(cperl-indent-exp): Add "field" to expression starters.
(cperl-imenu--create-perl-index): Rename variables refering to
"package", because they also contain classes.
(cperl-init-faces): Add new keywords for Perl 5.36 and 5.38.
(cperl-find-tags): Add support for "class".
(cperl-short-docs): Add new keywords for Perl 5.36 and 5.38.
(cperl-indent-exp): Add new keywords for Perl 5.36 and 5.38.

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-fontify-class): New test for fontification of class
elements.
(cperl-test-imenu-index): Add tests for (nested) class
definitions.

* test/lisp/progmodes/cperl-mode-resources/cperl-indents.erts:
Add test cases for try/catch/finally, defer, class, method

* test/lisp/progmodes/cperl-mode-resources/perl-class.pl: New
resource for fontification tests of class elements.

* test/lisp/progmodes/cperl-mode-resources/grammar.pl: Add some
classes to the test resource.
2023-07-03 23:05:10 +02:00
Juri Linkov
67def1f550 * lisp/progmodes/grep.el (rgrep): Fix docstring.
Instead of the incorrect key `M-c' produce the right key
with \\<read-regexp-map>\\[read-regexp-toggle-case-fold].
2023-07-03 21:50:44 +03:00
Spencer Baugh
a9b46bb25d Include a help-echo for flymake's modeline counters
This helps clarify what each of these numbers mean.  This is inspired
by 'compilation-mode-line-errors' which does the same.
* lisp/progmodes/flymake.el (flymake--mode-line-counter): Add
help-echo to mode line properties.  (Bug#64424)
2023-07-03 14:11:41 +03:00
Po Lu
61a38b470d Merge remote-tracking branch 'origin/master' into feature/android 2023-07-03 08:05:55 +08:00
Andreas Schwab
a5bf0ae661 sh-script: improve fontification of RPM spec files
Fontifiy only macros at line beginning as keywords, otherwise as
variables.  Add more accurate match for macros.

* lisp/progmodes/sh-script.el (sh-font-lock-keywords-var): Add
more accurate patterns for rpm macros.  Also fontify parenthesized
word after keyword.
2023-07-03 00:08:21 +02:00
Harald Jörg
777c4dfa30 ; cperl-mode: Fix a wide docstring which causes warnings when compiling
* lisp/progmodes/cperl-mode.el (defconst): Fix wide docstring for '
cperl--sloppy-signature-rx' (thanks Mattias Engdegård for reviewing)
2023-07-02 13:06:50 +02:00
João Távora
c2e4c68333 Eglot: another tweak to eglot--sig-info
Going to the start of the first param and skipping non-word syntax
backward would seem to be the right thing to do, for traditional
C-style languages and also languages like Ocaml where function
signatures don't start the param list with '('.

See also https://github.com/joaotavora/eglot/discussions/1251.

* lisp/progmodes/eglot.el (eglot--sig-info): Rework again.
2023-07-02 11:58:04 +01:00
Po Lu
2baf2c5fd9 Merge remote-tracking branch 'origin/master' into feature/android 2023-07-02 08:26:54 +08:00
Harald Jörg
9b9dcc146b ; cperl-mode.el: Fix two indentation bugs (Bug#11733)
* lisp/progmodes/cperl-mode.el (cperl-sniff-for-indent): Detect
whether we have a label or a regex/string.
(cperl-calculate-indent): Check for things which look like labels
but aren't.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-11733):
Test the examples provided in the bug report.

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-11733.pl:
Examples from the bug report.
2023-07-02 00:37:10 +02:00
João Távora
a371e1def7 Eglot: fix broken indentation of eglot--sig-info
* lisp/progmodes/eglot.el (eglot--sig-info): Fix.
2023-07-01 22:49:49 +01:00
João Távora
f6e6d6c730 Eglot: bail out of eglot-imenu if no server capability (bug#64274)
* lisp/progmodes/eglot.el (eglot-imenu): Bail out if no
capability.
2023-07-01 22:49:49 +01:00
João Távora
03d4ca6f6b Eglot: improve heuristic to highlight function names in signatures
* lisp/progmodes/eglot.el (eglot--sig-info): Rework.

See https://github.com/joaotavora/eglot/discussions/1251.
2023-07-01 22:49:48 +01:00
Harald Jörg
ce8e6cea42 cperl-mode.el: Support Perl 5.38 syntax for subroutine signatures
* lisp/progmodes/cperl-mode.el (defconst): New rx sequence
describing a signature with initialization.
(cperl-init-faces): integrate the new rx sequence into the
font-lock-defaults init routine (Bug#64190) (Bug#64364).

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-64364.pl: Add
test data for a signature with initialization (tests indentation).

* test/lisp/progmodes/cperl-mode-resources/proto-and-attrs.pl: Add
test data for a signature with initialization (tests fontification).
2023-07-01 21:40:46 +02:00
Harald Jörg
d42b45dcc7 cperl-mode: Fix byte-compilation warnings
* lisp/progmodes/cperl-mode.el (defconst): Reformat docstring to
fit into 80 columns.
(cperl-find-sub-attrs): Mark lexical parameters as unused.

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-fontify-attrs-and-signatures): Fix use of
`match-beginning'
(perl-indent-parens-as-block): Define as a variable.
2023-07-01 15:25:33 +02:00