From 02644fe47bc8380104e16a05e9e980f30c0c264a Mon Sep 17 00:00:00 2001 From: Eric Ludlam Date: Fri, 18 Mar 2016 14:47:15 -0400 Subject: [PATCH] semantic: Add missing save-excursion for scope calculation * lisp/cedet/semantic/scope.el (semantic-calculate-scope-for-tag): Also save-excursion in case the internal jump is local and moves point. --- lisp/cedet/semantic/scope.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/cedet/semantic/scope.el b/lisp/cedet/semantic/scope.el index 0ac994cbd49..36a08d208af 100644 --- a/lisp/cedet/semantic/scope.el +++ b/lisp/cedet/semantic/scope.el @@ -774,10 +774,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. -- 2.39.5