Subject: bug#31906: 26.1.50; Properly set completion-at-point-functions in eshell

From: Carlos Pita <[email-masked]>
Date: Tue, 19 Jun 2018 23:59:29 -0300

Mmmh it seems to be that it's overriding the default
pcomplete-completions-at-point. But then why is this default set at
all? <Tab> is directly bound to eshell-pcomplete, a simple wrapper
around pcomplete, which AFAICS doesn't rely on
completion-at-point-functions. But there is this workaround for
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=12838 in the final line
of eshell-pcomplete:

(defun eshell-pcomplete (&optional interactively)
  "Eshell wrapper for `pcomplete'."
  (interactive "p")
  ;; Pretend to be pcomplete so that cycling works (bug#13293).
  (setq this-command 'pcomplete)
  (condition-case nil
      (if interactively
      (call-interactively 'pcomplete)
    (pcomplete))
    (text-read-only (completion-at-point)))) ; Workaround for bug#12838.

Although I don't fully understand the workaround.

So to sum up, what I would have expected is:

1. completion-at-point-functions contains only elisp-completions-at-point.
2. M-<Tab> is bound to completion-at-point.
3. <Tab> is bound to a wrapper to pcomplete (that doesn't call
completion-at-point).

All these expectations are violated.