(semantic-calculate-scope-for-tag): Also save-excursion in case the internal jump
authorEric Ludlam <[email protected]>
Fri, 18 Mar 2016 18:47:15 +0000 (18 14:47 -0400)
committerEric Ludlam <[email protected]>
Fri, 18 Mar 2016 18:47:15 +0000 (18 14:47 -0400)
is local and moves point.

lisp/cedet/semantic/scope.el

index faa0b30..00f1b6c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; semantic/scope.el --- Analyzer Scope Calculations
 
-;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2016 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <[email protected]>
 
@@ -775,10 +775,11 @@ The class returned from the scope calculation is variable
 Return nil if TAG has no position, or we cannot otherwise find a scope.
 Use this when pulling a datatype off TAG so when it is looked up
 it has the right context around it."
-   (save-current-buffer
-     (when (semantic-tag-with-position-p tag)
-       (semantic-go-to-tag tag)
-       (semantic-calculate-scope (point)))) )
+  (save-excursion
+    (save-current-buffer
+      (when (semantic-tag-with-position-p tag)
+       (semantic-go-to-tag tag)
+       (semantic-calculate-scope (point)))) ))
 
 (defun semantic-scope-find (name &optional class scope-in)
   "Find the tag with NAME, and optional CLASS in the current SCOPE-IN.