branch: elpa/sass-mode commit e0c919872bc8ee5f7d0e8e8024b9a3cd8ff92c97 Merge: 7f0df85 69fc32b Author: Steve Purcell <st...@sanityinc.com> Commit: GitHub <nore...@github.com>
Merge pull request #24 from dcluna/add-pre-eval-hook-and-options Adding pre-eval hook function and sass-command-options --- sass-mode.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sass-mode.el b/sass-mode.el index e271907..d8a56ec 100644 --- a/sass-mode.el +++ b/sass-mode.el @@ -45,6 +45,16 @@ :type 'integer :group 'sass) +(defcustom sass-command-options nil + "Options to pass to the `sass' command." + :type 'string + :group 'sass) + +(defcustom sass-before-eval-hook nil + "Hook run in the buffer used as input to the `sass' command." + :type 'hook + :group 'sass) + (defvar sass-non-block-openers '("^.*,$" ;; Continued selectors "^ *@\\(extend\\|debug\\|warn\\|include\\|import\\)" ;; Single-line mixins @@ -236,8 +246,9 @@ Called from a program, START and END specify the region to indent." (with-temp-buffer (insert region-contents) (newline-and-indent) + (run-hooks 'sass-before-eval-hook) (sass--remove-leading-indent) - (shell-command-on-region (point-min) (point-max) "sass --stdin" + (shell-command-on-region (point-min) (point-max) (mapconcat #'identity (list "sass" sass-command-options "--stdin") " ") output-buffer nil errors-buffer