unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 23079@debbugs.gnu.org, jonas@bernoul.li
Subject: bug#23079: 25.0.92; Movement commands leave cursor in invisible line
Date: Tue, 22 Mar 2016 12:16:12 -0400	[thread overview]
Message-ID: <jwvbn66qyqk.fsf-monnier+Inbox@gnu.org> (raw)
In-Reply-To: <871t72cxhh.fsf@web.de> (Michael Heerdegen's message of "Tue, 22 Mar 2016 17:02:02 +0100")

>> > Seems that works only for the invisible text property.  In Magit,
>> > they use overlays to make text invisible, and stickiness of text
>> > properties has not effect there.
>> For overlays, you need to use the insertion-type of the beg/end marker.
>> See the FRONT-ADVANCE and REAR-ADVANCE args of make-overlay.
> Hmm, that doesn't seem to work:

> (progn
>   (insert "111" "\n222\n")
>   (let ((beg (point)) end)
>     (insert "333\n444\n")
>     (setq end (point))
>     (insert "555\n666\n")
>     (overlay-put
>      (make-overlay beg end nil t t)
>      'invisible t)
>     (goto-char 1)
>     (hl-line-mode +1)))

The default "stickiness" of overlay boundaries is the inverse of that if
text-properties, for some reason.  So, this test above suffers from the
bug#19200, but other than that, it seems to work correctly for me
(i.e. it prefers putting point in front of "333" rather than in front
of "555").

And if I remove the "nil t t" args to make-overlay, then
point-adjustment correctly tries to put point in front of "555" instead
of putting it in front of "333".

At least, in my tests,


        Stefan


PS: Notice that the hl-line-highlighting is sometimes off, because it's
performed in post-command-hook, which is run *before* point-adjustment.
hl-line-mode should probably be changed to use pre-redisplay-function to
try and avoid this problem.





  reply	other threads:[~2016-03-22 16:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 20:19 bug#23079: 25.0.92; Movement commands leave cursor in invisible line Michael Heerdegen
2016-03-21 20:26 ` Michael Heerdegen
2016-03-21 21:11 ` Stefan Monnier
2016-03-21 22:29   ` Michael Heerdegen
2016-03-22  1:27     ` Stefan Monnier
2016-03-22 16:02       ` Michael Heerdegen
2016-03-22 16:16         ` Stefan Monnier [this message]
2016-03-22 16:48           ` Michael Heerdegen
2016-03-23  1:59             ` Stefan Monnier
2016-03-23  3:41               ` Eli Zaretskii
2016-03-23 11:23                 ` Stefan Monnier
2016-03-23 15:12                   ` Michael Heerdegen
2016-03-24  2:07                     ` Michael Heerdegen
2016-03-24 21:32                       ` Michael Heerdegen
2016-03-24 22:01                         ` Stefan Monnier
2016-03-25 11:42                           ` Jonas Bernoulli
2016-03-25 13:53                             ` Eli Zaretskii
2016-03-26 10:21                               ` Jonas Bernoulli
2016-03-21 22:54   ` Michael Heerdegen
2020-08-15  4:22   ` Stefan Kangas
2020-10-01 12:26     ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvbn66qyqk.fsf-monnier+Inbox@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=23079@debbugs.gnu.org \
    --cc=jonas@bernoul.li \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).