emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sass-mode 8190f29 15/31: Better version of sass-output-reg


From: ELPA Syncer
Subject: [nongnu] elpa/sass-mode 8190f29 15/31: Better version of sass-output-region (see #1)
Date: Sun, 29 Aug 2021 11:29:39 -0400 (EDT)

branch: elpa/sass-mode
commit 8190f29bc13c4b31af5c9d1a803b75534bdf4643
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>

    Better version of sass-output-region (see #1)
---
 sass-mode.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sass-mode.el b/sass-mode.el
index 662b2ff..e5bb277 100644
--- a/sass-mode.el
+++ b/sass-mode.el
@@ -216,12 +216,12 @@ LIMIT is the limit of the search."
   "Displays the CSS output for the current block of Sass code.
 Called from a program, START and END specify the region to indent."
   (interactive "r")
-  (let* ((text (buffer-substring-no-properties start end))
-         (command (format "ruby -rubygems -e \"require 'sass'; puts 
Sass::Engine.new('%s').render\"" text)))
-  (kill-new text)
-  (with-temp-buffer
-    (yank)
-    (shell-command-on-region (point-min) (point-max) command "sass-output"))))
+  (let ((output-buffer "*sass-output*"))
+    (shell-command-on-region start end "sass --stdin" output-buffer)
+    (when (fboundp 'css-mode)
+      (with-current-buffer output-buffer
+        (css-mode)))
+    (switch-to-buffer-other-window output-buffer)))
 
 (defun sass-output-buffer ()
   "Displays the CSS output for entire buffer."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]