unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* move-beginning-of-line misbehaves on wrapped-line invisible text - recent cvs checkout
@ 2006-01-13  0:12 Ken Manheimer
  2006-01-19 17:45 ` Richard M. Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: Ken Manheimer @ 2006-01-13  0:12 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-01-31 19:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-13  0:12 move-beginning-of-line misbehaves on wrapped-line invisible text - recent cvs checkout Ken Manheimer
2006-01-19 17:45 ` 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

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