all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: move-beginning-of-line
Date: Mon, 14 Mar 2005 09:20:53 +0100	[thread overview]
Message-ID: <m3fyyywsd6.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <200503140258.j2E2wbI11194@raven.dms.auburn.edu> (Luc Teirlinck's message of "Sun, 13 Mar 2005 20:58:37 -0600 (CST)")

Luc Teirlinck <teirllm@dms.auburn.edu> 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 <storm@cua.dk> http://www.cua.dk

  reply	other threads:[~2005-03-14  8:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-01 23:01 move-beginning-of-line Kim F. Storm
2005-03-14  2:58 ` move-beginning-of-line Luc Teirlinck
2005-03-14  8:20   ` Kim F. Storm [this message]
2005-03-14 16:48     ` move-beginning-of-line Ralf Angeli
2005-03-14 17:31       ` move-beginning-of-line David Kastrup
2005-03-14 17:52         ` move-beginning-of-line Ralf Angeli
2005-03-14 18:48       ` move-beginning-of-line Stefan Monnier
2005-03-15 18:38         ` move-beginning-of-line Richard Stallman
2005-03-15 18:39     ` move-beginning-of-line Richard Stallman
2005-03-15 22:23     ` move-beginning-of-line David Kastrup
     [not found] ` <m364zqibx2.fsf@zsu.sush.org>
2005-03-17 15:34   ` move-beginning-of-line Kim F. Storm

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3fyyywsd6.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.