aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/complete.el40
1 files changed, 18 insertions, 22 deletions
diff --git a/lisp/complete.el b/lisp/complete.el
index 207b7f549d8..9c5156a3980 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -737,8 +737,6 @@ GOTO-END is non-nil, however, it instead replaces up to END."
737 (setq prefix (PC-try-completion 737 (setq prefix (PC-try-completion
738 (PC-chunk-after basestr skip) poss))) 738 (PC-chunk-after basestr skip) poss)))
739 (let ((first t) i) 739 (let ((first t) i)
740 ;; Retain capitalization of user input even if
741 ;; completion-ignore-case is set.
742 (if (eq mode 'word) 740 (if (eq mode 'word)
743 (setq prefix (PC-chop-word prefix basestr))) 741 (setq prefix (PC-chop-word prefix basestr)))
744 (goto-char (+ beg (length dirname))) 742 (goto-char (+ beg (length dirname)))
@@ -746,27 +744,25 @@ GOTO-END is non-nil, however, it instead replaces up to END."
746 (setq i 0) ; index into prefix string 744 (setq i 0) ; index into prefix string
747 (while (< i (length prefix)) 745 (while (< i (length prefix))
748 (if (and (< (point) end) 746 (if (and (< (point) end)
749 (eq (downcase (aref prefix i)) 747 (or (eq (downcase (aref prefix i))
750 (downcase (following-char)))) 748 (downcase (following-char)))
751 ;; same char (modulo case); no action 749 (and (looking-at " ")
752 (forward-char 1) 750 (memq (aref prefix i)
753 (if (and (< (point) end) 751 PC-delims-list))))
754 (and (looking-at " ") 752 ;; replace " " by the actual delimiter
755 (memq (aref prefix i) 753 ;; or input char by prefix char
756 PC-delims-list)))
757 ;; replace " " by the actual delimiter
758 (progn
759 (delete-char 1)
760 (insert (substring prefix i (1+ i))))
761 ;; insert a new character
762 (progn 754 (progn
763 (and filename (looking-at "\\*") 755 (delete-char 1)
764 (progn 756 (insert (substring prefix i (1+ i))))
765 (delete-char 1) 757 ;; insert a new character
766 (setq end (1- end)))) 758 (progn
767 (setq improved t) 759 (and filename (looking-at "\\*")
768 (insert (substring prefix i (1+ i))) 760 (progn
769 (setq end (1+ end))))) 761 (delete-char 1)
762 (setq end (1- end))))
763 (setq improved t)
764 (insert (substring prefix i (1+ i)))
765 (setq end (1+ end))))
770 (setq i (1+ i))) 766 (setq i (1+ i)))
771 (or pt (setq pt (point))) 767 (or pt (setq pt (point)))
772 (looking-at PC-delim-regex)) 768 (looking-at PC-delim-regex))