]> code.delx.au - gnu-emacs/blobdiff - lisp/minibuffer.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / minibuffer.el
index 2814d020b8d6237b392022e8f805f651a24dcb81..6540059b965a6f58aa660ab444e19736859a9659 100644 (file)
@@ -1,6 +1,6 @@
 ;;; minibuffer.el --- Minibuffer completion functions -*- lexical-binding: t -*-
 
-;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2016 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Package: emacs
 ;;; Completion table manipulation
 
 ;; New completion-table operation.
-(defun completion-boundaries (string table pred suffix)
-  "Return the boundaries of the completions returned by TABLE for STRING.
+(defun completion-boundaries (string collection pred suffix)
+  "Return the boundaries of text on which COLLECTION will operate.
 STRING is the string on which completion will be performed.
 SUFFIX is the string after point.
+If COLLECTION is a function, it is called with 3 arguments: STRING,
+PRED, and a cons cell of the form (boundaries . SUFFIX).
+
 The result is of the form (START . END) where START is the position
 in STRING of the beginning of the completion field and END is the position
 in SUFFIX of the end of the completion field.
 E.g. for simple completion tables, the result is always (0 . (length SUFFIX))
 and for file names the result is the positions delimited by
 the closest directory separators."
-  (let ((boundaries (if (functionp table)
-                        (funcall table string pred
+  (let ((boundaries (if (functionp collection)
+                        (funcall collection string pred
                                  (cons 'boundaries suffix)))))
     (if (not (eq (car-safe boundaries) 'boundaries))
         (setq boundaries nil))
@@ -828,7 +831,8 @@ styles for specific categories, such as files, buffers, etc."
 
 (defvar completion-category-defaults
   '((buffer (styles . (basic substring)))
-    (unicode-name (styles . (basic substring))))
+    (unicode-name (styles . (basic substring)))
+    (project-file (styles . (basic substring))))
   "Default settings for specific completion categories.
 Each entry has the shape (CATEGORY . ALIST) where ALIST is
 an association list that can specify properties such as:
@@ -1831,7 +1835,7 @@ variables.")
                 'display-buffer-below-selected))
            ,(if temp-buffer-resize-mode
                 '(window-height . resize-temp-buffer-window)
-              '(window-height . shrink-window-if-larger-than-buffer))
+              '(window-height . fit-window-to-buffer))
            ,(when temp-buffer-resize-mode
               '(preserve-size . (nil . t))))
           nil