emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 2d8b2fd 1/2: Restore point when writing semantic


From: David Engster
Subject: [Emacs-diffs] emacs-25 2d8b2fd 1/2: Restore point when writing semantic table to disk
Date: Sun, 21 Feb 2016 16:24:01 +0000

branch: emacs-25
commit 2d8b2fd034ccc61f949b408373342b5f9f8ba592
Author: David Engster <address@hidden>
Commit: David Engster <address@hidden>

    Restore point when writing semantic table to disk
    
    * lisp/cedet/semantic/db-file.el (object-write): Wrap call to
      `semantic-fetch-tags' in `save-excursion', since it might move point
      in current buffer. (Bug #22287)
---
 lisp/cedet/semantic/db-file.el |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el
index d9dd1f9..0ae433f 100644
--- a/lisp/cedet/semantic/db-file.el
+++ b/lisp/cedet/semantic/db-file.el
@@ -287,22 +287,22 @@ Argument OBJ is the object to write."
   (when (semanticdb-live-p obj)
     (when (semanticdb-in-buffer-p obj)
       (with-current-buffer (semanticdb-in-buffer-p obj)
-
-       ;; Make sure all our tag lists are up to date.
-       (semantic-fetch-tags)
-
-       ;; Try to get an accurate unmatched syntax table.
-       (when (and (boundp semantic-show-unmatched-syntax-mode)
-                  semantic-show-unmatched-syntax-mode)
-         ;; Only do this if the user runs unmatched syntax
-         ;; mode display entries.
-         (oset obj unmatched-syntax
-               (semantic-show-unmatched-lex-tokens-fetch))
-         )
-
-       ;; Make sure pointmax is up to date
-       (oset obj pointmax (point-max))
-       ))
+        (save-excursion
+          ;; Make sure all our tag lists are up to date.
+          (semantic-fetch-tags)
+
+          ;; Try to get an accurate unmatched syntax table.
+          (when (and (boundp semantic-show-unmatched-syntax-mode)
+                     semantic-show-unmatched-syntax-mode)
+            ;; Only do this if the user runs unmatched syntax
+            ;; mode display entries.
+            (oset obj unmatched-syntax
+                  (semantic-show-unmatched-lex-tokens-fetch))
+            )
+
+          ;; Make sure pointmax is up to date
+          (oset obj pointmax (point-max))
+          )))
 
     ;; Make sure that the file size and other attributes are
     ;; up to date.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]