Skip to content

Instantly share code, notes, and snippets.

@yrns
Created April 2, 2016 20:16
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 yrns/e9b0cf1c24a87812e1ecab9816823f4c to your computer and use it in GitHub Desktop.
Save yrns/e9b0cf1c24a87812e1ecab9816823f4c to your computer and use it in GitHub Desktop.
Emacs ramda-destruct
;; ramda-destruct
(defun ramda-destruct ()
(interactive)
;; save-excursion does not work with replace. Can't use point since
;; the buffer contents are changing.
(let ((line (line-number-at-pos))
(column (current-column)))
(shell-command-on-region (point-min) (point-max) "ramda-destruct" t t)
(goto-char (point-min))
(forward-line (- line 1))
(move-to-column column)))
@yrns
Copy link
Author

yrns commented Apr 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment