From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Manheimer Newsgroups: gmane.emacs.devel Subject: move-beginning-of-line misbehaves on wrapped-line invisible text - recent cvs checkout Date: Thu, 12 Jan 2006 19:12:39 -0500 Message-ID: <2cd46e7f0601121612y386d057ft68324aeb352b777d@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_27189_28353084.1137111159020" X-Trace: sea.gmane.org 1137112720 24898 80.91.229.2 (13 Jan 2006 00:38:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 13 Jan 2006 00:38:40 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 13 01:38:36 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ExCxg-0007lG-0R for ged-emacs-devel@m.gmane.org; Fri, 13 Jan 2006 01:38:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ExCzm-0006ea-Iq for ged-emacs-devel@m.gmane.org; Thu, 12 Jan 2006 19:40:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ExCzG-0006eG-KM for emacs-devel@gnu.org; Thu, 12 Jan 2006 19:40:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ExCzE-0006dW-0H for emacs-devel@gnu.org; Thu, 12 Jan 2006 19:40:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ExCzD-0006dQ-RT for emacs-devel@gnu.org; Thu, 12 Jan 2006 19:40:11 -0500 Original-Received: from [66.249.92.194] (helo=uproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ExD26-0003Hz-Uv for emacs-devel@gnu.org; Thu, 12 Jan 2006 19:43:11 -0500 Original-Received: by uproxy.gmail.com with SMTP id u2so24707uge for ; Thu, 12 Jan 2006 16:37:59 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=OoMBMgHY7w2QIgDS8ZzxxfJrpECsHgW9CxpuKQzhHnEH3bLbq8x0JuMff9mroiaTidrnoox6OjvDH11OjChiitym9hjjYqKzyl7n3cZ51huCJpxAWlKH8Y0FNOgENmPi71QjsopfWbRUZIOsq+reZWBx1gvJ0FPjSLOqSM4iNxc= Original-Received: by 10.67.31.14 with SMTP id i14mr1055562ugj; Thu, 12 Jan 2006 16:12:39 -0800 (PST) Original-Received: by 10.66.220.6 with HTTP; Thu, 12 Jan 2006 16:12:39 -0800 (PST) Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:48977 Archived-At: ------=_Part_27189_28353084.1137111159020 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline i think i've found a bug in the behavior of move-beginning-of-line when crossing invisible text at or beyond the right window edge. i'm not sure exactly what is meant by the function's description, so don't know exactly what the right behavior is, but i know it behaves inconsistently, which i can demonstrate. move-beginning-of-line is supposed to move to the beginning of the current _display_ line. emphasis on "display" is because i'm not quite clear what it means. the attached elisp script sets up a buffer with text where you can demonstrate the problem for your self (or demonstrate that there's something weird about my setup or me in general, eg hallucinations:).=20 the demonstration includes some description, but for those of you that don't want to run it: on lines where invisible text starts near (so the elipses hit) or beyond the right margin, starting at the end of the line and doing a move-beginning-of-line (often bound to \C-a), the cursor stops in the invisible text. if the place where the cursor stopped is at the right margin, successive move-beginning-of-line doesn't advance. if the cursor stopped somewhere to the right, then the next move-beginning-of-line will actually get to the real beginning of line. the inconsistency there is obvious, but is compounded by the fact that move-beginning-of-line always moves to the real beginning if no invisible text is present. i have noticed in passing some problems with move-end-of-line, but haven't pinpointed them and wouldn't swear that they exist. ken ken.manheimer@gmail.com ------=_Part_27189_28353084.1137111159020 Content-Type: application/octet-stream; name=overlay-prob.el Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="overlay-prob.el" (defun construct-overlay-problem () (interactive) (let* ((buffer (get-buffer-create "overlay-problem")) beg offset ol) (pop-to-buffer buffer) (erase-buffer) (outline-mode) (insert "This may demonstrate a bug in move-beginning-of-line in\n") (insert "In my build of emacs 20.0.50, it sometimes doesn't move the\n") (insert "cursor through invisible text as it should. The problems\n") (insert "occur when invisible text is at or past the right window margin\n") (insert "\n") (insert "On each of the following '===' lines, hit \C-a and line end\n") (insert "On this line, you should see no problem - cursor goes to bol:\n") (construct-overlay-line -5) (insert "On this and next line, \C-a stays at the invisible text:") (insert "\n") (construct-overlay-line -2) (construct-overlay-line -1) (insert "On this line, it'll take two \C-a's to get to the real bol:") (insert "\n") (construct-overlay-line 0))) (defun construct-overlay-line (right-offset) (let* ((width (window-width)) (pre (make-string (+ width right-offset) ?=)) (string (format "%s|invisible" pre)) (beg (point)) (ol-start (+ beg width right-offset 1)) (ol-end (+ ol-start 10)) ol) (insert string) (insert "\n\n") (setq ol (make-overlay ol-start ol-end)) (overlay-put ol 'invisible 'outline) )) ------=_Part_27189_28353084.1137111159020 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel ------=_Part_27189_28353084.1137111159020--