Commit 5a6df064 authored by João Távora's avatar João Távora

Simplify ignored extensions filtering in Icomplete (bug#34070)

* lisp/icomplete.el: Use lexical binding.
(icomplete-completions): Use minibuffer-completion-predicate
to filter out completion-ignored-extensions.
parent 7560ef7d
Pipeline #553 passed with stage
in 47 minutes and 52 seconds
;;; icomplete.el --- minibuffer completion incremental feedback
;;; icomplete.el --- minibuffer completion incremental feedback -*- lexical-binding: t -*-
;; Copyright (C) 1992-1994, 1997, 1999, 2001-2019 Free Software
;; Foundation, Inc.
......@@ -368,8 +368,21 @@ If there are multiple possibilities, `icomplete-separator' separates them.
The displays for unambiguous matches have ` [Matched]' appended
\(whether complete or not), or ` [No matches]', if no eligible
matches exist."
(let* ((minibuffer-completion-table candidates)
(minibuffer-completion-predicate predicate)
(let* ((ignored-extension-re
(and minibuffer-completing-file-name
(concat "\\(?:\\`\\.\\./\\|"
(regexp-opt completion-ignored-extensions)
(minibuffer-completion-table candidates)
(if ignored-extension-re
(lambda (cand)
(and (not (string-match ignored-extension-re cand))
(or (null predicate)
(funcall predicate cand))))
(md (completion--field-metadata (icomplete--field-beg)))
(comps (completion-all-sorted-completions
(icomplete--field-beg) (icomplete--field-end)))
......@@ -382,9 +395,6 @@ matches exist."
(progn ;;(debug (format "Candidates=%S field=%S" candidates name))
(format " %sNo matches%s" open-bracket close-bracket))
(if last (setcdr last nil))
(when (and minibuffer-completing-file-name
(setq comps (completion-pcm--filename-try-filter comps)))
(let* ((most-try
(if (and base-size (> base-size 0))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment