Created
May 20, 2025 18:19
-
-
Save prozacchiwawa/f836472cbfe7fbe4b95b9f6d80af65f5 to your computer and use it in GitHub Desktop.
elisp save selection to file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Given a target buffer, copy the range from point to | |
;; mark in the current buffer to that other buffer. | |
(defun save-selection-to-file (target-buffer) | |
(interactive "B") | |
(copy-region-as-kill (point) (mark)) | |
(with-current-buffer target-buffer | |
(save-excursion | |
(erase-buffer) | |
(yank) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment