From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Kurochkin Newsgroups: gmane.emacs.devel Subject: Re: `vertical-motion', `goto-line' set point to invisible text Date: Mon, 04 Jul 2011 06:08:45 +0400 Message-ID: <87aacu4x1u.fsf@gmail.com> References: <87ei28f4re.fsf@gmail.com> <87liwf4y7o.fsf@gmail.com> <837h7zqyil.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1309745569 9182 80.91.229.12 (4 Jul 2011 02:12:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Jul 2011 02:12:49 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 04 04:12:46 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QdYeT-0006of-IR for ged-emacs-devel@m.gmane.org; Mon, 04 Jul 2011 04:12:45 +0200 Original-Received: from localhost ([::1]:45625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdYeS-0004pj-FX for ged-emacs-devel@m.gmane.org; Sun, 03 Jul 2011 22:12:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdYao-0004Nu-My for emacs-devel@gnu.org; Sun, 03 Jul 2011 22:09:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdYan-0004Xk-7n for emacs-devel@gnu.org; Sun, 03 Jul 2011 22:08:58 -0400 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:48815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdYaj-0004WX-Qq; Sun, 03 Jul 2011 22:08:54 -0400 Original-Received: by bwd14 with SMTP id 14so4872579bwd.0 for ; Sun, 03 Jul 2011 19:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=CQi0sajoS/vp0C9Vb9WrTA2ZOYPj8Odahjj05K6WNMg=; b=fYUjlVzrBscCyR3VnQj+lScERzyhpJ9Eh7mlGMvjCa8i8z2CYci2BKW72S3oGQEbg9 R9jkxVaju+6BOXVMITk36G5dr+EVO7uMcbyfm6qDLpwd0M9cWx4z8ONU+a12pPbpfitg BfhK3D2Ug5akJWLZw6dRtRauOnQu/9QIKTGxA= Original-Received: by 10.204.156.25 with SMTP id u25mr5151753bkw.43.1309745331958; Sun, 03 Jul 2011 19:08:51 -0700 (PDT) Original-Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id l24sm5108756bkw.15.2011.07.03.19.08.49 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jul 2011 19:08:50 -0700 (PDT) In-Reply-To: <837h7zqyil.fsf@gnu.org> User-Agent: Notmuch/0.5-321-g41686e2 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:141513 Archived-At: On Sun, 03 Jul 2011 16:33:54 +0300, Eli Zaretskii wrote: > > From: Dmitry Kurochkin > > 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