diff options
| author | Stefan Monnier | 2011-02-10 14:40:17 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2011-02-10 14:40:17 -0500 |
| commit | 9517f8af147c034fd2242377a5212c8de4115e1f (patch) | |
| tree | 4b072e0b8fa47d0e0148001284cf4b9548e92738 | |
| parent | cf77dd27af3e9893f4051887cb0e17999bbdb631 (diff) | |
| download | emacs-9517f8af147c034fd2242377a5212c8de4115e1f.tar.gz emacs-9517f8af147c034fd2242377a5212c8de4115e1f.zip | |
* 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.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/smie.el | 16 |
2 files changed, 18 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 70dc7697814..e89003e724b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2011-02-10 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2011-02-10 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * emacs-lisp/smie.el (smie-blink-matching-open): Don't use `pos' in two | ||
| 4 | conflicting ways. | ||
| 5 | (smie-indent--parent): Extend to "parent of arg". | ||
| 6 | (smie-indent-inside-string): New function. | ||
| 7 | (smie-indent-functions): Use it. | ||
| 8 | |||
| 3 | * vc/vc-dir.el (vc-dir-refresh): Reorder operations to try and avoid | 9 | * vc/vc-dir.el (vc-dir-refresh): Reorder operations to try and avoid |
| 4 | bzr locking race condition. | 10 | bzr locking race condition. |
| 5 | 11 | ||
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 702e8d880ba..e81a8b37981 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el | |||
| @@ -915,7 +915,7 @@ This uses SMIE's tables and is expected to be placed on `post-self-insert-hook'. | |||
| 915 | ;; anything else than this trigger char, lest we'd blink | 915 | ;; anything else than this trigger char, lest we'd blink |
| 916 | ;; both when inserting the trigger char and when | 916 | ;; both when inserting the trigger char and when |
| 917 | ;; inserting a subsequent trigger char like SPC. | 917 | ;; inserting a subsequent trigger char like SPC. |
| 918 | (or (eq (point) pos) | 918 | (or (eq (char-before) last-command-event) |
| 919 | (not (memq (char-before) | 919 | (not (memq (char-before) |
| 920 | smie-blink-matching-triggers))) | 920 | smie-blink-matching-triggers))) |
| 921 | (or smie-blink-matching-inners | 921 | (or smie-blink-matching-inners |
| @@ -998,7 +998,10 @@ the beginning of a line." | |||
| 998 | (unless (numberp (cadr (assoc tok smie-grammar))) | 998 | (unless (numberp (cadr (assoc tok smie-grammar))) |
| 999 | (goto-char pos)) | 999 | (goto-char pos)) |
| 1000 | (setq smie--parent | 1000 | (setq smie--parent |
| 1001 | (smie-backward-sexp 'halfsexp)))))) | 1001 | (or (smie-backward-sexp 'halfsexp) |
| 1002 | (let (res) | ||
| 1003 | (while (null (setq res (smie-backward-sexp)))) | ||
| 1004 | (list nil (point) (nth 2 res))))))))) | ||
| 1002 | 1005 | ||
| 1003 | (defun smie-rule-parent-p (&rest parents) | 1006 | (defun smie-rule-parent-p (&rest parents) |
| 1004 | "Return non-nil if the current token's parent is among PARENTS. | 1007 | "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 | (and (nth 4 (syntax-ppss)) | 1406 | (and (nth 4 (syntax-ppss)) |
| 1404 | 'noindent)) | 1407 | 'noindent)) |
| 1405 | 1408 | ||
| 1409 | (defun smie-indent-inside-string () | ||
| 1410 | (and (nth 3 (syntax-ppss)) | ||
| 1411 | 'noindent)) | ||
| 1412 | |||
| 1406 | (defun smie-indent-after-keyword () | 1413 | (defun smie-indent-after-keyword () |
| 1407 | ;; Indentation right after a special keyword. | 1414 | ;; Indentation right after a special keyword. |
| 1408 | (save-excursion | 1415 | (save-excursion |
| @@ -1476,8 +1483,9 @@ should not be computed on the basis of the following token." | |||
| 1476 | 1483 | ||
| 1477 | (defvar smie-indent-functions | 1484 | (defvar smie-indent-functions |
| 1478 | '(smie-indent-fixindent smie-indent-bob smie-indent-close | 1485 | '(smie-indent-fixindent smie-indent-bob smie-indent-close |
| 1479 | smie-indent-comment smie-indent-comment-continue smie-indent-comment-close | 1486 | smie-indent-comment smie-indent-comment-continue smie-indent-comment-close |
| 1480 | smie-indent-comment-inside smie-indent-keyword smie-indent-after-keyword | 1487 | smie-indent-comment-inside smie-indent-inside-string |
| 1488 | smie-indent-keyword smie-indent-after-keyword | ||
| 1481 | smie-indent-exps) | 1489 | smie-indent-exps) |
| 1482 | "Functions to compute the indentation. | 1490 | "Functions to compute the indentation. |
| 1483 | Each function is called with no argument, shouldn't move point, and should | 1491 | Each function is called with no argument, shouldn't move point, and should |