Commit 9517f8af authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/emacs-lisp/smie.el (smie-blink-matching-open): Don't use `pos' in two

conflicting ways.
(smie-indent--parent): Extend to "parent of arg".
(smie-indent-inside-string): New function.
(smie-indent-functions): Use it.
parent cf77dd27
2011-02-10 Stefan Monnier <monnier@iro.umontreal.ca> 2011-02-10 Stefan Monnier <monnier@iro.umontreal.ca>
   
* emacs-lisp/smie.el (smie-blink-matching-open): Don't use `pos' in two
conflicting ways.
(smie-indent--parent): Extend to "parent of arg".
(smie-indent-inside-string): New function.
(smie-indent-functions): Use it.
* vc/vc-dir.el (vc-dir-refresh): Reorder operations to try and avoid * vc/vc-dir.el (vc-dir-refresh): Reorder operations to try and avoid
bzr locking race condition. bzr locking race condition.
   
......
...@@ -915,7 +915,7 @@ This uses SMIE's tables and is expected to be placed on `post-self-insert-hook'. ...@@ -915,7 +915,7 @@ This uses SMIE's tables and is expected to be placed on `post-self-insert-hook'.
;; anything else than this trigger char, lest we'd blink ;; anything else than this trigger char, lest we'd blink
;; both when inserting the trigger char and when ;; both when inserting the trigger char and when
;; inserting a subsequent trigger char like SPC. ;; inserting a subsequent trigger char like SPC.
(or (eq (point) pos) (or (eq (char-before) last-command-event)
(not (memq (char-before) (not (memq (char-before)
smie-blink-matching-triggers))) smie-blink-matching-triggers)))
(or smie-blink-matching-inners (or smie-blink-matching-inners
...@@ -998,7 +998,10 @@ the beginning of a line." ...@@ -998,7 +998,10 @@ the beginning of a line."
(unless (numberp (cadr (assoc tok smie-grammar))) (unless (numberp (cadr (assoc tok smie-grammar)))
(goto-char pos)) (goto-char pos))
(setq smie--parent (setq smie--parent
(smie-backward-sexp 'halfsexp)))))) (or (smie-backward-sexp 'halfsexp)
(let (res)
(while (null (setq res (smie-backward-sexp))))
(list nil (point) (nth 2 res)))))))))
(defun smie-rule-parent-p (&rest parents) (defun smie-rule-parent-p (&rest parents)
"Return non-nil if the current token's parent is among PARENTS. "Return non-nil if the current token's parent is among PARENTS.
...@@ -1403,6 +1406,10 @@ should not be computed on the basis of the following token." ...@@ -1403,6 +1406,10 @@ should not be computed on the basis of the following token."
(and (nth 4 (syntax-ppss)) (and (nth 4 (syntax-ppss))
'noindent)) 'noindent))
(defun smie-indent-inside-string ()
(and (nth 3 (syntax-ppss))
'noindent))
(defun smie-indent-after-keyword () (defun smie-indent-after-keyword ()
;; Indentation right after a special keyword. ;; Indentation right after a special keyword.
(save-excursion (save-excursion
...@@ -1477,7 +1484,8 @@ should not be computed on the basis of the following token." ...@@ -1477,7 +1484,8 @@ should not be computed on the basis of the following token."
(defvar smie-indent-functions (defvar smie-indent-functions
'(smie-indent-fixindent smie-indent-bob smie-indent-close '(smie-indent-fixindent smie-indent-bob smie-indent-close
smie-indent-comment smie-indent-comment-continue smie-indent-comment-close smie-indent-comment smie-indent-comment-continue smie-indent-comment-close
smie-indent-comment-inside smie-indent-keyword smie-indent-after-keyword smie-indent-comment-inside smie-indent-inside-string
smie-indent-keyword smie-indent-after-keyword
smie-indent-exps) smie-indent-exps)
"Functions to compute the indentation. "Functions to compute the indentation.
Each function is called with no argument, shouldn't move point, and should Each function is called with no argument, shouldn't move point, and should
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment