diff options
| author | Stefan Monnier | 2014-06-19 18:07:09 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-06-19 18:07:09 -0400 |
| commit | cb5f7e19f2e71dec8cae189c7233f31610d543aa (patch) | |
| tree | daab140d68231d2aed2fd9b0b6550840495f0bb6 | |
| parent | da20e0f1a8ab6b4c0713b237315dd1bd383f8f76 (diff) | |
| download | emacs-cb5f7e19f2e71dec8cae189c7233f31610d543aa.tar.gz emacs-cb5f7e19f2e71dec8cae189c7233f31610d543aa.zip | |
* 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.
| -rw-r--r-- | lisp/cedet/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/cedet/semantic/ia.el | 80 |
2 files changed, 47 insertions, 39 deletions
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index 56f186fe588..820e75260a9 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-06-19 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * semantic/ia.el (semantic-ia-complete-symbol-menu): Use posn-at-point | ||
| 4 | instead of senator-completion-menu-point-as-event; un-comment, tho keep | ||
| 5 | the "no smart completion" fallback commented since it still doesn't work. | ||
| 6 | |||
| 1 | 2014-05-01 Glenn Morris <rgm@gnu.org> | 7 | 2014-05-01 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * ede.el (ede-project-directories, ede-check-project-directory): | 9 | * ede.el (ede-project-directories, ede-check-project-directory): |
diff --git a/lisp/cedet/semantic/ia.el b/lisp/cedet/semantic/ia.el index 10e84880ab6..8a5cbac4129 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'." | |||
| 150 | :group 'semantic | 150 | :group 'semantic |
| 151 | :type semantic-format-tag-custom-list) | 151 | :type semantic-format-tag-custom-list) |
| 152 | 152 | ||
| 153 | ;; Disabled - see http://debbugs.gnu.org/14522 | 153 | ;;;###autoload |
| 154 | ;; ;;;###autoload | 154 | (defun semantic-ia-complete-symbol-menu (point) |
| 155 | ;; (defun semantic-ia-complete-symbol-menu (point) | 155 | "Complete the current symbol via a menu based at POINT. |
| 156 | ;; "Complete the current symbol via a menu based at POINT. | 156 | Completion options are calculated with `semantic-analyze-possible-completions'." |
| 157 | ;; Completion options are calculated with `semantic-analyze-possible-completions'." | 157 | (interactive "d") |
| 158 | ;; (interactive "d") | 158 | (require 'imenu) |
| 159 | ;; (require 'imenu) | 159 | (let* ((a (semantic-analyze-current-context point)) |
| 160 | ;; (let* ((a (semantic-analyze-current-context point)) | 160 | (syms (semantic-analyze-possible-completions a)) |
| 161 | ;; (syms (semantic-analyze-possible-completions a)) | 161 | ) |
| 162 | ;; ) | 162 | ;; Complete this symbol. |
| 163 | ;; ;; Complete this symbol. | 163 | (if (not syms) |
| 164 | ;; (if (not syms) | 164 | (progn |
| 165 | ;; (progn | 165 | (message "No smart completions found.") |
| 166 | ;; (message "No smart completions found. Trying Senator.") | 166 | ;; Disabled - see http://debbugs.gnu.org/14522 |
| 167 | ;; (when (semantic-analyze-context-p a) | 167 | ;; (message "No smart completions found. Trying Senator.") |
| 168 | ;; ;; This is a quick way of getting a nice completion list | 168 | ;; (when (semantic-analyze-context-p a) |
| 169 | ;; ;; in the menu if the regular context mechanism fails. | 169 | ;; ;; This is a quick way of getting a nice completion list |
| 170 | ;; (senator-completion-menu-popup))) | 170 | ;; ;; in the menu if the regular context mechanism fails. |
| 171 | ;; | 171 | ;; (senator-completion-menu-popup)) |
| 172 | ;; (let* ((menu | 172 | ) |
| 173 | ;; (mapcar | 173 | |
| 174 | ;; (lambda (tag) | 174 | (let* ((menu |
| 175 | ;; (cons | 175 | (mapcar |
| 176 | ;; (funcall semantic-ia-completion-menu-format-tag-function tag) | 176 | (lambda (tag) |
| 177 | ;; (vector tag))) | 177 | (cons |
| 178 | ;; syms)) | 178 | (funcall semantic-ia-completion-menu-format-tag-function tag) |
| 179 | ;; (ans | 179 | (vector tag))) |
| 180 | ;; (imenu--mouse-menu | 180 | syms)) |
| 181 | ;; ;; XEmacs needs that the menu has at least 2 items. So, | 181 | (ans |
| 182 | ;; ;; include a nil item that will be ignored by imenu. | 182 | (imenu--mouse-menu |
| 183 | ;; (cons nil menu) | 183 | ;; XEmacs needs that the menu has at least 2 items. So, |
| 184 | ;; (senator-completion-menu-point-as-event) | 184 | ;; include a nil item that will be ignored by imenu. |
| 185 | ;; "Completions"))) | 185 | (cons nil menu) |
| 186 | ;; (when ans | 186 | `(down-mouse-1 ,(posn-at-point)) |
| 187 | ;; (if (not (semantic-tag-p ans)) | 187 | "Completions"))) |
| 188 | ;; (setq ans (aref (cdr ans) 0))) | 188 | (when ans |
| 189 | ;; (delete-region (car (oref a bounds)) (cdr (oref a bounds))) | 189 | (if (not (semantic-tag-p ans)) |
| 190 | ;; (semantic-ia-insert-tag ans)) | 190 | (setq ans (aref (cdr ans) 0))) |
| 191 | ;; )))) | 191 | (delete-region (car (oref a bounds)) (cdr (oref a bounds))) |
| 192 | (semantic-ia-insert-tag ans)) | ||
| 193 | )))) | ||
| 192 | 194 | ||
| 193 | ;;; Completions Tip | 195 | ;;; Completions Tip |
| 194 | ;; | 196 | ;; |