سؤال

(defun search-for-what-is-just-killed () 
(interactive)
(search-forward latestkillringvariable? nil t)
)

How to use "yank" in an emacs lisp function?

هل كانت مفيدة؟

المحلول

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).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top