diff options
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r-- | lisp/minibuffer.el | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 2c0541ac096..7b252b4d46d 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -873,6 +873,7 @@ completing buffer and file names, respectively." ;; part of the string (e.g. substitute-in-file-name). (let ((requote (when (completion-metadata-get metadata 'completion--unquote-requote) + (cl-assert (functionp table)) (let ((new (funcall table string point 'completion--unquote))) (setq string (pop new)) (setq table (pop new)) @@ -1117,9 +1118,10 @@ If no characters can be completed, display a list of possible completions. If you repeat this command after it displayed such a list, scroll the window of possible completions." (interactive) - (completion-in-region (minibuffer-prompt-end) (point-max) - minibuffer-completion-table - minibuffer-completion-predicate)) + (when (<= (minibuffer-prompt-end) (point)) + (completion-in-region (minibuffer-prompt-end) (point-max) + minibuffer-completion-table + minibuffer-completion-predicate))) (defun completion--in-region-1 (beg end) ;; If the previous command was not this, @@ -3065,16 +3067,9 @@ filter out additional entries (because TABLE might not obey PRED)." (nconc (completion-pcm--hilit-commonality pattern all) (length prefix))))) -(defun completion--sreverse (str) - "Like `reverse' but for a string STR rather than a list." - (apply #'string (nreverse (mapcar 'identity str)))) - (defun completion--common-suffix (strs) "Return the common suffix of the strings STRS." - (completion--sreverse - (try-completion - "" - (mapcar #'completion--sreverse strs)))) + (nreverse (try-completion "" (mapcar #'reverse strs)))) (defun completion-pcm--merge-completions (strs pattern) "Extract the commonality in STRS, with the help of PATTERN. |