diff options
| author | Richard M. Stallman | 1995-04-08 22:42:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-04-08 22:42:47 +0000 |
| commit | 98b45886f2e9c8bdb1c25bc0400e023f53873def (patch) | |
| tree | b84b078b9228c062199ec16bc280ffbdc1ae592f | |
| parent | 0088a46e472a67523489ee63f95df9f71d4c0454 (diff) | |
| download | emacs-98b45886f2e9c8bdb1c25bc0400e023f53873def.tar.gz emacs-98b45886f2e9c8bdb1c25bc0400e023f53873def.zip | |
(completion-setup-function): Undo March 11 change.
Add some doc strings to completion-related variables.
| -rw-r--r-- | lisp/simple.el | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 7b4969953da..8d7fbc7e76b 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2622,7 +2622,8 @@ it were the arg to `interactive' (which see) to interactively read the value." | |||
| 2622 | 2622 | ||
| 2623 | ;; Define the major mode for lists of completions. | 2623 | ;; Define the major mode for lists of completions. |
| 2624 | 2624 | ||
| 2625 | (defvar completion-list-mode-map nil) | 2625 | (defvar completion-list-mode-map nil |
| 2626 | "Local map for completion list buffers.") | ||
| 2626 | (or completion-list-mode-map | 2627 | (or completion-list-mode-map |
| 2627 | (let ((map (make-sparse-keymap))) | 2628 | (let ((map (make-sparse-keymap))) |
| 2628 | (define-key map [mouse-2] 'mouse-choose-completion) | 2629 | (define-key map [mouse-2] 'mouse-choose-completion) |
| @@ -2636,13 +2637,17 @@ it were the arg to `interactive' (which see) to interactively read the value." | |||
| 2636 | ;; Completion mode is suitable only for specially formatted data. | 2637 | ;; Completion mode is suitable only for specially formatted data. |
| 2637 | (put 'completion-list-mode 'mode-class 'special) | 2638 | (put 'completion-list-mode 'mode-class 'special) |
| 2638 | 2639 | ||
| 2639 | ;; Record the buffer that was current when the completion list was requested. | 2640 | (defvar completion-reference-buffer nil |
| 2640 | ;; Initial value is nil to avoid some compiler warnings. | 2641 | "Record the buffer that was current when the completion list was requested. |
| 2641 | (defvar completion-reference-buffer nil) | 2642 | This is a local variable in the completion list buffer. |
| 2643 | Initial value is nil to avoid some compiler warnings." | ||
| 2642 | 2644 | ||
| 2643 | ;; This records the length of the text at the beginning of the buffer | 2645 | (defvar completion-base-size nil |
| 2644 | ;; which was not included in the completion. | 2646 | "Number of chars at beginning of minibuffer not involved in completion. |
| 2645 | (defvar completion-base-size nil) | 2647 | This is a local variable in the completion list buffer |
| 2648 | but it talks about the buffer in `completion-reference-buffer'. | ||
| 2649 | If this is nil, it means to compare text to determine which part | ||
| 2650 | of the tail end of the buffer's text is involved in completion.") | ||
| 2646 | 2651 | ||
| 2647 | (defun delete-completion-window () | 2652 | (defun delete-completion-window () |
| 2648 | "Delete the completion list window. | 2653 | "Delete the completion list window. |
| @@ -2724,6 +2729,9 @@ WIth prefix argument N, move N items (negative N means move backward)." | |||
| 2724 | (forward-char 1)) | 2729 | (forward-char 1)) |
| 2725 | (delete-char len))) | 2730 | (delete-char len))) |
| 2726 | 2731 | ||
| 2732 | ;; Switch to BUFFER and insert the completion choice CHOICE. | ||
| 2733 | ;; BASE-SIZE, if non-nil, says how many characters of BUFFER's text | ||
| 2734 | ;; to keep. If it is nil, use choose-completion-delete-max-match instead. | ||
| 2727 | (defun choose-completion-string (choice &optional buffer base-size) | 2735 | (defun choose-completion-string (choice &optional buffer base-size) |
| 2728 | (let ((buffer (or buffer completion-reference-buffer))) | 2736 | (let ((buffer (or buffer completion-reference-buffer))) |
| 2729 | ;; If BUFFER is a minibuffer, barf unless it's the currently | 2737 | ;; If BUFFER is a minibuffer, barf unless it's the currently |
| @@ -2764,17 +2772,26 @@ Use \\<completion-list-mode-map>\\[mouse-choose-completion] to select one\ | |||
| 2764 | (setq completion-base-size nil) | 2772 | (setq completion-base-size nil) |
| 2765 | (run-hooks 'completion-list-mode-hook)) | 2773 | (run-hooks 'completion-list-mode-hook)) |
| 2766 | 2774 | ||
| 2767 | (defvar completion-fixup-function nil) | 2775 | (defvar completion-fixup-function nil |
| 2776 | "A function to customize how completions are identified in completion lists. | ||
| 2777 | `completion-setup-function' calls this function with no arguments | ||
| 2778 | each time it has found what it thinks is one completion. | ||
| 2779 | Point is at the end of the completion in the completion list buffer. | ||
| 2780 | If this function moves point, it can alter the end of that completion.") | ||
| 2781 | |||
| 2782 | ;; This function goes in completion-setup-hook, so that it is called | ||
| 2783 | ;; after the text of the completion list buffer is written. | ||
| 2768 | 2784 | ||
| 2769 | (defun completion-setup-function () | 2785 | (defun completion-setup-function () |
| 2770 | (save-excursion | 2786 | (save-excursion |
| 2771 | (let ((mainbuf (current-buffer)) | 2787 | (let ((mainbuf (current-buffer))) |
| 2772 | (base-size (- (point-max) (point-min)))) | ||
| 2773 | (set-buffer standard-output) | 2788 | (set-buffer standard-output) |
| 2774 | (completion-list-mode) | 2789 | (completion-list-mode) |
| 2775 | (make-local-variable 'completion-reference-buffer) | 2790 | (make-local-variable 'completion-reference-buffer) |
| 2776 | (setq completion-reference-buffer mainbuf) | 2791 | (setq completion-reference-buffer mainbuf) |
| 2777 | (setq completion-base-size base-size) | 2792 | ;;; The value 0 is right in most cases, but not for file name completion. |
| 2793 | ;;; so this has to be turned off. | ||
| 2794 | ;;; (setq completion-base-size 0) | ||
| 2778 | (goto-char (point-min)) | 2795 | (goto-char (point-min)) |
| 2779 | (if window-system | 2796 | (if window-system |
| 2780 | (insert (substitute-command-keys | 2797 | (insert (substitute-command-keys |