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
f936ae06
Commit
f936ae06
authored
Jul 13, 1993
by
Richard M. Stallman
Browse files
(mouse-choose-completion): New function.
parent
f1ca9012
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
lisp/mouse.el
lisp/mouse.el
+23
-0
No files found.
lisp/mouse.el
View file @
f936ae06
...
...
@@ -840,6 +840,29 @@ and selects that window."
;;;!! (- (car relative-coordinate) (current-column)) " "))
;;;!! ((= (current-column) (car relative-coordinate)) (ding))))))
;; Choose a completion with the mouse.
(
defun
mouse-choose-completion
(
event
)
(
interactive
"e"
)
(
let
(
choice
)
(
save-excursion
(
set-buffer
(
window-buffer
(
posn-window
(
event-start
event
))))
(
save-excursion
(
goto-char
(
posn-point
(
event-start
event
)))
(
skip-chars-backward
"^ \t\n"
)
(
let
((
beg
(
point
)))
(
skip-chars-forward
"^ \t\n"
)
(
setq
choice
(
buffer-substring
beg
(
point
))))))
(
save-excursion
(
set-buffer
(
window-buffer
(
minibuffer-window
)))
(
goto-char
(
max
(
point-min
)
(
-
(
point-max
)
(
length
choice
))))
(
while
(
and
(
not
(
eobp
))
(
let
((
tail
(
buffer-substring
(
point
)
(
point-max
))))
(
not
(
string=
tail
(
substring
choice
0
(
length
tail
))))))
(
forward-char
1
))
(
insert
choice
)
(
delete-region
(
point
)
(
point-max
)))))
;; Font selection.
(
defvar
x-fixed-font-alist
...
...
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