From f95b2ec117e6bae58e0b4f64fe872851a69436c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Ramos?= Date: Tue, 1 May 2012 10:01:39 -0700 Subject: Import sass-elisp_3.0.15.orig.tar.gz [dgit import orig sass-elisp_3.0.15.orig.tar.gz] --- .gitignore | 1 + MIT-LICENSE | 20 ++++++ sass-mode.el | 209 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 230 insertions(+) create mode 100644 .gitignore create mode 100644 MIT-LICENSE create mode 100644 sass-mode.el diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c531d98 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.elc diff --git a/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..68b7aef --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/sass-mode.el b/sass-mode.el new file mode 100644 index 0000000..11d8993 --- /dev/null +++ b/sass-mode.el @@ -0,0 +1,209 @@ +;;; sass-mode.el --- Major mode for editing Sass files + +;; Copyright (c) 2007, 2008 Nathan Weizenbaum + +;; Author: Nathan Weizenbaum +;; URL: http://github.com/nex3/haml/tree/master +;; Version: 3.0.15 +;; Created: 2007-03-15 +;; By: Nathan Weizenbaum +;; Keywords: markup, language, css +;; Package-Requires: ((haml-mode "3.0.15")) + +;;; Commentary: + +;; Because Sass's indentation schema is similar +;; to that of YAML and Python, many indentation-related +;; functions are similar to those in yaml-mode and python-mode. + +;; To install, save this on your load path and add the following to +;; your .emacs file: +;; +;; (require 'sass-mode) + +;; sass-mode requires haml-mode, which can be found at http://github.com/nex3/haml-mode. + +;;; Code: + +(require 'haml-mode) + +;; User definable variables + +(defgroup sass nil + "Support for the Sass template language." + :group 'languages + :prefix "sass-") + +(defcustom sass-mode-hook nil + "Hook run when entering Sass mode." + :type 'hook + :group 'sass) + +(defcustom sass-indent-offset 2 + "Amount of offset per level of indentation." + :type 'integer + :group 'sass) + +(defvar sass-non-block-openers + '("^.*,$" ;; Continued selectors + "^ *@\\(extend\\|debug\\|warn\\|include\\|import\\)" ;; Single-line mixins + "^ *[$!]" ;; Variables + ) + "A list of regexps that match lines of Sass that couldn't have +text nested beneath them.") + +;; Font lock + +(defconst sass-selector-font-lock-keywords + '(;; Attribute selectors (e.g. p[foo=bar]) + ("\\[\\([^]=]+\\)" (1 font-lock-variable-name-face) + ("[~|$^*]?=\\([^]=]+\\)" nil nil (1 font-lock-string-face))) + ("&" 0 font-lock-constant-face) + ("\\.\\w+" 0 font-lock-type-face) + ("#\\w+" 0 font-lock-keyword-face) + ;; Pseudo-selectors, optionally with arguments (e.g. :first, :nth-child(12)) + ("\\(::?\\w+\\)" (1 font-lock-function-name-face) + ("(\\([^)]+\\))" nil nil (1 font-lock-string-face))))) + +(defconst sass-script-font-lock-keywords + `(("\"\\([^\"\\\\]\\|\\\\.\\)*\"" 0 font-lock-string-face) + ("!\\(\\w\\|_\\)+" 0 font-lock-variable-name-face) + ("#[0-9a-fA-F]\\{0,6\\}" 0 font-lock-preprocessor-face) + (,(regexp-opt + '("true" "false" "black" "silver" "gray" "white" "maroon" "red" + "purple" "fuchsia" "green" "lime" "olive" "yellow" "navy" + "blue" "teal" "aqua")) + 0 font-lock-constant-face) + (,(regexp-opt '("and" "or" "not")) 0 font-lock-keyword-face))) + +(defconst sass-syntax-table + (let ((st (make-syntax-table))) + (modify-syntax-entry ?- "w" st) + (modify-syntax-entry ?_ "w" st) + st)) + +(defconst sass-script-syntax-table + (let ((st (make-syntax-table sass-syntax-table))) + (modify-syntax-entry ?- "." st) + st)) + +(defconst sass-font-lock-keywords + '((sass-highlight-line 1 nil nil t))) + +(defconst sass-line-keywords + '(("@\\(\\w+\\)" 0 font-lock-keyword-face sass-highlight-directive) + ("/[/*].*" 0 font-lock-comment-face) + ("[=+]\\w+" 0 font-lock-function-name-face sass-highlight-script-after-match) + ("!\\w+" 0 font-lock-variable-name-face sass-highlight-script-after-match) + (":\\w+" 0 font-lock-variable-name-face) + ("\\w+\s*:" 0 font-lock-variable-name-face) + ("\\(\\w+\\)\s*=" 1 font-lock-variable-name-face sass-highlight-script-after-match) + ("\\(:\\w+\\)\s*=" 1 font-lock-variable-name-face sass-highlight-script-after-match) + (".*" sass-highlight-selector)) + "A list of full-line Sass syntax to highlight, used by `sass-highlight-line'. + +Each item is either of the form (REGEXP SUBEXP FACE), (REGEXP FN), +or (REGEXP SUBEXP FACE FN). Each REGEXP is run successively on the +beginning of non-whitespace on the current line until one matches. +If it has SUBEXP and FACE, then SUBEXP is highlighted using FACE. +If it has FN, FN is run.") + +(defun sass-highlight-line (limit) + "Highlight a single line using some Sass single-line syntax. +This syntax is taken from `sass-line-keywords'. +LIMIT is the limit of the search." + (save-match-data + (when (re-search-forward "^ *\\(.+\\)$" limit t) + (goto-char (match-beginning 1)) + (dolist (keyword sass-line-keywords) + (destructuring-bind (keyword subexp-or-fn &optional face fn) keyword + (when (looking-at keyword) + (if (integerp subexp-or-fn) + (put-text-property (match-beginning subexp-or-fn) + (match-end subexp-or-fn) + 'face face) + (setq fn subexp-or-fn)) + (when fn (funcall fn)) + (end-of-line) + (return t))))))) + +(defun sass-highlight-selector () + "Highlight a CSS selector starting at `point' and ending at `end-of-line'." + (let ((font-lock-keywords sass-selector-font-lock-keywords) + font-lock-multiline) + (font-lock-fontify-region + (point) (progn (end-of-line) (point)))) + t) + +(defun sass-highlight-script (beg end) + "Highlight a section of SassScript between BEG and END." + (save-match-data + (with-syntax-table sass-script-syntax-table + (let ((font-lock-keywords sass-script-font-lock-keywords) + font-lock-syntax-table + font-lock-extend-region-functions) + (font-lock-fontify-region beg end))))) + +(defun sass-highlight-script-after-match () + "Highlight a section of SassScript after the last match." + (end-of-line) + (sass-highlight-script (match-end 0) (point))) + +(defun sass-highlight-directive () + "Highlight a Sass directive." + (goto-char (match-end 0)) + (block nil + (case (intern (match-string 1)) + (for + (unless (looking-at " +!\\w+") (return)) + (put-text-property (match-beginning 0) (match-end 0) + 'face font-lock-variable-name-face) + (goto-char (match-end 0)) + (unless (looking-at " +from") (return)) + (put-text-property (match-beginning 0) (match-end 0) + 'face font-lock-keyword-face) + (goto-char (match-end 0)) + (when (looking-at " +\\(.+?\\) +\\(to\\|through\\)") + (sass-highlight-script (match-beginning 1) (match-end 1)) + (put-text-property (match-beginning 2) (match-end 2) + 'face font-lock-keyword-face)) + (sass-highlight-script-after-match)) + + (else + (unless (looking-at " +if") (return)) + (put-text-property (match-beginning 0) (match-end 0) + 'face font-lock-keyword-face) + (sass-highlight-script-after-match)) + + ((if while debug) (sass-highlight-script-after-match))))) + +;; Constants + +;; Mode setup + +;;;###autoload +(define-derived-mode sass-mode haml-mode "Sass" + "Major mode for editing Sass files." + (set-syntax-table sass-syntax-table) + (setq font-lock-extend-region-functions + '(font-lock-extend-region-wholelines font-lock-extend-region-multiline)) + (set (make-local-variable 'font-lock-multiline) nil) + (set (make-local-variable 'comment-start) "/*") + (set (make-local-variable 'haml-indent-function) 'sass-indent-p) + (set (make-local-variable 'haml-indent-offset) sass-indent-offset) + (setq font-lock-defaults '(sass-font-lock-keywords t t))) + +;; Indentation + +(defun sass-indent-p () + "Return non-nil if the current line can have lines nested beneath it." + (loop for opener in sass-non-block-openers + if (looking-at opener) return nil + finally return t)) + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.sass$" . sass-mode)) + +;; Setup/Activation +(provide 'sass-mode) +;;; sass-mode.el ends here -- cgit v1.2.3 From 941d3cd0d43a5480995b5c3245230ce234ce7ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Ramos?= Date: Wed, 29 Jan 2014 04:55:26 -0700 Subject: Import sass-elisp_3.0.15-4.debian.tar.xz [dgit import tarball sass-elisp 3.0.15-4 sass-elisp_3.0.15-4.debian.tar.xz] --- changelog | 32 +++++++++++++++++++++ compat | 1 + control | 18 ++++++++++++ copyright | 47 +++++++++++++++++++++++++++++++ patches/fix-auto-mode-alisp-pattern.patch | 16 +++++++++++ patches/series | 1 + rules | 4 +++ sass-elisp.dirs | 1 + sass-elisp.emacsen-install | 47 +++++++++++++++++++++++++++++++ sass-elisp.emacsen-remove | 12 ++++++++ sass-elisp.emacsen-startup | 25 ++++++++++++++++ sass-elisp.install | 1 + source/format | 1 + 13 files changed, 206 insertions(+) create mode 100644 changelog create mode 100644 compat create mode 100644 control create mode 100644 copyright create mode 100644 patches/fix-auto-mode-alisp-pattern.patch create mode 100644 patches/series create mode 100755 rules create mode 100644 sass-elisp.dirs create mode 100644 sass-elisp.emacsen-install create mode 100644 sass-elisp.emacsen-remove create mode 100644 sass-elisp.emacsen-startup create mode 100644 sass-elisp.install create mode 100644 source/format diff --git a/changelog b/changelog new file mode 100644 index 0000000..ea5a8d5 --- /dev/null +++ b/changelog @@ -0,0 +1,32 @@ +sass-elisp (3.0.15-4) unstable; urgency=low + + * auto-mode-alisp pattern should ends with "\\" + (Closes: #680696) + + -- Gastón Ramos Wed, 29 Jan 2014 08:55:26 -0300 + +sass-elisp (3.0.15-3) unstable; urgency=low + + * Add Emacs24 to the list of supported emacsen + + -- Gastón Ramos Mon, 17 Sep 2012 23:01:44 -0300 + +sass-elisp (3.0.15-2) unstable; urgency=low + + * Dendends on haml-elisp (>= 1:3.0.15-4) because + haml-elisp 1:3.0.15-3 has a bug on the emacsen install + script. (Closes: #672251) + + * Remove the symlink or src file if exists and + make a symlink instead of copy the source file + + * Added symlink to the source code in order to show a link on + C-h f + + -- Gastón Ramos Thu, 10 May 2012 08:20:37 -0300 + +sass-elisp (3.0.15-1) unstable; urgency=low + + * Initial release + + -- Gastón Ramos Sun, 1 May 2012 14:01:39 -0300 diff --git a/compat b/compat new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/compat @@ -0,0 +1 @@ +8 diff --git a/control b/control new file mode 100644 index 0000000..1a7c214 --- /dev/null +++ b/control @@ -0,0 +1,18 @@ +Source: sass-elisp +Section: lisp +Priority: optional +Maintainer: Gastón Ramos +Build-Depends: debhelper (>= 8.0.0), quilt +Standards-Version: 3.9.3 +Homepage: http://sass-lang.com/ +Vcs-Git: git://git.debian.org/collab-maint/sass-elisp.git +Vcs-Browser: http://git.debian.org/?p=collab-maint/sass-elisp.git;a=summary + +Package: sass-elisp +Section: lisp +Architecture: all +Recommends: ruby-sass +Depends: ${misc:Depends}, emacs23 | emacs24, haml-elisp (>= 1:3.0.15-5) +Description: Emacs Lisp mode for the Sass markup language + This package provides the emacs-lisp for syntax-highlighting Sass + mode for emacs23 or emacs24. diff --git a/copyright b/copyright new file mode 100644 index 0000000..7ec3bad --- /dev/null +++ b/copyright @@ -0,0 +1,47 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: sass-mode.el +Source: http://github.com/nex3/sass/tree/master + +Files: * +Copyright: © 2007-2009 Hampton Catlin, Nathan Weizenbaum, Chris Eppstein +License: MIT + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Files: debian/* +Source: All files were build using debian build tools (git-buildpackage, etc.) +Copyright: 2012 Gastón Ramos +License: GPL-2+ + +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/patches/fix-auto-mode-alisp-pattern.patch b/patches/fix-auto-mode-alisp-pattern.patch new file mode 100644 index 0000000..4d33f84 --- /dev/null +++ b/patches/fix-auto-mode-alisp-pattern.patch @@ -0,0 +1,16 @@ +auto-mode-alisp pattern should ends with \\ +see this: http://www.emacswiki.org/emacs/AutoModeAlist + +Index: sass-elisp/sass-mode.el +=================================================================== +--- sass-elisp.orig/sass-mode.el 2012-05-11 09:50:55.000000000 -0300 ++++ sass-elisp/sass-mode.el 2014-01-29 08:53:03.379903442 -0300 +@@ -202,7 +202,7 @@ + finally return t)) + + ;;;###autoload +-(add-to-list 'auto-mode-alist '("\\.sass$" . sass-mode)) ++(add-to-list 'auto-mode-alist '("\\.sass\\'" . sass-mode)) + + ;; Setup/Activation + (provide 'sass-mode) diff --git a/patches/series b/patches/series new file mode 100644 index 0000000..103190d --- /dev/null +++ b/patches/series @@ -0,0 +1 @@ +fix-auto-mode-alisp-pattern.patch diff --git a/rules b/rules new file mode 100755 index 0000000..2d33f6a --- /dev/null +++ b/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ diff --git a/sass-elisp.dirs b/sass-elisp.dirs new file mode 100644 index 0000000..b59a67e --- /dev/null +++ b/sass-elisp.dirs @@ -0,0 +1 @@ +/usr/share/emacs/site-lisp/sass-elisp diff --git a/sass-elisp.emacsen-install b/sass-elisp.emacsen-install new file mode 100644 index 0000000..7fb6794 --- /dev/null +++ b/sass-elisp.emacsen-install @@ -0,0 +1,47 @@ +#!/bin/sh +set -e +SRC_FILE="sass-mode.el" +# Right now only emacs23 and emacs24 are supported. If the future brings support +# for other emacsen, we can keep this same logic - just update this +# regex +SUPPORTED_EMACSEN="^emacs2[34]$" +FLAVOR="$1" + +if echo $FLAVOR | egrep -vq $SUPPORTED_EMACSEN; then + echo "Skipping byte-compilation for ${FLAVOR}: Not supported" + exit 0 +fi + +echo "install/sass-elisp: Handling install of emacsen flavor ${FLAVOR}" + +if [ "${FLAVOR}" != "emacs" ]; then + SRC_FLAVOR_PATH=/usr/share/${FLAVOR}/site-lisp/sass-elisp/$SRC_FILE + + echo "install/sass-elisp: byte-compiling for ${FLAVOR}" + cd /usr/share/emacs/site-lisp/sass-elisp + mkdir -p /usr/share/${FLAVOR}/site-lisp/sass-elisp + + echo "Installing source code for ${FLAVOR}" + # Remove the symlink or file if already exists + rm -f $SRC_FLAVOR_PATH + + ln -s /usr/share/emacs/site-lisp/sass-elisp/$SRC_FILE \ + /usr/share/${FLAVOR}/site-lisp/sass-elisp/$SRC_FILE + + cd /usr/share/${FLAVOR}/site-lisp/sass-elisp + cat < path.el +(setq load-path (cons "." load-path) byte-compile-warnings nil) +EOF + FLAVORTEST=`echo $FLAVOR | cut -c-6` + if [ ${FLAVORTEST} = xemacs ] ; then + SITEFLAG="-no-site-file" + else + SITEFLAG="--no-site-file" + fi + + ${FLAVOR} -q ${SITEFLAG} -batch -l path.el -f batch-byte-compile $SRC_FILE + rm path.el +fi + +exit 0; + diff --git a/sass-elisp.emacsen-remove b/sass-elisp.emacsen-remove new file mode 100644 index 0000000..9f14c32 --- /dev/null +++ b/sass-elisp.emacsen-remove @@ -0,0 +1,12 @@ +#!/bin/sh -e + +FLAVOR="$1" + +echo "install/sass-elisp: Handling removal of emacsen flavor ${FLAVOR}" + +if [ "${FLAVOR}" != "emacs" ]; then + echo "install/sass-elisp: purging byte-compiled files for ${FLAVOR}" + rm -rf /usr/share/${FLAVOR}/site-lisp/sass-elisp +fi + +exit 0; diff --git a/sass-elisp.emacsen-startup b/sass-elisp.emacsen-startup new file mode 100644 index 0000000..fc0920b --- /dev/null +++ b/sass-elisp.emacsen-startup @@ -0,0 +1,25 @@ +;; -*-emacs-lisp-*- +;; +;; Emacs startup file, e.g. /etc/emacs/site-start.d/50sass-mode.el +;; for the Debian sass-mode package +;; +;; Originally contributed by Nils Naumann +;; Modified by Gastón Ramos + +;; The sass-mode package follows the Debian/GNU Linux 'emacsen' policy and +;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, +;; xemacs19, emacs20, xemacs20...). The compiled code is then +;; installed in a subdirectory of the respective site-lisp directory. +;; We have to add this to the load-path: +(let ((package-dir (concat "/usr/share/" + (symbol-name flavor) + "/site-lisp/sass-elisp"))) +;; If package-dir does not exist, the sass-mode package must have +;; removed but not purged, and we should skip the setup. + (when (file-directory-p package-dir) + ;; Use debian-pkg-add-load-path-item per §9 of debian emacs subpolicy + (debian-pkg-add-load-path-item package-dir ) + (autoload 'sass-mode "sass-mode" + "Major mode for editing sass-mode files." t) + (add-to-list 'auto-mode-alist '("\\.sass\\'" . sass-mode)) + )) diff --git a/sass-elisp.install b/sass-elisp.install new file mode 100644 index 0000000..07b1de8 --- /dev/null +++ b/sass-elisp.install @@ -0,0 +1 @@ +sass-mode.el usr/share/emacs/site-lisp/sass-elisp diff --git a/source/format b/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/source/format @@ -0,0 +1 @@ +3.0 (quilt) -- cgit v1.2.3 From 49a39f0fe090e814f35560375703c1776db9c4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Ramos?= Date: Wed, 29 Jan 2014 04:55:26 -0700 Subject: fix-auto-mode-alisp-pattern auto-mode-alisp pattern should ends with \\ see this: http://www.emacswiki.org/emacs/AutoModeAlist Gbp-Pq: Name fix-auto-mode-alisp-pattern.patch --- sass-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass-mode.el b/sass-mode.el index 11d8993..89748a9 100644 --- a/sass-mode.el +++ b/sass-mode.el @@ -202,7 +202,7 @@ LIMIT is the limit of the search." finally return t)) ;;;###autoload -(add-to-list 'auto-mode-alist '("\\.sass$" . sass-mode)) +(add-to-list 'auto-mode-alist '("\\.sass\\'" . sass-mode)) ;; Setup/Activation (provide 'sass-mode) -- cgit v1.2.3