Reputation: 21451
(defun search-for-what-is-just-killed ()
(interactive)
(search-forward latestkillringvariable? nil t)
)
How to use "yank" in an emacs lisp function?
Upvotes: 0
Views: 116
Reputation: 56645
You can access directly the kill-ring
list to access the latest kill:
(substring-no-properties (car kill-ring))
The substring-no-properties
bit is important since text is kept in the kill ring with additional properties (like fontification specific to a particular mode and you'll probably want to strip those).
Upvotes: 2