On 1/22/06, Ken Manheimer wrote: > this works for me! ... but i've discovered what i think is a bug in rms' new move-beginning-of-line code. i'm attaching another bit of elisp to construct a demonstration. it appears that move-beginning-of-line will _sometimes_ go to the wrong place - the beginning of the buffer, in this case - if hidden text it's traversing begins with a newline. my best guess at a fix for the recent move-beginning-of-lines would be to remove the first (skip-chars-backward "^\n") - the one before the loop. that resolves both this current problem and the previous one i demonstrated. unfortunately, i can't be confident about any fix i invent, because i'm hazy about some of the contingencies move-beginning-of-line is supposed to handle - i don't know enough about fields, and am still a bit unclear about some wording in the function's docstring and rms explanation. (gmail may be preventing sending of application/octet-stream attachments, which is how it recognizes .el files, so the attachment may be omitted. if so, i'll resend with the attachment as a text file.) > On 1/19/06, Richard M. Stallman wrote: > > 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. > > > > I believe the idea is that newlines that don't really appear as such > > do not count. > > > > I don't see the problems you reported with the medium-size lines, > > but I do see the problem with the longest line. This seems to fix it. > > Does this give good results in general? > > i see none of the problems that had been showing without the patch. i > haven't exercised emacs very much with the change, but see that it's > already in CVS. i'll report if i encounter any problems with it. > thanks! > > ken > > > *** simple.el 05 Jan 2006 10:48:16 -0500 1.783 > > --- simple.el 19 Jan 2006 12:11:57 -0500 > > *************** > > *** 3734,3740 **** > > (or arg (setq arg 1)) > > (if (/= arg 1) > > (line-move (1- arg) t)) > > ! (beginning-of-line 1) > > (let ((orig (point))) > > (vertical-motion 0) > > (if (/= orig (point)) > > --- 3735,3747 ---- > > (or arg (setq arg 1)) > > (if (/= arg 1) > > (line-move (1- arg) t)) > > ! > > ! ;; Move to beginning-of-line, ignoring fields and invisibles. > > ! (skip-chars-backward "^\n") > > ! (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) > > ! (goto-char (previous-char-property-change (1- (point)))) > > ! (skip-chars-backward "^\n")) > > ! > > (let ((orig (point))) > > (vertical-motion 0) > > (if (/= orig (point)) > > >