Subject: 27.0.50; rgrep + icomplete => (cl-assertion-failed (functionp table))
From: Dmitry Alexandrov <[email-masked]>
To: [email-masked]
Date: Thu, 19 Oct 2017 04:57:30 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Steps to reproduce:

$ cd /
$ emacs -Q
M-x icomplete-mode
M-x rgrep foo RET e

(Where ‘foo’ is arbitrary text and ‘e’ is the first letter of one of possible completions.  In this example that would be ‘etc’.)

Got an ‘Error in post-command-hook (icomplete-post-command-hook): (cl-assertion-failed (functionp table))’.

Backtrace:
--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (cl-assertion-failed ((functionp table) nil))
  cl--assertion-failed((functionp table))
  completion--nth-completion(1 "e" (#("etc/" 0 1 (face completions-common-part) 1 2 (face (completions-first-difference)))) nil 1 (metadata (category . file) (completion--unquote-requote . t)))
  completion-try-completion("e" (#("etc/" 0 1 (face completions-common-part) 1 2 (face (completions-first-difference)))) nil 1 (metadata (category . file) (completion--unquote-requote . t)))
  icomplete-completions("e" read-file-name-internal nil t)
  icomplete-exhibit()
  icomplete-post-command-hook()
  read-from-minibuffer("Search for \"foo\" in files matching wildcard (default all): " nil (keymap (menu-bar keymap (minibuf "Minibuf" keymap (tab menu-item "Complete" minibuffer-complete :help "Complete as far as possible") (space menu-item "Complete Word" minibuffer-complete-word :help "Complete at most one word") (63 menu-item "List Completions" minibuffer-completion-help :help "Display all possible completions") "Minibuf")) (27 keymap (118 . switch-to-completions)) (prior . switch-to-completions) (63 . minibuffer-completion-help) (32 . minibuffer-complete-word) (9 . minibuffer-complete) keymap (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the minibuffer") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuffer") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\015" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . abort-recursive-edit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil grep-files-history ("all" "el" "ch" "c" "cc" "cchh" "hh" "h" "l" "m" "tex" "texi" "asm") nil)
  completing-read-default("Search for \"foo\" in files matching wildcard (default all): " read-file-name-internal nil nil nil grep-files-history ("all" "el" "ch" "c" "cc" "cchh" "hh" "h" "l" "m" "tex" "texi" "asm") nil)
  completing-read("Search for \"foo\" in files matching wildcard (default all): " read-file-name-internal nil nil nil grep-files-history ("all" "el" "ch" "c" "cc" "cchh" "hh" "h" "l" "m" "tex" "texi" "asm"))
  grep-read-files("foo")
  byte-code("\304 \210\010\203\026\0\011\305\232\203\026\0\306\307\010\310\211\311%C\207\n\204\036\0\312\313!\207\314 \315\001!\316\317\310\013\320$\011\321\232\003\003\003\003F\207" [grep-find-command current-prefix-arg grep-find-template default-directory grep-compute-defaults (16) read-from-minibuffer "Run: " nil grep-find-history error "grep.el: No `grep-find-template' available" grep-read-regexp grep-read-files read-directory-name "Base directory: " t (4)] 8)
  call-interactively(rgrep record nil)
  command-execute(rgrep record)
  execute-extended-command(nil "rgrep" nil)
  funcall-interactively(execute-extended-command nil "rgrep" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)
--8<---------------cut here---------------end--------------->8---

This might be related to bug № 16274 [0].

[0] https://bugs.gnu.org/16274