Attached please find a patch to sort cycling completion candidates by
the text property :completion-cycle-penalty (lower is better).

Thanks
Ted

=== modified file 'lisp/minibuffer.el'
--- lisp/minibuffer.el	2011-02-12 18:30:13 +0000
+++ lisp/minibuffer.el	2011-03-08 14:51:07 +0000
@@ -704,7 +704,19 @@
         (when last
           (setcdr last nil)
           ;; Prefer shorter completions.
-          (setq all (sort all (lambda (c1 c2) (< (length c1) (length c2)))))
+          (setq
+           all
+           (sort all
+                 (lambda (c1 c2)
+                   (let ((s1 (get-text-property
+                              0 :completion-cycle-penalty c1))
+                         (s2 (get-text-property
+                              0 :completion-cycle-penalty c2)))
+                     (cond ((and s1 s2) (cond ((< s1 s2) t)
+                                              ((> s1 s2) nil)
+                                              (t (< (length c1) (length c2)))))
+                           (s1 t)
+                           (s2 nil))))))
           ;; Prefer recently used completions.
           (let ((hist (symbol-value minibuffer-history-variable)))
             (setq all (sort all (lambda (c1 c2)

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to