unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64547: `show-paren-mode` thinks that a paren is offscreen in `M-:` when it isn't
@ 2023-07-09 19:49 Okamsn via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-10 12:15 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Okamsn via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-09 19:49 UTC (permalink / raw)
  To: 64547

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

Hello,

I have `show-paren-style` set to `mixed` and 
`show-paren-context-when-offscreen` set to `overlay`.

When using `eval-expression`, `show-paren` thinks that the starting 
parenthesis is offscreen.

I have attached images showing how, although I am typing on the same 
line as the parenthesis, the context overlay is still shown.

With `show-paren-when-point-inside-paren` enabled, typing before the 
closing parenthesis causes the prompt of `M-:` to be shown before 
quickly being hidden by the context overlay again. This causes text to 
quickly move side to side as I type. I have attached a screen recording 
of this movement.

This is in Emacs 29.0.92. If it is relevant, I have `line-spacing` set 
to 0.15.

Thank you.

[-- Attachment #2: without-context.png --]
[-- Type: image/png, Size: 1812 bytes --]

[-- Attachment #3: with-context.png --]
[-- Type: image/png, Size: 1328 bytes --]

[-- Attachment #4: show-paren-movement.mp4 --]
[-- Type: video/mp4, Size: 84260 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64547: `show-paren-mode` thinks that a paren is offscreen in `M-:` when it isn't
  2023-07-09 19:49 bug#64547: `show-paren-mode` thinks that a paren is offscreen in `M-:` when it isn't Okamsn via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-10 12:15 ` Eli Zaretskii
  2023-07-10 13:26   ` Stephen Berman
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2023-07-10 12:15 UTC (permalink / raw)
  To: Okamsn; +Cc: 64547

> Date: Sun, 09 Jul 2023 19:49:06 +0000
> From:  Okamsn via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> I have `show-paren-style` set to `mixed` and 
> `show-paren-context-when-offscreen` set to `overlay`.
> 
> When using `eval-expression`, `show-paren` thinks that the starting 
> parenthesis is offscreen.
> 
> I have attached images showing how, although I am typing on the same 
> line as the parenthesis, the context overlay is still shown.
> 
> With `show-paren-when-point-inside-paren` enabled, typing before the 
> closing parenthesis causes the prompt of `M-:` to be shown before 
> quickly being hidden by the context overlay again. This causes text to 
> quickly move side to side as I type. I have attached a screen recording 
> of this movement.
> 
> This is in Emacs 29.0.92. If it is relevant, I have `line-spacing` set 
> to 0.15.

I cannot reproduce this.  I see neither of the problems you describe,
and nothing like the screen recording you posted.  You don't show the
details of your platform and build, so maybe it is something specific
to that (macOS, per chance?).

Can you post a detailed reproduction recipe, starting from "emacs -Q"
and showing all the settings and commands you have to do to reproduce
the problem.

Thanks.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64547: `show-paren-mode` thinks that a paren is offscreen in `M-:` when it isn't
  2023-07-10 12:15 ` Eli Zaretskii
@ 2023-07-10 13:26   ` Stephen Berman
  2023-07-10 14:17     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Berman @ 2023-07-10 13:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Okamsn, 64547

On Mon, 10 Jul 2023 15:15:48 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> Date: Sun, 09 Jul 2023 19:49:06 +0000
>> From:  Okamsn via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> I have `show-paren-style` set to `mixed` and
>> `show-paren-context-when-offscreen` set to `overlay`.
>>
>> When using `eval-expression`, `show-paren` thinks that the starting
>> parenthesis is offscreen.
>>
>> I have attached images showing how, although I am typing on the same
>> line as the parenthesis, the context overlay is still shown.
>>
>> With `show-paren-when-point-inside-paren` enabled, typing before the
>> closing parenthesis causes the prompt of `M-:` to be shown before
>> quickly being hidden by the context overlay again. This causes text to
>> quickly move side to side as I type. I have attached a screen recording
>> of this movement.
>>
>> This is in Emacs 29.0.92. If it is relevant, I have `line-spacing` set
>> to 0.15.
>
> I cannot reproduce this.  I see neither of the problems you describe,
> and nothing like the screen recording you posted.  You don't show the
> details of your platform and build, so maybe it is something specific
> to that (macOS, per chance?).
>
> Can you post a detailed reproduction recipe, starting from "emacs -Q"
> and showing all the settings and commands you have to do to reproduce
> the problem.

I can reproduce the problem in GNU Emacs 29.0.92 (x86_64-pc-linux-gnu,
GTK+ Version 3.24.38, cairo version 1.17.6), but only with line-spacing
set to at least 0.06.  Recipe:

0. emacs -Q
1. M-x customize-option show-paren-style RET.  Choose "mixed" from the
   Value Menu and set for current session.
2. M-x customize-option show-paren-context-when-offscreen RET.  Choose
   "In overlay" from the Value Menu and set for current session.
3. M-x customize-option line-spacing RET.  Choose "Number" from the
   Value Menu, enter 0.06 or greater and set for current session.
4. M-: ()
=> On typing ")" the "Eval: " prompt vanishes, the string "(" is
   displayed with a hollow box over it, followed directly by the string
   "()" with a cyan background.  Typing DEL to delete the final ")"
   displays the "Eval: " prompt again, the "(" with a hollow box over it
   vanishes, and the remaining "(" has no cyan overlay.  Typing any
   characters and then ")" at the end again makes the prompt vanishes,
   "(" with the hollow box and the cyan overlay return.  Lather, rinse,
   repeat...

Steve Berman





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64547: `show-paren-mode` thinks that a paren is offscreen in `M-:` when it isn't
  2023-07-10 13:26   ` Stephen Berman
@ 2023-07-10 14:17     ` Eli Zaretskii
  2023-07-14  3:03       ` okamsn--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2023-07-10 14:17 UTC (permalink / raw)
  To: Stephen Berman; +Cc: okamsn, 64547

> From: Stephen Berman <stephen.berman@gmx.net>
> Cc: Okamsn <okamsn@protonmail.com>,  64547@debbugs.gnu.org
> Date: Mon, 10 Jul 2023 15:26:34 +0200
> 
> 0. emacs -Q
> 1. M-x customize-option show-paren-style RET.  Choose "mixed" from the
>    Value Menu and set for current session.
> 2. M-x customize-option show-paren-context-when-offscreen RET.  Choose
>    "In overlay" from the Value Menu and set for current session.
> 3. M-x customize-option line-spacing RET.  Choose "Number" from the
>    Value Menu, enter 0.06 or greater and set for current session.
> 4. M-: ()
> => On typing ")" the "Eval: " prompt vanishes, the string "(" is
>    displayed with a hollow box over it, followed directly by the string
>    "()" with a cyan background.  Typing DEL to delete the final ")"
>    displays the "Eval: " prompt again, the "(" with a hollow box over it
>    vanishes, and the remaining "(" has no cyan overlay.  Typing any
>    characters and then ")" at the end again makes the prompt vanishes,
>    "(" with the hollow box and the cyan overlay return.  Lather, rinse,
>    repeat...

Thanks, should be fixed now on the emacs-29 branch.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64547: `show-paren-mode` thinks that a paren is offscreen in `M-:` when it isn't
  2023-07-10 14:17     ` Eli Zaretskii
@ 2023-07-14  3:03       ` okamsn--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-14  6:44         ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: okamsn--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-14  3:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64547, Stephen Berman

On 2023-07-10 14:17 UTC, Eli Zaretskii wrote:
>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: Okamsn <okamsn@protonmail.com>,  64547@debbugs.gnu.org
>> Date: Mon, 10 Jul 2023 15:26:34 +0200
>>
>> 0. emacs -Q
>> 1. M-x customize-option show-paren-style RET.  Choose "mixed" from the
>>     Value Menu and set for current session.
>> 2. M-x customize-option show-paren-context-when-offscreen RET.  Choose
>>     "In overlay" from the Value Menu and set for current session.
>> 3. M-x customize-option line-spacing RET.  Choose "Number" from the
>>     Value Menu, enter 0.06 or greater and set for current session.
>> 4. M-: ()
>> => On typing ")" the "Eval: " prompt vanishes, the string "(" is
>>     displayed with a hollow box over it, followed directly by the string
>>     "()" with a cyan background.  Typing DEL to delete the final ")"
>>     displays the "Eval: " prompt again, the "(" with a hollow box over it
>>     vanishes, and the remaining "(" has no cyan overlay.  Typing any
>>     characters and then ")" at the end again makes the prompt vanishes,
>>     "(" with the hollow box and the cyan overlay return.  Lather, rinse,
>>     repeat...
> 
> Thanks, should be fixed now on the emacs-29 branch.

Hello,

The change fixed it for the minibuffer, but also disabled it when the 
opening parenthesis was offscreen.  I think this is because
`(pos-visible-in-window-p openparen nil t)` seems to return nil in that 
case.

I got it to work by swapping

     (or (< (length part) 4)
         (and
          (< (nth 2 part) dfh4)
          (< (nth 3 part) dfh4)))

with

     (and (>= (length part) 4)
          (< (nth 2 part) dfh4)
          (< (nth 3 part) dfh4))

, which did not re-introduce the problem in the minibuffer.

Thank you.






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64547: `show-paren-mode` thinks that a paren is offscreen in `M-:` when it isn't
  2023-07-14  3:03       ` okamsn--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-14  6:44         ` Eli Zaretskii
  2023-07-15  1:06           ` okamsn--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2023-07-14  6:44 UTC (permalink / raw)
  To: okamsn; +Cc: 64547, stephen.berman

> Date: Fri, 14 Jul 2023 03:03:31 +0000
> From: okamsn@protonmail.com
> Cc: 64547@debbugs.gnu.org, Stephen Berman <stephen.berman@gmx.net>
> 
> On 2023-07-10 14:17 UTC, Eli Zaretskii wrote:
> > 
> > Thanks, should be fixed now on the emacs-29 branch.
> 
> Hello,
> 
> The change fixed it for the minibuffer, but also disabled it when the 
> opening parenthesis was offscreen.  I think this is because
> `(pos-visible-in-window-p openparen nil t)` seems to return nil in that 
> case.

Disabled what?  Can you post a detailed recipe, and the description of
what you see and what you expected to see?  I'd like to make sure I
understand the issue we are discussing now.

Thanks.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64547: `show-paren-mode` thinks that a paren is offscreen in `M-:` when it isn't
  2023-07-14  6:44         ` Eli Zaretskii
@ 2023-07-15  1:06           ` okamsn--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-15  7:22             ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: okamsn--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-15  1:06 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64547, stephen.berman

On 2023-07-14 06:44 UTC, Eli Zaretskii wrote:
>> Date: Fri, 14 Jul 2023 03:03:31 +0000
>> From: okamsn@protonmail.com
>> Cc: 64547@debbugs.gnu.org, Stephen Berman <stephen.berman@gmx.net>
>>
>> On 2023-07-10 14:17 UTC, Eli Zaretskii wrote:
>>>
>>> Thanks, should be fixed now on the emacs-29 branch.
>>
>> Hello,
>>
>> The change fixed it for the minibuffer, but also disabled it when the
>> opening parenthesis was offscreen.  I think this is because
>> `(pos-visible-in-window-p openparen nil t)` seems to return nil in that
>> case.
> 
> Disabled what?  Can you post a detailed recipe, and the description of
> what you see and what you expected to see?  I'd like to make sure I
> understand the issue we are discussing now.
> 
> Thanks.

Sorry, I meant that the new change stopped showing the overlay in the 
normal buffers in addition to the minibuffer. I was expecting it to only 
stop showing the overlay for the minibuffer when the opening parenthesis 
was visible.

These are the steps I took:

1) Start `emacs -q` without the new change to paren.el.

2) Set `show-paren-context-when-offscreen` to `overlay`.

3) In a normal buffer (not the minibuffer), move to the end of a long 
expression so that the starting parenthesis is no longer on the screen 
and is not visible.

4) See the overlay, as expected.

5) Move inside the expression so that the overlay is no longer shown.

6) Evaluate the new definition of `show-paren-function`.

7) Move back to the end of the long expression.

8) See that the overlay is no longer shown.


I expected to see that the overlay would still be shown for the opening 
parenthesis that is completely unseen.

I think that this happens because there is an expression `(not ... (or 
(< (length part) 4) ...))` which resolves to `nil` when the parenthesis 
is not visible and not partially visible, from what I can tell.

Does this make sense?

Thank you.









^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64547: `show-paren-mode` thinks that a paren is offscreen in `M-:` when it isn't
  2023-07-15  1:06           ` okamsn--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-15  7:22             ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2023-07-15  7:22 UTC (permalink / raw)
  To: okamsn; +Cc: stephen.berman, 64547-done

> Date: Sat, 15 Jul 2023 01:06:54 +0000
> From: okamsn@protonmail.com
> Cc: 64547@debbugs.gnu.org, stephen.berman@gmx.net
> 
> 1) Start `emacs -q` without the new change to paren.el.
> 
> 2) Set `show-paren-context-when-offscreen` to `overlay`.
> 
> 3) In a normal buffer (not the minibuffer), move to the end of a long 
> expression so that the starting parenthesis is no longer on the screen 
> and is not visible.
> 
> 4) See the overlay, as expected.
> 
> 5) Move inside the expression so that the overlay is no longer shown.
> 
> 6) Evaluate the new definition of `show-paren-function`.
> 
> 7) Move back to the end of the long expression.
> 
> 8) See that the overlay is no longer shown.
> 
> 
> I expected to see that the overlay would still be shown for the opening 
> parenthesis that is completely unseen.
> 
> I think that this happens because there is an expression `(not ... (or 
> (< (length part) 4) ...))` which resolves to `nil` when the parenthesis 
> is not visible and not partially visible, from what I can tell.
> 
> Does this make sense?

Thanks, now fixed as you suggested, and closing the bug.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-07-15  7:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-09 19:49 bug#64547: `show-paren-mode` thinks that a paren is offscreen in `M-:` when it isn't Okamsn via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-10 12:15 ` Eli Zaretskii
2023-07-10 13:26   ` Stephen Berman
2023-07-10 14:17     ` Eli Zaretskii
2023-07-14  3:03       ` okamsn--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-14  6:44         ` Eli Zaretskii
2023-07-15  1:06           ` okamsn--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-15  7:22             ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).