diff options
| author | Lars Ingebrigtsen | 2019-06-14 15:15:09 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-06-14 15:15:09 +0200 |
| commit | 595e12c2da7b5053f56f57ba59a6156ac239bbf0 (patch) | |
| tree | 619386fee9e918d62a409729fd80ac740ce6543f | |
| parent | c213422fd33cf00ef0e2515ec9639bdc06ea45c5 (diff) | |
| download | emacs-595e12c2da7b5053f56f57ba59a6156ac239bbf0.tar.gz emacs-595e12c2da7b5053f56f57ba59a6156ac239bbf0.zip | |
Move functions from semantic.el to analyze.el to avoid warnings
* lisp/cedet/semantic.el (semantic-analyze-completion-at-point-function)
(semantic-analyze-notc-completion-at-point-function)
(semantic-analyze-nolongprefix-completion-at-point-function): Add
autoloads for the moved functions.
* lisp/cedet/semantic/analyze.el
(semantic-analyze-completion-at-point-function)
(semantic-analyze-notc-completion-at-point-function)
(semantic-analyze-nolongprefix-completion-at-point-function): Move
here from semantic.el to avoid getting compilation warnings about
unknown slot `bounds'.
| -rw-r--r-- | lisp/cedet/semantic.el | 61 | ||||
| -rw-r--r-- | lisp/cedet/semantic/analyze.el | 52 |
2 files changed, 62 insertions, 51 deletions
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el index 3c844610e41..5e05d86d113 100644 --- a/lisp/cedet/semantic.el +++ b/lisp/cedet/semantic.el | |||
| @@ -1168,57 +1168,6 @@ Semantic mode. | |||
| 1168 | ;; re-activated. | 1168 | ;; re-activated. |
| 1169 | (setq semantic-new-buffer-fcn-was-run nil))) | 1169 | (setq semantic-new-buffer-fcn-was-run nil))) |
| 1170 | 1170 | ||
| 1171 | ;;; Completion At Point functions | ||
| 1172 | (defun semantic-analyze-completion-at-point-function () | ||
| 1173 | "Return possible analysis completions at point. | ||
| 1174 | The completions provided are via `semantic-analyze-possible-completions'. | ||
| 1175 | This function can be used by `completion-at-point-functions'." | ||
| 1176 | (when (semantic-active-p) | ||
| 1177 | (let* ((ctxt (semantic-analyze-current-context)) | ||
| 1178 | (possible (semantic-analyze-possible-completions ctxt))) | ||
| 1179 | |||
| 1180 | ;; The return from this is either: | ||
| 1181 | ;; nil - not applicable here. | ||
| 1182 | ;; A list: (START END COLLECTION . PROPS) | ||
| 1183 | (when possible | ||
| 1184 | (list (car (oref ctxt bounds)) | ||
| 1185 | (cdr (oref ctxt bounds)) | ||
| 1186 | possible)) | ||
| 1187 | ))) | ||
| 1188 | |||
| 1189 | (defun semantic-analyze-notc-completion-at-point-function () | ||
| 1190 | "Return possible analysis completions at point. | ||
| 1191 | The completions provided are via `semantic-analyze-possible-completions', | ||
| 1192 | but with the `no-tc' option passed in, which means constraints based | ||
| 1193 | on what is being assigned to are ignored. | ||
| 1194 | This function can be used by `completion-at-point-functions'." | ||
| 1195 | (when (semantic-active-p) | ||
| 1196 | (let* ((ctxt (semantic-analyze-current-context)) | ||
| 1197 | (possible (semantic-analyze-possible-completions ctxt 'no-tc))) | ||
| 1198 | |||
| 1199 | (when possible | ||
| 1200 | (list (car (oref ctxt bounds)) | ||
| 1201 | (cdr (oref ctxt bounds)) | ||
| 1202 | possible)) | ||
| 1203 | ))) | ||
| 1204 | |||
| 1205 | (defun semantic-analyze-nolongprefix-completion-at-point-function () | ||
| 1206 | "Return possible analysis completions at point. | ||
| 1207 | The completions provided are via `semantic-analyze-possible-completions', | ||
| 1208 | but with the `no-tc' and `no-longprefix' option passed in, which means | ||
| 1209 | constraints resulting in a long multi-symbol dereference are ignored. | ||
| 1210 | This function can be used by `completion-at-point-functions'." | ||
| 1211 | (when (semantic-active-p) | ||
| 1212 | (let* ((ctxt (semantic-analyze-current-context)) | ||
| 1213 | (possible (semantic-analyze-possible-completions | ||
| 1214 | ctxt 'no-tc 'no-longprefix))) | ||
| 1215 | |||
| 1216 | (when possible | ||
| 1217 | (list (car (oref ctxt bounds)) | ||
| 1218 | (cdr (oref ctxt bounds)) | ||
| 1219 | possible)) | ||
| 1220 | ))) | ||
| 1221 | |||
| 1222 | ;;; Autoload some functions that are not in semantic/loaddefs | 1171 | ;;; Autoload some functions that are not in semantic/loaddefs |
| 1223 | 1172 | ||
| 1224 | (autoload 'global-semantic-idle-completions-mode "semantic/idle" | 1173 | (autoload 'global-semantic-idle-completions-mode "semantic/idle" |
| @@ -1259,6 +1208,16 @@ Call `semantic-symref-hits-in-region' to identify local references." t nil) | |||
| 1259 | (autoload 'srecode-template-setup-parser "srecode/srecode-template" | 1208 | (autoload 'srecode-template-setup-parser "srecode/srecode-template" |
| 1260 | "Set up buffer for parsing SRecode template files." t nil) | 1209 | "Set up buffer for parsing SRecode template files." t nil) |
| 1261 | 1210 | ||
| 1211 | (autoload 'semantic-analyze-completion-at-point-function "semantic/analyze" | ||
| 1212 | "Return possible analysis completions at point.") | ||
| 1213 | |||
| 1214 | (autoload 'semantic-analyze-notc-completion-at-point-function "semantic/analyze" | ||
| 1215 | "Return possible analysis completions at point.") | ||
| 1216 | |||
| 1217 | (autoload 'semantic-analyze-nolongprefix-completion-at-point-function | ||
| 1218 | "semantic/analyze" | ||
| 1219 | "Return possible analysis completions at point.") | ||
| 1220 | |||
| 1262 | (provide 'semantic) | 1221 | (provide 'semantic) |
| 1263 | 1222 | ||
| 1264 | ;; Semantic-util is a part of the semantic API. Include it last | 1223 | ;; Semantic-util is a part of the semantic API. Include it last |
diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el index 8f1d92822e6..6851ad556a7 100644 --- a/lisp/cedet/semantic/analyze.el +++ b/lisp/cedet/semantic/analyze.el | |||
| @@ -819,6 +819,58 @@ CONTEXT's content is described in `semantic-analyze-current-context'." | |||
| 819 | (get-buffer-window "*Semantic Context Analysis*")) | 819 | (get-buffer-window "*Semantic Context Analysis*")) |
| 820 | ) | 820 | ) |
| 821 | 821 | ||
| 822 | |||
| 823 | ;;; Completion At Point functions | ||
| 824 | (defun semantic-analyze-completion-at-point-function () | ||
| 825 | "Return possible analysis completions at point. | ||
| 826 | The completions provided are via `semantic-analyze-possible-completions'. | ||
| 827 | This function can be used by `completion-at-point-functions'." | ||
| 828 | (when (semantic-active-p) | ||
| 829 | (let* ((ctxt (semantic-analyze-current-context)) | ||
| 830 | (possible (semantic-analyze-possible-completions ctxt))) | ||
| 831 | |||
| 832 | ;; The return from this is either: | ||
| 833 | ;; nil - not applicable here. | ||
| 834 | ;; A list: (START END COLLECTION . PROPS) | ||
| 835 | (when possible | ||
| 836 | (list (car (oref ctxt bounds)) | ||
| 837 | (cdr (oref ctxt bounds)) | ||
| 838 | possible)) | ||
| 839 | ))) | ||
| 840 | |||
| 841 | (defun semantic-analyze-notc-completion-at-point-function () | ||
| 842 | "Return possible analysis completions at point. | ||
| 843 | The completions provided are via `semantic-analyze-possible-completions', | ||
| 844 | but with the `no-tc' option passed in, which means constraints based | ||
| 845 | on what is being assigned to are ignored. | ||
| 846 | This function can be used by `completion-at-point-functions'." | ||
| 847 | (when (semantic-active-p) | ||
| 848 | (let* ((ctxt (semantic-analyze-current-context)) | ||
| 849 | (possible (semantic-analyze-possible-completions ctxt 'no-tc))) | ||
| 850 | |||
| 851 | (when possible | ||
| 852 | (list (car (oref ctxt bounds)) | ||
| 853 | (cdr (oref ctxt bounds)) | ||
| 854 | possible)) | ||
| 855 | ))) | ||
| 856 | |||
| 857 | (defun semantic-analyze-nolongprefix-completion-at-point-function () | ||
| 858 | "Return possible analysis completions at point. | ||
| 859 | The completions provided are via `semantic-analyze-possible-completions', | ||
| 860 | but with the `no-tc' and `no-longprefix' option passed in, which means | ||
| 861 | constraints resulting in a long multi-symbol dereference are ignored. | ||
| 862 | This function can be used by `completion-at-point-functions'." | ||
| 863 | (when (semantic-active-p) | ||
| 864 | (let* ((ctxt (semantic-analyze-current-context)) | ||
| 865 | (possible (semantic-analyze-possible-completions | ||
| 866 | ctxt 'no-tc 'no-longprefix))) | ||
| 867 | |||
| 868 | (when possible | ||
| 869 | (list (car (oref ctxt bounds)) | ||
| 870 | (cdr (oref ctxt bounds)) | ||
| 871 | possible)) | ||
| 872 | ))) | ||
| 873 | |||
| 822 | (provide 'semantic/analyze) | 874 | (provide 'semantic/analyze) |
| 823 | 875 | ||
| 824 | ;; Local variables: | 876 | ;; Local variables: |