]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic.el
Merge from origin/emacs-24
[gnu-emacs] / lisp / cedet / semantic.el
index 6bd090cf83856eb70005217500834cd8d51d4fbb..50e2082600b89390c24a189b97354c22cdc443bf 100644 (file)
@@ -1174,17 +1174,18 @@ Semantic mode.
   "Return possible analysis completions at point.
 The completions provided are via `semantic-analyze-possible-completions'.
 This function can be used by `completion-at-point-functions'."
-  (let* ((ctxt (semantic-analyze-current-context))
-        (possible (semantic-analyze-possible-completions ctxt)))
-
-    ;; The return from this is either:
-    ;; nil - not applicable here.
-    ;; A list: (START END COLLECTION . PROPS)
-    (when possible
-      (list (car (oref ctxt bounds))
-           (cdr (oref ctxt bounds))
-           possible))
-    ))
+  (when (semantic-active-p)
+    (let* ((ctxt (semantic-analyze-current-context))
+           (possible (semantic-analyze-possible-completions ctxt)))
+
+      ;; The return from this is either:
+      ;; nil - not applicable here.
+      ;; A list: (START END COLLECTION . PROPS)
+      (when possible
+        (list (car (oref ctxt bounds))
+              (cdr (oref ctxt bounds))
+              possible))
+      )))
 
 (defun semantic-analyze-notc-completion-at-point-function ()
   "Return possible analysis completions at point.
@@ -1192,14 +1193,15 @@ The completions provided are via `semantic-analyze-possible-completions',
 but with the 'no-tc option passed in, which means constraints based
 on what is being assigned to are ignored.
 This function can be used by `completion-at-point-functions'."
-  (let* ((ctxt (semantic-analyze-current-context))
-        (possible (semantic-analyze-possible-completions ctxt 'no-tc)))
+  (when (semantic-active-p)
+    (let* ((ctxt (semantic-analyze-current-context))
+           (possible (semantic-analyze-possible-completions ctxt 'no-tc)))
 
-    (when possible
-      (list (car (oref ctxt bounds))
-           (cdr (oref ctxt bounds))
-           possible))
-    ))
+      (when possible
+        (list (car (oref ctxt bounds))
+              (cdr (oref ctxt bounds))
+              possible))
+      )))
 
 (defun semantic-analyze-nolongprefix-completion-at-point-function ()
   "Return possible analysis completions at point.
@@ -1207,15 +1209,16 @@ The completions provided are via `semantic-analyze-possible-completions',
 but with the 'no-tc and 'no-longprefix option passed in, which means
 constraints resulting in a long multi-symbol dereference are ignored.
 This function can be used by `completion-at-point-functions'."
-  (let* ((ctxt (semantic-analyze-current-context))
-        (possible (semantic-analyze-possible-completions
-                   ctxt 'no-tc 'no-longprefix)))
-
-    (when possible
-      (list (car (oref ctxt bounds))
-           (cdr (oref ctxt bounds))
-           possible))
-    ))
+  (when (semantic-active-p)
+    (let* ((ctxt (semantic-analyze-current-context))
+           (possible (semantic-analyze-possible-completions
+                      ctxt 'no-tc 'no-longprefix)))
+
+      (when possible
+        (list (car (oref ctxt bounds))
+              (cdr (oref ctxt bounds))
+              possible))
+      )))
 
 ;;; Autoload some functions that are not in semantic/loaddefs