aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/smie.el
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2013-05-23 13:44:38 -0400
committerStefan Monnier <[email protected]>2013-05-23 13:44:38 -0400
commitbdda4c66ac1318148de69040d3b4c6f9b6037794 (patch)
tree11fb24f8ed3f3c3b6a0f58a3f7342113636c3185 /lisp/emacs-lisp/smie.el
parenta7eb9b0fbeeaa24d803355fd90d462809916a2d8 (diff)
* lisp/emacs-lisp/smie.el (smie-indent-forward-token)
(smie-indent-backward-token): Handle string tokens. Fixes: debbugs:14381
Diffstat (limited to 'lisp/emacs-lisp/smie.el')
-rw-r--r--lisp/emacs-lisp/smie.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index b088399553..cb93cdf8dc 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -1363,7 +1363,12 @@ BASE-POS is the position relative to which offsets should be applied."
((looking-at "\\s(\\|\\s)\\(\\)")
(forward-char 1)
(cons (buffer-substring (1- (point)) (point))
- (if (match-end 1) '(0 nil) '(nil 0)))))))
+ (if (match-end 1) '(0 nil) '(nil 0))))
+ ((looking-at "\\s\"")
+ (forward-sexp 1)
+ nil)
+ ((eobp) nil)
+ (t (error "Bumped into unknown token")))))
(defun smie-indent-backward-token ()
"Skip token backward and return it, along with its levels."
@@ -1375,7 +1380,12 @@ BASE-POS is the position relative to which offsets should be applied."
((memq (setq class (syntax-class (syntax-after (1- (point))))) '(4 5))
(forward-char -1)
(cons (buffer-substring (point) (1+ (point)))
- (if (eq class 4) '(nil 0) '(0 nil)))))))
+ (if (eq class 4) '(nil 0) '(0 nil))))
+ ((eq class 7)
+ (backward-sexp 1)
+ nil)
+ ((bobp) nil)
+ (t (error "Bumped into unknown token")))))
(defun smie-indent-virtual ()
;; We used to take an optional arg (with value :not-hanging) to specify that