Commit graph

821 commits

Author SHA1 Message Date
Eli Zaretskii
59fa0b1dd6 ; Improve doc strings in compile.el
* lisp/progmodes/compile.el (compilation-transform-file-match-alist)
(compilation-error-regexp-alist): Doc fixes.
2024-12-08 07:47:07 +02:00
Robert Pluim
df7f02a795 Add tags to 'compilation-transform-file-match-alist' custom type
* lisp/progmodes/compile.el (compilation-filter-start): Add some
more meaningful tags, and switch to using 'radio' instead of
'choice'.
2024-12-04 17:00:16 +01:00
Robert Pluim
7c50e4cc8c Improve 'compilation-transform-file-match-alist' documentation
* doc/emacs/building.texi (Compilation Mode): Document
'compilation-transform-file-match-alist'.
* lisp/progmodes/compile.el
(compilation-transform-file-match-alist):
Expand docstring and add some examples.
2024-12-04 14:55:27 +01:00
Robert Pluim
a73d08bb67 Improve 'compilation-hidden-output' docstring
* lisp/progmodes/compile.el (compilation-hidden-output): Escape
the newline so the example value is more suitable for copying.
2024-12-04 14:50:41 +01: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
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
Mattias Engdegård
876bd6506d ; compilation-error-regexp-alist-alist order comment 2024-06-03 16:53:29 +02:00
Mattias Engdegård
bf6c3892de Revert "Add support for Rust compilation messages"
This reverts commit 2e862f81a3.
It had serveral problems; see bug#70794.
2024-06-03 16:31:02 +02:00
Ergus
2e862f81a3 Add support for Rust compilation messages
* etc/compilation.txt (Rust): Add Rust/cargo examples.

* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): Add rust/cargo error and
warning patterns.  (Bug#70794)
2024-05-18 13:51:01 +03:00
Phil Sainty
f950621e6a ; Additional fixup for truncation of long lines in compilation buffers
* lisp/progmodes/compile.el
(compilation--insert-abbreviated-line): Handle long lines that end
in a newline.  (Bug#70236)

The fix in commit 8f93cba324 resulted in
the previous "Don't hide the final newline" code causing an off-by-one
error.  With the new code the value of point is what is wanted in both
cases.
2024-04-14 01:00:05 +12:00
Eli Zaretskii
8f93cba324 Fix truncation of long lines in compilation buffers
* lisp/progmodes/compile.el
(compilation--insert-abbreviated-line): Handle long lines that end
in a newline.  (Bug#70236)
2024-04-07 12:08:18 +03:00
Eli Zaretskii
492e16f2ff Fix downcasing of mode-name in compile.el
* lisp/progmodes/compile.el (compilation--downcase-mode-name): New
function.
(compilation-start, kill-compilation): Use it instead of calling
'downcase' on 'mode-name'.  (Bug#68795)
2024-02-03 13:00:15 +02:00
Mattias Engdegård
d7d9bf1fe3 Lua compilation-mode rules adjustments (bug#60830)
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Translate `lua' and `lua-stack' to rx, and change two unnecessary
non-greedy operators to greedy.
2024-01-10 17:24:42 +01:00
Rudolf Adamkovič
cd0eb055fd Make Compilation mode recognize Lua errors
Emacs comes with built-in support for the Lua programming language in
the form of the Lua mode and now also the Lua Tree-sitter mode.  This
patch further improves Lua support in Emacs by making the Compilation
mode recognize Lua errors and stack traces.

* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Add regexps to aid Lua development, namely the 'lua' regexp that
matches Lua errors and the 'lua-stack' regexp that matches Lua stack
frames.  (Bug#60830)
* etc/compilation.txt (Lua): Add an example of a Lua error message
with a stack trace.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data):
(compile-test-error-regexps): Test the new 'lua' and 'lua-stack'
regexps added to the 'compilation-error-regexp-alist-alist'.
2024-01-10 14:48:00 +01:00
Eli Zaretskii
409985288d Fix last change (bug#67930)
* lisp/progmodes/compile.el (compilation--expand-fn): Renamed from
'safe-expand-file-name'; all callers changed.  Doc fix.
2024-01-06 12:33:44 +02:00
Jurgen De Backer
471cc26002 Fix file-name resolution in *compilation* and *grep* buffers
Resolving symlinks in file names could lead to non-existent files
if some leading directory is a symlink to its parent.
In emacs 28 'expand-file-name' was replaced by 'file-truename' to
solve bug #8035.

* lisp/progmodes/compile.el (safe-expand-file-name): New function.
(compilation-find-file-1): Call 'safe-expand-file-name'.  (Bug#67930)
2024-01-06 12:23:51 +02:00
Po Lu
ecf08f0621 Merge from savannah/emacs-29
dc4e6b1329 ; Update copyright years in more files
64b3777631 ; Run set-copyright from admin.el
8e1c56ae46 ; Add 2024 to copyright years

# Conflicts:
#	doc/misc/modus-themes.org
#	doc/misc/texinfo.tex
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	etc/themes/modus-operandi-theme.el
#	etc/themes/modus-themes.el
#	etc/themes/modus-vivendi-theme.el
#	lib/alloca.in.h
#	lib/binary-io.h
#	lib/c-ctype.h
#	lib/c-strcasecmp.c
#	lib/c-strncasecmp.c
#	lib/careadlinkat.c
#	lib/cloexec.c
#	lib/close-stream.c
#	lib/diffseq.h
#	lib/dup2.c
#	lib/filemode.h
#	lib/fpending.c
#	lib/fpending.h
#	lib/fsusage.c
#	lib/getgroups.c
#	lib/getloadavg.c
#	lib/gettext.h
#	lib/gettime.c
#	lib/gettimeofday.c
#	lib/group-member.c
#	lib/malloc.c
#	lib/md5-stream.c
#	lib/md5.c
#	lib/md5.h
#	lib/memmem.c
#	lib/memrchr.c
#	lib/nanosleep.c
#	lib/save-cwd.h
#	lib/sha1.c
#	lib/sig2str.c
#	lib/stdlib.in.h
#	lib/strtoimax.c
#	lib/strtol.c
#	lib/strtoll.c
#	lib/time_r.c
#	lib/xalloc-oversized.h
#	lisp/auth-source-pass.el
#	lisp/emacs-lisp/lisp-mnt.el
#	lisp/emacs-lisp/timer.el
#	lisp/info-look.el
#	lisp/jit-lock.el
#	lisp/loadhist.el
#	lisp/mail/rmail.el
#	lisp/net/ntlm.el
#	lisp/net/webjump.el
#	lisp/progmodes/asm-mode.el
#	lisp/progmodes/project.el
#	lisp/progmodes/sh-script.el
#	lisp/textmodes/flyspell.el
#	lisp/textmodes/reftex-toc.el
#	lisp/textmodes/reftex.el
#	lisp/textmodes/tex-mode.el
#	lisp/url/url-gw.el
#	m4/alloca.m4
#	m4/clock_time.m4
#	m4/d-type.m4
#	m4/dirent_h.m4
#	m4/dup2.m4
#	m4/euidaccess.m4
#	m4/fchmodat.m4
#	m4/filemode.m4
#	m4/fsusage.m4
#	m4/getgroups.m4
#	m4/getloadavg.m4
#	m4/getrandom.m4
#	m4/gettime.m4
#	m4/gettimeofday.m4
#	m4/gnulib-common.m4
#	m4/group-member.m4
#	m4/inttypes.m4
#	m4/malloc.m4
#	m4/manywarnings.m4
#	m4/mempcpy.m4
#	m4/memrchr.m4
#	m4/mkostemp.m4
#	m4/mktime.m4
#	m4/nproc.m4
#	m4/nstrftime.m4
#	m4/pathmax.m4
#	m4/pipe2.m4
#	m4/pselect.m4
#	m4/pthread_sigmask.m4
#	m4/readlink.m4
#	m4/realloc.m4
#	m4/sig2str.m4
#	m4/ssize_t.m4
#	m4/stat-time.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/stdio_h.m4
#	m4/stdlib_h.m4
#	m4/stpcpy.m4
#	m4/strnlen.m4
#	m4/strtoimax.m4
#	m4/strtoll.m4
#	m4/time_h.m4
#	m4/timegm.m4
#	m4/timer_time.m4
#	m4/timespec.m4
#	m4/unistd_h.m4
#	m4/warnings.m4
#	nt/configure.bat
#	nt/preprep.c
#	test/lisp/register-tests.el
2024-01-02 10:28:14 +08:00
Po Lu
8e1c56ae46 ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
Eli Zaretskii
486094126b Merge from origin/emacs-29
0f361cc985 ; Minor copyedits in description of ':box' face property
46fe7a17f5 Fix dragging mode line on text terminals with a mouse (bu...
12daf386f3 ; * doc/lispref/processes.texi (Network): Fix wording and...
037d858dc1 (rust-ts-mode): Set electric-indent-chars
dc9b733ab8 js-ts-mode: Highlight function parameters inside destruct...
4a72f13bdf js-ts-mode: Highlight property shorthands in assignments
83ed9018ed (js--treesit-font-lock-settings): Highlight parameters in...
ad0f87bb4c (js--treesit-font-lock-settings): Remove some duplicates
71c5f3694f ; Another fix of doc string of 'message-mail-user-agent' ...
04a39353ba ; * lisp/gnus/message.el (message-mail-user-agent): Doc f...
82ddcf37ec ; * doc/lispref/files.texi (Changing Files): Fix last cha...
89068516b3 Don't claim to signal an error when deleting a nonexistin...
4fd254e183 * lisp/indent.el (indent-rigidly): Improve prompt (bug#67...
5f923ff1a6 ; Fix typos
a1f88963f5 rust-ts-mode--comment-docstring: Handle block doc comments
a547b0e2e8 rust-ts-mode--comment-docstring: Fix/improve the previous...
2023-12-09 07:25:21 -05:00
Stefan Kangas
5f923ff1a6 ; Fix typos 2023-12-03 23:31:30 +01:00
Mattias Engdegård
ca9f0e75b1 Omit the omake compilation-mode rule by default
It keeps interfering with other rules, slowing everything down a
little bit and makes it harder to add or change other rules.  The rule
is still there and can easily be re-enabled by those who need it.

* etc/NEWS: Announce.
* lisp/progmodes/compile.el (compilation-error-regexp-alist):
Exclude `omake`.
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data):
Actually test the `cucumber` rule. Remove the `omake` test case.
(compile-test-error-regexps):
Test `omake` here.  Test other rules without `omake` included.
2023-10-05 12:25:57 +02:00
Eli Zaretskii
a9c4994776 ' Improve wording of compilation-error messages
* lisp/progmodes/compile.el (compilation-next-error): Improve
wording of user-error text.  (Bug#65713)
2023-10-05 11:01:41 +03:00
Mattias Engdegård
cc533f2338 Show duration of compilation when it stops (bug#65251)
Patch by Helmut Eller, lightly edited.

* lisp/progmodes/compile.el (compilation--start-time): New variable.
(compilation-start): Set it.
(compilation-handle-exit): Display duration.
2023-08-18 13:23:39 +02:00
Augusto Stoffel
b699c38028 Introduce 'compilation-annotation' text property
It is meant to mark parts of compilation buffers which do not
correspond to process output (bug#59888).

* lisp/progmodes/compile.el (compilation-insert-annotation): New
function.
(compilation-start, compilation-handle-exit): Use it.
(compilation--ensure-parse) Rely on 'compilation-annotation' property
instead of 'compilation-header-end'.
2023-02-27 21:14:41 +02:00
Mattias Engdegård
321cbd9a60 Tighten and simplify typescript compilation-mode regexps (bug#61104)
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Tighten regexps and simplify.  Translate to rx.
* etc/compilation.txt: Add examples.

In collaboration with Jostein Kjønigsen.
2023-02-06 17:47:00 +01:00
Jostein Kjønigsen
873a0a1508 Add support for TypeScript compilation to compile.el (bug#61104)
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Add regexps.
2023-02-04 09:19:40 +01:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Stefan Monnier
26243f7b65 compile.el: Fix regression with nb of errors in modeline
* lisp/progmodes/compile.el (compilation-mode-line-errors): Mark it as
risky-local, like `defconst` used to do for us.
2022-12-15 13:36:14 -05:00
Stefan Kangas
70ecdebc92 ; Fix typos (don't abbreviate "with" or "without") 2022-12-01 16:36:09 +01:00
Stefan Monnier
9bfe00dda6 * lisp/progmodes/compile.el (compilation-mode-line-errors): Use defvar
This is not really a constant, e.g. it's modified in `grep.el`.
2022-10-24 14:25:02 -04:00
Eli Zaretskii
b7802190fe ; Update the doc string of 'compilation-auto-jump-to-first-error'
* lisp/progmodes/compile.el
(compilation-auto-jump-to-first-error): Doc fix.  (Bug#58407)
2022-10-10 12:37:04 +03:00
Lars Ingebrigtsen
ef0c2e9940 Fix some misleading quoting in cl-case
* lisp/progmodes/compile.el (compilation-auto-jump):
* lisp/image/image-crop.el (image-crop--crop-image-1):
(image-crop--crop-image-1):
* lisp/image/exif.el (exif--process-value):
* lisp/image-mode.el (image-mode--next-file):
* lisp/dnd.el (dnd-begin-text-drag):
(dnd-begin-file-drag):
(dnd-begin-drag-files): Fix misleading quoting in cl-case (bug#51368).
2022-09-13 18:19:26 +02:00
Lars Ingebrigtsen
9c5d8d59cf Fix remaining byte-compile warnings in loaddefs.el
* lisp/progmodes/compile.el (compilation--default-buffer-name):
* lisp/kmacro.el (kmacro-name-last-macro):
* lisp/emacs-lisp/package.el (package--activate-all): Autoload to
avoid byte-compilation warnings when byte-compiling loaddefs.el.
2022-07-31 11:29:52 +02:00
Lars Ingebrigtsen
02c14216db Reformulate compile-command condition
* lisp/progmodes/compile.el: Reformulate to avoid a byte-compile
warning when compiling loaddefs.el.
2022-07-31 11:17:29 +02:00
João Távora
ffe12ff250 Clean up more robustly in compile.el
* lisp/progmodes/compile.el (compilation-sentinel): Use
unwind-protect.
2022-07-25 14:19:02 +01:00
Stefan Monnier
8fac539b50 (compilation-parse-errors-function): Remove obsolete var
* lisp/progmodes/compile.el (compilation-parse-errors-function): Remove.
(compilation--parse-region): Simplify accordingly.
(compilation--compat-parse-errors): Remove function, not used any more.
(compilation-error-list, compilation-parsing-end)
(compilation-old-error-list): Remove vars, not used any more.
(compilation-last-buffer): Mark as obsolete (sadly, forgot to do that
back in Emacs-22).

* lisp/textmodes/tex-mode.el: Remove old code that was needed for
Emacs<24.

* lisp/progmodes/prolog.el (prolog-consult-compile): Remove long-dead code.
(compilation-parse-errors-function): Remove declaration, not used any more.
(prolog-parse-sicstus-compilation-errors): Remove function, not used any more.
2022-07-21 18:59:57 -04:00
Lars Ingebrigtsen
c59b8dfefa Recognize Gradle error messages in compile-mode
* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): Recognize Gradle errors
(bug#56249).
2022-06-30 11:04:15 +02:00
Mattias Engdegård
e4df6203e2 More robust gnu pattern (bug#56249)
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Don't allow spaces in the file names, to avoid false matches.
Don't allow ad-hoc spaces preceding the program name either.
2022-06-29 17:28:24 +02:00
Mattias Engdegård
d462c8133b Complete transition to rx for compilation gnu pattern
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Change from a mixture of traditional regexp syntax and rx,
to make intentions clearer.
2022-06-29 17:28:24 +02:00
Lars Ingebrigtsen
e73dbcf26d Fix compilation-mode parsing of file names in Gradle errors
* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): Fix parsing of file names
in Gradle output (bug#56249).
2022-06-29 11:53:16 +02:00
Lars Ingebrigtsen
da736c9f02 Make `M-x grep' work better with "git grep"
* lisp/progmodes/compile.el (compilation-start): Bind PAGER to ""
to avoid errors in output from "git grep" and similar commands
(bug#4359).
2022-06-02 17:21:28 +02:00
Lars Ingebrigtsen
092aea9a27 Allow running several commands in compilation-start
* lisp/progmodes/compile.el (compilation-start): Allow not erasing
the contents of the buffer (bug#28892).
2022-05-17 22:08:17 +02:00
Lars Ingebrigtsen
ed71839c33 Add new user option compilation-hidden-output
* doc/emacs/building.texi (Compilation Mode): Document it.
* lisp/progmodes/compile.el (compilation-hidden-output): New user
option.
(compilation-filter): Use it.
(compilation--hide-output): New function.
2022-05-16 15:30:50 +02:00
Lars Ingebrigtsen
e568c3845c Add more compilation-auto-jump-to-first-error options
* doc/emacs/building.texi (Compilation Mode): Document it.
* lisp/progmodes/compile.el
(compilation-auto-jump-to-first-error): Extend type.
(compilation--file-known-p): New function.
(compilation-auto-jump): Use it to support the new values
(bug#8228).
(compilation-find-file-1): Factored out into own function.
(compilation-find-file): Factored out from here.
2022-05-10 05:58:33 +02:00
Lars Ingebrigtsen
7601a77d8a Make compilation-parse-errors more resilient
* lisp/progmodes/compile.el (compilation-parse-errors): Be more
resilient in the presence of regexp alist not being completely set
up (bug#55282).
2022-05-06 14:15:19 +02:00
Lars Ingebrigtsen
0ea217d646 Fix compilation-max-output-line-length type
* lisp/progmodes/compile.el (compilation-max-output-line-length):
Fix the type.
2022-04-30 19:42:42 +02:00
Lars Ingebrigtsen
58398dea25 Truncate output from grep
* doc/emacs/building.texi (Compilation): Document it.
* lisp/progmodes/compile.el (compilation-max-output-line-length):
New user option (bug#44983).
(compilation-filter): Use it.
(compilation--insert-abbreviated-line): New function.
2022-04-30 12:57:20 +02:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Mattias Engdegård
1a84b7a328 Tighten gnu compile regexp further
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
The -fanalyzer ASCII art does not contain tabs.
2021-11-24 15:07:17 +01:00