all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Perhaps a bug in line-move-1
@ 2005-06-24 14:29 David PONCE
  2005-06-25  0:31 ` Richard M. Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: David PONCE @ 2005-06-24 14:29 UTC (permalink / raw)


Hello,

Since this change to line-move-1 in simple.el:

2005-06-23  Richard M. Stallman  <rms@gnu.org>

	* simple.el (set-variable): Args renamed; doc fix.
	(line-move-1): When there are overlays around, use
	vertical-motion.


When I use the up/down button to move the cursor to the previous/next
line, it actually move it up/down 2 lines.  I looked at the
implementation and it seems that when there are overlays around the
text moved over (which is the case in buffers where semantic is
enabled), the code unconditionally calls forward-line, then
`vertical-motion', which looks like a bug.

The following patch seems to have fixed the problem.

Hope it will help.
Sincerely,
David

Index: simple.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v
retrieving revision 1.733
diff -c -r1.733 simple.el
*** simple.el	23 Jun 2005 21:26:31 -0000	1.733
--- simple.el	24 Jun 2005 14:11:36 -0000
***************
*** 3442,3455 ****
  		  (when (and (not done)
  			     (not (integerp selective-display))
  			     (not (line-move-invisible-p (point))))
- 		    ;; We avoid vertical-motion when possible
- 		    ;; because that has to fontify.
- 		    (forward-line 1)
  		    ;; If there are overlays in and around
  		    ;; the text we moved over, we need to be
  		    ;; sophisticated.
  		    (unless (overlays-in (max (1- pos-before) (point-min))
  					 (min (1+ (point)) (point-max)))
  		      (setq line-done t)))
  		  ;; Otherwise move a more sophisticated way.
  		  ;; (What's the logic behind this code?)
--- 3442,3455 ----
  		  (when (and (not done)
  			     (not (integerp selective-display))
  			     (not (line-move-invisible-p (point))))
  		    ;; If there are overlays in and around
  		    ;; the text we moved over, we need to be
  		    ;; sophisticated.
  		    (unless (overlays-in (max (1- pos-before) (point-min))
  					 (min (1+ (point)) (point-max)))
+ 		      ;; We avoid vertical-motion when possible
+ 		      ;; because that has to fontify.
+ 		      (forward-line 1)
  		      (setq line-done t)))
  		  ;; Otherwise move a more sophisticated way.
  		  ;; (What's the logic behind this code?)
***************
*** 3473,3481 ****
  		  (when (and (not done)
  			     (not (integerp selective-display))
  			     (not (line-move-invisible-p (1- (point)))))
- 		    (forward-line -1)
  		    (unless (overlays-in (max (1- (point)) (point-min))
  					 (min (1+ pos-before) (point-max)))
  		      (setq line-done t)))
  		  (and (not done) (not line-done)
  		       (zerop (vertical-motion -1))
--- 3473,3481 ----
  		  (when (and (not done)
  			     (not (integerp selective-display))
  			     (not (line-move-invisible-p (1- (point)))))
  		    (unless (overlays-in (max (1- (point)) (point-min))
  					 (min (1+ pos-before) (point-max)))
+ 		      (forward-line -1)
  		      (setq line-done t)))
  		  (and (not done) (not line-done)
  		       (zerop (vertical-motion -1))

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

* Re: Perhaps a bug in line-move-1
  2005-06-24 14:29 Perhaps a bug in line-move-1 David PONCE
@ 2005-06-25  0:31 ` Richard M. Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard M. Stallman @ 2005-06-25  0:31 UTC (permalink / raw)
  Cc: emacs-devel

Thanks.

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

end of thread, other threads:[~2005-06-25  0:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-24 14:29 Perhaps a bug in line-move-1 David PONCE
2005-06-25  0:31 ` Richard M. Stallman

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.