Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruliana/083eaeac19520cabc35633b2ee379db9 to your computer and use it in GitHub Desktop.
Save ruliana/083eaeac19520cabc35633b2ee379db9 to your computer and use it in GitHub Desktop.
Playing with emacs lisp
(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