From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: move-beginning-of-line Date: Mon, 14 Mar 2005 09:20:53 +0100 Message-ID: References: <200503140258.j2E2wbI11194@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1110789502 10433 80.91.229.2 (14 Mar 2005 08:38:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 Mar 2005 08:38:22 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 14 09:38:21 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DAl5B-0003e2-5m for ged-emacs-devel@m.gmane.org; Mon, 14 Mar 2005 09:37:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DAlFa-0004Zk-Pv for ged-emacs-devel@m.gmane.org; Mon, 14 Mar 2005 03:48:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DAlF3-0004V9-OH for emacs-devel@gnu.org; Mon, 14 Mar 2005 03:48:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DAlEz-0004SM-9b for emacs-devel@gnu.org; Mon, 14 Mar 2005 03:47:58 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DAlEy-0004Pl-Oa for emacs-devel@gnu.org; Mon, 14 Mar 2005 03:47:56 -0500 Original-Received: from [212.88.64.25] (helo=mail-relay.sonofon.dk) by monty-python.gnu.org with smtp (Exim 4.34) id 1DAkod-0004Ft-H8 for emacs-devel@gnu.org; Mon, 14 Mar 2005 03:20:43 -0500 Original-Received: (qmail 64485 invoked from network); 14 Mar 2005 08:20:40 -0000 Original-Received: from unknown (HELO kfs-l.imdomain.dk.cua.dk) (213.83.150.2) by 0 with SMTP; 14 Mar 2005 08:20:40 -0000 Original-To: Luc Teirlinck In-Reply-To: <200503140258.j2E2wbI11194@raven.dms.auburn.edu> (Luc Teirlinck's message of "Sun, 13 Mar 2005 20:58:37 -0600 (CST)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34565 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34565 Luc Teirlinck writes: > Kim Storm wrote: > > As I indicated in another mail today, I have been looking at a problem > with moving to the beginning of a line in a window with the following > appearence: > > abc > [ ] > x[IMAGE]yz > [ ] > def > > Now, if I place the cursor on x, and do C-e, cursor moves to z. > If I then do C-a, cursor moves to y, not x. > > The IMAGE is layed on top (via a display property) of text that ends > in a newline, so formally, C-a (beginning-of-line) DTRT. > > However, from a user point of view, this is !TRT. > > Sorry for replying so late to this, but is there some extremely good > (that is, absolutely unavoidable) reason why that image is layed on > top of text that _ends in a newline_ (or just contains newlines)? Is > that fact, rather than beginning-of-line not the problem? For example, this is how insert-image-file works. Try to eval this in an empty buffer: (progn (insert "\nab") (insert-image-file "../etc/splash.xpm") (move-end-of-line 1) (insert "def\n")) This could be considered a bug in insert-image-file. I wonder how preview-latex handles this, as it uses images over multiline text _a lot_ ...? Does beginning-of-line work ok with images in the middle of lines? If so, how? > Trying to > "fix" the C-a behavior you consider "wrong" using > `move-beginning-of-line' is not going to change the fact that every > other Emacs command or function will still consider the offending > newline to be the end of a line _and_ to be visible (unless it has the > invisibility property). Giving newlines a display property is a very > dubious thing to do. I do not believe that very much in Emacs is > prepared for newlines with a display property. True. This _is_ a problem, but it is not new. > > Contrary to what I previously thought, this is not caused by an error > in the move_it_vertically_backward function -- it is simply the way > bolp and beginning-of-line work, i.e. they don't care if the newline > before point is invisible. > > And on top of that, unless that newline has the invisibility property, > Emacs considers it to be visible, whether the user can see it or not. True. I have tried to put invisibile property on the image text, but it doesn't give good result for me ... anybody want to experiment with that, to find something which works ? If we can fix the places where a display property gives problems, I guess we could get rid of move-beginning-of-line (or at least not have it as the default binding for C-a). -- Kim F. Storm http://www.cua.dk