aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2014-06-19 18:07:09 -0400
committerStefan Monnier <[email protected]>2014-06-19 18:07:09 -0400
commitcb5f7e19f2e71dec8cae189c7233f31610d543aa (patch)
treedaab140d68231d2aed2fd9b0b6550840495f0bb6 /lisp
parentda20e0f1a8ab6b4c0713b237315dd1bd383f8f76 (diff)
* cedet/semantic/ia.el (semantic-ia-complete-symbol-menu): Use posn-at-point
instead of senator-completion-menu-point-as-event; un-comment, tho keep the "no smart completion" fallback commented since it still doesn't work.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/cedet/ChangeLog6
-rw-r--r--lisp/cedet/semantic/ia.el80
2 files changed, 47 insertions, 39 deletions
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 56f186fe58..820e75260a 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,9 @@
+2014-06-19 Stefan Monnier <[email protected]>
+
+ * semantic/ia.el (semantic-ia-complete-symbol-menu): Use posn-at-point
+ instead of senator-completion-menu-point-as-event; un-comment, tho keep
+ the "no smart completion" fallback commented since it still doesn't work.
+
2014-05-01 Glenn Morris <[email protected]>
* ede.el (ede-project-directories, ede-check-project-directory):
diff --git a/lisp/cedet/semantic/ia.el b/lisp/cedet/semantic/ia.el
index 10e84880ab..8a5cbac412 100644
--- a/lisp/cedet/semantic/ia.el
+++ b/lisp/cedet/semantic/ia.el
@@ -150,45 +150,47 @@ Completion options are calculated with `semantic-analyze-possible-completions'."
:group 'semantic
:type semantic-format-tag-custom-list)
-;; Disabled - see http://debbugs.gnu.org/14522
-;; ;;;###autoload
-;; (defun semantic-ia-complete-symbol-menu (point)
-;; "Complete the current symbol via a menu based at POINT.
-;; Completion options are calculated with `semantic-analyze-possible-completions'."
-;; (interactive "d")
-;; (require 'imenu)
-;; (let* ((a (semantic-analyze-current-context point))
-;; (syms (semantic-analyze-possible-completions a))
-;; )
-;; ;; Complete this symbol.
-;; (if (not syms)
-;; (progn
-;; (message "No smart completions found. Trying Senator.")
-;; (when (semantic-analyze-context-p a)
-;; ;; This is a quick way of getting a nice completion list
-;; ;; in the menu if the regular context mechanism fails.
-;; (senator-completion-menu-popup)))
-;;
-;; (let* ((menu
-;; (mapcar
-;; (lambda (tag)
-;; (cons
-;; (funcall semantic-ia-completion-menu-format-tag-function tag)
-;; (vector tag)))
-;; syms))
-;; (ans
-;; (imenu--mouse-menu
-;; ;; XEmacs needs that the menu has at least 2 items. So,
-;; ;; include a nil item that will be ignored by imenu.
-;; (cons nil menu)
-;; (senator-completion-menu-point-as-event)
-;; "Completions")))
-;; (when ans
-;; (if (not (semantic-tag-p ans))
-;; (setq ans (aref (cdr ans) 0)))
-;; (delete-region (car (oref a bounds)) (cdr (oref a bounds)))
-;; (semantic-ia-insert-tag ans))
-;; ))))
+;;;###autoload
+(defun semantic-ia-complete-symbol-menu (point)
+ "Complete the current symbol via a menu based at POINT.
+Completion options are calculated with `semantic-analyze-possible-completions'."
+ (interactive "d")
+ (require 'imenu)
+ (let* ((a (semantic-analyze-current-context point))
+ (syms (semantic-analyze-possible-completions a))
+ )
+ ;; Complete this symbol.
+ (if (not syms)
+ (progn
+ (message "No smart completions found.")
+ ;; Disabled - see http://debbugs.gnu.org/14522
+ ;; (message "No smart completions found. Trying Senator.")
+ ;; (when (semantic-analyze-context-p a)
+ ;; ;; This is a quick way of getting a nice completion list
+ ;; ;; in the menu if the regular context mechanism fails.
+ ;; (senator-completion-menu-popup))
+ )
+
+ (let* ((menu
+ (mapcar
+ (lambda (tag)
+ (cons
+ (funcall semantic-ia-completion-menu-format-tag-function tag)
+ (vector tag)))
+ syms))
+ (ans
+ (imenu--mouse-menu
+ ;; XEmacs needs that the menu has at least 2 items. So,
+ ;; include a nil item that will be ignored by imenu.
+ (cons nil menu)
+ `(down-mouse-1 ,(posn-at-point))
+ "Completions")))
+ (when ans
+ (if (not (semantic-tag-p ans))
+ (setq ans (aref (cdr ans) 0)))
+ (delete-region (car (oref a bounds)) (cdr (oref a bounds)))
+ (semantic-ia-insert-tag ans))
+ ))))
;;; Completions Tip
;;