aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2015-01-05 11:34:06 -0500
committerStefan Monnier2015-01-05 11:34:06 -0500
commitd2cf05d1bac19d8564d0806f515b9f40fe57f4df (patch)
tree061c33d524e476bfeba63d1d6b4ec2842f3fd527
parentc477f2073018ed4deb3810059c1032c1709164fa (diff)
downloademacs-d2cf05d1bac19d8564d0806f515b9f40fe57f4df.tar.gz
emacs-d2cf05d1bac19d8564d0806f515b9f40fe57f4df.zip
* lisp/minibuffer.el (completion-category-defaults): Default to nil.
(completion-category-defaults): New var. Set unicode-name to use substring completion.
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/minibuffer.el29
3 files changed, 30 insertions, 7 deletions
diff --git a/etc/NEWS b/etc/NEWS
index ac42a9ff6dc..3a53c9c02a5 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -166,6 +166,8 @@ characters, which can be used for geometry-related calculations.
166 166
167* Editing Changes in Emacs 25.1 167* Editing Changes in Emacs 25.1
168 168
169** Unicode names entered via C-x 8 RET now use substring completion by default.
170
169** New minor mode global-eldoc-mode is enabled by default. 171** New minor mode global-eldoc-mode is enabled by default.
170 172
171** Emacs now supports "bracketed paste mode" when running on a terminal 173** Emacs now supports "bracketed paste mode" when running on a terminal
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f413526c0b2..df760f20a7e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12015-01-05 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * minibuffer.el (completion-category-defaults): New var.
4 Set unicode-name to use substring completion.
5 (completion-category-defaults): Set it to nil.
6
12015-01-04 Dmitry Gutov <dgutov@yandex.ru> 72015-01-04 Dmitry Gutov <dgutov@yandex.ru>
2 8
3 Add mouse interaction to xref. 9 Add mouse interaction to xref.
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 16312444e3c..538bd974256 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -826,16 +826,27 @@ styles for specific categories, such as files, buffers, etc."
826 :type completion--styles-type 826 :type completion--styles-type
827 :version "23.1") 827 :version "23.1")
828 828
829(defcustom completion-category-overrides 829(defvar completion-category-defaults
830 '((buffer (styles . (basic substring)))) 830 '((buffer (styles . (basic substring)))
831 "List of `completion-styles' overrides for specific categories. 831 (unicode-name (styles . (basic substring))))
832 "Default settings for specific completion categories.
833Each entry has the shape (CATEGORY . ALIST) where ALIST is
834an association list that can specify properties such as:
835- `styles': the list of `completion-styles' to use for that category.
836- `cycle': the `completion-cycle-threshold' to use for that category.
837Categories are symbols such as `buffer' and `file', used when
838completing buffer and file names, respectively.")
839
840(defcustom completion-category-overrides nil
841 "List of category-specific user overrides for completion styles.
832Each override has the shape (CATEGORY . ALIST) where ALIST is 842Each override has the shape (CATEGORY . ALIST) where ALIST is
833an association list that can specify properties such as: 843an association list that can specify properties such as:
834- `styles': the list of `completion-styles' to use for that category. 844- `styles': the list of `completion-styles' to use for that category.
835- `cycle': the `completion-cycle-threshold' to use for that category. 845- `cycle': the `completion-cycle-threshold' to use for that category.
836Categories are symbols such as `buffer' and `file', used when 846Categories are symbols such as `buffer' and `file', used when
837completing buffer and file names, respectively." 847completing buffer and file names, respectively.
838 :version "24.1" 848This overrides the defaults specified in `completion-category-defaults'."
849 :version "25.1"
839 :type `(alist :key-type (choice :tag "Category" 850 :type `(alist :key-type (choice :tag "Category"
840 (const buffer) 851 (const buffer)
841 (const file) 852 (const file)
@@ -851,9 +862,13 @@ completing buffer and file names, respectively."
851 (const :tag "Select one value from the menu." cycle) 862 (const :tag "Select one value from the menu." cycle)
852 ,completion--cycling-threshold-type)))) 863 ,completion--cycling-threshold-type))))
853 864
865(defun completion--category-override (category tag)
866 (or (assq tag (cdr (assq category completion-category-overrides)))
867 (assq tag (cdr (assq category completion-category-defaults)))))
868
854(defun completion--styles (metadata) 869(defun completion--styles (metadata)
855 (let* ((cat (completion-metadata-get metadata 'category)) 870 (let* ((cat (completion-metadata-get metadata 'category))
856 (over (assq 'styles (cdr (assq cat completion-category-overrides))))) 871 (over (completion--category-override cat 'styles)))
857 (if over 872 (if over
858 (delete-dups (append (cdr over) (copy-sequence completion-styles))) 873 (delete-dups (append (cdr over) (copy-sequence completion-styles)))
859 completion-styles))) 874 completion-styles)))
@@ -967,7 +982,7 @@ completion candidates than this number."
967 982
968(defun completion--cycle-threshold (metadata) 983(defun completion--cycle-threshold (metadata)
969 (let* ((cat (completion-metadata-get metadata 'category)) 984 (let* ((cat (completion-metadata-get metadata 'category))
970 (over (assq 'cycle (cdr (assq cat completion-category-overrides))))) 985 (over (completion--category-override cat 'cycle)))
971 (if over (cdr over) completion-cycle-threshold))) 986 (if over (cdr over) completion-cycle-threshold)))
972 987
973(defvar-local completion-all-sorted-completions nil) 988(defvar-local completion-all-sorted-completions nil)