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
1f3696d7
Commit
1f3696d7
authored
Jun 11, 1993
by
Jim Blandy
Browse files
* simple.el (hscroll-point-visible): Work as documented in the
docstring for hscroll-step.
parent
e54f1227
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
+22
-10
lisp/simple.el
lisp/simple.el
+22
-10
No files found.
lisp/simple.el
View file @
1f3696d7
...
...
@@ -1477,16 +1477,28 @@ If this is zero, point is always centered after it moves off frame.")
(
defun
hscroll-point-visible
()
"Scrolls the window horizontally to make point visible."
(
let*
((
min
(
window-hscroll
))
(
max
(
-
(
+
min
(
window-width
))
2
))
(
here
(
current-column
))
(
delta
(
if
(
zerop
hscroll-step
)
(
/
(
window-width
)
2
)
hscroll-step
))
)
(
if
(
<
here
min
)
(
scroll-right
(
max
0
(
+
(
-
min
here
)
delta
)))
(
if
(
>=
here
max
)
(
scroll-left
(
-
(
-
here
min
)
delta
))
))))
(
let*
((
here
(
current-column
))
(
left
(
window-hscroll
))
(
right
(
-
(
+
left
(
window-width
))
3
)))
(
cond
;; Should we recenter?
((
or
(
<
here
(
-
left
hscroll-step
))
(
>
here
(
+
right
hscroll-step
)))
(
set-window-hscroll
(
selected-window
)
;; Recenter, but don't show too much white space off the end of
;; the line.
(
max
0
(
min
(
-
(
save-excursion
(
end-of-line
)
(
current-column
))
(
window-width
)
-5
)
(
-
here
(
/
(
window-width
)
2
))))))
;; Should we scroll left?
((
>
here
right
)
(
scroll-left
hscroll-step
))
;; Or right?
((
<
here
left
)
(
scroll-right
hscroll-step
)))))
;; rms: (1) The definitions of arrow keys should not simply restate
;; what keys they are. The arrow keys should run the ordinary commands.
...
...
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