unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ken Manheimer <ken.manheimer@gmail.com>
Subject: move-beginning-of-line misbehaves on wrapped-line invisible text - recent cvs checkout
Date: Thu, 12 Jan 2006 19:12:39 -0500	[thread overview]
Message-ID: <2cd46e7f0601121612y386d057ft68324aeb352b777d@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1595 bytes --]

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:). 
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

[-- Attachment #2: overlay-prob.el --]
[-- Type: application/octet-stream, Size: 1450 bytes --]

(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)
    ))














[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

             reply	other threads:[~2006-01-13  0:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-13  0:12 Ken Manheimer [this message]
2006-01-19 17:45 ` move-beginning-of-line misbehaves on wrapped-line invisible text - recent cvs checkout Richard M. Stallman
2006-01-22 16:12   ` Ken Manheimer
2006-01-23 18:17     ` Ken Manheimer
2006-01-23 20:47       ` Ken Manheimer
2006-01-26  3:28         ` Lőrentey Károly
2006-01-27  0:19           ` Ken Manheimer
2006-01-30 18:46         ` Richard M. Stallman
2006-01-31 19:10           ` Ken Manheimer

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=2cd46e7f0601121612y386d057ft68324aeb352b777d@mail.gmail.com \
    --to=ken.manheimer@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).