# HG changeset patch # User Chong Yidong # Date 1215887627 0 # Node ID 40cc43cf4ef11b945f50b99ed158f8c6115a51d6 # Parent 535c63e99ba4c937d385376cbaaf3c857de4ca93 (line-move-visual): Handle null pixel position gracefully. diff -r 535c63e99ba4 -r 40cc43cf4ef1 lisp/simple.el --- a/lisp/simple.el Sat Jul 12 18:33:32 2008 +0000 +++ b/lisp/simple.el Sat Jul 12 18:33:47 2008 +0000 @@ -3993,21 +3993,20 @@ ;; specified number of lines. (defun line-move-visual (arg &optional noerror) (unless (and (floatp temporary-goal-column) - (or (memq last-command '(next-line previous-line)) - ;; In case we're called from some other command. - (eq last-command this-command))) - (setq temporary-goal-column - (/ (car (nth 2 (posn-at-point))) 1.0 (frame-char-width)))) - (let ((moved (vertical-motion - (cons (or goal-column - (truncate temporary-goal-column)) - arg)))) - (or (= arg moved) - (unless noerror - (signal (if (< arg 0) - 'beginning-of-buffer - 'end-of-buffer) - nil))))) + (or (memq last-command '(next-line previous-line)) + ;; In case we're called from some other command. + (eq last-command this-command))) + (let ((x (car (nth 2 (posn-at-point))))) + (when x + (setq temporary-goal-column (/ (float x) (frame-char-width)))))) + (or (= (vertical-motion + (cons (or goal-column (truncate temporary-goal-column)) arg)) + arg) + (unless noerror + (signal (if (< arg 0) + 'beginning-of-buffer + 'end-of-buffer) + nil)))) ;; This is the guts of next-line and previous-line. ;; Arg says how many lines to move.