Commit graph

300 commits

Author SHA1 Message Date
Stefan Kangas
9b14e312f4 Merge from origin/emacs-28
478b786d5a ; * doc/lispref/windows.texi (Window Hooks): Fix a typo (b...
5085351645 * lisp/text-modes/tex-mode.el (tex-mode): Fix AUCTeX regre...
ee6f8598ca Add vc-annotate-switches to manual
616dcf27e5 ; Fix typos in Lisp symbols
5405852541 Remove mention of non-existent `annotate-switches'
191505b8a3 Mention that src/macuvs.h sometimes needs committing
10373c4b68 ; More comment fixes in font.h (bug#57935)
c2595b8dcc ; * src/font.h (struct font_driver): Comment fix.
97b928ce09 MacOS ld warning from native compilation (bug#57849)
2022-09-21 10:25:06 +02:00
Stefan Kangas
616dcf27e5 ; Fix typos in Lisp symbols 2022-09-20 12:21:40 +02:00
Stefan Kangas
4e79f77635 Merge from origin/emacs-28
5e47ec9511 ; * lisp/url/url-http.el (url-http-parse-headers): Fix typo.
ba0871bef1 ; Fix typos: prefer American spelling
e3e7f31faa Adapt Tramp doc

# Conflicts:
#	etc/NEWS
#	etc/themes/modus-themes.el
#	lisp/emacs-lisp/byte-opt.el
#	test/lisp/so-long-tests/spelling-tests.el
2022-07-14 11:37:42 +02:00
Stefan Kangas
ba0871bef1 ; Fix typos: prefer American spelling 2022-07-13 13:04:22 +02:00
Po Lu
774880c84c Get rid of `defvar-keymap' in flymake.el
* lisp/progmodes/flymake.el (flymake-mode-map)
(flymake-diagnostics-buffer-mode-map): Stop using
`defvar-keymap', since Flymake only requires Emacs 26.1.
2022-05-30 18:09:41 +08:00
Stefan Kangas
7d74b8f632 Prefer defvar-keymap in some progmodes
* lisp/progmodes/asm-mode.el (asm-mode-map):
* lisp/progmodes/bug-reference.el (bug-reference-map):
* lisp/progmodes/erts-mode.el (erts-mode-map):
* lisp/progmodes/flymake.el (flymake-mode-map)
(flymake-diagnostics-buffer-mode-map):
* lisp/progmodes/icon.el (icon-mode-map):
* lisp/progmodes/js.el (js-mode-map):
* lisp/progmodes/m4-mode.el (m4-mode-map):
* lisp/progmodes/mixal-mode.el (mixal-mode-map):
* lisp/progmodes/scheme.el (scheme-mode-map): Prefer defvar-keymap.
2022-05-27 10:00:14 +02:00
Paul Eggert
ec7567f02c Avoid formatting twice in flymake
* lisp/progmodes/flymake.el (flymake-error): Don't format a
message twice, as that can translate quotes we don't want
translated.
2022-05-18 12:40:01 -07:00
Eli Zaretskii
b1620a44ff ; * lisp/progmodes/flymake.el (flymake-mode): Fix a typo. 2022-05-18 16:53:49 +03:00
Lars Ingebrigtsen
960008aa98 Mention next-error-function in flymake-mode doc string
* lisp/progmodes/flymake.el (flymake-mode): Note that you can set
next-error-function (bug#32322).
2022-05-18 15:33:57 +02:00
Lars Ingebrigtsen
ae877d5511 Add new user option flymake-mode-line-lighter
* doc/misc/flymake.texi (Customizable variables): Document it.

* lisp/progmodes/flymake.el (flymake-mode-line-lighter): New user
option (bug#55115).
(flymake--mode-line-title): Use it.
2022-04-26 12:39:13 +02:00
Lars Ingebrigtsen
dad2a41a2a Make flymake-show-buffer-diagnostics error out in non-Flymake buffers
* lisp/progmodes/flymake.el (flymake-show-buffer-diagnostics):
Signal an error if run outside of a buffer with Flymake enabled
(bug#55097).
2022-04-25 10:05:44 +02:00
Robert Pluim
31af9bca99 Mark flymake as compatible with emacs-26.1
* lisp/progmodes/flymake.el: Bump package version and set
emacs version in Package-Requires to 26.1 (Bug#53853).
2022-02-08 16:04:15 +01:00
Brian Leung
82e74e4559 flymake: Ensure compatibility with older Emacsen
* lisp/progmodes/flymake.el (flymake--log-1): Use
replace-regexp-in-string instead of Emacs 28's
string-replace (bug#53853).
2022-02-08 07:16:55 +01:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Eli Zaretskii
6b89578524 ; * lisp/progmodes/flymake.el: Update the minimum Emacs version. 2021-12-09 17:01:57 +02:00
Stefan Kangas
42d4e24ff3 ; Fix typos 2021-11-12 13:59:58 +01:00
Stefan Kangas
d85cf33e49 Escape '%' in filenames to fix flymake warnings
* lisp/progmodes/flymake.el (flymake--log-1): Escape '%' in filenames
for 'warning-type-format' so they are not interpreted as a %-sequence
by 'format' later.  (Bug#51549)
2021-11-06 20:59:28 +01:00
Mattias Engdegård
79b5d66bd6 * lisp/progmodes/flymake.el (flymake-menu): Don't use obsolete name. 2021-09-27 16:00:32 +02:00
Mattias Engdegård
32de11d8de ; Remove various duplicated words
* doc/lispref/searching.texi (Extending Rx):
* doc/lispref/strings.texi (Creating Strings):
* doc/misc/modus-themes.org (Measure color contrast (DIY)):
* etc/NEWS:
* lisp/find-file.el (ff-find-other-file):
* lisp/gnus/gnus-group.el (gnus-group-suspend):
* lisp/progmodes/cc-langs.el (c-ml-string-any-closer-re):
* lisp/progmodes/flymake.el (flymake-list-only-diagnostics):
* lisp/progmodes/xref.el (xref--group-name-for-display):
* lisp/transient.el (transient-child, transient-files)
(transient-infix-value):
* src/alloc.c:
* src/regex-emacs.c (regex_compile):

Remove duplicate words in comments, documentation etc.
2021-09-25 20:25:01 +02:00
Stefan Kangas
aebba085cb ; More minor stylistic fixes found by checkdoc 2021-09-22 20:26:40 +02:00
Stefan Kangas
63f419f133 ; Minor stylistic fixes found by checkdoc 2021-09-16 19:37:07 +02:00
João Távora
55dda2571a Unbreak make bootstrap (don't use cl-defun's &aux parameters)
* lisp/progmodes/flymake.el (flymake--handle-report): Don't use &aux.
2021-09-14 19:30:47 +01:00
João Távora
4633e02726 Add support for project-wide diagnostics in Flymake (bug#50244)
This is done with two new concepts: "foreign diagnostics" and
"list-only diagnostics".  The manual has been updated with a
description of these new concepts.

* doc/misc/flymake.texi (Flymake utility functions):
Explain creation of foreign diagnostics.
(Foreign and list-only diagnostics): New subsection.
(Listing diagnostics): New subsection.

* lisp/progmodes/flymake.el
(Version): Bump to 1.2.1
(project): Require project.
(flymake--diag): Add new slots 'orig-beg' and 'orig-end'.  Rename
'buffer' slot to 'locus'.
(flymake-make-diagnostic): Rework docstring.  Accept stringp
LOCUS arg.
(flymake-diagnostic-beg, flymake-diagnostic-end)
(flymake-diagnostic-buffer):  Simplify definition.
(flymake--equal-diagnostic-p): New helper
(flymake--highlight-line): Rework.  Accept FOREIGN arg.
(flymake--state): Work docstring. Add new slot 'foreign-diags'
(flymake--handle-report): Call
flymake--update-diagnostics-listings.
(flymake--handle-report): New helper.
(flymake--mode): Forward declare.
(flymake--handle-report): Rework for foreign diagnostics.
(flymake-mode): When turning on, notice any Flymake diagnostics
for current buffer.  When turning off update diagnostics listings.
(flymake-kill-buffer-hook): Turn off flymake explicitly before
killing.
(flymake--mode-line-counter): Use flymake-diagnostics to collect
diagnostics.
(flymake-show-diagnostic): Visit buffer of file-specific
diagnostic.
(flymake--tabulated-entries-1): New helper extracted from
flymake--diagnostic-buffer-entries.
(flymake--diagnostics-buffer-entries): Rework.
(flymake--diagnostics-base-tabulated-list-format): New helper.
(flymake--diagnostics-buffer-name): Adjust.
(flymake-list-only-diagnostics): New variable.
(flymake--project-diagnostic-list-project): New variable.
(flymake--clear-list-only-diagnostics): New helper.
(flymake-project-diagnostics-mode): New major mode.
(flymake--project-diagnostics)
(flymake--project-diagnostics-entries)
(flymake--project-diagnostics-buffer): New helpers.
(flymake-show-project-diagnostics): New command.
(flymake--update-diagnostics-listings): New helper.
(flymake-show-buffer-diagnostics): Renamed from flymake-diagnostics-buffer.

* etc/NEWS: Mention change.
2021-09-14 12:26:25 +01:00
João Távora
7d9d3951c6 Abbreviate Flymake backend name in flymake-show-diagnostics-buffer
* lisp/progmodes/flymake.el (flymake--diagnostics-buffer-entries):
(flymake-diagnostics-buffer-mode): Report abbreviated backend, too.
2021-09-14 12:22:15 +01:00
João Távora
e793a73fbe Unbreak M-x compile-defun of functions using flymake-log
* lisp/progmodes/flymake.el (flymake-log): Check if compilation unit
  is indeed a string before treating it as a file name.
2021-09-14 12:22:15 +01:00
João Távora
4040232994 Refactor some Flymake functions
* lisp/progmodes/flymake.el (flymake-diagnostic-buffer): New
helper.
(flymake-diagnostic-beg, flymake-diagnostic-end): Tweak docstring.
(flymake--handle-report): Simplify.
(flymake--publish-diagnostics): Helper for flymake--handle-report.
(flymake--mode-line-counter, flymake-show-diagnostic)
(flymake--diagnostics-buffer-entries): Use
flymake-diagnostic-buffer, flymake-diagonstic-type,
flymake-diagnostic-beg.
2021-09-14 12:22:14 +01:00
João Távora
6e10086901 Rename flymake--backend-state to flymake--state
The previous name was confusing and akward and dreadful to type and
read.

* lisp/progmodes/flymake.el (flymake--state): Rename from
flymake--backend-state.
(flymake--with-backend-state): Use flymake--state.
(flymake--handle-report): Use flymake--state.
(flymake--collect): Use flymake--state.
(flymake-running-backends): Use flymake--state.
(flymake--disable-backend): Use flymake--state.
(flymake--run-backend): Use flymake--state.
(flymake-start): Use flymake--state.
(flymake-mode): Use flymake--state.
(flymake--mode-line-title): Use flymake--state.
(flymake--mode-line-exception): Use flymake--state.
(flymake--mode-line-counter): Use flymake--state.
2021-09-14 12:22:14 +01:00
Stefan Kangas
f02624b342 ; Minor doc fixes found by checkdoc 2021-09-13 06:44:52 +02:00
Juri Linkov
55e77a811a * lisp/progmodes/flymake.el: Bind mouse-3 to flymake-menu on mode-line.
* lisp/progmodes/flymake.el (flymake--mode-line-title):
Bind [mode-line down-mouse-3] to flymake-menu (bug#50067)
2021-08-27 20:12:30 +03:00
Stefan Monnier
1a7818824b * lisp/progmodes/flymake.el (flymake--mode-line-title): Don't quote lambda 2021-08-01 18:08:01 -04:00
João Távora
c50b5907e0 Fail earlier if stale Flymake report functions called
If a Flymake backend calls a "stale" report function,
flymake--handle-report might be called for a backend function that is
no longer in the flymake--backend-state hash table.  This patch makes
that erroneous situation slightly more explicit.

* lisp/progmodes/flymake.el (flymake--handle-report): Improve
error reporting.
2021-04-10 11:19:34 +01:00
Stefan Monnier
b8e3f338a6 * lisp/progmodes/flymake.el (flymake-log): Push the right code 2021-03-06 09:56:43 -05:00
Stefan Monnier
da383aeb8e * lisp/progmodes/flymake.el (flymake-log): Simplify 2021-03-06 09:55:30 -05:00
Basil L. Contovounesios
f2f233d867 Conditionally use macroexp-file-name in Flymake
* lisp/progmodes/flymake.el (flymake-log): Reinstate Emacs 26
support by conditionally using macroexp-file-name which is new in
Emacs 28 (bug#46957).
2021-03-06 09:05:49 +00:00
Stefan Monnier
2766f9fdb9 * lisp/emacs-lisp/macroexp.el (macroexp-file-name): New function.
Yes, finally: a function that tells you the name of the file where
the code is located.  Finding this name is non-trivial in practice,
as evidenced by the "4 shift/reduce conflicts" warning when compiling
CEDET's python.el, because its `wisent-source` got it wrong in that
case, thinking the grammar came from `python.el` instead of
`python-wy.el`.

While at it, also made `macroexp-compiling-p` public, since it's
useful at various places.

(macroexp-compiling-p): Rename from `macroexp--compiling-p`.

* lisp/emacs-lisp/bytecomp.el (byte-compile-close-variables):
Bind `load-file-name` to nil so we can distinguish a load that calls
the byte compiler from a byte compilation which causes a load.

* lisp/cedet/semantic/wisent/python.el (wisent-python--expected-conflicts):
Remove; it was just a workaround.
* lisp/subr.el (do-after-load-evaluation): Avoid `byte-compile--` vars.
* lisp/cedet/semantic/fw.el (semantic-alias-obsolete):
Use `macroexp-compiling-p` and `macroexp-file-name`.
* lisp/cedet/semantic/wisent/comp.el (wisent-source): Use `macroexp-file-name`
(wisent-total-conflicts): Tighten regexp.
* lisp/emacs-lisp/cl-lib.el (cl--compiling-file): Delete function
and variable.  Use `macroexp-compiling-p` instead.
* lisp/progmodes/flymake.el (flymake-log):
* lisp/emacs-lisp/package.el (package-get-version):
* lisp/emacs-lisp/ert-x.el (ert-resource-directory):
Use `macroexp-file-name`.
2021-02-24 13:52:45 -05:00
Mattias Engdegård
de15ca7d00 Fix typos
* doc/lispref/display.texi (Size of Displayed Text):
* doc/lispref/windows.texi (Buffer Display Action Functions):
* etc/NEWS:
* etc/ORG-NEWS (Org-Attach has been refactored and extended):
* lisp/battery.el (display-battery-mode, battery--upower-subsribe):
* lisp/calendar/parse-time.el:
* lisp/dired-x.el:
* lisp/emacs-lisp/chart.el (chart-sequece, chart-bar-quickie):
* lisp/emacs-lisp/eldoc.el (eldoc-echo-area-use-multiline-p)
(eldoc-documentation-strategy):
* lisp/emacs-lisp/pcase.el (pcase--split-pred, pcase--u1):
* lisp/gnus/gnus-search.el (gnus-search-expandable-keys)
(gnus-search-parse-query, gnus-search-query-return-string)
(gnus-search-imap, gnus-search-imap-search-command)
(gnus-search-transform-expression):
* lisp/gnus/nnselect.el:
* lisp/isearch.el (isearch-lazy-count-format):
* lisp/mh-e/mh-show.el (mh-show-msg):
* lisp/net/dictionary-connection.el (dictionary-connection-open):
* lisp/net/dictionary.el (dictionary-default-popup-strategy)
(dictionary, dictionary-split-string, dictionary-do-select-dictionary)
(dictionary-display-dictionarys, dictionary-search)
(dictionary-tooltip-mode):
* lisp/net/eudcb-macos-contacts.el (eudc-macos-contacts-set-server):
* lisp/net/mailcap.el (mailcap-mime-data):
* lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection):
* lisp/nxml/nxml-mode.el (nxml-mode):
* lisp/progmodes/cc-engine.el:
* lisp/progmodes/cperl-mode.el (cperl-mode)
(cperl-fontify-syntaxically):
* lisp/progmodes/flymake.el (flymake-diagnostic-functions):
* lisp/progmodes/verilog-mode.el (verilog--supressed-warnings)
(verilog-preprocess):
* lisp/simple.el (self-insert-uses-region-functions):
* lisp/textmodes/bibtex.el (bibtex-copy-summary-as-kill):
* lisp/textmodes/texnfo-upd.el (texinfo-insert-master-menu-list):
* src/dispnew.c:
* src/font.c (Ffont_get):
* src/indent.c (compute_motion):
* src/process.c (init_process_emacs):
* src/w32fns.c (deliver_wm_chars):
* test/lisp/jsonrpc-tests.el (deferred-action-complex-tests):
Fix typos in documentation, comments, and internal identifiers.
2021-02-18 16:50:55 +01:00
Stefan Kangas
b4b9ecdfe3 Remove redundant :group args in progmodes/*.el
* lisp/progmodes/bug-reference.el:
* lisp/progmodes/cfengine.el:
* lisp/progmodes/cmacexp.el:
* lisp/progmodes/cpp.el:
* lisp/progmodes/cwarn.el:
* lisp/progmodes/dcl-mode.el:
* lisp/progmodes/executable.el:
* lisp/progmodes/flymake.el:
* lisp/progmodes/gud.el:
* lisp/progmodes/hideshow.el:
* lisp/progmodes/icon.el:
* lisp/progmodes/inf-lisp.el:
* lisp/progmodes/js.el:
* lisp/progmodes/ld-script.el:
* lisp/progmodes/make-mode.el:
* lisp/progmodes/modula2.el:
* lisp/progmodes/pascal.el:
* lisp/progmodes/perl-mode.el:
* lisp/progmodes/prog-mode.el:
* lisp/progmodes/simula.el:
* lisp/progmodes/xscheme.el: Remove redundant :group args.
2021-02-13 07:17:20 +01:00
Lars Ingebrigtsen
9fb859010f flymake-diagnostic-beg/end doc string and error reporting improvement
* lisp/progmodes/flymake.el (flymake-diagnostic-beg):
(flymake-diagnostic-end): Improve doc string and error reporting
(bug#39971).
2021-01-29 07:15:35 +01:00
João Távora
ace749f2e3 Count Flymake diagnostics in modeline by severity, not type
Originally reported in https://github.com/joaotavora/eglot/issues/588
by Pankaj Jangid.

* lisp/progmodes/flymake.el (flymake--mode-line-counter): Count
diagnostics by severity level, not by type.
(Version): Bump to 1.1.1
2021-01-09 18:50:19 +00:00
João Távora
70e6c0850e ; * lisp/progmodes/flymake.el: Bump version to 1.1.0. 2021-01-02 11:19:46 +00:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
João Távora
6670972562 Fix type declaration of two Flymake customization variables
* lisp/progmodes/flymake.el (flymake-mode-line-format)
(flymake-mode-line-counter-format): Fix type declaration.
2020-12-31 16:04:42 +00:00
João Távora
1b449af5a1 Must explicitly create unpropertized strings in mode-line
Otherwise, an innocent string like " " will mysteriously
pickup properties from some other minor mode.

Making this a separate commit in hopes of raising attention to this
possible bug.

* lisp/progmodes/flymake.el (flymake--mode-line-counter): Must
explicily create a new string unpropertized string
2020-12-31 14:03:53 +00:00
João Távora
2e6fbb05b6 Make Flymake mode-line indicator customizable (bug#33740)
* lisp/progmodes/flymake.el (flymake-mode): Use
flymake-mode-line-format.
(flymake--mode-line-format): Remove.
(flymake-mode-line-counter-format, flymake-mode-line-format): New
defcustom.
(flymake-mode-line-title, flymake-mode-line-exception)
(flymake-mode-line-counters, flymake-error-counter)
(flymake-warning-counter, flymake-note-counter): New variables.
(flymake--mode-line-title, flymake--mode-line-exception)
(flymake--mode-line-counters, flymake--mode-line-counter): New
helpers.

* doc/misc/flymake.texi (Customizable variables): Mention
flymake-mode-line-format and flymake-mode-line-counter-format

* etc/NEWS: Mention Flymake's customizable mode-line.
2020-12-31 14:03:53 +00:00
João Távora
ecd9264372 Revert "Allow the flymake mode line indicator to be customized"
This reverts commit 37049ee78c.

It's not ready to be used, contains some fundamental errors.

See bug#33740.
2020-12-29 14:08:23 +00:00
Lars Ingebrigtsen
37049ee78c Allow the flymake mode line indicator to be customized
* doc/misc/flymake.texi (Customizable variables): Mention it.

* lisp/progmodes/flymake.el (flymake-mode-line-indicator-format):
New variable (bug#33740).
(flymake--mode-line-format): Use it.
2020-12-29 03:10:00 +01:00
João Távora
fdaaf886b7 Document that flymake-diag-region saves match data
The typical use of this function (which is parsing compiler diagnostic
messages), lends itself too easily to one the problems in bug#29193.
Make it a friendlier API.

* doc/misc/flymake.texi (Flymake utility functions): Document that
flymake-diag-region saves match data.

* lisp/progmodes/flymake.el (flymake-diag-region): Document that
this saves match data.
2020-12-18 15:38:35 +00:00
João Távora
95eaf45ddf Save match data in flymake-diag-region (bug#29193)
* lisp/progmodes/flymake.el (flymake-diag-region): Move
save-match-data up.
2020-12-18 11:29:28 +00:00
Dmitry Gutov
fa4c2768cf flymake-diag-region: Fix the recent test breakage
* lisp/progmodes/flymake.el (flymake-diag-region):
Make sure to save the match data (bug#29193).
2020-12-18 04:05:18 +02:00
Dmitry Gutov
fda9a2bbfd (flymake-diag-region): Fall back to (end-of-thing 'symbol)
* lisp/progmodes/flymake.el (flymake-diag-region):
Fall back to (end-of-thing 'symbol) (bug#29193).
2020-12-16 02:49:35 +02:00