comparison lisp/complete.el @ 77211:43c40e825164

(PC-goto-end, PC-do-completion-end): Make buffer-local.
author Glenn Morris <rgm@gnu.org>
date Sat, 14 Apr 2007 20:23:31 +0000
parents 2b2091de06c3
children 9355f9b7bbff b6eaf964a6cf e6fdae9180d4
comparison
equal deleted inserted replaced
77210:d83335a3519d 77211:43c40e825164
188 (define-key global-map [remap lisp-complete-symbol] 'PC-lisp-complete-symbol))))) 188 (define-key global-map [remap lisp-complete-symbol] 'PC-lisp-complete-symbol)))))
189 189
190 (defvar PC-do-completion-end nil 190 (defvar PC-do-completion-end nil
191 "Internal variable used by `PC-do-completion'.") 191 "Internal variable used by `PC-do-completion'.")
192 192
193 (make-variable-buffer-local 'PC-do-completion-end)
194
193 (defvar PC-goto-end nil 195 (defvar PC-goto-end nil
194 "Internal variable set in `PC-do-completion', used in 196 "Internal variable set in `PC-do-completion', used in
195 `choose-completion-string-functions'.") 197 `choose-completion-string-functions'.")
198
199 (make-variable-buffer-local 'PC-goto-end)
196 200
197 ;;;###autoload 201 ;;;###autoload
198 (define-minor-mode partial-completion-mode 202 (define-minor-mode partial-completion-mode
199 "Toggle Partial Completion mode. 203 "Toggle Partial Completion mode.
200 With prefix ARG, turn Partial Completion mode on if ARG is positive. 204 With prefix ARG, turn Partial Completion mode on if ARG is positive.
766 (eq last-command this-command)) 770 (eq last-command this-command))
767 (eq mode 'help)) 771 (eq mode 'help))
768 (let ((prompt-end (minibuffer-prompt-end))) 772 (let ((prompt-end (minibuffer-prompt-end)))
769 (with-output-to-temp-buffer "*Completions*" 773 (with-output-to-temp-buffer "*Completions*"
770 (display-completion-list (sort helpposs 'string-lessp)) 774 (display-completion-list (sort helpposs 'string-lessp))
775 (setq PC-do-completion-end end
776 PC-goto-end goto-end)
771 (with-current-buffer standard-output 777 (with-current-buffer standard-output
772 ;; Record which part of the buffer we are completing 778 ;; Record which part of the buffer we are completing
773 ;; so that choosing a completion from the list 779 ;; so that choosing a completion from the list
774 ;; knows how much old text to replace. 780 ;; knows how much old text to replace.
775 ;; This was briefly nil in the non-dirname case. 781 ;; This was briefly nil in the non-dirname case.
784 ;; 790 ;;
785 ;; Note that choose-completion-string-functions 791 ;; Note that choose-completion-string-functions
786 ;; plays around with point. 792 ;; plays around with point.
787 (setq completion-base-size (if dirname 793 (setq completion-base-size (if dirname
788 dirlength 794 dirlength
789 (- beg prompt-end)) 795 (- beg prompt-end))))))
790 PC-do-completion-end end
791 PC-goto-end goto-end))))
792 (PC-temp-minibuffer-message " [Next char not unique]")) 796 (PC-temp-minibuffer-message " [Next char not unique]"))
793 nil))))) 797 nil)))))
794 798
795 ;; Only one possible completion 799 ;; Only one possible completion
796 (t 800 (t