aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-05-29 16:25:12 +0000
committerStefan Monnier2008-05-29 16:25:12 +0000
commitc2d0b538ee5f5ce37f27c0609e285eea581216af (patch)
treed0457ccfc67bae8457353d5bf5e8b28ef1057dfa
parent1519d52ee5536601899189485a96674113a42199 (diff)
downloademacs-c2d0b538ee5f5ce37f27c0609e285eea581216af.tar.gz
emacs-c2d0b538ee5f5ce37f27c0609e285eea581216af.zip
(icomplete-prospects-length): Make obsolete.
(icomplete-prospects-height): New var. (icomplete-completions): Use it.
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/icomplete.el32
3 files changed, 31 insertions, 9 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 9d74ae0e1fa..3d590ad94b7 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -426,6 +426,8 @@ this buffer, and special Proced commands to operate on the processes listed.
426 426
427* Changes in Specialized Modes and Packages in Emacs 23.1 427* Changes in Specialized Modes and Packages in Emacs 23.1
428 428
429** Icomplete: `icomplete-prospects-height' supercedes `icomplete-prospects-length'.
430
429** A new `whitespace' package has been installed, and the pre-existing one 431** A new `whitespace' package has been installed, and the pre-existing one
430renamed to `old-whitespace'. 432renamed to `old-whitespace'.
431[FIXME someone explain why this is good, if it is...] 433[FIXME someone explain why this is good, if it is...]
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 925eeb7af09..aa61efaaa67 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12008-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * icomplete.el (icomplete-prospects-length): Make obsolete.
4 (icomplete-prospects-height): New var.
5 (icomplete-completions): Use it.
6
12008-05-29 David Kastrup <dak@gnu.org> 72008-05-29 David Kastrup <dak@gnu.org>
2 8
3 * autoinsert.el (auto-insert): Add :link. 9 * autoinsert.el (auto-insert): Add :link.
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index cacb7b26f19..02fb4c76214 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -67,11 +67,17 @@
67 :prefix "icomplete-" 67 :prefix "icomplete-"
68 :group 'minibuffer) 68 :group 'minibuffer)
69 69
70(defvar icomplete-prospects-length 80)
71(make-obsolete-variable
72 'icomplete-prospects-length 'icomplete-prospects-height "23.1")
73
70;;;_* User Customization variables 74;;;_* User Customization variables
71(defcustom icomplete-prospects-length 80 75(defcustom icomplete-prospects-height
72 "Length of string displaying the prospects." 76 ;; 20 is an estimated common size for the prompt + minibuffer content, to
73 :type 'integer 77 ;; try to guess the number of lines used up by icomplete-prospects-length.
74 :group 'icomplete) 78 (+ 1 (/ (+ icomplete-prospects-length 20) (window-width)))
79 "Maximum number of lines to use in the minibuffer."
80 :type 'integer)
75 81
76(defcustom icomplete-compute-delay .3 82(defcustom icomplete-compute-delay .3
77 "Completions-computation stall, used only with large-number completions. 83 "Completions-computation stall, used only with large-number completions.
@@ -280,8 +286,7 @@ are exhibited within the square braces.)"
280 (base-size (cdr last)) 286 (base-size (cdr last))
281 (open-bracket (if require-match "(" "[")) 287 (open-bracket (if require-match "(" "["))
282 (close-bracket (if require-match ")" "]"))) 288 (close-bracket (if require-match ")" "]")))
283 ;; `concat'/`mapconcat' is the slow part. With the introduction of 289 ;; `concat'/`mapconcat' is the slow part.
284 ;; `icomplete-prospects-length', there is no need for `catch'/`throw'.
285 (if (not (consp comps)) 290 (if (not (consp comps))
286 (format " %sNo matches%s" open-bracket close-bracket) 291 (format " %sNo matches%s" open-bracket close-bracket)
287 (if last (setcdr last nil)) 292 (if last (setcdr last nil))
@@ -311,7 +316,15 @@ are exhibited within the square braces.)"
311 (t (concat "..." (substring most compare)))) 316 (t (concat "..." (substring most compare))))
312 close-bracket))) 317 close-bracket)))
313 ;;"-prospects" - more than one candidate 318 ;;"-prospects" - more than one candidate
314 (prospects-len (+ (length determ) 6)) ;; take {,...} into account 319 (prospects-len (+ (length determ) 6 ;; take {,...} into account
320 (string-width (buffer-string))))
321 (prospects-max
322 ;; Max total length to use, including the minibuffer content.
323 (* (+ icomplete-max-minibuffer-height
324 ;; If the minibuffer content already uses up more than
325 ;; one line, increase the allowable space accordingly.
326 (/ prospects-len (window-width)))
327 (window-width)))
315 (prefix-len 328 (prefix-len
316 ;; Find the common prefix among `comps'. 329 ;; Find the common prefix among `comps'.
317 (if (eq t (compare-strings (car comps) nil (length most) 330 (if (eq t (compare-strings (car comps) nil (length most)
@@ -332,8 +345,9 @@ are exhibited within the square braces.)"
332 comps (cdr comps)) 345 comps (cdr comps))
333 (cond ((string-equal comp "") (setq most-is-exact t)) 346 (cond ((string-equal comp "") (setq most-is-exact t))
334 ((member comp prospects)) 347 ((member comp prospects))
335 (t (setq prospects-len (+ (length comp) 1 prospects-len)) 348 (t (setq prospects-len
336 (if (< prospects-len icomplete-prospects-length) 349 (+ (string-width comp) 1 prospects-len))
350 (if (< prospects-len prospects-max)
337 (push comp prospects) 351 (push comp prospects)
338 (setq limit t)))))) 352 (setq limit t))))))
339 ;; Restore the base-size info, since completion-all-sorted-completions 353 ;; Restore the base-size info, since completion-all-sorted-completions