summaryrefslogtreecommitdiff
path: root/lisp/complete.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2007-03-28 03:28:49 +0000
committerGlenn Morris <rgm@gnu.org>2007-03-28 03:28:49 +0000
commit90dcec6f719b0d061cd0247f94befe5515092507 (patch)
tree881a729979434541afb6d471dcb6e41addde6098 /lisp/complete.el
parent3305111a068cd802478ae0bce84ca2e9d84e95ef (diff)
downloademacs-90dcec6f719b0d061cd0247f94befe5515092507.tar.gz
(PC-do-completion-end): New variable.
(partial-completion-mode) <choose-completion-string-functions>: Use PC-do-completion-end in the non-minibuffer case to replace the correct amount of text. (PC-do-completion): Set PC-do-completion-end for c-c-s-f. (PC-lisp-complete-symbol): Give marker the after-insertion type, to deal with improvements inserted after point.
Diffstat (limited to 'lisp/complete.el')
-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."
(define-key global-map [remap lisp-complete-symbol] 'PC-lisp-complete-symbol)))))
+(defvar PC-do-completion-end nil
+ "Internal variable used by `PC-do-completion'.")
+
;;;###autoload
(define-minor-mode partial-completion-mode
"Toggle Partial Completion mode.
@@ -239,7 +242,9 @@ second TAB brings up the `*Completions*' buffer."
(if partial-completion-mode 'add-hook 'remove-hook)
'choose-completion-string-functions
(lambda (choice buffer mini-p base-size)
- (if mini-p (goto-char (point-max)))
+ (if mini-p (goto-char (point-max))
+ ;; Need a similar hack for the non-minibuffer-case -- gm.
+ (if PC-do-completion-end (goto-char PC-do-completion-end)))
nil))
;; Build the env-completion and mapping table.
(when (and partial-completion-mode (null PC-env-vars-alist))
@@ -759,9 +764,13 @@ of `minibuffer-completion-table' and the minibuffer contents.")
;; completion gets confused trying to figure out
;; how much to replace, so we tell it explicitly
;; (ie, the number of chars in the buffer before beg).
+ ;;
+ ;; Note that choose-completion-string-functions
+ ;; plays around with point.
(setq completion-base-size (if dirname
dirlength
- (- beg prompt-end))))))
+ (- beg prompt-end))
+ PC-do-completion-end end))))
(PC-temp-minibuffer-message " [Next char not unique]"))
nil)))))
@@ -869,6 +878,7 @@ or properties are considered."
(if (equal last-command 'PC-lisp-complete-symbol)
(PC-do-completion nil beg PC-lisp-complete-end)
(setq PC-lisp-complete-end (point-marker))
+ (set-marker-insertion-type PC-lisp-complete-end t)
(PC-do-completion nil beg end))))
(defun PC-complete-as-file-name ()