diff --git a/extra/sass-mode.el b/extra/sass-mode.el index 077e4766..3b313b31 100644 --- a/extra/sass-mode.el +++ b/extra/sass-mode.el @@ -42,8 +42,9 @@ (defvar sass-non-block-openers '("^ *:[^ \t]+[ \t]+[^ \t]" "^ *[^ \t:]+[ \t]*[=:][ \t]*[^ \t]") - "A list of regexps that match lines of Sass that couldn't have -text nested beneath them.") + "A list of regexps that match lines of Sass that don't open blocks. +That is, a Sass line that can't have text nested beneath it +should be matched by a regexp in this list.") ;; Font lock @@ -93,18 +94,18 @@ text nested beneath them.") ("\\(\\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'. + "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 +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, -taken from `sass-line-keywords'." + "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)) @@ -121,8 +122,7 @@ taken from `sass-line-keywords'." (return t))))))) (defun sass-highlight-selector () - "Highlight a CSS selector starting at `point' -and ending at `end-of-line'." + "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 @@ -139,10 +139,12 @@ and ending at `end-of-line'." (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)) @@ -188,7 +190,7 @@ and ending at `end-of-line'." ;; Indentation (defun sass-indent-p () - "Returns t if the current line can have lines nested beneath it." + "Return non-nil if the current line can have lines nested beneath it." (loop for opener in sass-non-block-openers unless (looking-at opener) return t return nil))