Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
e9ab825f
Commit
e9ab825f
authored
Apr 26, 2005
by
Richard M. Stallman
Browse files
(line-move-1): Avoid using vertical-motion in easy cases.
parent
5931327a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
lisp/simple.el
lisp/simple.el
+23
-9
No files found.
lisp/simple.el
View file @
e9ab825f
...
...
@@ -3403,19 +3403,33 @@ Outline mode sets this."
(goto-char (next-char-property-change (point))))
;; Now move a line.
(end-of-line)
(and (zerop (vertical-motion 1))
(if (not noerror)
(signal 'end-of-buffer nil)
(setq done t)))
;; If there's no invisibility here, move over the newline.
(if (not (line-move-invisible-p (point)))
;; We avoid vertical-motion when possible
;; because that has to fontify.
(if (eobp)
(setq done t)
(forward-line 1))
;; Otherwise move a more sophisticated way.
;; (What's the logic behind this code?)
(and (zerop (vertical-motion 1))
(if (not noerror)
(signal 'end-of-buffer nil)
(setq done t))))
(unless done
(setq arg (1- arg))))
;; The logic of this is the same as the loop above,
;; it just goes in the other direction.
(while (and (< arg 0) (not done))
(beginning-of-line)
(if (zerop (vertical-motion -1))
(if (not noerror)
(signal 'beginning-of-buffer nil)
(setq done t)))
(if (not (line-move-invisible-p (1- (point))))
(if (bobp)
(setq done t)
(forward-line -1))
(if (zerop (vertical-motion -1))
(if (not noerror)
(signal 'beginning-of-buffer nil)
(setq done t))))
(unless done
(setq arg (1+ arg))
(while (and ;; Don't move over previous invis lines
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment