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
2877eac2
Commit
2877eac2
authored
Jun 17, 1993
by
Richard M. Stallman
Browse files
(mouse-menu-choose-yank): New function. Put it in the edit menu.
(yank-menu-length): New variable.
parent
8f9dc2ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
lisp/menu-bar.el
lisp/menu-bar.el
+27
-0
No files found.
lisp/menu-bar.el
View file @
2877eac2
...
...
@@ -104,6 +104,33 @@
(
and
(
boundp
'pending-undo-list
)
pending-undo-list
)
buffer-undo-list
)))
(
defvar
yank-menu-length
100
"
*Maximum
length
of
an
item
in
the
menu
for
\
\\[mouse-menu-choose-yank].
")
(defun mouse-menu-choose-yank (event)
"
Pop
up
a
menu
of
the
kill-ring
for
selection
with
the
mouse.
The
kill-ring-yank-pointer
is
moved
to
the
selected
element.
A
subsequent
\\[yank]
yanks
the
choice
just
selected.
"
(interactive "
e
")
(let* ((count 0)
(menu (mapcar (lambda (string)
(if (> (length string) yank-menu-length)
(setq string (substring string
0 yank-menu-length)))
(prog1 (cons string count)
(setq count (1+ count))))
kill-ring)))
(rotate-yank-pointer (x-popup-menu event
(list "
Yank
Menu
"
(cons "
Pick
Selection
" menu))))
(if (interactive-p)
(message "
The
next
yank
will
insert
the
selected
text.
")
(current-kill 0))))
(define-key menu-bar-edit-menu [choose-selection]
'("
Choose
Pasting
Selection
" . mouse-menu-choose-yank))
(define-key global-map [menu-bar buffer] '("
Buffers
" . mouse-menu-bar-buffers))
...
...
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