Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
ed627e08
Commit
ed627e08
authored
May 22, 1994
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(posn-col-row): Do something useful for scroll bar event.
parent
524587f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
lisp/subr.el
lisp/subr.el
+19
-9
No files found.
lisp/subr.el
View file @
ed627e08
...
...
@@ -420,17 +420,27 @@ POSITION should be a list of the form
as returned by the `event-start' and `event-end' functions."
(
nth
2
position
))
(
def
subst
posn-col-row
(
position
)
"Return the
column and row
in POSITION, measured in characters.
(
def
un
posn-col-row
(
position
)
"Return the
row and column
in POSITION, measured in characters.
POSITION should be a list of the form
(WINDOW BUFFER-POSITION (X . Y) TIMESTAMP)
as returned by the `event-start' and `event-end' functions."
(
let*
((
pair
(
nth
2
position
))
(
window
(
posn-window
position
))
(
frame
(
if
(
framep
window
)
window
(
window-frame
window
)))
(
x
(
/
(
car
pair
)
(
frame-char-width
frame
)))
(
y
(
/
(
cdr
pair
)
(
frame-char-height
frame
))))
(
cons
x
y
)))
as returned by the `event-start' and `event-end' functions.
For a scroll-bar event, the result column is 0, and the row
corresponds to the vertical position of the click in the scroll bar."
(
let
((
pair
(
nth
2
position
))
(
window
(
posn-window
position
)))
(
if
(
eq
(
if
(
symbolp
(
nth
1
position
))
(
nth
1
position
)
(
car
(
nth
1
position
)))
'vertical-scroll-bar
)
(
cons
0
(
scroll-bar-scale
pair
(
1-
(
window-height
window
))))
(
if
(
eq
(
if
(
symbolp
(
nth
1
position
))
(
nth
1
position
)
(
car
(
nth
1
position
)))
'horizontal-scroll-bar
)
(
cons
(
scroll-bar-scale
pair
(
window-width
window
))
0
)
(
let
((
frame
(
if
(
framep
window
)
window
(
window-frame
window
)))
(
x
(
/
(
car
pair
)
(
frame-char-width
frame
)))
(
y
(
/
(
cdr
pair
)
(
frame-char-height
frame
))))
(
cons
x
y
))))))
(
defsubst
posn-timestamp
(
position
)
"Return the timestamp of POSITION.
...
...
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