unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [O] Emacs master, faces with :extend t let cursor vanish at EOL?!
       [not found] <8736fko8wr.fsf@kenko.localhost.com>
@ 2019-10-22 20:17 ` Kaushal Modi
  2019-10-23 16:06   ` Eli Zaretskii
  0 siblings, 1 reply; 5+ 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] 5+ messages in thread

* Re: Emacs master, faces with :extend t let cursor vanish at EOL?!
  2019-10-22 20:17 ` [O] Emacs master, faces with :extend t let cursor vanish at EOL?! Kaushal Modi
@ 2019-10-23 16:06   ` Eli Zaretskii
  2019-10-31 16:55     ` Eric S Fraga
  0 siblings, 1 reply; 5+ 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] 5+ 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; 5+ 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] 5+ 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; 5+ 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] 5+ 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; 5+ 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] 5+ messages in thread

end of thread, other threads:[~2019-10-31 17:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <8736fko8wr.fsf@kenko.localhost.com>
2019-10-22 20:17 ` [O] Emacs master, faces with :extend t let cursor vanish at EOL?! 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

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).