unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
Cc: 9034@debbugs.gnu.org
Subject: bug#9034: point adjustment (with invisible text) moves to the next line
Date: Wed, 25 Aug 2021 18:32:15 +0200	[thread overview]
Message-ID: <87tujd32pc.fsf@gnus.org> (raw)
In-Reply-To: <87iprb38sa.fsf@gmail.com> (Dmitry Kurochkin's message of "Sat, 09 Jul 2011 17:04:05 +0400")

Dmitry Kurochkin <dmitry.kurochkin@gmail.com> writes:

>   (progn (switch-to-buffer "test")
>          (insert "aline1\nbline2\ncline3\n")
>          (put-text-property 7 14 'invisible t) ; region [\nbline2]
>          (goto-char (point-min)))
>
> After that in the test buffer do M-: (progn (end-of-visual-line)
> (point)).  `end-of-visual-line' moves point to position 14 as expected.
> But after that the point is adjusted to position 15, as can be checked
> by C-x =.

(I'm going through old bug reports that unfortunately got weren't
resolved at the time.)

This problem is still present in Emacs 28, and as previously noted, any
command you do (with `M-:') makes point advance to the next line.  (It's
not 100% reproducible -- sometimes nothing happens, and sometimes it
advances.)

So `C-e' and then, for instance `M-: 4 RET' will advance point here.

Also as previously noted, if Vglobal_disable_point_adjustment is on,
then this doesn't happen, so the problem almost has to be here:

command_loop_1
...
      if (current_buffer == prev_buffer
	  && XBUFFER (XWINDOW (selected_window)->contents) == current_buffer
	  && last_point_position != PT
	  && NILP (Vdisable_point_adjustment)
	  && NILP (Vglobal_disable_point_adjustment))
	{
	  if (last_point_position > BEGV
	      && last_point_position < ZV
	      && (composition_adjust_point (last_point_position,
					    last_point_position)
		  != last_point_position))
	    /* The last point was temporarily set within a grapheme
	       cluster to prevent automatic composition.  To recover
	       the automatic composition, we must update the
	       display.  */
	    windows_or_buffers_changed = 21;
	  if (!already_adjusted)
	    adjust_point_for_property (last_point_position,
				       MODIFF != prev_modiff);
	}

I haven't tried to debug any further -- is it obvious to anybody what's
failing here, by any chance?  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  parent reply	other threads:[~2021-08-25 16:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-09 13:04 bug#9034: point adjustment after `end-of-visual-line' moves to the next line Dmitry Kurochkin
2011-07-11  4:16 ` Stefan Monnier
2011-07-11  8:27   ` Dmitry Kurochkin
2021-08-25 16:32 ` Lars Ingebrigtsen [this message]
2021-08-25 16:43   ` bug#9034: point adjustment (with invisible text) " Eli Zaretskii
2021-08-26 13:48     ` Lars Ingebrigtsen
2021-08-26 15:46       ` Eli Zaretskii
2021-08-26 16:33         ` Lars Ingebrigtsen
2021-08-26 16:48           ` Eli Zaretskii
2021-08-26 17:05             ` Lars Ingebrigtsen
2021-08-26 17:13               ` Eli Zaretskii

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=87tujd32pc.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=9034@debbugs.gnu.org \
    --cc=dmitry.kurochkin@gmail.com \
    /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).