* lisp/emacs-lisp/smie.el (smie-next-sexp): Fix up "other-end" info when
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 13 Jun 2014 15:31:17 +0000 (11:31 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 13 Jun 2014 15:31:17 +0000 (11:31 -0400)
bumping forward into a closing paren.

Fixes: debbugs:17761

lisp/ChangeLog
lisp/emacs-lisp/smie.el

index 1ecc6a1..db615f6 100644 (file)
@@ -1,5 +1,8 @@
 2014-06-13  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * emacs-lisp/smie.el (smie-next-sexp): Fix up "other-end" info when
+       bumping forward into a closing paren (bug#17761).
+
        * term/xterm.el (xterm--version-handler): Work around for OSX
        Terminal.app (bug#17607).
 
index e65f873..3e40d37 100644 (file)
@@ -709,7 +709,8 @@ Possible return values:
                 (condition-case err
                     (progn (funcall next-sexp 1) nil)
                   (scan-error
-                   (let ((epos (nth 2 err)))
+                   (let* ((epos1 (nth 2 err))
+                          (epos (if (<= (point) epos1) (nth 3 err) epos1)))
                      (goto-char pos)
                      (throw 'return
                             (list t epos
@@ -1832,6 +1833,8 @@ KEYWORDS are additional arguments, which can use the following keywords:
                     (append smie-blink-matching-triggers
                             (delete-dups triggers)))))))
 
+(declare-function edebug-instrument-function "edebug" (func))
+
 (defun smie-edebug ()
   "Instrument the `smie-rules-function' for Edebug."
   (interactive)