From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: `vertical-motion', `goto-line' set point to invisible text
Date: Mon, 04 Jul 2011 06:08:45 +0400 [thread overview]
Message-ID: <87aacu4x1u.fsf@gmail.com> (raw)
In-Reply-To: <837h7zqyil.fsf@gnu.org>
On Sun, 03 Jul 2011 16:33:54 +0300, Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
> > Cc: emacs-devel@gnu.org
> > Date: Sun, 03 Jul 2011 11:31:23 +0400
> >
> > Is there a way to ask Emacs to sync point to visible position, so
> > that I do not have to do it by hand?
>
> Not sure what that means. Can you explain more about what you are
> looking for?
>
I am looking for a function that does something like what you described
below. I.e. moves point to the next suitable character in the given
direction. At the moment I do it with smth like:
;; if point is invisible, skip forward to visible text
(while (invisible-p p)
(setq p (next-single-char-property-change p 'invisible)))
> > I.e. M-: (progn (backward-char) (point)) works fine. But after that
> > M-: (point) returns another position which corresponds to the
> > beginning of the hidden line. I guess this has to do command loop I
> > know nothing about.
>
> When a command finishes and Emacs is idle (i.e. has nothing else to
> do), it examines the position of point. If it finds that point is on
> some character where it shouldn't be, it moves point to the next
> "suitable" character in the direction of last move. Text where point
> shouldn't be includes: invisible text, non-base character that belongs
> to a composed character, and text covered by a "replacing" `display'
> property.
>
Thanks for the detailed explanation.
> > IMO Emacs should not touch the point in this case, because it is
> > already visible. Sounds like a bug to me.
>
> If no one comes up with a plausible explanation until tomorrow, feel
> free to submit a bug report.
>
ok
> Btw, I just tried past releases, and Emacs 21.4 didn't have this
> problem, but Emacs 22.3 did. I guess that's a side effect of point
> adjustment described above, which Emacs 21.4 didn't have: in Emacs
> 21.4, the cursor stays put for several C-f or C-b commands, as long as
> point is on invisible text.
I will put a reference in the bug report.
Regards,
Dmitry
next prev parent reply other threads:[~2011-07-04 2:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-03 2:59 `vertical-motion', `goto-line' set point to invisible text Dmitry Kurochkin
2011-07-03 6:55 ` Eli Zaretskii
2011-07-03 7:31 ` Dmitry Kurochkin
2011-07-03 13:33 ` Eli Zaretskii
2011-07-04 2:08 ` Dmitry Kurochkin [this message]
2011-07-03 14:50 ` Stefan Monnier
2011-07-03 15:14 ` Eli Zaretskii
2011-07-04 14:01 ` Stefan Monnier
2011-07-04 15:14 ` Eli Zaretskii
2011-07-04 18:10 ` Stefan Monnier
2011-07-04 20:06 ` Eli Zaretskii
2011-07-04 20:06 ` Eli Zaretskii
2011-07-05 2:22 ` Dmitry Kurochkin
2011-07-05 2:55 ` Eli Zaretskii
2011-07-05 3:52 ` Dmitry Kurochkin
2011-07-05 7:56 ` Eli Zaretskii
2011-07-09 13:13 ` Dmitry Kurochkin
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=87aacu4x1u.fsf@gmail.com \
--to=dmitry.kurochkin@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/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).