all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Elijah G <eg642616@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>, Roman Rudakov <rrudakov@fastmail.com>
Cc: 70711@debbugs.gnu.org
Subject: bug#70711: 30.0.50; Issue with flymake indicators
Date: Thu, 2 May 2024 11:03:14 -0600	[thread overview]
Message-ID: <CACnP4NJVhqYSacOWZ4tVGa-NrBPB13+9NP_TsZANpWdVh=V0tQ@mail.gmail.com> (raw)
In-Reply-To: <86o79olbk6.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2159 bytes --]

On Thu, May 2, 2024 at 5:04 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Roman Rudakov <rrudakov@fastmail.com>
> > Date: Thu, 02 May 2024 10:06:15 +0200
> >
> > After the latest update of flymake I started experiencing an issue
> > with indicators. The problem occurs if I try to disable indicators
> > completely.
> >
> > Steps to reproduce from "emacs -q":
> > 1. Evaluate the following forms:
> >
> > (setopt flymake-fringe-indicator-position nil
> >         flymake-margin-indicator-position nil)
> > (flymake-mode)
> >
> > 2. Type some invalid expression to trigger flymake.
> >
> > Expected result: No indicators.
> >
> > Actual result: Exclamation mark is shown right before the faulty
> > expression (not even on fringe or margin).
>
> Elijah, could you please look into this?
>
> Thanks.

Hi Eli, below you can find the attached patch that
should fix this issue.

Roman Can you eval this defun and tell
if the bug is fixed?

Thanks.

``` elisp
(defun flymake--indicator-overlay-spec (indicator)
  "Return INDICATOR as propertized string to use in error indicators."
  (let* ((value (if (symbolp indicator)
                    (symbol-value indicator)
                  indicator))
         (indicator-car (if (listp value)
                            (car value)
                          value))
         (indicator-cdr (if (listp value)
                            (cdr value))))
    (cond
     ((and (symbolp indicator-car)
           flymake-fringe-indicator-position)
      (propertize "!" 'display
                  (cons flymake-fringe-indicator-position
                        (if (listp value)
                            value
                          (list value)))))
     ((and (stringp indicator-car)
           flymake-margin-indicator-position)
      (propertize "!"
                  'display
                  `((margin ,flymake-margin-indicator-position)
                    ,(propertize
                      indicator-car
                      'face
                      `(:inherit (,indicator-cdr
                                  default)))))))))
````

[-- Attachment #2: 0001-Fix-bug-70711.patch --]
[-- Type: application/octet-stream, Size: 1360 bytes --]

From f47840dfa17e27cede2b10039f8cd36f94384c66 Mon Sep 17 00:00:00 2001
From: "Elias G. Perez" <eg642616@gmail.com>
Date: Thu, 2 May 2024 10:33:43 -0600
Subject: [PATCH] Fix bug#70711

* lisp/progmodes/flymake.el (flymake--indicator-overlay-spec):
Check if `flymake-fringe-indicator-position' or
`flymake-margin-indicator-position' are non-nil for allow no
indicators.
---
 lisp/progmodes/flymake.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 22a139d3045..f3578152b36 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -754,13 +754,15 @@ flymake--indicator-overlay-spec
          (indicator-cdr (if (listp value)
                             (cdr value))))
     (cond
-     ((symbolp indicator-car)
+     ((and (symbolp indicator-car)
+           flymake-fringe-indicator-position)
       (propertize "!" 'display
                   (cons flymake-fringe-indicator-position
                         (if (listp value)
                             value
                           (list value)))))
-     ((stringp indicator-car)
+     ((and (stringp indicator-car)
+           flymake-margin-indicator-position)
       (propertize "!"
                   'display
                   `((margin ,flymake-margin-indicator-position)
-- 
2.44.0.windows.1


  reply	other threads:[~2024-05-02 17:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02  8:06 bug#70711: 30.0.50; Issue with flymake indicators Roman Rudakov
2024-05-02 11:04 ` Eli Zaretskii
2024-05-02 17:03   ` Elijah G [this message]
2024-05-02 20:43     ` Roman Rudakov
2024-05-03  6:18       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACnP4NJVhqYSacOWZ4tVGa-NrBPB13+9NP_TsZANpWdVh=V0tQ@mail.gmail.com' \
    --to=eg642616@gmail.com \
    --cc=70711@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rrudakov@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.