Skip to content

Instantly share code, notes, and snippets.

@calas
Created July 10, 2009 11:52
Show Gist options
  • Save calas/144423 to your computer and use it in GitHub Desktop.
Save calas/144423 to your computer and use it in GitHub Desktop.
(defun sass-convert-region (beg end)
"Convierte la región seleccionada a código sass"
(interactive "r")
(let ((comando "/usr/local/bin/css2sass -s"))
(shell-command-on-region beg end comando (buffer-name) t)))
(defun sass-convert-buffer ()
"Convierte el buffer seleccionado a código sass"
(interactive)
(let ((nuevoarchivo
(replace-regexp-in-string "css$" "sass" (buffer-file-name))))
(sass-convert-region (point-min) (point-max))
(write-file nuevoarchivo)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment