Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
no case-folding in cg-calculate-indent regexp search
  • Loading branch information
unhammer committed Jan 6, 2010
1 parent a257e40 commit cdee63a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cg.el
Expand Up @@ -182,20 +182,22 @@ seems this function only runs on comments and strings..."
;; (eq (get-text-property (1- (point)) 'face)
;; font-lock-string-face))
;; (eq (get-text-property (point) 'face) sh-heredoc-face))
(let ((origin (point)))
(let ((origin (point))
(old-case-fold-search case-fold-search))
(setq case-fold-search nil) ; for re-search-backward
(save-excursion
(let ((kw-pos (progn
(goto-char (1- (or (search-forward ";" (line-end-position) t)
(line-end-position))))
(re-search-backward (regexp-opt cg-kw-list) nil 'noerror))))
(setq case-fold-search old-case-fold-search)
(when kw-pos
(let* ((kw (match-string-no-properties 0)))
(if (and (not (equal kw ";"))
(> origin (line-end-position)))
cg-indentation
0)))))))


(defun cg-indent-line ()
"Indent the current line. Very simple indentation: lines with
keywords from `cg-kw-list' get zero indentation, others get one
Expand Down

0 comments on commit cdee63a

Please sign in to comment.