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
bb3aa835
Commit
bb3aa835
authored
Jun 27, 1997
by
Richard M. Stallman
Browse files
(mouse-drag-region): For a click (not a drag),
let the up-event run normally.
parent
12c226c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
45 deletions
+35
-45
lisp/mouse.el
lisp/mouse.el
+35
-45
No files found.
lisp/mouse.el
View file @
bb3aa835
...
...
@@ -573,52 +573,42 @@ remains active. Otherwise, it remains until the next input event."
;; Run the binding of the terminating up-event, if possible.
;; In the case of a multiple click, it gives the wrong results,
;; because it would fail to set up a region.
(
if
nil
;; (and (= (mod mouse-selection-click-count 3) 0) (fboundp fun))
;; In this case, we can just let the up-event execute normally.
(
let
((
end
(
event-end
event
)))
;; Set the position in the event before we replay it,
;; because otherwise it may have a position in the wrong
;; buffer.
(
setcar
(
cdr
end
)
end-of-range
)
;; Delete the overlay before calling the function,
;; because delete-overlay increases buffer-modified-tick.
(
delete-overlay
mouse-drag-overlay
)
(
setq
unread-command-events
(
cons
event
unread-command-events
)))
(
if
(
not
(
=
(
overlay-start
mouse-drag-overlay
)
(
if
(
not
(
=
(
overlay-start
mouse-drag-overlay
)
(
overlay-end
mouse-drag-overlay
)))
(
let*
((
stop-point
(
if
(
numberp
(
posn-point
(
event-end
event
)))
(
posn-point
(
event-end
event
))
last-end-point
))
;; The end that comes from where we ended the drag.
;; Point goes here.
(
region-termination
(
if
(
and
stop-point
(
<
stop-point
start-point
))
(
overlay-start
mouse-drag-overlay
)
(
overlay-end
mouse-drag-overlay
)))
(
let*
((
stop-point
(
if
(
numberp
(
posn-point
(
event-end
event
)))
(
posn-point
(
event-end
event
))
last-end-point
))
;; The end that comes from where we ended the drag.
;; Point goes here.
(
region-termination
(
if
(
and
stop-point
(
<
stop-point
start-point
))
(
overlay-start
mouse-drag-overlay
)
(
overlay-end
mouse-drag-overlay
)))
;; The end that comes from where we started the drag.
;; Mark goes there.
(
region-commencement
(
-
(
+
(
overlay-end
mouse-drag-overlay
)
(
overlay-start
mouse-drag-overlay
))
region-termination
))
last-command
this-command
)
(
push-mark
region-commencement
t
t
)
(
goto-char
region-termination
)
(
copy-region-as-kill
(
point
)
(
mark
t
))
(
let
((
buffer
(
current-buffer
)))
(
mouse-show-mark
)
;; mouse-show-mark can call read-event,
;; and that means the Emacs server could switch buffers
;; under us. If that happened,
;; avoid trying to use the region.
(
and
(
mark
t
)
mark-active
(
eq
buffer
(
current-buffer
))
(
mouse-set-region-1
))))
(
goto-char
(
overlay-end
mouse-drag-overlay
))
(
setq
this-command
'mouse-set-point
)
(
delete-overlay
mouse-drag-overlay
))))
;; The end that comes from where we started the drag.
;; Mark goes there.
(
region-commencement
(
-
(
+
(
overlay-end
mouse-drag-overlay
)
(
overlay-start
mouse-drag-overlay
))
region-termination
))
last-command
this-command
)
(
push-mark
region-commencement
t
t
)
(
goto-char
region-termination
)
(
copy-region-as-kill
(
point
)
(
mark
t
))
(
let
((
buffer
(
current-buffer
)))
(
mouse-show-mark
)
;; mouse-show-mark can call read-event,
;; and that means the Emacs server could switch buffers
;; under us. If that happened,
;; avoid trying to use the region.
(
and
(
mark
t
)
mark-active
(
eq
buffer
(
current-buffer
))
(
mouse-set-region-1
))))
(
delete-overlay
mouse-drag-overlay
)
;; Run the binding of the terminating up-event.
(
if
(
fboundp
fun
)
(
setq
unread-command-events
(
cons
event
unread-command-events
)))))
(
delete-overlay
mouse-drag-overlay
)))))
;; Commands to handle xterm-style multiple clicks.
...
...
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