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: `vertical-motion', `goto-line' set point to invisible text Date: Sun, 03 Jul 2011 06:59:49 +0400 Message-ID: <87ei28f4re.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1309667509 9169 80.91.229.12 (3 Jul 2011 04:31:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 3 Jul 2011 04:31:49 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 03 06:31:45 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 1QdELR-0007tN-8V for ged-emacs-devel@m.gmane.org; Sun, 03 Jul 2011 06:31:45 +0200 Original-Received: from localhost ([::1]:56033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdELQ-0002r2-1Y for ged-emacs-devel@m.gmane.org; Sun, 03 Jul 2011 00:31:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdCud-0007At-Nt for emacs-devel@gnu.org; Sat, 02 Jul 2011 23:00:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdCuc-0002Gd-JG for emacs-devel@gnu.org; Sat, 02 Jul 2011 22:59:59 -0400 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:55570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdCuc-0002GZ-B0 for emacs-devel@gnu.org; Sat, 02 Jul 2011 22:59:58 -0400 Original-Received: by bwd14 with SMTP id 14so4461124bwd.0 for ; Sat, 02 Jul 2011 19:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:user-agent:date:message-id:mime-version :content-type; bh=yHdVlTNtMkUhx4IZR3YKMiScuaRGtieUevxxoQIzgRE=; b=nAOW9J4zpqlmhvaNmL6I+3Bfgmfeu7dWcIv3rcdZiBh8Lt+Eeu4CMFETg7jMYvbbvI 78pMy3Qdf56zY7C0iHB2FQur3wzYb2f5R+qbzYMpe4/9wP4RCJ6TCVypzQle+WtVrQ2i gYaF4rySwq26hrmh7ySBv/PpENMC360PrVK38= Original-Received: by 10.204.22.13 with SMTP id l13mr1714761bkb.175.1309661996877; Sat, 02 Jul 2011 19:59:56 -0700 (PDT) Original-Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id af13sm4332513bkc.19.2011.07.02.19.59.54 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 02 Jul 2011 19:59:55 -0700 (PDT) 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-Mailman-Approved-At: Sun, 03 Jul 2011 00:31:29 -0400 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:141479 Archived-At: Hi all. While working on notmuch [1] emacs client, I stumbled upon an unexpected behavior: `beginning-of-visual-line' places point to invisible text in the beginning to the line. I.e. you have: line1 line2 <--- this line is not visible line3 <--- point is on this line in this case, `beginning-of-visual-line' will set the position to start of line2 (which is invisible), not line3. It differs from what `move-beginning-of-line' and even does not match `line-beginning-position'. `beginning-of-visual-line' uses `vertical-motion' to do the job. `goto-line' has a similar behavior. I believe there are more functions like this. This does not look right to me. I expect these functions never set point inside invisible text and there should be some general way to protect from this. But perhaps I am wrong and we have to manually skip all invisible text forward after any point move? Here is a small test to demonstrate the issue: (progn (message "test begin") (switch-to-buffer "test") (insert "line1\nline2\nline3\n") (goto-line 2) (put-text-property (line-beginning-position) (line-beginning-position 2) 'invisible 'invis1) (goto-line 3) (message "point #1: %s" (point)) (add-to-invisibility-spec 'invis1) (move-beginning-of-line nil) (message "point #2: %s" (point)) (vertical-motion 0) (message "point #3: %s, invisible-p: %s" (point) (invisible-p (point))) (message "test end")) Regards, Dmitry [1] http://notmuchmail.org/