Skip to content

Instantly share code, notes, and snippets.

@sharapeco
Created September 3, 2018 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharapeco/a253483c962a35e3d1af216b51a6a921 to your computer and use it in GitHub Desktop.
Save sharapeco/a253483c962a35e3d1af216b51a6a921 to your computer and use it in GitHub Desktop.
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