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
652ccd35
Commit
652ccd35
authored
Oct 17, 1992
by
Richard M. Stallman
Browse files
(mouse-set-region): New command. Bind drag-mouse-1 to it.
parent
cb7b0c05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
lisp/mouse.el
lisp/mouse.el
+15
-1
No files found.
lisp/mouse.el
View file @
652ccd35
...
...
@@ -114,6 +114,20 @@ This must be bound to a mouse click."
(
if
(
numberp
(
posn-point
posn
))
(
goto-char
(
posn-point
posn
)))))
(
defun
mouse-set-region
(
click
)
"Set the region to the text that the mouse is dragged over.
This must be bound to a mouse click."
(
interactive
"e"
)
(
let
((
posn
(
event-start
click
))
(
end
(
event-end
click
)))
(
select-window
(
posn-window
posn
))
(
if
(
numberp
(
posn-point
posn
))
(
goto-char
(
posn-point
posn
)))
(
sit-for
1
)
(
push-mark
)
(
if
(
numberp
(
posn-point
end
))
(
goto-char
(
posn-point
end
)))))
(
defun
mouse-set-mark
(
click
)
"Set mark at the position clicked on with the mouse.
Display cursor at that position for a second.
...
...
@@ -582,7 +596,7 @@ This does not delete the region; it acts like \\[kill-ring-save]."
;; are properly implemented.
(
global-set-key
[mouse-1]
'mouse-set-point
)
(
global-set-key
[drag-mouse-1]
'mouse-set-
mark
)
(
global-set-key
[drag-mouse-1]
'mouse-set-
region
)
(
global-set-key
[mouse-2]
'mouse-yank-at-click
)
(
global-set-key
[mouse-3]
'mouse-save-then-kill
)
...
...
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