有没有办法告诉 emacs 忽略少于 4 个字符的 kill?在邪恶模式下,有很多单字符 kill 非常烦人。谢谢!
答案1
过滤机制已在 24.4 中。感谢 glucas。 https://emacs.stackexchange.com/questions/8097/how-do-i-filter-kill-ring-contents
(defvar kill-ring-entry-length 3)
(defun my/replace-blank-kill (args)
(let ((string (car args))
(replace (cdr args))
(last (car-safe kill-ring)))
(when (or (and last (string-blank-p last))
(< (length last) kill-ring-entry-length))
(setq replace t))
(list string replace)))
(advice-add 'kill-new :filter-args #'my/replace-blank-kill)