emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Newlines after links are fontified with the org-link face after an incremental search
@ 2024-02-02  7:03 Rohit Patnaik
  2024-02-02 13:23 ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Rohit Patnaik @ 2024-02-02  7:03 UTC (permalink / raw)
  To: emacs-orgmode

Hello everyone,

I've noticed a potential regression in the way that org-mode fontifies links in
the latest git main branch version of org-mode. When the user conducts an
incremental search that matches a link that runs to the end of the line, for 
some reason the =org-link= face is extended to cover the newline as well.

Detailed repro steps:
1. Run =make repro= from the =main= branch
2. Switch the scratch buffer to org-mode with =M-x org-mode=
3. Add two lines
   - The first line should be a link, for example:
     [[https://www.google.com][Link]]
   - The second line should be a blank line
4. Place the point at the beginning of the first line
5. Hit =C-s= to begin an incremental search and search for the link description
   (i.e. =Link=)
6. Hit =RET= to leave the search
7. Note that the link underline now seems to extend past the end of the link
   text
8. Place the point at the end of the line and hit =M-x describe-char=. You
   should see that the character is a =C-j=, and the face is =org-link=

The above result does not occur when I check out the =release_9.6.17= tag, which
is why I think it might be a regression. 

My version of emacs is: 

GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.17.8, 
Xaw3d scroll bars) of 2023-08-02

My operating system is Fedora Linux 39, running Gnome 45.3 on Wayland.

Thanks,
Rohit Patnaik


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

* Re: [BUG] Newlines after links are fontified with the org-link face after an incremental search
  2024-02-02  7:03 [BUG] Newlines after links are fontified with the org-link face after an incremental search Rohit Patnaik
@ 2024-02-02 13:23 ` Ihor Radchenko
  2024-02-02 16:30   ` Rohit Patnaik
  0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2024-02-02 13:23 UTC (permalink / raw)
  To: Rohit Patnaik; +Cc: emacs-orgmode

"Rohit Patnaik" <quanticle@quanticle.net> writes:

> I've noticed a potential regression in the way that org-mode fontifies links in
> the latest git main branch version of org-mode. When the user conducts an
> incremental search that matches a link that runs to the end of the line, for 
> some reason the =org-link= face is extended to cover the newline as well.
>
> Detailed repro steps:
> 1. Run =make repro= from the =main= branch
> 2. Switch the scratch buffer to org-mode with =M-x org-mode=
> 3. Add two lines
>    - The first line should be a link, for example:
>      [[https://www.google.com][Link]]
>    - The second line should be a blank line
> 4. Place the point at the beginning of the first line
> 5. Hit =C-s= to begin an incremental search and search for the link description
>    (i.e. =Link=)
> 6. Hit =RET= to leave the search
> 7. Note that the link underline now seems to extend past the end of the link
>    text

Fixed, on main; for Emacs >=29. Will not be fixed for earlier Emacs versions.

isearch + folding is very hard to make work reliably. We need to have
ugly workarounds. And not only for isearch - a number of other parts of
Emacs and third-party code exclusively support overlay folding.

Considering that overlays are no longer performance bottleneck, switched
back to using overlays for folding by default, except in Emacs <=28
where the overlays were slow. After Emacs 31 is released, folding via
text properties will be removed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [BUG] Newlines after links are fontified with the org-link face after an incremental search
  2024-02-02 13:23 ` Ihor Radchenko
@ 2024-02-02 16:30   ` Rohit Patnaik
  2024-02-25 20:34     ` Rohit Patnaik
  0 siblings, 1 reply; 6+ messages in thread
From: Rohit Patnaik @ 2024-02-02 16:30 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

> Fixed, on main; for Emacs >=29. Will not be fixed for earlier Emacs versions.

I've confirmed that it's fixed. Thanks so much for the fast turnaround!

Rohit Patnaik


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

* Re: [BUG] Newlines after links are fontified with the org-link face after an incremental search
  2024-02-02 16:30   ` Rohit Patnaik
@ 2024-02-25 20:34     ` Rohit Patnaik
  2024-02-26 12:54       ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Rohit Patnaik @ 2024-02-25 20:34 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Hello,

It seems like this fix regressed as a result of commit
5d186b499dde97f59a91dc11f4c4a15113d29f4d. After I updated to the latest version
of org-mode again, I noticed that the fontification of newlines was back. When I
created a branch that reverted 5d186b499dde97f59a91dc11f4c4a15113d29f4d, the
fontification behaving as it should.

Thanks,
Rohit Patnaik


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

* Re: [BUG] Newlines after links are fontified with the org-link face after an incremental search
  2024-02-25 20:34     ` Rohit Patnaik
@ 2024-02-26 12:54       ` Ihor Radchenko
  2024-02-26 22:41         ` Rohit Patnaik
  0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2024-02-26 12:54 UTC (permalink / raw)
  To: Rohit Patnaik; +Cc: emacs-orgmode

"Rohit Patnaik" <quanticle@quanticle.net> writes:

> It seems like this fix regressed as a result of commit
> 5d186b499dde97f59a91dc11f4c4a15113d29f4d. After I updated to the latest version
> of org-mode again, I noticed that the fontification of newlines was back. When I
> created a branch that reverted 5d186b499dde97f59a91dc11f4c4a15113d29f4d, the
> fontification behaving as it should.

Thanks for the heads up!
Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=9f6894c10

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [BUG] Newlines after links are fontified with the org-link face after an incremental search
  2024-02-26 12:54       ` Ihor Radchenko
@ 2024-02-26 22:41         ` Rohit Patnaik
  0 siblings, 0 replies; 6+ messages in thread
From: Rohit Patnaik @ 2024-02-26 22:41 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Confirmed fixed.

Thanks for the quick turnaround!

Rohit


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

end of thread, other threads:[~2024-02-26 22:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-02  7:03 [BUG] Newlines after links are fontified with the org-link face after an incremental search Rohit Patnaik
2024-02-02 13:23 ` Ihor Radchenko
2024-02-02 16:30   ` Rohit Patnaik
2024-02-25 20:34     ` Rohit Patnaik
2024-02-26 12:54       ` Ihor Radchenko
2024-02-26 22:41         ` Rohit Patnaik

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).