分类: LINUX
2008-08-14 04:56:35
;; copy file to kill-ring
(defun my-copy-file-to-kill-ring (filename)
(interactive "fCopy this file to kill-ring:")
(let ((buf (generate-new-buffer "*my-copy-file-to-kill-ring*"))
(pbeg)
(pend))
(with-current-buffer buf
(set 'pbeg (point))
(insert-file-contents filename)
(end-of-buffer)
(set 'pend (point))
(kill-ring-save pbeg pend))
(kill-buffer buf)))