unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Redisplay loop with an unicode overlay-arrow-string
@ 2022-04-21 19:16 Yuri D'Elia
  2022-04-21 20:21 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Yuri D'Elia @ 2022-04-21 19:16 UTC (permalink / raw)
  To: emacs-devel

I'm disabling the left fringe to force using the overlay-arrow-string
(due to the fringe being unreadable on hidpi displays).

At some point I thought of being smart and attempt to:

  (setq overlay-arrow-string "🡆") ; RIGHTWARDS HEAVY ARROW

since it's an uncommon/heavy character (while still being narrower than
"=>"). Or just in case it's not readable for you, a more commonly
available character:

  (setq overlay-arrow-string "⮕") ; RIGHTWARDS BLACK ARROW

This results in an endless/unrecoverable redisplay loop on my current
config, hanging emacs.

To trigger on an emacs -q, evaluate this inside a buffer:

  (fringe-mode 0) ; force-disable the fringe
  (setq overlay-arrow-string "⮕")
  (setq overlay-arrow-position
        (set-marker (or overlay-arrow-position (make-marker))
                    (line-beginning-position)))




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

* Re: Redisplay loop with an unicode overlay-arrow-string
  2022-04-21 19:16 Redisplay loop with an unicode overlay-arrow-string Yuri D'Elia
@ 2022-04-21 20:21 ` Eli Zaretskii
  2022-04-21 21:25   ` Yuri D'Elia
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2022-04-21 20:21 UTC (permalink / raw)
  To: Yuri D'Elia; +Cc: emacs-devel

> From: Yuri D'Elia <wavexx@thregr.org>
> Date: Thu, 21 Apr 2022 21:16:46 +0200
> 
>   (setq overlay-arrow-string "⮕") ; RIGHTWARDS BLACK ARROW
> 
> This results in an endless/unrecoverable redisplay loop on my current
> config, hanging emacs.
> 
> To trigger on an emacs -q, evaluate this inside a buffer:
> 
>   (fringe-mode 0) ; force-disable the fringe
>   (setq overlay-arrow-string "⮕")
>   (setq overlay-arrow-position
>         (set-marker (or overlay-arrow-position (make-marker))
>                     (line-beginning-position)))

Thanks, should now be fixed on the release branch.

(And PLEASE always report bugs using "M-x report-emacs-bug".)



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

* Re: Redisplay loop with an unicode overlay-arrow-string
  2022-04-21 20:21 ` Eli Zaretskii
@ 2022-04-21 21:25   ` Yuri D'Elia
  2022-04-22  1:25     ` Yuan Fu
  2022-04-22  6:07     ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Yuri D'Elia @ 2022-04-21 21:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On Thu, Apr 21 2022, Eli Zaretskii wrote:
> Thanks, should now be fixed on the release branch.

Seems to be fixed for the single character case, but if you try with two
unicode chars it doesn't always work as expected:

  (setq overlay-arrow-string "━━") ; only one char shown
  (setq overlay-arrow-string " ━") ; two shown
  (setq overlay-arrow-string "━ ") ; one shown

> (And PLEASE always report bugs using "M-x report-emacs-bug".)

Sorry about this, I wasn't even sure this was a bug at first (I noticed
this due to some error thrown within xref which was using the
arrow-string). Then I wasn't even sure this was supposed to work at
all..




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

* Re: Redisplay loop with an unicode overlay-arrow-string
  2022-04-21 21:25   ` Yuri D'Elia
@ 2022-04-22  1:25     ` Yuan Fu
  2022-04-22  9:49       ` Yuri D'Elia
  2022-04-22  6:07     ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Yuan Fu @ 2022-04-22  1:25 UTC (permalink / raw)
  To: Yuri D'Elia; +Cc: Eli Zaretskii, emacs-devel

> 
>> (And PLEASE always report bugs using "M-x report-emacs-bug".)
> 
> Sorry about this, I wasn't even sure this was a bug at first (I noticed
> this due to some error thrown within xref which was using the
> arrow-string). Then I wasn't even sure this was supposed to work at
> all..
> 

I believe the metric is “if you are unsure if it’s a bug report, it’s a bug report” ;-)

Yuan


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

* Re: Redisplay loop with an unicode overlay-arrow-string
  2022-04-21 21:25   ` Yuri D'Elia
  2022-04-22  1:25     ` Yuan Fu
@ 2022-04-22  6:07     ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2022-04-22  6:07 UTC (permalink / raw)
  To: Yuri D'Elia; +Cc: emacs-devel

> From: Yuri D'Elia <wavexx@thregr.org>
> Cc: emacs-devel@gnu.org
> Date: Thu, 21 Apr 2022 23:25:52 +0200
> 
> On Thu, Apr 21 2022, Eli Zaretskii wrote:
> > Thanks, should now be fixed on the release branch.
> 
> Seems to be fixed for the single character case, but if you try with two
> unicode chars it doesn't always work as expected:
> 
>   (setq overlay-arrow-string "━━") ; only one char shown
>   (setq overlay-arrow-string " ━") ; two shown
>   (setq overlay-arrow-string "━ ") ; one shown

Fixed, thanks.

> > (And PLEASE always report bugs using "M-x report-emacs-bug".)
> 
> Sorry about this, I wasn't even sure this was a bug at first (I noticed
> this due to some error thrown within xref which was using the
> arrow-string). Then I wasn't even sure this was supposed to work at
> all..

Crashes and infloops in redisplay cannot possibly be anything but
bugs, right?



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

* Re: Redisplay loop with an unicode overlay-arrow-string
  2022-04-22  1:25     ` Yuan Fu
@ 2022-04-22  9:49       ` Yuri D'Elia
  2022-04-22 10:46         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Yuri D'Elia @ 2022-04-22  9:49 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Eli Zaretskii, emacs-devel

On Thu, Apr 21 2022, Yuan Fu wrote:
> I believe the metric is “if you are unsure if it’s a bug report, it’s
> a bug report” ;-)

Heh, true, although after years of "try it within emacs -q" and seeing
the behavior changing _drammatically_, I know better that most of the
time the issue is some of my elisp customization or code, somewhere,
sometimes not even remotely related such as my build ;))

I swear I tried the unicode arrow somehow. How I did it? No idea.. it
hangs in any way I set it now ;)).



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

* Re: Redisplay loop with an unicode overlay-arrow-string
  2022-04-22  9:49       ` Yuri D'Elia
@ 2022-04-22 10:46         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2022-04-22 10:46 UTC (permalink / raw)
  To: Yuri D'Elia; +Cc: casouri, emacs-devel

> From: Yuri D'Elia <wavexx@thregr.org>
> Date: Fri, 22 Apr 2022 11:49:37 +0200
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
> 
> I swear I tried the unicode arrow somehow. How I did it? No idea.. it
> hangs in any way I set it now ;)).

It only hangs (well, hanged) if the characters involved use more than
one byte in its internal representation, and then only if the byte
index of some character is greater than the index of the last
characters in the string.  The hang is (was) caused by
get-text-property, called by the code, signaling an error due to
invalid character index, which would then trigger another redisplay
cycle, which will then cause another error, etc. etc.



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

end of thread, other threads:[~2022-04-22 10:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-21 19:16 Redisplay loop with an unicode overlay-arrow-string Yuri D'Elia
2022-04-21 20:21 ` Eli Zaretskii
2022-04-21 21:25   ` Yuri D'Elia
2022-04-22  1:25     ` Yuan Fu
2022-04-22  9:49       ` Yuri D'Elia
2022-04-22 10:46         ` Eli Zaretskii
2022-04-22  6:07     ` 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).