all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs master, faces with :extend t let cursor vanish at EOL?!
@ 2019-10-22 19:52 Ingo Lohmar
  2019-10-22 20:17   ` Kaushal Modi
  2020-02-04 10:07 ` Bastien
  0 siblings, 2 replies; 10+ messages in thread
From: Ingo Lohmar @ 2019-10-22 19:52 UTC (permalink / raw)
  To: emacs-orgmode

I am writing to the org-mode list first, because I have only been able
to reproduce this problem in org-mode.

With a recent Emacs master build, faces can have the :extend t property
to indicated that they should extend after the newline.  This is useful
for a user to customize, eg, for `org-block', and it also applies to
default faces like `region', `highlight' or `secondary-selection'.

Using this with a current elpa pkg of org-mode, and setting :extend t on
faces like `org-block`, "often" the cursor vanishes at the EOL of a line
using such a face.  It reliably happens for `org-block', only sometimes
for `secondary-selection'.

Has anybody else experienced that as well, or do you have any pointers
on how to further investigate this?  I think I remember that org-mode does
something with text overlays, but I can't relate that to what I see.

There might also be an issue with face inheritance and the new :extend
attribute --- I might post on emacs-devel to get a better idea of that
as well.

Thanks,
Ingo

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

* Re: [O] Emacs master, faces with :extend t let cursor vanish at EOL?!
  2019-10-22 19:52 Emacs master, faces with :extend t let cursor vanish at EOL?! Ingo Lohmar
@ 2019-10-22 20:17   ` Kaushal Modi
  2020-02-04 10:07 ` Bastien
  1 sibling, 0 replies; 10+ messages in thread
From: Kaushal Modi @ 2019-10-22 20:17 UTC (permalink / raw)
  To: Emacs developers; +Cc: emacs-org list, Ingo Lohmar

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

On Tue, Oct 22, 2019 at 3:52 PM Ingo Lohmar <ingo.lohmar@posteo.net> wrote:

> I am writing to the org-mode list first, because I have only been able
> to reproduce this problem in org-mode.
>
> With a recent Emacs master build, faces can have the :extend t property
> to indicated that they should extend after the newline.  This is useful
> for a user to customize, eg, for `org-block', and it also applies to
> default faces like `region', `highlight' or `secondary-selection'.
>

Hello,

I have been seeing this issue too, but I haven't found time to create a
proper bug report for it.

But now that you have this email, I am forwarding this to the Emacs devel
list too.

The issue occurs because of the new :extend feature for faces to extend
till end of lines.

With that enabled, I have also seen that the cursor "hides" automatically
only at end of lines inside the Org source blocks. i.e within

#+begin_src emacs-lisp
(message "hello")X
#+end_src

Above: X is where the cursor would be, but it would not be visible (with
the :extend t added to the org-block face). The cursor would show up again
on doing C-b i.e. bringing it to any column position other than the EOL.


> Using this with a current elpa pkg of org-mode, and setting :extend t on
> faces like `org-block`, "often" the cursor vanishes at the EOL of a line
> using such a face.  It reliably happens for `org-block', only sometimes
> for `secondary-selection'.
>
> Has anybody else experienced that as well, or do you have any pointers
> on how to further investigate this?  I think I remember that org-mode does
> something with text overlays, but I can't relate that to what I see.
>
> There might also be an issue with face inheritance and the new :extend
> attribute --- I might post on emacs-devel to get a better idea of that
> as well.
>
> Thanks,
> Ingo
>
>

[-- Attachment #2: Type: text/html, Size: 2593 bytes --]

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

* Re: Emacs master, faces with :extend t let cursor vanish at EOL?!
@ 2019-10-22 20:17   ` Kaushal Modi
  0 siblings, 0 replies; 10+ messages in thread
From: Kaushal Modi @ 2019-10-22 20:17 UTC (permalink / raw)
  To: Emacs developers; +Cc: emacs-org list, Ingo Lohmar

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

On Tue, Oct 22, 2019 at 3:52 PM Ingo Lohmar <ingo.lohmar@posteo.net> wrote:

> I am writing to the org-mode list first, because I have only been able
> to reproduce this problem in org-mode.
>
> With a recent Emacs master build, faces can have the :extend t property
> to indicated that they should extend after the newline.  This is useful
> for a user to customize, eg, for `org-block', and it also applies to
> default faces like `region', `highlight' or `secondary-selection'.
>

Hello,

I have been seeing this issue too, but I haven't found time to create a
proper bug report for it.

But now that you have this email, I am forwarding this to the Emacs devel
list too.

The issue occurs because of the new :extend feature for faces to extend
till end of lines.

With that enabled, I have also seen that the cursor "hides" automatically
only at end of lines inside the Org source blocks. i.e within

#+begin_src emacs-lisp
(message "hello")X
#+end_src

Above: X is where the cursor would be, but it would not be visible (with
the :extend t added to the org-block face). The cursor would show up again
on doing C-b i.e. bringing it to any column position other than the EOL.


> Using this with a current elpa pkg of org-mode, and setting :extend t on
> faces like `org-block`, "often" the cursor vanishes at the EOL of a line
> using such a face.  It reliably happens for `org-block', only sometimes
> for `secondary-selection'.
>
> Has anybody else experienced that as well, or do you have any pointers
> on how to further investigate this?  I think I remember that org-mode does
> something with text overlays, but I can't relate that to what I see.
>
> There might also be an issue with face inheritance and the new :extend
> attribute --- I might post on emacs-devel to get a better idea of that
> as well.
>
> Thanks,
> Ingo
>
>

[-- Attachment #2: Type: text/html, Size: 2593 bytes --]

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

* Re: Emacs master, faces with :extend t let cursor vanish at EOL?!
  2019-10-22 20:17   ` Kaushal Modi
  (?)
@ 2019-10-23 16:06   ` Eli Zaretskii
  2019-10-31 16:55     ` Eric S Fraga
  -1 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2019-10-23 16:06 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: emacs-devel, emacs-orgmode, ingo.lohmar

> From: Kaushal Modi <kaushal.modi@gmail.com>
> Date: Tue, 22 Oct 2019 16:17:04 -0400
> Cc: emacs-org list <emacs-orgmode@gnu.org>,
>  Ingo Lohmar <ingo.lohmar@posteo.net> 

I suggest not to cross-post to 2 mailing lists.

> The issue occurs because of the new :extend feature for faces to extend till end of lines.
> 
> With that enabled, I have also seen that the cursor "hides" automatically only at end of lines inside the Org
> source blocks. i.e within
> 
> #+begin_src emacs-lisp
> (message "hello")X
> #+end_src
> 
> Above: X is where the cursor would be, but it would not be visible (with the :extend t added to the org-block
> face). The cursor would show up again on doing C-b i.e. bringing it to any column position other than the
> EOL.

I tried to reproduce this, but couldn't.  The OP says "often", so I
understand the problem is not 100% reproducible and the exact
situations in which it arises are not yet known.

So I suggest to find a reproducible recipe and then report it with
report-emacs-bug, so that the problem could be debugged and solved.

Thanks.



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

* Re: Emacs master, faces with :extend t let cursor vanish at EOL?!
  2019-10-23 16:06   ` Eli Zaretskii
@ 2019-10-31 16:55     ` Eric S Fraga
  2019-10-31 17:10       ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Eric S Fraga @ 2019-10-31 16:55 UTC (permalink / raw)
  To: emacs-devel

On Wednesday, 23 Oct 2019 at 19:06, Eli Zaretskii wrote:
>> From: Kaushal Modi <kaushal.modi@gmail.com>
>> The issue occurs because of the new :extend feature for faces to extend till end of lines.

[...]

> I tried to reproduce this, but couldn't.  The OP says "often", so I
> understand the problem is not 100% reproducible and the exact
> situations in which it arises are not yet known.
>
> So I suggest to find a reproducible recipe and then report it with
> report-emacs-bug, so that the problem could be debugged and solved.

(emacs up to date from git a few minutes ago)

I see this, in a reproducible way, when using hl-line-mode in
combination with visual-line-mode and evil-mode.  In Evil's "normal"
mode, my cursor is a block.  This block disappears when at EOL if the
hl-line face is extended to include the EOL position (by modifying
hl-line-range-function).  I have the following:

#+begin_src emacs-lisp
  (defun esf/get-visual-line-range ()
    (let (b e r)
      (save-excursion
        (beginning-of-visual-line)
        (setq b (point))
        (end-of-visual-line)
        (setq e (point))
        ;; (setq e (+ 1 (point)))
        ;; (beginning-of-line)
        ;; (setq r (point))                  ;real beginning of line
        ;; (if (< r b) (setq b (+ b 1)))     ;adjust to avoid extension backwards
        )
      (cons b e)))
  (setq hl-line-range-function #'esf/get-visual-line-range)
#+end_src

If I uncomment the first commented line, and comment out the one above,
I get the hl-line face extended very nicely to the edge of the window
*but* my cursor disappears if it is past the last text character on the
line.  If I keep the code as it is, the hl-line face only covers the
text, it is not extended, and the cursor is visible.

Aside: the other bits commented out are to deal with the face sometimes
extending backwards onto the previous line; another edge effect...

thanks,
eric

-- 
Eric S Fraga via Emacs 27.0.50 & org 9.2.6 on Debian bullseye/sid




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

* Re: Emacs master, faces with :extend t let cursor vanish at EOL?!
  2019-10-31 16:55     ` Eric S Fraga
@ 2019-10-31 17:10       ` Eli Zaretskii
  2019-10-31 17:47         ` Eric S Fraga
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2019-10-31 17:10 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-devel

> From: Eric S Fraga <e.fraga@ucl.ac.uk>
> Date: Thu, 31 Oct 2019 16:55:47 +0000
> 
> #+begin_src emacs-lisp
>   (defun esf/get-visual-line-range ()
>     (let (b e r)
>       (save-excursion
>         (beginning-of-visual-line)
>         (setq b (point))
>         (end-of-visual-line)
>         (setq e (point))
>         ;; (setq e (+ 1 (point)))
>         ;; (beginning-of-line)
>         ;; (setq r (point))                  ;real beginning of line
>         ;; (if (< r b) (setq b (+ b 1)))     ;adjust to avoid extension backwards
>         )
>       (cons b e)))
>   (setq hl-line-range-function #'esf/get-visual-line-range)
> #+end_src
> 
> If I uncomment the first commented line, and comment out the one above,
> I get the hl-line face extended very nicely to the edge of the window
> *but* my cursor disappears if it is past the last text character on the
> line.  If I keep the code as it is, the hl-line face only covers the
> text, it is not extended, and the cursor is visible.

I cannot reproduce any of this, sorry.  Could you please show a step
by step recipe, starting from "emacs -Q", then evaluating your
function, loading hl-line, turning it on, etc. -- whatever needs to be
done to reproduce the problem, with all the details?

Thanks.



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

* Re: Emacs master, faces with :extend t let cursor vanish at EOL?!
  2019-10-31 17:10       ` Eli Zaretskii
@ 2019-10-31 17:47         ` Eric S Fraga
  0 siblings, 0 replies; 10+ messages in thread
From: Eric S Fraga @ 2019-10-31 17:47 UTC (permalink / raw)
  To: emacs-devel

On Thursday, 31 Oct 2019 at 19:10, Eli Zaretskii wrote:
> I cannot reproduce any of this, sorry.  Could you please show a step
> by step recipe, starting from "emacs -Q", then evaluating your
> function, loading hl-line, turning it on, etc. -- whatever needs to be
> done to reproduce the problem, with all the details?

Okay, I will try but not today unfortunately.  The possible missing
ingredient was that the buffer was in org mode with org-indent-mode set.

-- 
Eric S Fraga via Emacs 27.0.50 & org 9.2.6 on Debian bullseye/sid




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

* Re: Emacs master, faces with :extend t let cursor vanish at EOL?!
  2019-10-22 19:52 Emacs master, faces with :extend t let cursor vanish at EOL?! Ingo Lohmar
  2019-10-22 20:17   ` Kaushal Modi
@ 2020-02-04 10:07 ` Bastien
  2020-02-04 19:27   ` Ingo Lohmar
  1 sibling, 1 reply; 10+ messages in thread
From: Bastien @ 2020-02-04 10:07 UTC (permalink / raw)
  To: Ingo Lohmar; +Cc: emacs-orgmode

Hi Ingo,

Ingo Lohmar <ingo.lohmar@posteo.net> writes:

> Using this with a current elpa pkg of org-mode, and setting :extend t on
> faces like `org-block`, "often" the cursor vanishes at the EOL of a line
> using such a face.  It reliably happens for `org-block', only sometimes
> for `secondary-selection'.

can you keep track of this issue and related discussions?

I doubt there is anything we can do in Org itself, but perhaps a hint
in a docstring could help.

Let us know, thanks,

-- 
 Bastien

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

* Re: Emacs master, faces with :extend t let cursor vanish at EOL?!
  2020-02-04 10:07 ` Bastien
@ 2020-02-04 19:27   ` Ingo Lohmar
  2020-02-04 23:16     ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Ingo Lohmar @ 2020-02-04 19:27 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

On Tue, Feb 04 2020 11:07 (+0100), Bastien wrote:

> Hi Ingo,
>
> Ingo Lohmar <ingo.lohmar@posteo.net> writes:
>
>> Using this with a current elpa pkg of org-mode, and setting :extend t on
>> faces like `org-block`, "often" the cursor vanishes at the EOL of a line
>> using such a face.  It reliably happens for `org-block', only sometimes
>> for `secondary-selection'.
>
> can you keep track of this issue and related discussions?
>
> I doubt there is anything we can do in Org itself, but perhaps a hint
> in a docstring could help.
>
> Let us know, thanks,

Hi Bastien,

I am confused, I thought this was fixed, but I have a really hard to find
the bug..

Some time later: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38330

Best,
Ingo

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

* Re: Emacs master, faces with :extend t let cursor vanish at EOL?!
  2020-02-04 19:27   ` Ingo Lohmar
@ 2020-02-04 23:16     ` Bastien
  0 siblings, 0 replies; 10+ messages in thread
From: Bastien @ 2020-02-04 23:16 UTC (permalink / raw)
  To: Ingo Lohmar; +Cc: emacs-orgmode

Hi Ingo,

Ingo Lohmar <ingo.lohmar@posteo.net> writes:

> I am confused, I thought this was fixed, but I have a really hard to find
> the bug..
>
> Some time later: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38330

Yes, it is fixed, I couldn't find the reference for this bug.

-- 
 Bastien

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

end of thread, other threads:[~2020-02-04 23:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22 19:52 Emacs master, faces with :extend t let cursor vanish at EOL?! Ingo Lohmar
2019-10-22 20:17 ` [O] " Kaushal Modi
2019-10-22 20:17   ` Kaushal Modi
2019-10-23 16:06   ` Eli Zaretskii
2019-10-31 16:55     ` Eric S Fraga
2019-10-31 17:10       ` Eli Zaretskii
2019-10-31 17:47         ` Eric S Fraga
2020-02-04 10:07 ` Bastien
2020-02-04 19:27   ` Ingo Lohmar
2020-02-04 23:16     ` Bastien

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.