On Mon, 28 Feb 2011 18:50:20 -0500 Stefan Monnier <monn...@iro.umontreal.ca> wrote:
>> The only thing I need to clarify is sorting. Right now shorter string >> wins. In the new method, higher score should win. SM> I think it's easier if lower scores win, so it's consistent with the SM> current use of `length'. It's really not a big issue: just negate the SM> values you put on the property and you're done. I thought that would be easier too, but it's counter-intuitive. Well, here's the patch. It doesn't check that the completion score is a number but otherwise seems OK to me. A string with a completion score always wins over one without. Ted === modified file 'lisp/minibuffer.el' *** lisp/minibuffer.el 2011-02-12 18:30:13 +0000 --- lisp/minibuffer.el 2011-03-01 15:39:33 +0000 *************** *** 704,710 **** (when last (setcdr last nil) ;; Prefer shorter completions. ! (setq all (sort all (lambda (c1 c2) (< (length c1) (length c2))))) ;; Prefer recently used completions. (let ((hist (symbol-value minibuffer-history-variable))) (setq all (sort all (lambda (c1 c2) --- 704,719 ---- (when last (setcdr last nil) ;; Prefer shorter completions. ! (setq ! all ! (sort all ! (lambda (c1 c2) ! (let ((s1 (get-text-property 0 :completion-score c1)) ! (s2 (get-text-property 0 :completion-score c2))) ! (cond ((and s1 s2) (< s1 s2)) ! (s1 t) ! (s2 nil) ! (t (< (length c1) (length c2)))))))) ;; Prefer recently used completions. (let ((hist (symbol-value minibuffer-history-variable))) (setq all (sort all (lambda (c1 c2) ------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev _______________________________________________ bbdb-info@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bbdb-info BBDB Home Page: http://bbdb.sourceforge.net/