Created
June 4, 2020 15:38
-
-
Save ruliana/083eaeac19520cabc35633b2ee379db9 to your computer and use it in GitHub Desktop.
Playing with emacs lisp
This file contains 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
(defun evil-copy-accumulate-paragraph-header () | |
"Some fun here" | |
(interactive) | |
(save-excursion | |
(backward-paragraph) | |
(skip-chars-forward "[\t\n ]*") | |
(let* ((reg-char ?a) | |
(reg-text (get-register reg-char)) | |
(line-text (thing-at-point 'line)) | |
(full-text (cond ((not reg-text) line-text) | |
(t (concat reg-text line-text)))) | |
(line-text (progn | |
(remove-list-of-text-properties 0 (length full-text) '(yank-handler) full-text) | |
(propertize full-text 'yank-handler '(evil-yank-line-handler))))) | |
(set-register reg-char line-text)))) | |
;;(message (number-to-string (apply '+ '(1 2 3)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment