diff options
| author | Lars Ingebrigtsen | 2019-06-27 18:13:18 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-06-27 18:13:18 +0200 |
| commit | 2fbcda71a9f1d6ebff041203cb5ca4979decdf3e (patch) | |
| tree | 5499e872ac1bed77d588d1faf2d3e58ff5d9f48d /lisp/cedet/semantic | |
| parent | 8a11e430ec261c08cc928a7a5b05ee1027f50368 (diff) | |
| download | emacs-2fbcda71a9f1d6ebff041203cb5ca4979decdf3e.tar.gz emacs-2fbcda71a9f1d6ebff041203cb5ca4979decdf3e.zip | |
Rename displayor to displayer in CEDET
* doc/misc/sem-user.texi (Idle Completions Mode): Rename
displayor->displayer throughout.
(Idle Completions Mode): Ditto.
* lisp/cedet/semantic/complete.el: Rename displayor->displayer
throughout and add aliases for all the methods that used that name.
Diffstat (limited to 'lisp/cedet/semantic')
| -rw-r--r-- | lisp/cedet/semantic/complete.el | 387 | ||||
| -rw-r--r-- | lisp/cedet/semantic/idle.el | 2 |
2 files changed, 219 insertions, 170 deletions
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el index e95f08eb91e..b438a1c6e22 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el | |||
| @@ -72,17 +72,17 @@ | |||
| 72 | ;; plain name format, a postfix name such as method:class, or a | 72 | ;; plain name format, a postfix name such as method:class, or a |
| 73 | ;; prefix name such as class.method. | 73 | ;; prefix name such as class.method. |
| 74 | ;; | 74 | ;; |
| 75 | ;; DISPLAYORS | 75 | ;; DISPLAYERS |
| 76 | ;; | 76 | ;; |
| 77 | ;; A displayor is in charge if showing the user interesting things | 77 | ;; A displayer is in charge if showing the user interesting things |
| 78 | ;; about available completions, and can optionally provide a focus. | 78 | ;; about available completions, and can optionally provide a focus. |
| 79 | ;; The simplest display just lists all available names in a separate | 79 | ;; The simplest display just lists all available names in a separate |
| 80 | ;; window. It may even choose to show short names when there are | 80 | ;; window. It may even choose to show short names when there are |
| 81 | ;; many to choose from, or long names when there are fewer. | 81 | ;; many to choose from, or long names when there are fewer. |
| 82 | ;; | 82 | ;; |
| 83 | ;; A complex displayor could opt to help the user 'focus' on some | 83 | ;; A complex displayer could opt to help the user 'focus' on some |
| 84 | ;; range. For example, if 4 tags all have the same name, subsequent | 84 | ;; range. For example, if 4 tags all have the same name, subsequent |
| 85 | ;; calls to the displayor may opt to show each tag one at a time in | 85 | ;; calls to the displayer may opt to show each tag one at a time in |
| 86 | ;; the buffer. When the user likes one, selection would cause the | 86 | ;; the buffer. When the user likes one, selection would cause the |
| 87 | ;; 'focus' item to be selected. | 87 | ;; 'focus' item to be selected. |
| 88 | ;; | 88 | ;; |
| @@ -190,22 +190,22 @@ Keeps STRINGS only in the history.") | |||
| 190 | (defvar semantic-complete-active-default) | 190 | (defvar semantic-complete-active-default) |
| 191 | (defvar semantic-complete-current-matched-tag) | 191 | (defvar semantic-complete-current-matched-tag) |
| 192 | 192 | ||
| 193 | (defun semantic-complete-read-tag-engine (collector displayor prompt | 193 | (defun semantic-complete-read-tag-engine (collector displayer prompt |
| 194 | default-tag initial-input | 194 | default-tag initial-input |
| 195 | history) | 195 | history) |
| 196 | "Read a semantic tag, and return a tag for the selection. | 196 | "Read a semantic tag, and return a tag for the selection. |
| 197 | Argument COLLECTOR is an object which can be used to calculate | 197 | Argument COLLECTOR is an object which can be used to calculate |
| 198 | a list of possible hits. See `semantic-completion-collector-engine' | 198 | a list of possible hits. See `semantic-completion-collector-engine' |
| 199 | for details on COLLECTOR. | 199 | for details on COLLECTOR. |
| 200 | Argument DISPLAYOR is an object used to display a list of possible | 200 | Argument DISPLAYER is an object used to display a list of possible |
| 201 | completions for a given prefix. See`semantic-completion-display-engine' | 201 | completions for a given prefix. See`semantic-completion-display-engine' |
| 202 | for details on DISPLAYOR. | 202 | for details on DISPLAYER. |
| 203 | PROMPT is a string to prompt with. | 203 | PROMPT is a string to prompt with. |
| 204 | DEFAULT-TAG is a semantic tag or string to use as the default value. | 204 | DEFAULT-TAG is a semantic tag or string to use as the default value. |
| 205 | If INITIAL-INPUT is non-nil, insert it in the minibuffer initially. | 205 | If INITIAL-INPUT is non-nil, insert it in the minibuffer initially. |
| 206 | HISTORY is a symbol representing a variable to story the history in." | 206 | HISTORY is a symbol representing a variable to story the history in." |
| 207 | (let* ((semantic-completion-collector-engine collector) | 207 | (let* ((semantic-completion-collector-engine collector) |
| 208 | (semantic-completion-display-engine displayor) | 208 | (semantic-completion-display-engine displayer) |
| 209 | (semantic-complete-active-default nil) | 209 | (semantic-complete-active-default nil) |
| 210 | (semantic-complete-current-matched-tag nil) | 210 | (semantic-complete-current-matched-tag nil) |
| 211 | (default-as-tag (semantic-complete-default-to-tag default-tag)) | 211 | (default-as-tag (semantic-complete-default-to-tag default-tag)) |
| @@ -241,7 +241,7 @@ HISTORY is a symbol representing a variable to story the history in." | |||
| 241 | 'semantic-completion-default-history) | 241 | 'semantic-completion-default-history) |
| 242 | default-tag) | 242 | default-tag) |
| 243 | (semantic-collector-cleanup semantic-completion-collector-engine) | 243 | (semantic-collector-cleanup semantic-completion-collector-engine) |
| 244 | (semantic-displayor-cleanup semantic-completion-display-engine) | 244 | (semantic-displayer-cleanup semantic-completion-display-engine) |
| 245 | ) | 245 | ) |
| 246 | ;; | 246 | ;; |
| 247 | ;; Extract the tag from the completion machinery. | 247 | ;; Extract the tag from the completion machinery. |
| @@ -312,10 +312,10 @@ HISTORY is a symbol representing a variable to story the history in." | |||
| 312 | (defvar semantic-complete-current-matched-tag nil | 312 | (defvar semantic-complete-current-matched-tag nil |
| 313 | "Variable used to pass the tags being matched to the prompt.") | 313 | "Variable used to pass the tags being matched to the prompt.") |
| 314 | 314 | ||
| 315 | ;; semantic-displayor-focus-abstract-child-p is part of the | 315 | ;; semantic-displayer-focus-abstract-child-p is part of the |
| 316 | ;; semantic-displayor-focus-abstract class, defined later in this | 316 | ;; semantic-displayer-focus-abstract class, defined later in this |
| 317 | ;; file. | 317 | ;; file. |
| 318 | (declare-function semantic-displayor-focus-abstract-child-p "semantic/complete" | 318 | (declare-function semantic-displayer-focus-abstract-child-p "semantic/complete" |
| 319 | t t) | 319 | t t) |
| 320 | 320 | ||
| 321 | (defun semantic-complete-current-match () | 321 | (defun semantic-complete-current-match () |
| @@ -327,7 +327,7 @@ Return value can be: | |||
| 327 | string - a message to show in the minibuffer." | 327 | string - a message to show in the minibuffer." |
| 328 | ;; Query the environment for an active completion. | 328 | ;; Query the environment for an active completion. |
| 329 | (let ((collector semantic-completion-collector-engine) | 329 | (let ((collector semantic-completion-collector-engine) |
| 330 | (displayor semantic-completion-display-engine) | 330 | (displayer semantic-completion-display-engine) |
| 331 | (contents (semantic-completion-text)) | 331 | (contents (semantic-completion-text)) |
| 332 | matchlist | 332 | matchlist |
| 333 | answer) | 333 | answer) |
| @@ -339,20 +339,20 @@ Return value can be: | |||
| 339 | (semantic-collector-calculate-completions collector contents nil)) | 339 | (semantic-collector-calculate-completions collector contents nil)) |
| 340 | (semantic-complete-try-completion) | 340 | (semantic-complete-try-completion) |
| 341 | (cond | 341 | (cond |
| 342 | ;; Input match displayor focus entry | 342 | ;; Input match displayer focus entry |
| 343 | ((setq answer (semantic-displayor-current-focus displayor)) | 343 | ((setq answer (semantic-displayer-current-focus displayer)) |
| 344 | ;; We have answer, continue | 344 | ;; We have answer, continue |
| 345 | ) | 345 | ) |
| 346 | ;; One match from the collector | 346 | ;; One match from the collector |
| 347 | ((setq matchlist (semantic-collector-current-exact-match collector)) | 347 | ((setq matchlist (semantic-collector-current-exact-match collector)) |
| 348 | (if (= (semanticdb-find-result-length matchlist) 1) | 348 | (if (= (semanticdb-find-result-length matchlist) 1) |
| 349 | (setq answer (semanticdb-find-result-nth-in-buffer matchlist 0)) | 349 | (setq answer (semanticdb-find-result-nth-in-buffer matchlist 0)) |
| 350 | (if (semantic-displayor-focus-abstract-child-p displayor) | 350 | (if (semantic-displayer-focus-abstract-child-p displayer) |
| 351 | ;; For focusing displayors, we can claim this is | 351 | ;; For focusing displayers, we can claim this is |
| 352 | ;; not unique. Multiple focuses can choose the correct | 352 | ;; not unique. Multiple focuses can choose the correct |
| 353 | ;; one. | 353 | ;; one. |
| 354 | (setq answer "Not Unique") | 354 | (setq answer "Not Unique") |
| 355 | ;; If we don't have a focusing displayor, we need to do something | 355 | ;; If we don't have a focusing displayer, we need to do something |
| 356 | ;; graceful. First, see if all the matches have the same name. | 356 | ;; graceful. First, see if all the matches have the same name. |
| 357 | (let ((allsame t) | 357 | (let ((allsame t) |
| 358 | (firstname (semantic-tag-name | 358 | (firstname (semantic-tag-name |
| @@ -493,7 +493,7 @@ If PARTIAL, do partial completion stopping at spaces." | |||
| 493 | If PARTIAL, do partial completion stopping at spaces. | 493 | If PARTIAL, do partial completion stopping at spaces. |
| 494 | if INLINE, then completion is happening inline in a buffer." | 494 | if INLINE, then completion is happening inline in a buffer." |
| 495 | (let* ((collector semantic-completion-collector-engine) | 495 | (let* ((collector semantic-completion-collector-engine) |
| 496 | (displayor semantic-completion-display-engine) | 496 | (displayer semantic-completion-display-engine) |
| 497 | (contents (semantic-completion-text)) | 497 | (contents (semantic-completion-text)) |
| 498 | (ans nil)) | 498 | (ans nil)) |
| 499 | 499 | ||
| @@ -514,8 +514,8 @@ if INLINE, then completion is happening inline in a buffer." | |||
| 514 | ;; We need to display the completions. | 514 | ;; We need to display the completions. |
| 515 | ;; Set the completions into the display engine | 515 | ;; Set the completions into the display engine |
| 516 | ((or (eq na 'display) (eq na 'displayend)) | 516 | ((or (eq na 'display) (eq na 'displayend)) |
| 517 | (semantic-displayor-set-completions | 517 | (semantic-displayer-set-completions |
| 518 | displayor | 518 | displayer |
| 519 | (or | 519 | (or |
| 520 | ;; For the below - This caused problems for Chong Yidong | 520 | ;; For the below - This caused problems for Chong Yidong |
| 521 | ;; when experimenting with the completion engine. I don't | 521 | ;; when experimenting with the completion engine. I don't |
| @@ -526,14 +526,14 @@ if INLINE, then completion is happening inline in a buffer." | |||
| 526 | ;; (semantic-collector-current-exact-match collector)) | 526 | ;; (semantic-collector-current-exact-match collector)) |
| 527 | (semantic-collector-all-completions collector contents)) | 527 | (semantic-collector-all-completions collector contents)) |
| 528 | contents) | 528 | contents) |
| 529 | ;; Ask the displayor to display them. | 529 | ;; Ask the displayer to display them. |
| 530 | (semantic-displayor-show-request displayor)) | 530 | (semantic-displayer-show-request displayer)) |
| 531 | ((eq na 'scroll) | 531 | ((eq na 'scroll) |
| 532 | (semantic-displayor-scroll-request displayor) | 532 | (semantic-displayer-scroll-request displayer) |
| 533 | ) | 533 | ) |
| 534 | ((eq na 'focus) | 534 | ((eq na 'focus) |
| 535 | (semantic-displayor-focus-next displayor) | 535 | (semantic-displayer-focus-next displayer) |
| 536 | (semantic-displayor-focus-request displayor) | 536 | (semantic-displayer-focus-request displayer) |
| 537 | ) | 537 | ) |
| 538 | ((eq na 'empty) | 538 | ((eq na 'empty) |
| 539 | (semantic-completion-message " [No Match]")) | 539 | (semantic-completion-message " [No Match]")) |
| @@ -589,8 +589,8 @@ Similar to `minibuffer-contents' when completing in the minibuffer." | |||
| 589 | (defun semantic-complete-inline-done () | 589 | (defun semantic-complete-inline-done () |
| 590 | "This completion thing is DONE, OR, insert a newline." | 590 | "This completion thing is DONE, OR, insert a newline." |
| 591 | (interactive) | 591 | (interactive) |
| 592 | (let* ((displayor semantic-completion-display-engine) | 592 | (let* ((displayer semantic-completion-display-engine) |
| 593 | (tag (semantic-displayor-current-focus displayor))) | 593 | (tag (semantic-displayer-current-focus displayer))) |
| 594 | (if tag | 594 | (if tag |
| 595 | (let ((txt (semantic-completion-text))) | 595 | (let ((txt (semantic-completion-text))) |
| 596 | (insert (substring (semantic-tag-name tag) | 596 | (insert (substring (semantic-tag-name tag) |
| @@ -627,7 +627,7 @@ Similar to `minibuffer-contents' when completing in the minibuffer." | |||
| 627 | (when semantic-completion-collector-engine | 627 | (when semantic-completion-collector-engine |
| 628 | (semantic-collector-cleanup semantic-completion-collector-engine)) | 628 | (semantic-collector-cleanup semantic-completion-collector-engine)) |
| 629 | (when semantic-completion-display-engine | 629 | (when semantic-completion-display-engine |
| 630 | (semantic-displayor-cleanup semantic-completion-display-engine)) | 630 | (semantic-displayer-cleanup semantic-completion-display-engine)) |
| 631 | 631 | ||
| 632 | (when semantic-complete-inline-overlay | 632 | (when semantic-complete-inline-overlay |
| 633 | (let ((wc (overlay-get semantic-complete-inline-overlay | 633 | (let ((wc (overlay-get semantic-complete-inline-overlay |
| @@ -725,29 +725,29 @@ DO NOT CALL THIS IF THE INLINE COMPLETION ENGINE IS NOT ACTIVE." | |||
| 725 | (condition-case e | 725 | (condition-case e |
| 726 | (save-excursion | 726 | (save-excursion |
| 727 | (let ((collector semantic-completion-collector-engine) | 727 | (let ((collector semantic-completion-collector-engine) |
| 728 | (displayor semantic-completion-display-engine) | 728 | (displayer semantic-completion-display-engine) |
| 729 | (contents (semantic-completion-text))) | 729 | (contents (semantic-completion-text))) |
| 730 | (when collector | 730 | (when collector |
| 731 | (semantic-collector-calculate-completions | 731 | (semantic-collector-calculate-completions |
| 732 | collector contents nil) | 732 | collector contents nil) |
| 733 | (semantic-displayor-set-completions | 733 | (semantic-displayer-set-completions |
| 734 | displayor | 734 | displayer |
| 735 | (semantic-collector-all-completions collector contents) | 735 | (semantic-collector-all-completions collector contents) |
| 736 | contents) | 736 | contents) |
| 737 | ;; Ask the displayor to display them. | 737 | ;; Ask the displayer to display them. |
| 738 | (semantic-displayor-show-request displayor)) | 738 | (semantic-displayer-show-request displayer)) |
| 739 | )) | 739 | )) |
| 740 | (error (message "Bug Showing Completions: %S" e)))) | 740 | (error (message "Bug Showing Completions: %S" e)))) |
| 741 | 741 | ||
| 742 | (defun semantic-complete-inline-tag-engine | 742 | (defun semantic-complete-inline-tag-engine |
| 743 | (collector displayor buffer start end) | 743 | (collector displayer buffer start end) |
| 744 | "Perform completion based on semantic tags in a buffer. | 744 | "Perform completion based on semantic tags in a buffer. |
| 745 | Argument COLLECTOR is an object which can be used to calculate | 745 | Argument COLLECTOR is an object which can be used to calculate |
| 746 | a list of possible hits. See `semantic-completion-collector-engine' | 746 | a list of possible hits. See `semantic-completion-collector-engine' |
| 747 | for details on COLLECTOR. | 747 | for details on COLLECTOR. |
| 748 | Argument DISPLAYOR is an object used to display a list of possible | 748 | Argument DISPLAYER is an object used to display a list of possible |
| 749 | completions for a given prefix. See`semantic-completion-display-engine' | 749 | completions for a given prefix. See`semantic-completion-display-engine' |
| 750 | for details on DISPLAYOR. | 750 | for details on DISPLAYER. |
| 751 | BUFFER is the buffer in which completion will take place. | 751 | BUFFER is the buffer in which completion will take place. |
| 752 | START is a location for the start of the full symbol. | 752 | START is a location for the start of the full symbol. |
| 753 | If the symbol being completed is \"foo.ba\", then START | 753 | If the symbol being completed is \"foo.ba\", then START |
| @@ -755,7 +755,7 @@ is on the \"f\" character. | |||
| 755 | END is at the end of the current symbol being completed." | 755 | END is at the end of the current symbol being completed." |
| 756 | ;; Set us up for doing completion | 756 | ;; Set us up for doing completion |
| 757 | (setq semantic-completion-collector-engine collector | 757 | (setq semantic-completion-collector-engine collector |
| 758 | semantic-completion-display-engine displayor) | 758 | semantic-completion-display-engine displayer) |
| 759 | ;; Create an overlay | 759 | ;; Create an overlay |
| 760 | (setq semantic-complete-inline-overlay | 760 | (setq semantic-complete-inline-overlay |
| 761 | (make-overlay start end buffer nil t)) | 761 | (make-overlay start end buffer nil t)) |
| @@ -791,19 +791,19 @@ END is at the end of the current symbol being completed." | |||
| 791 | ) | 791 | ) |
| 792 | 792 | ||
| 793 | (defun semantic-complete-inline-down() | 793 | (defun semantic-complete-inline-down() |
| 794 | "Focus forwards through the displayor." | 794 | "Focus forwards through the displayer." |
| 795 | (interactive) | 795 | (interactive) |
| 796 | (let ((displayor semantic-completion-display-engine)) | 796 | (let ((displayer semantic-completion-display-engine)) |
| 797 | (semantic-displayor-focus-next displayor) | 797 | (semantic-displayer-focus-next displayer) |
| 798 | (semantic-displayor-focus-request displayor) | 798 | (semantic-displayer-focus-request displayer) |
| 799 | )) | 799 | )) |
| 800 | 800 | ||
| 801 | (defun semantic-complete-inline-up () | 801 | (defun semantic-complete-inline-up () |
| 802 | "Focus backwards through the displayor." | 802 | "Focus backwards through the displayer." |
| 803 | (interactive) | 803 | (interactive) |
| 804 | (let ((displayor semantic-completion-display-engine)) | 804 | (let ((displayer semantic-completion-display-engine)) |
| 805 | (semantic-displayor-focus-previous displayor) | 805 | (semantic-displayer-focus-previous displayer) |
| 806 | (semantic-displayor-focus-request displayor) | 806 | (semantic-displayer-focus-request displayer) |
| 807 | )) | 807 | )) |
| 808 | 808 | ||
| 809 | 809 | ||
| @@ -811,13 +811,13 @@ END is at the end of the current symbol being completed." | |||
| 811 | ;;; Interactions between collection and displaying | 811 | ;;; Interactions between collection and displaying |
| 812 | ;; | 812 | ;; |
| 813 | ;; Functional routines used to help collectors communicate with | 813 | ;; Functional routines used to help collectors communicate with |
| 814 | ;; the current displayor, or for the previous section. | 814 | ;; the current displayer, or for the previous section. |
| 815 | 815 | ||
| 816 | (defun semantic-complete-next-action (partial) | 816 | (defun semantic-complete-next-action (partial) |
| 817 | "Determine what the next completion action should be. | 817 | "Determine what the next completion action should be. |
| 818 | PARTIAL is non-nil if we are doing partial completion. | 818 | PARTIAL is non-nil if we are doing partial completion. |
| 819 | First, the collector can determine if we should perform a completion or not. | 819 | First, the collector can determine if we should perform a completion or not. |
| 820 | If there is nothing to complete, then the displayor determines if we are | 820 | If there is nothing to complete, then the displayer determines if we are |
| 821 | to show a completion list, scroll, or perhaps do a focus (if it is capable.) | 821 | to show a completion list, scroll, or perhaps do a focus (if it is capable.) |
| 822 | Expected return values are: | 822 | Expected return values are: |
| 823 | done -> We have a singular match | 823 | done -> We have a singular match |
| @@ -827,21 +827,21 @@ Expected return values are: | |||
| 827 | display -> Show the list of completions | 827 | display -> Show the list of completions |
| 828 | scroll -> The completions have been shown, and the user keeps hitting | 828 | scroll -> The completions have been shown, and the user keeps hitting |
| 829 | the complete button. If possible, scroll the completions | 829 | the complete button. If possible, scroll the completions |
| 830 | focus -> The displayor knows how to shift focus among possible completions. | 830 | focus -> The displayer knows how to shift focus among possible completions. |
| 831 | Let it do that. | 831 | Let it do that. |
| 832 | displayend -> Whatever options the displayor had for repeating options, there | 832 | displayend -> Whatever options the displayer had for repeating options, there |
| 833 | are none left. Try something new." | 833 | are none left. Try something new." |
| 834 | (let ((ans1 (semantic-collector-next-action | 834 | (let ((ans1 (semantic-collector-next-action |
| 835 | semantic-completion-collector-engine | 835 | semantic-completion-collector-engine |
| 836 | partial)) | 836 | partial)) |
| 837 | (ans2 (semantic-displayor-next-action | 837 | (ans2 (semantic-displayer-next-action |
| 838 | semantic-completion-display-engine)) | 838 | semantic-completion-display-engine)) |
| 839 | ) | 839 | ) |
| 840 | (cond | 840 | (cond |
| 841 | ;; No collector answer, use displayor answer. | 841 | ;; No collector answer, use displayer answer. |
| 842 | ((not ans1) | 842 | ((not ans1) |
| 843 | ans2) | 843 | ans2) |
| 844 | ;; Displayor selection of 'scroll, 'display, or 'focus trumps | 844 | ;; Displayer selection of 'scroll, 'display, or 'focus trumps |
| 845 | ;; 'done | 845 | ;; 'done |
| 846 | ((and (eq ans1 'done) ans2) | 846 | ((and (eq ans1 'done) ans2) |
| 847 | ans2) | 847 | ans2) |
| @@ -909,7 +909,7 @@ When tokens are matched, they are added to this list.") | |||
| 909 | ) | 909 | ) |
| 910 | "Root class for completion engines. | 910 | "Root class for completion engines. |
| 911 | The baseclass provides basic functionality for interacting with | 911 | The baseclass provides basic functionality for interacting with |
| 912 | a completion displayor object, and tracking the current progress | 912 | a completion displayer object, and tracking the current progress |
| 913 | of a completion." | 913 | of a completion." |
| 914 | :abstract t) | 914 | :abstract t) |
| 915 | 915 | ||
| @@ -962,7 +962,7 @@ PARTIAL indicates if we are doing a partial completion." | |||
| 962 | (cond ((and cem (= cemlen 1) | 962 | (cond ((and cem (= cemlen 1) |
| 963 | cac (> caclen 1) | 963 | cac (> caclen 1) |
| 964 | (eq last-command this-command)) | 964 | (eq last-command this-command)) |
| 965 | ;; Defer to the displayor... | 965 | ;; Defer to the displayer... |
| 966 | nil) | 966 | nil) |
| 967 | ((and cem (= cemlen 1)) | 967 | ((and cem (= cemlen 1)) |
| 968 | 'done) | 968 | 'done) |
| @@ -1289,44 +1289,48 @@ Uses semanticdb for searching all tags in the current project." | |||
| 1289 | ;;; ------------------------------------------------------------ | 1289 | ;;; ------------------------------------------------------------ |
| 1290 | ;;; Tag List Display Engines | 1290 | ;;; Tag List Display Engines |
| 1291 | ;; | 1291 | ;; |
| 1292 | ;; A typical displayor accepts a pre-determined list of completions | 1292 | ;; A typical displayer accepts a pre-determined list of completions |
| 1293 | ;; generated by a collector. This format is in semanticdb search | 1293 | ;; generated by a collector. This format is in semanticdb search |
| 1294 | ;; form. This vaguely standard form is a bit challenging to navigate | 1294 | ;; form. This vaguely standard form is a bit challenging to navigate |
| 1295 | ;; because the tags do not contain buffer info, but the file associated | 1295 | ;; because the tags do not contain buffer info, but the file associated |
| 1296 | ;; with the tags precedes the tag in the list. | 1296 | ;; with the tags precedes the tag in the list. |
| 1297 | ;; | 1297 | ;; |
| 1298 | ;; Basic displayors don't care, and can strip the results. | 1298 | ;; Basic displayers don't care, and can strip the results. |
| 1299 | ;; Advanced highlighting displayors need to know when they need | 1299 | ;; Advanced highlighting displayers need to know when they need |
| 1300 | ;; to load a file so that the tag in question can be highlighted. | 1300 | ;; to load a file so that the tag in question can be highlighted. |
| 1301 | ;; | 1301 | ;; |
| 1302 | ;; Key interface methods to a displayor are: | 1302 | ;; Key interface methods to a displayer are: |
| 1303 | ;; * semantic-displayor-next-action | 1303 | ;; * semantic-displayer-next-action |
| 1304 | ;; * semantic-displayor-set-completions | 1304 | ;; * semantic-displayer-set-completions |
| 1305 | ;; * semantic-displayor-current-focus | 1305 | ;; * semantic-displayer-current-focus |
| 1306 | ;; * semantic-displayor-show-request | 1306 | ;; * semantic-displayer-show-request |
| 1307 | ;; * semantic-displayor-scroll-request | 1307 | ;; * semantic-displayer-scroll-request |
| 1308 | ;; * semantic-displayor-focus-request | 1308 | ;; * semantic-displayer-focus-request |
| 1309 | 1309 | ||
| 1310 | (defclass semantic-displayor-abstract () | 1310 | (defclass semantic-displayer-abstract () |
| 1311 | ((table :type (or null semanticdb-find-result-with-nil) | 1311 | ((table :type (or null semanticdb-find-result-with-nil) |
| 1312 | :initform nil | 1312 | :initform nil |
| 1313 | :protection :protected | 1313 | :protection :protected |
| 1314 | :documentation "List of tags this displayor is showing.") | 1314 | :documentation "List of tags this displayer is showing.") |
| 1315 | (last-prefix :type string | 1315 | (last-prefix :type string |
| 1316 | :protection :protected | 1316 | :protection :protected |
| 1317 | :documentation "Prefix associated with slot `table'") | 1317 | :documentation "Prefix associated with slot `table'") |
| 1318 | ) | 1318 | ) |
| 1319 | "Abstract displayor baseclass. | 1319 | "Abstract displayer baseclass. |
| 1320 | Manages the display of some number of tags. | 1320 | Manages the display of some number of tags. |
| 1321 | Provides the basics for a displayor, including interacting with | 1321 | Provides the basics for a displayer, including interacting with |
| 1322 | a collector, and tracking tables of completion to display." | 1322 | a collector, and tracking tables of completion to display." |
| 1323 | :abstract t) | 1323 | :abstract t) |
| 1324 | 1324 | ||
| 1325 | (cl-defmethod semantic-displayor-cleanup ((obj semantic-displayor-abstract)) | 1325 | (define-obsolete-function-alias 'semantic-displayor-cleanup |
| 1326 | "Clean up any mess this displayor may have." | 1326 | #'semantic-displayer-cleanup "27.1") |
| 1327 | (cl-defmethod semantic-displayer-cleanup ((obj semantic-displayer-abstract)) | ||
| 1328 | "Clean up any mess this displayer may have." | ||
| 1327 | nil) | 1329 | nil) |
| 1328 | 1330 | ||
| 1329 | (cl-defmethod semantic-displayor-next-action ((obj semantic-displayor-abstract)) | 1331 | (define-obsolete-function-alias 'semantic-displayor-next-action |
| 1332 | #'semantic-displayer-next-action "27.1") | ||
| 1333 | (cl-defmethod semantic-displayer-next-action ((obj semantic-displayer-abstract)) | ||
| 1330 | "The next action to take on the minibuffer related to display." | 1334 | "The next action to take on the minibuffer related to display." |
| 1331 | (if (and (slot-boundp obj 'last-prefix) | 1335 | (if (and (slot-boundp obj 'last-prefix) |
| 1332 | (or (eq this-command 'semantic-complete-inline-TAB) | 1336 | (or (eq this-command 'semantic-complete-inline-TAB) |
| @@ -1335,65 +1339,82 @@ a collector, and tracking tables of completion to display." | |||
| 1335 | 'scroll | 1339 | 'scroll |
| 1336 | 'display)) | 1340 | 'display)) |
| 1337 | 1341 | ||
| 1338 | (cl-defmethod semantic-displayor-set-completions ((obj semantic-displayor-abstract) | 1342 | (define-obsolete-function-alias 'semantic-displayor-set-completions |
| 1343 | #'semantic-displayer-set-completions "27.1") | ||
| 1344 | (cl-defmethod semantic-displayer-set-completions ((obj semantic-displayer-abstract) | ||
| 1339 | table prefix) | 1345 | table prefix) |
| 1340 | "Set the list of tags to be completed over to TABLE." | 1346 | "Set the list of tags to be completed over to TABLE." |
| 1341 | (oset obj table table) | 1347 | (oset obj table table) |
| 1342 | (oset obj last-prefix prefix)) | 1348 | (oset obj last-prefix prefix)) |
| 1343 | 1349 | ||
| 1344 | (cl-defmethod semantic-displayor-show-request ((obj semantic-displayor-abstract)) | 1350 | (define-obsolete-function-alias 'semantic-displayor-show-request |
| 1351 | #'semantic-displayer-show-request "27.1") | ||
| 1352 | (cl-defmethod semantic-displayer-show-request ((obj semantic-displayer-abstract)) | ||
| 1345 | "A request to show the current tags table." | 1353 | "A request to show the current tags table." |
| 1346 | (ding)) | 1354 | (ding)) |
| 1347 | 1355 | ||
| 1348 | (cl-defmethod semantic-displayor-focus-request ((obj semantic-displayor-abstract)) | 1356 | (define-obsolete-function-alias 'semantic-displayor-focus-request |
| 1349 | "A request to for the displayor to focus on some tag option." | 1357 | #'semantic-displayer-focus-request "27.1") |
| 1358 | (cl-defmethod semantic-displayer-focus-request ((obj semantic-displayer-abstract)) | ||
| 1359 | "A request to for the displayer to focus on some tag option." | ||
| 1350 | (ding)) | 1360 | (ding)) |
| 1351 | 1361 | ||
| 1352 | (cl-defmethod semantic-displayor-scroll-request ((obj semantic-displayor-abstract)) | 1362 | (define-obsolete-function-alias 'semantic-displayor-scroll-request |
| 1353 | "A request to for the displayor to scroll the completion list (if needed)." | 1363 | #'semantic-displayer-scroll-request "27.1") |
| 1364 | (cl-defmethod semantic-displayer-scroll-request ((obj semantic-displayer-abstract)) | ||
| 1365 | "A request to for the displayer to scroll the completion list (if needed)." | ||
| 1354 | (scroll-other-window)) | 1366 | (scroll-other-window)) |
| 1355 | 1367 | ||
| 1356 | (cl-defmethod semantic-displayor-focus-previous ((obj semantic-displayor-abstract)) | 1368 | (define-obsolete-function-alias 'semantic-displayor-focus-previous |
| 1369 | #'semantic-displayer-focus-previous "27.1") | ||
| 1370 | (cl-defmethod semantic-displayer-focus-previous ((obj semantic-displayer-abstract)) | ||
| 1357 | "Set the current focus to the previous item." | 1371 | "Set the current focus to the previous item." |
| 1358 | nil) | 1372 | nil) |
| 1359 | 1373 | ||
| 1360 | (cl-defmethod semantic-displayor-focus-next ((obj semantic-displayor-abstract)) | 1374 | (define-obsolete-function-alias 'semantic-displayor-focus-next |
| 1375 | #'semantic-displayer-focus-next "27.1") | ||
| 1376 | (cl-defmethod semantic-displayer-focus-next ((obj semantic-displayer-abstract)) | ||
| 1361 | "Set the current focus to the next item." | 1377 | "Set the current focus to the next item." |
| 1362 | nil) | 1378 | nil) |
| 1363 | 1379 | ||
| 1364 | (cl-defmethod semantic-displayor-current-focus ((obj semantic-displayor-abstract)) | 1380 | (define-obsolete-function-alias 'semantic-displayor-current-focus |
| 1381 | #'semantic-displayer-current-focus "27.1") | ||
| 1382 | (cl-defmethod semantic-displayer-current-focus ((obj semantic-displayer-abstract)) | ||
| 1365 | "Return a single tag currently in focus. | 1383 | "Return a single tag currently in focus. |
| 1366 | This object type doesn't do focus, so will never have a focus object." | 1384 | This object type doesn't do focus, so will never have a focus object." |
| 1367 | nil) | 1385 | nil) |
| 1368 | 1386 | ||
| 1369 | ;; Traditional displayor | 1387 | |
| 1370 | (defcustom semantic-completion-displayor-format-tag-function | 1388 | ;; Traditional displayer |
| 1389 | (defcustom semantic-completion-displayer-format-tag-function | ||
| 1371 | #'semantic-format-tag-name | 1390 | #'semantic-format-tag-name |
| 1372 | "A Tag format function to use when showing completions." | 1391 | "A Tag format function to use when showing completions." |
| 1373 | :group 'semantic | 1392 | :group 'semantic |
| 1374 | :type semantic-format-tag-custom-list) | 1393 | :type semantic-format-tag-custom-list) |
| 1375 | 1394 | ||
| 1376 | (defclass semantic-displayor-traditional (semantic-displayor-abstract) | 1395 | (defclass semantic-displayer-traditional (semantic-displayer-abstract) |
| 1377 | () | 1396 | () |
| 1378 | "Display options in *Completions* buffer. | 1397 | "Display options in *Completions* buffer. |
| 1379 | Traditional display mechanism for a list of possible completions. | 1398 | Traditional display mechanism for a list of possible completions. |
| 1380 | Completions are showin in a new buffer and listed with the ability | 1399 | Completions are showin in a new buffer and listed with the ability |
| 1381 | to click on the items to aid in completion.") | 1400 | to click on the items to aid in completion.") |
| 1382 | 1401 | ||
| 1383 | (cl-defmethod semantic-displayor-show-request ((obj semantic-displayor-traditional)) | 1402 | (define-obsolete-function-alias 'semantic-displayor-show-request |
| 1403 | #'semantic-displayer-show-request "27.1") | ||
| 1404 | (cl-defmethod semantic-displayer-show-request ((obj semantic-displayer-traditional)) | ||
| 1384 | "A request to show the current tags table." | 1405 | "A request to show the current tags table." |
| 1385 | 1406 | ||
| 1386 | ;; NOTE TO SELF. Find the character to type next, and emphasize it. | 1407 | ;; NOTE TO SELF. Find the character to type next, and emphasize it. |
| 1387 | 1408 | ||
| 1388 | (with-output-to-temp-buffer "*Completions*" | 1409 | (with-output-to-temp-buffer "*Completions*" |
| 1389 | (display-completion-list | 1410 | (display-completion-list |
| 1390 | (mapcar semantic-completion-displayor-format-tag-function | 1411 | (mapcar semantic-completion-displayer-format-tag-function |
| 1391 | (semanticdb-strip-find-results (oref obj table)))) | 1412 | (semanticdb-strip-find-results (oref obj table)))) |
| 1392 | ) | 1413 | ) |
| 1393 | ) | 1414 | ) |
| 1394 | 1415 | ||
| 1395 | ;;; Abstract baseclass for any displayor which supports focus | 1416 | ;;; Abstract baseclass for any displayer which supports focus |
| 1396 | (defclass semantic-displayor-focus-abstract (semantic-displayor-abstract) | 1417 | (defclass semantic-displayer-focus-abstract (semantic-displayer-abstract) |
| 1397 | ((focus :type number | 1418 | ((focus :type number |
| 1398 | :protection :protected | 1419 | :protection :protected |
| 1399 | :documentation "A tag index from `table' which has focus. | 1420 | :documentation "A tag index from `table' which has focus. |
| @@ -1405,13 +1426,15 @@ given tag, by highlighting its location.") | |||
| 1405 | :documentation | 1426 | :documentation |
| 1406 | "Non-nil if focusing requires a tag's buffer be in memory.") | 1427 | "Non-nil if focusing requires a tag's buffer be in memory.") |
| 1407 | ) | 1428 | ) |
| 1408 | "Abstract displayor supporting `focus'. | 1429 | "Abstract displayer supporting `focus'. |
| 1409 | A displayor which has the ability to focus in on one tag. | 1430 | A displayer which has the ability to focus in on one tag. |
| 1410 | Focusing is a way of differentiating among multiple tags | 1431 | Focusing is a way of differentiating among multiple tags |
| 1411 | which have the same name." | 1432 | which have the same name." |
| 1412 | :abstract t) | 1433 | :abstract t) |
| 1413 | 1434 | ||
| 1414 | (cl-defmethod semantic-displayor-next-action ((obj semantic-displayor-focus-abstract)) | 1435 | (define-obsolete-function-alias 'semantic-displayor-next-action |
| 1436 | #'semantic-displayer-next-action "27.1") | ||
| 1437 | (cl-defmethod semantic-displayer-next-action ((obj semantic-displayer-focus-abstract)) | ||
| 1415 | "The next action to take on the minibuffer related to display." | 1438 | "The next action to take on the minibuffer related to display." |
| 1416 | (if (and (slot-boundp obj 'last-prefix) | 1439 | (if (and (slot-boundp obj 'last-prefix) |
| 1417 | (string= (oref obj last-prefix) (semantic-completion-text)) | 1440 | (string= (oref obj last-prefix) (semantic-completion-text)) |
| @@ -1427,13 +1450,17 @@ which have the same name." | |||
| 1427 | 'focus) | 1450 | 'focus) |
| 1428 | 'display)) | 1451 | 'display)) |
| 1429 | 1452 | ||
| 1430 | (cl-defmethod semantic-displayor-set-completions ((obj semantic-displayor-focus-abstract) | 1453 | (define-obsolete-function-alias 'semantic-displayor-set-completions |
| 1454 | #'semantic-displayer-set-completions "27.1") | ||
| 1455 | (cl-defmethod semantic-displayer-set-completions ((obj semantic-displayer-focus-abstract) | ||
| 1431 | table prefix) | 1456 | table prefix) |
| 1432 | "Set the list of tags to be completed over to TABLE." | 1457 | "Set the list of tags to be completed over to TABLE." |
| 1433 | (cl-call-next-method) | 1458 | (cl-call-next-method) |
| 1434 | (slot-makeunbound obj 'focus)) | 1459 | (slot-makeunbound obj 'focus)) |
| 1435 | 1460 | ||
| 1436 | (cl-defmethod semantic-displayor-focus-previous ((obj semantic-displayor-focus-abstract)) | 1461 | (define-obsolete-function-alias 'semantic-displayor-focus-previous |
| 1462 | #'semantic-displayer-focus-previous "27.1") | ||
| 1463 | (cl-defmethod semantic-displayer-focus-previous ((obj semantic-displayer-focus-abstract)) | ||
| 1437 | "Set the current focus to the previous item. | 1464 | "Set the current focus to the previous item. |
| 1438 | Not meaningful return value." | 1465 | Not meaningful return value." |
| 1439 | (when (and (slot-boundp obj 'table) (oref obj table)) | 1466 | (when (and (slot-boundp obj 'table) (oref obj table)) |
| @@ -1445,7 +1472,9 @@ Not meaningful return value." | |||
| 1445 | ) | 1472 | ) |
| 1446 | ))) | 1473 | ))) |
| 1447 | 1474 | ||
| 1448 | (cl-defmethod semantic-displayor-focus-next ((obj semantic-displayor-focus-abstract)) | 1475 | (define-obsolete-function-alias 'semantic-displayor-focus-next |
| 1476 | #'semantic-displayer-focus-next "27.1") | ||
| 1477 | (cl-defmethod semantic-displayer-focus-next ((obj semantic-displayer-focus-abstract)) | ||
| 1449 | "Set the current focus to the next item. | 1478 | "Set the current focus to the next item. |
| 1450 | Not meaningful return value." | 1479 | Not meaningful return value." |
| 1451 | (when (and (slot-boundp obj 'table) (oref obj table)) | 1480 | (when (and (slot-boundp obj 'table) (oref obj table)) |
| @@ -1458,13 +1487,17 @@ Not meaningful return value." | |||
| 1458 | (oset obj focus 0)) | 1487 | (oset obj focus 0)) |
| 1459 | ))) | 1488 | ))) |
| 1460 | 1489 | ||
| 1461 | (cl-defmethod semantic-displayor-focus-tag ((obj semantic-displayor-focus-abstract)) | 1490 | (define-obsolete-function-alias 'semantic-displayor-focus-tag |
| 1491 | #'semantic-displayer-focus-tag "27.1") | ||
| 1492 | (cl-defmethod semantic-displayer-focus-tag ((obj semantic-displayer-focus-abstract)) | ||
| 1462 | "Return the next tag OBJ should focus on." | 1493 | "Return the next tag OBJ should focus on." |
| 1463 | (when (and (slot-boundp obj 'table) (oref obj table)) | 1494 | (when (and (slot-boundp obj 'table) (oref obj table)) |
| 1464 | (with-slots (table) obj | 1495 | (with-slots (table) obj |
| 1465 | (semanticdb-find-result-nth table (oref obj focus))))) | 1496 | (semanticdb-find-result-nth table (oref obj focus))))) |
| 1466 | 1497 | ||
| 1467 | (cl-defmethod semantic-displayor-current-focus ((obj semantic-displayor-focus-abstract)) | 1498 | (define-obsolete-function-alias 'semantic-displayor-current-focus |
| 1499 | #'semantic-displayer-current-focus "27.1") | ||
| 1500 | (cl-defmethod semantic-displayer-current-focus ((obj semantic-displayer-focus-abstract)) | ||
| 1468 | "Return the tag currently in focus, or call parent method." | 1501 | "Return the tag currently in focus, or call parent method." |
| 1469 | (if (and (slot-boundp obj 'focus) | 1502 | (if (and (slot-boundp obj 'focus) |
| 1470 | (slot-boundp obj 'table) | 1503 | (slot-boundp obj 'table) |
| @@ -1482,24 +1515,26 @@ Not meaningful return value." | |||
| 1482 | ;; Do whatever | 1515 | ;; Do whatever |
| 1483 | (cl-call-next-method))) | 1516 | (cl-call-next-method))) |
| 1484 | 1517 | ||
| 1485 | ;;; Simple displayor which performs traditional display completion, | 1518 | ;;; Simple displayer which performs traditional display completion, |
| 1486 | ;; and also focuses with highlighting. | 1519 | ;; and also focuses with highlighting. |
| 1487 | (defclass semantic-displayor-traditional-with-focus-highlight | 1520 | (defclass semantic-displayer-traditional-with-focus-highlight |
| 1488 | (semantic-displayor-focus-abstract semantic-displayor-traditional) | 1521 | (semantic-displayer-focus-abstract semantic-displayer-traditional) |
| 1489 | ((find-file-focus :initform t)) | 1522 | ((find-file-focus :initform t)) |
| 1490 | "Display completions in *Completions* buffer, with focus highlight. | 1523 | "Display completions in *Completions* buffer, with focus highlight. |
| 1491 | A traditional displayor which can focus on a tag by showing it. | 1524 | A traditional displayer which can focus on a tag by showing it. |
| 1492 | Same as `semantic-displayor-traditional', but with selection between | 1525 | Same as `semantic-displayer-traditional', but with selection between |
| 1493 | multiple tags with the same name done by focusing on the source | 1526 | multiple tags with the same name done by focusing on the source |
| 1494 | location of the different tags to differentiate them.") | 1527 | location of the different tags to differentiate them.") |
| 1495 | 1528 | ||
| 1496 | (cl-defmethod semantic-displayor-focus-request | 1529 | (define-obsolete-function-alias 'semantic-displayor-focus-request |
| 1497 | ((obj semantic-displayor-traditional-with-focus-highlight)) | 1530 | #'semantic-displayer-focus-request "27.1") |
| 1531 | (cl-defmethod semantic-displayer-focus-request | ||
| 1532 | ((obj semantic-displayer-traditional-with-focus-highlight)) | ||
| 1498 | "Focus in on possible tag completions. | 1533 | "Focus in on possible tag completions. |
| 1499 | Focus is performed by cycling through the tags and highlighting | 1534 | Focus is performed by cycling through the tags and highlighting |
| 1500 | one in the source buffer." | 1535 | one in the source buffer." |
| 1501 | (let* ((tablelength (semanticdb-find-result-length (oref obj table))) | 1536 | (let* ((tablelength (semanticdb-find-result-length (oref obj table))) |
| 1502 | (focus (semantic-displayor-focus-tag obj)) | 1537 | (focus (semantic-displayer-focus-tag obj)) |
| 1503 | ;; Raw tag info. | 1538 | ;; Raw tag info. |
| 1504 | (rtag (car focus)) | 1539 | (rtag (car focus)) |
| 1505 | (rtable (cdr focus)) | 1540 | (rtable (cdr focus)) |
| @@ -1558,22 +1593,22 @@ one in the source buffer." | |||
| 1558 | ;; * Don't use 'avoid package for tooltip positioning. | 1593 | ;; * Don't use 'avoid package for tooltip positioning. |
| 1559 | 1594 | ||
| 1560 | ;;;###autoload | 1595 | ;;;###autoload |
| 1561 | (defcustom semantic-displayor-tooltip-mode 'standard | 1596 | (defcustom semantic-displayer-tooltip-mode 'standard |
| 1562 | "Mode for the tooltip inline completion. | 1597 | "Mode for the tooltip inline completion. |
| 1563 | 1598 | ||
| 1564 | Standard: Show only `semantic-displayor-tooltip-initial-max-tags' | 1599 | Standard: Show only `semantic-displayer-tooltip-initial-max-tags' |
| 1565 | number of completions initially. Pressing TAB will show the | 1600 | number of completions initially. Pressing TAB will show the |
| 1566 | extended set. | 1601 | extended set. |
| 1567 | 1602 | ||
| 1568 | Quiet: Only show completions when we have narrowed all | 1603 | Quiet: Only show completions when we have narrowed all |
| 1569 | possibilities down to a maximum of | 1604 | possibilities down to a maximum of |
| 1570 | `semantic-displayor-tooltip-initial-max-tags' tags. Pressing TAB | 1605 | `semantic-displayer-tooltip-initial-max-tags' tags. Pressing TAB |
| 1571 | multiple times will also show completions. | 1606 | multiple times will also show completions. |
| 1572 | 1607 | ||
| 1573 | Verbose: Always show all completions available. | 1608 | Verbose: Always show all completions available. |
| 1574 | 1609 | ||
| 1575 | The absolute maximum number of completions for all mode is | 1610 | The absolute maximum number of completions for all mode is |
| 1576 | determined through `semantic-displayor-tooltip-max-tags'." | 1611 | determined through `semantic-displayer-tooltip-max-tags'." |
| 1577 | :group 'semantic | 1612 | :group 'semantic |
| 1578 | :version "24.3" | 1613 | :version "24.3" |
| 1579 | :type '(choice (const :tag "Standard" standard) | 1614 | :type '(choice (const :tag "Standard" standard) |
| @@ -1581,14 +1616,14 @@ determined through `semantic-displayor-tooltip-max-tags'." | |||
| 1581 | (const :tag "Verbose" verbose))) | 1616 | (const :tag "Verbose" verbose))) |
| 1582 | 1617 | ||
| 1583 | ;;;###autoload | 1618 | ;;;###autoload |
| 1584 | (defcustom semantic-displayor-tooltip-initial-max-tags 5 | 1619 | (defcustom semantic-displayer-tooltip-initial-max-tags 5 |
| 1585 | "Maximum number of tags to be displayed initially. | 1620 | "Maximum number of tags to be displayed initially. |
| 1586 | See doc-string of `semantic-displayor-tooltip-mode' for details." | 1621 | See doc-string of `semantic-displayer-tooltip-mode' for details." |
| 1587 | :group 'semantic | 1622 | :group 'semantic |
| 1588 | :version "24.3" | 1623 | :version "24.3" |
| 1589 | :type 'integer) | 1624 | :type 'integer) |
| 1590 | 1625 | ||
| 1591 | (defcustom semantic-displayor-tooltip-max-tags 25 | 1626 | (defcustom semantic-displayer-tooltip-max-tags 25 |
| 1592 | "The maximum number of tags to be displayed. | 1627 | "The maximum number of tags to be displayed. |
| 1593 | Maximum number of completions where we have activated the | 1628 | Maximum number of completions where we have activated the |
| 1594 | extended completion list through typing TAB or SPACE multiple | 1629 | extended completion list through typing TAB or SPACE multiple |
| @@ -1606,17 +1641,17 @@ This will not happen if you directly set this variable via `setq'." | |||
| 1606 | (setcdr x-max-tooltip-size (max (1+ var) (cdr x-max-tooltip-size)))))) | 1641 | (setcdr x-max-tooltip-size (max (1+ var) (cdr x-max-tooltip-size)))))) |
| 1607 | 1642 | ||
| 1608 | 1643 | ||
| 1609 | (defclass semantic-displayor-tooltip (semantic-displayor-traditional) | 1644 | (defclass semantic-displayer-tooltip (semantic-displayer-traditional) |
| 1610 | ((mode :initarg :mode | 1645 | ((mode :initarg :mode |
| 1611 | :initform | 1646 | :initform |
| 1612 | (symbol-value 'semantic-displayor-tooltip-mode) | 1647 | (symbol-value 'semantic-displayer-tooltip-mode) |
| 1613 | :documentation | 1648 | :documentation |
| 1614 | "See `semantic-displayor-tooltip-mode'.") | 1649 | "See `semantic-displayer-tooltip-mode'.") |
| 1615 | (max-tags-initial :initarg max-tags-initial | 1650 | (max-tags-initial :initarg max-tags-initial |
| 1616 | :initform | 1651 | :initform |
| 1617 | (symbol-value 'semantic-displayor-tooltip-initial-max-tags) | 1652 | (symbol-value 'semantic-displayer-tooltip-initial-max-tags) |
| 1618 | :documentation | 1653 | :documentation |
| 1619 | "See `semantic-displayor-tooltip-initial-max-tags'.") | 1654 | "See `semantic-displayer-tooltip-initial-max-tags'.") |
| 1620 | (typing-count :type integer | 1655 | (typing-count :type integer |
| 1621 | :initform 0 | 1656 | :initform 0 |
| 1622 | :documentation | 1657 | :documentation |
| @@ -1629,7 +1664,7 @@ This will not happen if you directly set this variable via `setq'." | |||
| 1629 | "Display completions options in a tooltip. | 1664 | "Display completions options in a tooltip. |
| 1630 | Display mechanism using tooltip for a list of possible completions.") | 1665 | Display mechanism using tooltip for a list of possible completions.") |
| 1631 | 1666 | ||
| 1632 | (cl-defmethod initialize-instance :after ((obj semantic-displayor-tooltip) &rest args) | 1667 | (cl-defmethod initialize-instance :after ((obj semantic-displayer-tooltip) &rest args) |
| 1633 | "Make sure we have tooltips required." | 1668 | "Make sure we have tooltips required." |
| 1634 | (condition-case nil | 1669 | (condition-case nil |
| 1635 | (require 'tooltip) | 1670 | (require 'tooltip) |
| @@ -1638,7 +1673,9 @@ Display mechanism using tooltip for a list of possible completions.") | |||
| 1638 | 1673 | ||
| 1639 | (defvar tooltip-mode) | 1674 | (defvar tooltip-mode) |
| 1640 | 1675 | ||
| 1641 | (cl-defmethod semantic-displayor-show-request ((obj semantic-displayor-tooltip)) | 1676 | (define-obsolete-function-alias 'semantic-displayor-show-request |
| 1677 | #'semantic-displayer-show-request "27.1") | ||
| 1678 | (cl-defmethod semantic-displayer-show-request ((obj semantic-displayer-tooltip)) | ||
| 1642 | "A request to show the current tags table." | 1679 | "A request to show the current tags table." |
| 1643 | (if (or (not (featurep 'tooltip)) (not tooltip-mode)) | 1680 | (if (or (not (featurep 'tooltip)) (not tooltip-mode)) |
| 1644 | ;; If we cannot use tooltips, then go to the normal mode with | 1681 | ;; If we cannot use tooltips, then go to the normal mode with |
| @@ -1646,7 +1683,7 @@ Display mechanism using tooltip for a list of possible completions.") | |||
| 1646 | (cl-call-next-method) | 1683 | (cl-call-next-method) |
| 1647 | (let* ((tablelong (semanticdb-strip-find-results (oref obj table))) | 1684 | (let* ((tablelong (semanticdb-strip-find-results (oref obj table))) |
| 1648 | (table (semantic-unique-tag-table-by-name tablelong)) | 1685 | (table (semantic-unique-tag-table-by-name tablelong)) |
| 1649 | (completions (mapcar semantic-completion-displayor-format-tag-function table)) | 1686 | (completions (mapcar semantic-completion-displayer-format-tag-function table)) |
| 1650 | (numcompl (length completions)) | 1687 | (numcompl (length completions)) |
| 1651 | (typing-count (oref obj typing-count)) | 1688 | (typing-count (oref obj typing-count)) |
| 1652 | (mode (oref obj mode)) | 1689 | (mode (oref obj mode)) |
| @@ -1671,15 +1708,15 @@ Display mechanism using tooltip for a list of possible completions.") | |||
| 1671 | (setq msg "..."))) | 1708 | (setq msg "..."))) |
| 1672 | ((eq mode 'verbose) | 1709 | ((eq mode 'verbose) |
| 1673 | ;; Always show extended match set. | 1710 | ;; Always show extended match set. |
| 1674 | (oset obj max-tags-initial semantic-displayor-tooltip-max-tags) | 1711 | (oset obj max-tags-initial semantic-displayer-tooltip-max-tags) |
| 1675 | (setq max-tags semantic-displayor-tooltip-max-tags))) | 1712 | (setq max-tags semantic-displayer-tooltip-max-tags))) |
| 1676 | (unless msg | 1713 | (unless msg |
| 1677 | (oset obj shown t) | 1714 | (oset obj shown t) |
| 1678 | (cond | 1715 | (cond |
| 1679 | ((> numcompl max-tags) | 1716 | ((> numcompl max-tags) |
| 1680 | ;; We have too many items, be brave and truncate 'completions'. | 1717 | ;; We have too many items, be brave and truncate 'completions'. |
| 1681 | (setcdr (nthcdr (1- max-tags) completions) nil) | 1718 | (setcdr (nthcdr (1- max-tags) completions) nil) |
| 1682 | (if (= max-tags semantic-displayor-tooltip-initial-max-tags) | 1719 | (if (= max-tags semantic-displayer-tooltip-initial-max-tags) |
| 1683 | (setq msg-tail (concat "\n[<TAB> " (number-to-string (- numcompl max-tags)) " more]")) | 1720 | (setq msg-tail (concat "\n[<TAB> " (number-to-string (- numcompl max-tags)) " more]")) |
| 1684 | (setq msg-tail (concat "\n[<n/a> " (number-to-string (- numcompl max-tags)) " more]")) | 1721 | (setq msg-tail (concat "\n[<n/a> " (number-to-string (- numcompl max-tags)) " more]")) |
| 1685 | (when (>= (oref obj typing-count) 2) | 1722 | (when (>= (oref obj typing-count) 2) |
| @@ -1702,12 +1739,12 @@ Display mechanism using tooltip for a list of possible completions.") | |||
| 1702 | (setq msg (concat msg msg-tail)) | 1739 | (setq msg (concat msg msg-tail)) |
| 1703 | ;; Display tooltip. | 1740 | ;; Display tooltip. |
| 1704 | (when (not (eq msg "")) | 1741 | (when (not (eq msg "")) |
| 1705 | (semantic-displayor-tooltip-show msg))))) | 1742 | (semantic-displayer-tooltip-show msg))))) |
| 1706 | 1743 | ||
| 1707 | ;;; Compatibility | 1744 | ;;; Compatibility |
| 1708 | ;; | 1745 | ;; |
| 1709 | 1746 | ||
| 1710 | (defun semantic-displayor-point-position () | 1747 | (defun semantic-displayer-point-position () |
| 1711 | "Return the location of POINT as positioned on the selected frame. | 1748 | "Return the location of POINT as positioned on the selected frame. |
| 1712 | Return a cons cell (X . Y)" | 1749 | Return a cons cell (X . Y)" |
| 1713 | (let* ((frame (selected-frame)) | 1750 | (let* ((frame (selected-frame)) |
| @@ -1729,9 +1766,9 @@ Return a cons cell (X . Y)" | |||
| 1729 | (defvar tooltip-frame-parameters) | 1766 | (defvar tooltip-frame-parameters) |
| 1730 | (declare-function tooltip-show "tooltip" (text &optional use-echo-area)) | 1767 | (declare-function tooltip-show "tooltip" (text &optional use-echo-area)) |
| 1731 | 1768 | ||
| 1732 | (defun semantic-displayor-tooltip-show (text) | 1769 | (defun semantic-displayer-tooltip-show (text) |
| 1733 | "Display a tooltip with TEXT near cursor." | 1770 | "Display a tooltip with TEXT near cursor." |
| 1734 | (let ((point-pix-pos (semantic-displayor-point-position)) | 1771 | (let ((point-pix-pos (semantic-displayer-point-position)) |
| 1735 | (tooltip-frame-parameters | 1772 | (tooltip-frame-parameters |
| 1736 | (append tooltip-frame-parameters nil))) | 1773 | (append tooltip-frame-parameters nil))) |
| 1737 | (push | 1774 | (push |
| @@ -1742,19 +1779,21 @@ Return a cons cell (X . Y)" | |||
| 1742 | tooltip-frame-parameters) | 1779 | tooltip-frame-parameters) |
| 1743 | (tooltip-show text))) | 1780 | (tooltip-show text))) |
| 1744 | 1781 | ||
| 1745 | (cl-defmethod semantic-displayor-scroll-request ((obj semantic-displayor-tooltip)) | 1782 | (define-obsolete-function-alias 'semantic-displayor-scroll-request |
| 1746 | "A request to for the displayor to scroll the completion list (if needed)." | 1783 | #'semantic-displayer-scroll-request "27.1") |
| 1784 | (cl-defmethod semantic-displayer-scroll-request ((obj semantic-displayer-tooltip)) | ||
| 1785 | "A request to for the displayer to scroll the completion list (if needed)." | ||
| 1747 | ;; Do scrolling in the tooltip. | 1786 | ;; Do scrolling in the tooltip. |
| 1748 | (oset obj max-tags-initial 30) | 1787 | (oset obj max-tags-initial 30) |
| 1749 | (semantic-displayor-show-request obj) | 1788 | (semantic-displayer-show-request obj) |
| 1750 | ) | 1789 | ) |
| 1751 | 1790 | ||
| 1752 | ;; End code contributed by Masatake YAMATO <yamato@redhat.com> | 1791 | ;; End code contributed by Masatake YAMATO <yamato@redhat.com> |
| 1753 | 1792 | ||
| 1754 | 1793 | ||
| 1755 | ;;; Ghost Text displayor | 1794 | ;;; Ghost Text displayer |
| 1756 | ;; | 1795 | ;; |
| 1757 | (defclass semantic-displayor-ghost (semantic-displayor-focus-abstract) | 1796 | (defclass semantic-displayer-ghost (semantic-displayer-focus-abstract) |
| 1758 | 1797 | ||
| 1759 | ((ghostoverlay :type overlay | 1798 | ((ghostoverlay :type overlay |
| 1760 | :documentation | 1799 | :documentation |
| @@ -1764,11 +1803,13 @@ Return a cons cell (X . Y)" | |||
| 1764 | "Non nil if we have not seen our first show request.") | 1803 | "Non nil if we have not seen our first show request.") |
| 1765 | ) | 1804 | ) |
| 1766 | "Cycle completions inline with ghost text. | 1805 | "Cycle completions inline with ghost text. |
| 1767 | Completion displayor using ghost chars after point for focus options. | 1806 | Completion displayer using ghost chars after point for focus options. |
| 1768 | Whichever completion is currently in focus will be displayed as ghost | 1807 | Whichever completion is currently in focus will be displayed as ghost |
| 1769 | text using overlay options.") | 1808 | text using overlay options.") |
| 1770 | 1809 | ||
| 1771 | (cl-defmethod semantic-displayor-next-action ((obj semantic-displayor-ghost)) | 1810 | (define-obsolete-function-alias 'semantic-displayor-next-action |
| 1811 | #'semantic-displayer-next-action "27.1") | ||
| 1812 | (cl-defmethod semantic-displayer-next-action ((obj semantic-displayer-ghost)) | ||
| 1772 | "The next action to take on the inline completion related to display." | 1813 | "The next action to take on the inline completion related to display." |
| 1773 | (let ((ans (cl-call-next-method)) | 1814 | (let ((ans (cl-call-next-method)) |
| 1774 | (table (when (slot-boundp obj 'table) | 1815 | (table (when (slot-boundp obj 'table) |
| @@ -1780,28 +1821,34 @@ text using overlay options.") | |||
| 1780 | nil | 1821 | nil |
| 1781 | ans))) | 1822 | ans))) |
| 1782 | 1823 | ||
| 1783 | (cl-defmethod semantic-displayor-cleanup ((obj semantic-displayor-ghost)) | 1824 | (define-obsolete-function-alias 'semantic-displayor-cleanup |
| 1784 | "Clean up any mess this displayor may have." | 1825 | #'semantic-displayer-cleanup "27.1") |
| 1826 | (cl-defmethod semantic-displayer-cleanup ((obj semantic-displayer-ghost)) | ||
| 1827 | "Clean up any mess this displayer may have." | ||
| 1785 | (when (slot-boundp obj 'ghostoverlay) | 1828 | (when (slot-boundp obj 'ghostoverlay) |
| 1786 | (delete-overlay (oref obj ghostoverlay))) | 1829 | (delete-overlay (oref obj ghostoverlay))) |
| 1787 | ) | 1830 | ) |
| 1788 | 1831 | ||
| 1789 | (cl-defmethod semantic-displayor-set-completions ((obj semantic-displayor-ghost) | 1832 | (define-obsolete-function-alias 'semantic-displayor-set-completions |
| 1833 | #'semantic-displayer-set-completions "27.1") | ||
| 1834 | (cl-defmethod semantic-displayer-set-completions ((obj semantic-displayer-ghost) | ||
| 1790 | table prefix) | 1835 | table prefix) |
| 1791 | "Set the list of tags to be completed over to TABLE." | 1836 | "Set the list of tags to be completed over to TABLE." |
| 1792 | (cl-call-next-method) | 1837 | (cl-call-next-method) |
| 1793 | 1838 | ||
| 1794 | (semantic-displayor-cleanup obj) | 1839 | (semantic-displayer-cleanup obj) |
| 1795 | ) | 1840 | ) |
| 1796 | 1841 | ||
| 1797 | 1842 | ||
| 1798 | (cl-defmethod semantic-displayor-show-request ((obj semantic-displayor-ghost)) | 1843 | (define-obsolete-function-alias 'semantic-displayor-show-request |
| 1844 | #'semantic-displayer-show-request "27.1") | ||
| 1845 | (cl-defmethod semantic-displayer-show-request ((obj semantic-displayer-ghost)) | ||
| 1799 | "A request to show the current tags table." | 1846 | "A request to show the current tags table." |
| 1800 | ; (if (oref obj first-show) | 1847 | ; (if (oref obj first-show) |
| 1801 | ; (progn | 1848 | ; (progn |
| 1802 | ; (oset obj first-show nil) | 1849 | ; (oset obj first-show nil) |
| 1803 | (semantic-displayor-focus-next obj) | 1850 | (semantic-displayer-focus-next obj) |
| 1804 | (semantic-displayor-focus-request obj) | 1851 | (semantic-displayer-focus-request obj) |
| 1805 | ; ) | 1852 | ; ) |
| 1806 | ;; Only do the traditional thing if the first show request | 1853 | ;; Only do the traditional thing if the first show request |
| 1807 | ;; has been seen. Use the first one to start doing the ghost | 1854 | ;; has been seen. Use the first one to start doing the ghost |
| @@ -1810,13 +1857,15 @@ text using overlay options.") | |||
| 1810 | ; ) | 1857 | ; ) |
| 1811 | ) | 1858 | ) |
| 1812 | 1859 | ||
| 1813 | (cl-defmethod semantic-displayor-focus-request | 1860 | (define-obsolete-function-alias 'semantic-displayor-focus-request |
| 1814 | ((obj semantic-displayor-ghost)) | 1861 | #'semantic-displayer-focus-request "27.1") |
| 1862 | (cl-defmethod semantic-displayer-focus-request | ||
| 1863 | ((obj semantic-displayer-ghost)) | ||
| 1815 | "Focus in on possible tag completions. | 1864 | "Focus in on possible tag completions. |
| 1816 | Focus is performed by cycling through the tags and showing a possible | 1865 | Focus is performed by cycling through the tags and showing a possible |
| 1817 | completion text in ghost text." | 1866 | completion text in ghost text." |
| 1818 | (let* ((tablelength (semanticdb-find-result-length (oref obj table))) | 1867 | (let* ((tablelength (semanticdb-find-result-length (oref obj table))) |
| 1819 | (focus (semantic-displayor-focus-tag obj)) | 1868 | (focus (semantic-displayer-focus-tag obj)) |
| 1820 | (tag (car focus)) | 1869 | (tag (car focus)) |
| 1821 | ) | 1870 | ) |
| 1822 | (if (not tag) | 1871 | (if (not tag) |
| @@ -1863,14 +1912,14 @@ completion text in ghost text." | |||
| 1863 | (list 'const | 1912 | (list 'const |
| 1864 | :tag doc1 | 1913 | :tag doc1 |
| 1865 | C))) | 1914 | C))) |
| 1866 | (eieio-build-class-alist 'semantic-displayor-abstract t)) | 1915 | (eieio-build-class-alist 'semantic-displayer-abstract t)) |
| 1867 | ) | 1916 | ) |
| 1868 | "Possible options for inline completion displayors. | 1917 | "Possible options for inline completion displayers. |
| 1869 | Use this to enable custom editing.") | 1918 | Use this to enable custom editing.") |
| 1870 | 1919 | ||
| 1871 | (defcustom semantic-complete-inline-analyzer-displayor-class | 1920 | (defcustom semantic-complete-inline-analyzer-displayer-class |
| 1872 | 'semantic-displayor-traditional | 1921 | 'semantic-displayer-traditional |
| 1873 | "Class for displayor to use with inline completion." | 1922 | "Class for displayer to use with inline completion." |
| 1874 | :group 'semantic | 1923 | :group 'semantic |
| 1875 | :type semantic-complete-inline-custom-type | 1924 | :type semantic-complete-inline-custom-type |
| 1876 | ) | 1925 | ) |
| @@ -1889,8 +1938,8 @@ If INITIAL-INPUT is non-nil, insert it in the minibuffer initially. | |||
| 1889 | HISTORY is a symbol representing a variable to store the history in." | 1938 | HISTORY is a symbol representing a variable to store the history in." |
| 1890 | (semantic-complete-read-tag-engine | 1939 | (semantic-complete-read-tag-engine |
| 1891 | (semantic-collector-buffer-deep prompt :buffer (current-buffer)) | 1940 | (semantic-collector-buffer-deep prompt :buffer (current-buffer)) |
| 1892 | (semantic-displayor-traditional-with-focus-highlight) | 1941 | (semantic-displayer-traditional-with-focus-highlight) |
| 1893 | ;;(semantic-displayor-tooltip) | 1942 | ;;(semantic-displayer-tooltip) |
| 1894 | prompt | 1943 | prompt |
| 1895 | default-tag | 1944 | default-tag |
| 1896 | initial-input | 1945 | initial-input |
| @@ -1911,8 +1960,8 @@ If INITIAL-INPUT is non-nil, insert it in the minibuffer initially. | |||
| 1911 | HISTORY is a symbol representing a variable to store the history in." | 1960 | HISTORY is a symbol representing a variable to store the history in." |
| 1912 | (semantic-complete-read-tag-engine | 1961 | (semantic-complete-read-tag-engine |
| 1913 | (semantic-collector-local-members prompt :buffer (current-buffer)) | 1962 | (semantic-collector-local-members prompt :buffer (current-buffer)) |
| 1914 | (semantic-displayor-traditional-with-focus-highlight) | 1963 | (semantic-displayer-traditional-with-focus-highlight) |
| 1915 | ;;(semantic-displayor-tooltip) | 1964 | ;;(semantic-displayer-tooltip) |
| 1916 | prompt | 1965 | prompt |
| 1917 | default-tag | 1966 | default-tag |
| 1918 | initial-input | 1967 | initial-input |
| @@ -1936,7 +1985,7 @@ HISTORY is a symbol representing a variable to store the history in." | |||
| 1936 | :buffer (current-buffer) | 1985 | :buffer (current-buffer) |
| 1937 | :path (current-buffer) | 1986 | :path (current-buffer) |
| 1938 | ) | 1987 | ) |
| 1939 | (semantic-displayor-traditional-with-focus-highlight) | 1988 | (semantic-displayer-traditional-with-focus-highlight) |
| 1940 | prompt | 1989 | prompt |
| 1941 | default-tag | 1990 | default-tag |
| 1942 | initial-input | 1991 | initial-input |
| @@ -1948,7 +1997,7 @@ HISTORY is a symbol representing a variable to store the history in." | |||
| 1948 | This is similar to `semantic-complete-read-tag-project', except | 1997 | This is similar to `semantic-complete-read-tag-project', except |
| 1949 | that the completion interaction is in the buffer where the context | 1998 | that the completion interaction is in the buffer where the context |
| 1950 | was calculated from. | 1999 | was calculated from. |
| 1951 | Customize `semantic-complete-inline-analyzer-displayor-class' | 2000 | Customize `semantic-complete-inline-analyzer-displayer-class' |
| 1952 | to control how completion options are displayed. | 2001 | to control how completion options are displayed. |
| 1953 | See `semantic-complete-inline-tag-engine' for details on how | 2002 | See `semantic-complete-inline-tag-engine' for details on how |
| 1954 | completion works." | 2003 | completion works." |
| @@ -1982,8 +2031,8 @@ completion works." | |||
| 1982 | ;; There are several options. Do the completion. | 2031 | ;; There are several options. Do the completion. |
| 1983 | (semantic-complete-inline-tag-engine | 2032 | (semantic-complete-inline-tag-engine |
| 1984 | collector | 2033 | collector |
| 1985 | (funcall semantic-complete-inline-analyzer-displayor-class) | 2034 | (funcall semantic-complete-inline-analyzer-displayer-class) |
| 1986 | ;;(semantic-displayor-tooltip) | 2035 | ;;(semantic-displayer-tooltip) |
| 1987 | (current-buffer) | 2036 | (current-buffer) |
| 1988 | start end)) | 2037 | start end)) |
| 1989 | ))) | 2038 | ))) |
| @@ -2010,7 +2059,7 @@ prompts. these are calculated from the CONTEXT variable passed in." | |||
| 2010 | prompt | 2059 | prompt |
| 2011 | :buffer (oref context buffer) | 2060 | :buffer (oref context buffer) |
| 2012 | :context context) | 2061 | :context context) |
| 2013 | (semantic-displayor-traditional-with-focus-highlight) | 2062 | (semantic-displayer-traditional-with-focus-highlight) |
| 2014 | (with-current-buffer (oref context buffer) | 2063 | (with-current-buffer (oref context buffer) |
| 2015 | (goto-char (cdr (oref context bounds))) | 2064 | (goto-char (cdr (oref context bounds))) |
| 2016 | (concat prompt (mapconcat 'identity syms ".") | 2065 | (concat prompt (mapconcat 'identity syms ".") |
| @@ -2026,7 +2075,7 @@ This is similar to `semantic-complete-read-tag-analyze', except | |||
| 2026 | that the completion interaction is in the buffer where the context | 2075 | that the completion interaction is in the buffer where the context |
| 2027 | was calculated from. | 2076 | was calculated from. |
| 2028 | CONTEXT is the semantic analyzer context to start with. | 2077 | CONTEXT is the semantic analyzer context to start with. |
| 2029 | Customize `semantic-complete-inline-analyzer-displayor-class' | 2078 | Customize `semantic-complete-inline-analyzer-displayer-class' |
| 2030 | to control how completion options are displayed. | 2079 | to control how completion options are displayed. |
| 2031 | 2080 | ||
| 2032 | See `semantic-complete-inline-tag-engine' for details on how | 2081 | See `semantic-complete-inline-tag-engine' for details on how |
| @@ -2060,17 +2109,17 @@ completion works." | |||
| 2060 | ;; There are several options. Do the completion. | 2109 | ;; There are several options. Do the completion. |
| 2061 | (semantic-complete-inline-tag-engine | 2110 | (semantic-complete-inline-tag-engine |
| 2062 | collector | 2111 | collector |
| 2063 | (funcall semantic-complete-inline-analyzer-displayor-class) | 2112 | (funcall semantic-complete-inline-analyzer-displayer-class) |
| 2064 | ;;(semantic-displayor-tooltip) | 2113 | ;;(semantic-displayer-tooltip) |
| 2065 | (oref context buffer) | 2114 | (oref context buffer) |
| 2066 | (car (oref context bounds)) | 2115 | (car (oref context bounds)) |
| 2067 | (cdr (oref context bounds)) | 2116 | (cdr (oref context bounds)) |
| 2068 | )) | 2117 | )) |
| 2069 | ))) | 2118 | ))) |
| 2070 | 2119 | ||
| 2071 | (defcustom semantic-complete-inline-analyzer-idle-displayor-class | 2120 | (defcustom semantic-complete-inline-analyzer-idle-displayer-class |
| 2072 | 'semantic-displayor-ghost | 2121 | 'semantic-displayer-ghost |
| 2073 | "Class for displayor to use with inline completion at idle time." | 2122 | "Class for displayer to use with inline completion at idle time." |
| 2074 | :group 'semantic | 2123 | :group 'semantic |
| 2075 | :type semantic-complete-inline-custom-type | 2124 | :type semantic-complete-inline-custom-type |
| 2076 | ) | 2125 | ) |
| @@ -2081,13 +2130,13 @@ CONTEXT is the semantic analyzer context to start with. | |||
| 2081 | This function is used from `semantic-idle-completions-mode'. | 2130 | This function is used from `semantic-idle-completions-mode'. |
| 2082 | 2131 | ||
| 2083 | This is the same as `semantic-complete-inline-analyzer', except that | 2132 | This is the same as `semantic-complete-inline-analyzer', except that |
| 2084 | it uses `semantic-complete-inline-analyzer-idle-displayor-class' | 2133 | it uses `semantic-complete-inline-analyzer-idle-displayer-class' |
| 2085 | to control how completions are displayed. | 2134 | to control how completions are displayed. |
| 2086 | 2135 | ||
| 2087 | See `semantic-complete-inline-tag-engine' for details on how | 2136 | See `semantic-complete-inline-tag-engine' for details on how |
| 2088 | completion works." | 2137 | completion works." |
| 2089 | (let ((semantic-complete-inline-analyzer-displayor-class | 2138 | (let ((semantic-complete-inline-analyzer-displayer-class |
| 2090 | semantic-complete-inline-analyzer-idle-displayor-class)) | 2139 | semantic-complete-inline-analyzer-idle-displayer-class)) |
| 2091 | (semantic-complete-inline-analyzer context) | 2140 | (semantic-complete-inline-analyzer context) |
| 2092 | )) | 2141 | )) |
| 2093 | 2142 | ||
| @@ -2168,7 +2217,7 @@ The result is inserted as a replacement of the text that was there." | |||
| 2168 | possible values. | 2217 | possible values. |
| 2169 | The function returns immediately, leaving the buffer in a mode that | 2218 | The function returns immediately, leaving the buffer in a mode that |
| 2170 | will perform the completion. | 2219 | will perform the completion. |
| 2171 | Configure `semantic-complete-inline-analyzer-displayor-class' to change | 2220 | Configure `semantic-complete-inline-analyzer-displayer-class' to change |
| 2172 | how completion options are displayed." | 2221 | how completion options are displayed." |
| 2173 | (interactive) | 2222 | (interactive) |
| 2174 | ;; Only do this if we are not already completing something. | 2223 | ;; Only do this if we are not already completing something. |
| @@ -2190,7 +2239,7 @@ how completion options are displayed." | |||
| 2190 | possible values. | 2239 | possible values. |
| 2191 | The function returns immediately, leaving the buffer in a mode that | 2240 | The function returns immediately, leaving the buffer in a mode that |
| 2192 | will perform the completion. | 2241 | will perform the completion. |
| 2193 | Configure `semantic-complete-inline-analyzer-idle-displayor-class' | 2242 | Configure `semantic-complete-inline-analyzer-idle-displayer-class' |
| 2194 | to change how completion options are displayed." | 2243 | to change how completion options are displayed." |
| 2195 | (interactive) | 2244 | (interactive) |
| 2196 | ;; Only do this if we are not already completing something. | 2245 | ;; Only do this if we are not already completing something. |
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el index 3df51052c00..09af66658fa 100644 --- a/lisp/cedet/semantic/idle.el +++ b/lisp/cedet/semantic/idle.el | |||
| @@ -980,7 +980,7 @@ This minor mode only takes effect if Semantic is active and | |||
| 980 | 980 | ||
| 981 | When enabled, Emacs displays a list of possible completions at | 981 | When enabled, Emacs displays a list of possible completions at |
| 982 | idle time. The method for displaying completions is given by | 982 | idle time. The method for displaying completions is given by |
| 983 | `semantic-complete-inline-analyzer-idle-displayor-class'; the | 983 | `semantic-complete-inline-analyzer-idle-displayer-class'; the |
| 984 | default is to show completions inline. | 984 | default is to show completions inline. |
| 985 | 985 | ||
| 986 | While a completion is displayed, RET accepts the completion; M-n | 986 | While a completion is displayed, RET accepts the completion; M-n |