[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sass-mode 28dd06b 14/31: Merge remote-tracking branch 'ref
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sass-mode 28dd06b 14/31: Merge remote-tracking branch 'refs/remotes/nex3/pr/1' |
Date: |
Sun, 29 Aug 2021 11:29:38 -0400 (EDT) |
branch: elpa/sass-mode
commit 28dd06ba642620c76e38f8b60b06718fcdfd9f29
Merge: bf846d6 3930ddc
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>
Merge remote-tracking branch 'refs/remotes/nex3/pr/1'
---
sass-mode.el | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/sass-mode.el b/sass-mode.el
index 3c94cea..662b2ff 100644
--- a/sass-mode.el
+++ b/sass-mode.el
@@ -182,9 +182,17 @@ LIMIT is the limit of the search."
;; Mode setup
+(defvar sass-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\C-c\C-r" 'sass-output-region)
+ (define-key map "\C-c\C-l" 'sass-output-buffer)
+ map))
+
;;;###autoload
(define-derived-mode sass-mode haml-mode "Sass"
- "Major mode for editing Sass files."
+ "Major mode for editing Sass files.
+
+\\{sass-mode-map}"
(set-syntax-table sass-syntax-table)
(setq font-lock-extend-region-functions
'(font-lock-extend-region-wholelines
font-lock-extend-region-multiline))
@@ -202,6 +210,24 @@ LIMIT is the limit of the search."
if (looking-at opener) return nil
finally return t))
+;; Command
+
+(defun sass-output-region (start end)
+ "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"))))
+
+(defun sass-output-buffer ()
+ "Displays the CSS output for entire buffer."
+ (interactive)
+ (sass-output-region (point-min) (point-max)))
+
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.sass\\'" . sass-mode))
- [nongnu] branch elpa/sass-mode created (now 247a0d4), ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode 1bcaf92 02/31: Add a note about haml-mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode 242b0ea 07/31: Merge remote-tracking branch 'origin/master', ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode 26dff5f 12/31: Merge pull request #12 from purcell/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode 8190f29 15/31: Better version of sass-output-region (see #1), ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode 28dd06b 14/31: Merge remote-tracking branch 'refs/remotes/nex3/pr/1',
ELPA Syncer <=
- [nongnu] elpa/sass-mode c5de02d 22/31: Use cl-lib for consistent destructuring-bind etc., ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode b676b2d 03/31: Make variables buffer-local before setting., ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode 30f6132 09/31: added missing ' in auto-mode-alisp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode bf846d6 13/31: Merge pull request #11 from gramos/fix_auto-mode-alist_pattern, ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode 0c54866 16/31: Make comments toggleable with M-;, ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode aee28ea 18/31: Bump version to 3.0.16, ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode 5d69d5f 06/31: Update .gitignore., ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode fcee43b 01/31: Get rid of haml-mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode 3930ddc 05/31: add sass-output-region() and sass-output-buffer(), ELPA Syncer, 2021/08/29
- [nongnu] elpa/sass-mode 9d05841 08/31: auto-mode-alisp patter should ends with \\ is better, ELPA Syncer, 2021/08/29