Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
yank-select: xyzzy のキルリングをポップアップで選択する (from 須田さんち)
;; いろいろ
;; https://web.archive.org/web/20040817084508/http://member.nifty.ne.jp:80/seiya-suda/utilities.html
(defvar *yank-select-popup-menu* nil)
(setq *yank-select-popup-menu* (create-popup-menu nil))
(defun yank-select ()
(interactive)
(while (get-menu-position *yank-select-popup-menu* 'yank-select)
(delete-menu *yank-select-popup-menu* 'yank-select))
(continue-pre-selection)
(dotimes (arg (length *kill-ring*))
(let ((string (car (ed::current-kill arg t))))
(add-menu-item *yank-select-popup-menu* 'yank-select
(if (< (length string) 40)
string
(substring string 0 40))
#'(lambda ()
(interactive)
(insert string)))))
(track-popup-menu *yank-select-popup-menu*))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.