emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Flymake Support Indicator Errors in Margin


From: bird
Subject: Re: [PATCH] Flymake Support Indicator Errors in Margin
Date: Sun, 17 Mar 2024 16:44:15 +0000 (UTC)
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:
>> From: Elijah G <eg642616@gmail.com>
>> Date: Thu, 14 Mar 2024 09:35:33 -0600
>> Cc: João Távora <joaotavora@gmail.com>, 
>>      philipk@posteo.net, emacs-devel@gnu.org
>> 
>> On Thu, Mar 14, 2024 at 5:05 AM Eli Zaretskii <eliz@gnu.org> wrote:
>> 
>> > > +(defcustom flymake-margin-indicators-string
>> > > +  `((error ,(if (char-displayable-p 8252)
>> > > +               "‼"
>> > > +             "!!")
>> > > +     compilation-error)
>> >
>> > When do you expect this value to be evaluated?
>> >
>> > In general, I wonder whether it would be simpler and wiser to use just
>> > "!!", and leave it to users to customize to "‼" if their displays
>> > support that.  (We can mention the possibility in the doc string.)
>> 
>> I implemented it in a similar way to how display-fill-column-indicator
>> does with display-fill-column-indicator-character, this since I expect
>> users to only set left-margin-width to 1, because if there is several
>> errors on the same line, the indicators will be displayed next to each
>> other and it could be confusing.
>> 
>> However I agree that it is better to change it to just "!!",
>> I fixed the patch and added a doc string for the possibility of including
>> non-ASCII characters.
>
> Spencer, any comments?

A few thoughts:

- I looked through packages in core which use fringes.  The only
  function which seems to also support margins is
  gdb-put-breakpoint-icon, which automatically uses margins instead of
  fringes to display a breakpoint icon if (display-images-p) is nil.

- The current version of Elijah's patch requires the user to explicitly
  configure left-margin-width (or right-margin-width) to non-zero if
  they want the indicators to appear; the margins are not automatically
  grown, unlike in gdb-put-breakpoint-icon.

- I'm not sure whether or why this is even desirable in a TTY.

  The indicators duplicate information that's already communicated by
  the face, so they're a minor benefit.  In a graphical frame, the
  indicators are basically "free" in terms of visual space, since they
  display in the fringe which already exists, so it's worth having them.

  But in a TTY, with the current patch, two columns of text in every
  flymake buffer will be devoted to displaying these indicators, whether
  they're currently needed or not.  That seems like too high a cost,
  unless I'm missing something.

- If it *is* desirable on a TTY, then the need to explicitly configure
  it is unfortunate.

- One alternative design could display the indicators in the first few
  columns of text, if that would otherwise be whitespace, to avoid
  wasting space for the margin.  I think I've seen other packages which
  display stuff in the whitespace in the first column.

- If it's just about making diagnostics more visible, there are various
  things we could do, like displaying an indicator inline with the text
  which has the diagnostic, or highlighting the entire line containing
  the diagnostic.

Elijah, could you say more about your setup?

- You mentioned you already have a left margin configured; what is
  displayed in that margin? Is it anything other than flymake/flycheck
  indicators?

- Do you have the margin automatically disappear if you aren't using
  flycheck in a buffer/if there are no flycheck errors in a buffer?

- Is there some reason that seeing the indicators is especially
  important for you?  Does it communicate information not already
  carried by the face?

- If you just want the diagnostics to be more visible, would customizing
  the face on the diagnostics help?  Or perhaps customizing
  flymake-show-diagnostics-at-end-of-line?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]