[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/complete.el,v
From: |
Martin Rudalics |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/complete.el,v |
Date: |
Fri, 09 Mar 2007 07:28:42 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Martin Rudalics <m061211> 07/03/09 07:28:41
Index: complete.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/complete.el,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- complete.el 8 Mar 2007 14:50:59 -0000 1.63
+++ complete.el 9 Mar 2007 07:28:41 -0000 1.64
@@ -387,6 +387,29 @@
(let ((completion-ignore-case nil))
(test-completion str table pred))))
+;; The following function is an attempt to work around two problems:
+
+;; (1) When complete.el was written, (try-completion "" '(("") (""))) used to
+;; return the value "". With a change from 2002-07-07 it returns t which
caused
+;; `PC-lisp-complete-symbol' to fail with a "Wrong type argument: sequencep, t"
+;; error. `PC-try-completion' returns STRING in this case.
+
+;; (2) (try-completion "" '((""))) returned t before the above-mentioned
change.
+;; Since `PC-chop-word' operates on the return value of `try-completion' this
+;; case might have provoked a similar error as in (1). `PC-try-completion'
+;; returns "" instead. I don't know whether this is a real problem though.
+
+;; Since `PC-try-completion' is not a guaranteed to fix these bugs reliably,
you
+;; should try to look at the following discussions when you encounter problems:
+;; - emacs-pretest-bug ("Partial Completion" starting 2007-02-23),
+;; - emacs-devel ("[address-of-OP: Partial completion]" starting 2007-02-24),
+;; - emacs-devel ("[address-of-OP: EVAL and mouse selection in *Completions*]"
+;; starting 2007-03-05).
+(defun PC-try-completion (string alist &optional predicate)
+ "Like `try-completion' but return STRING instead of t."
+ (let ((result (try-completion string alist predicate)))
+ (if (eq result t) string result)))
+
(defun PC-do-completion (&optional mode beg end)
(or beg (setq beg (minibuffer-prompt-end)))
(or end (setq end (point-max)))
@@ -637,8 +660,8 @@
;; Check if next few letters are the same in all cases
(if (and (not (eq mode 'help))
- (setq prefix (try-completion (PC-chunk-after basestr skip)
- poss)))
+ (setq prefix (PC-try-completion
+ (PC-chunk-after basestr skip) poss)))
(let ((first t) i)
;; Retain capitalization of user input even if
;; completion-ignore-case is set.
@@ -676,7 +699,7 @@
(setq skip (concat skip
(regexp-quote prefix)
PC-ndelims-regex)
- prefix (try-completion
+ prefix (PC-try-completion
(PC-chunk-after
;; not basestr, because that does
;; not reflect insertions
@@ -1010,7 +1033,7 @@
(cond
((not completion-table) nil)
((eq action 'lambda) (test-completion str2 completion-table
nil))
- ((eq action nil) (try-completion str2 completion-table nil))
+ ((eq action nil) (PC-try-completion str2 completion-table nil))
((eq action t) (all-completions str2 completion-table nil)))))
ad-do-it))
- [Emacs-diffs] Changes to emacs/lisp/complete.el,v, Chong Yidong, 2007/03/05
- [Emacs-diffs] Changes to emacs/lisp/complete.el,v, Michaƫl Cadilhac, 2007/03/07
- [Emacs-diffs] Changes to emacs/lisp/complete.el,v, Kim F. Storm, 2007/03/07
- [Emacs-diffs] Changes to emacs/lisp/complete.el,v, Chong Yidong, 2007/03/08
- [Emacs-diffs] Changes to emacs/lisp/complete.el,v,
Martin Rudalics <=
- [Emacs-diffs] Changes to emacs/lisp/complete.el,v, Glenn Morris, 2007/03/09
- [Emacs-diffs] Changes to emacs/lisp/complete.el,v, Martin Rudalics, 2007/03/10
- [Emacs-diffs] Changes to emacs/lisp/complete.el,v, Stefan Monnier, 2007/03/21
- [Emacs-diffs] Changes to emacs/lisp/complete.el,v, Glenn Morris, 2007/03/26
- [Emacs-diffs] Changes to emacs/lisp/complete.el,v, Glenn Morris, 2007/03/27
- [Emacs-diffs] Changes to emacs/lisp/complete.el,v, Glenn Morris, 2007/03/28