aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/complete.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/complete.el b/lisp/complete.el
index 15ee5112ea7..e0ed2e49010 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -187,6 +187,9 @@ If nil, means use the colon-separated path in the variable $INCPATH instead."
187 187
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
191 "Internal variable used by `PC-do-completion'.")
192
190;;;###autoload 193;;;###autoload
191(define-minor-mode partial-completion-mode 194(define-minor-mode partial-completion-mode
192 "Toggle Partial Completion mode. 195 "Toggle Partial Completion mode.
@@ -239,7 +242,9 @@ second TAB brings up the `*Completions*' buffer."
239 (if partial-completion-mode 'add-hook 'remove-hook) 242 (if partial-completion-mode 'add-hook 'remove-hook)
240 'choose-completion-string-functions 243 'choose-completion-string-functions
241 (lambda (choice buffer mini-p base-size) 244 (lambda (choice buffer mini-p base-size)
242 (if mini-p (goto-char (point-max))) 245 (if mini-p (goto-char (point-max))
246 ;; Need a similar hack for the non-minibuffer-case -- gm.
247 (if PC-do-completion-end (goto-char PC-do-completion-end)))
243 nil)) 248 nil))
244 ;; Build the env-completion and mapping table. 249 ;; Build the env-completion and mapping table.
245 (when (and partial-completion-mode (null PC-env-vars-alist)) 250 (when (and partial-completion-mode (null PC-env-vars-alist))
@@ -759,9 +764,13 @@ of `minibuffer-completion-table' and the minibuffer contents.")
759 ;; completion gets confused trying to figure out 764 ;; completion gets confused trying to figure out
760 ;; how much to replace, so we tell it explicitly 765 ;; how much to replace, so we tell it explicitly
761 ;; (ie, the number of chars in the buffer before beg). 766 ;; (ie, the number of chars in the buffer before beg).
767 ;;
768 ;; Note that choose-completion-string-functions
769 ;; plays around with point.
762 (setq completion-base-size (if dirname 770 (setq completion-base-size (if dirname
763 dirlength 771 dirlength
764 (- beg prompt-end)))))) 772 (- beg prompt-end))
773 PC-do-completion-end end))))
765 (PC-temp-minibuffer-message " [Next char not unique]")) 774 (PC-temp-minibuffer-message " [Next char not unique]"))
766 nil))))) 775 nil)))))
767 776
@@ -869,6 +878,7 @@ or properties are considered."
869 (if (equal last-command 'PC-lisp-complete-symbol) 878 (if (equal last-command 'PC-lisp-complete-symbol)
870 (PC-do-completion nil beg PC-lisp-complete-end) 879 (PC-do-completion nil beg PC-lisp-complete-end)
871 (setq PC-lisp-complete-end (point-marker)) 880 (setq PC-lisp-complete-end (point-marker))
881 (set-marker-insertion-type PC-lisp-complete-end t)
872 (PC-do-completion nil beg end)))) 882 (PC-do-completion nil beg end))))
873 883
874(defun PC-complete-as-file-name () 884(defun PC-complete-as-file-name ()