help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

eshell sees `.#` as a directory as part of `nix build .#nixosConfigurati


From: pareto optimal
Subject: eshell sees `.#` as a directory as part of `nix build .#nixosConfigurations.my-pc`
Date: Sun, 20 Nov 2022 08:33:08 +0100 (CET)

Hi!

In xterm or vterm in emacs I get completion for the string `nix build .#` that 
looks like this:

```
$ nix build .#
.#deploy               .#lib                  .#pkgs
.#devShell             .#nixosConfigurations  .#repl
.#gdb-frontend         .#overlays             .#waveform
.#homeConfigurations   .#packages
```

In eshell however I get completions like this:

```
Click on a completion to select it.
In this buffer, type RET to select the completion near point.

Possible completions are:
../
./
```

I'd like the functionality to be the same in eshell.

I knew that `completion-at-point` was being used here and therefore it semed 
`copmletion-at-point-functions` would point me in the right direction to start 
studying in order to not treat `.#` as a filename in `nix build .#` and 
eventually get the same completions as xterm and vterm have.

So I looked at the value of completion-at-point-functions:

```
completion-at-point-functions is a variable defined in ‘minibuffer.el’.

Its value is (pcomplete-completions-at-point t)
Local in buffer *eshell*; global value is 
(tags-completion-at-point-function)
```

Alright, So it's a pcomplete thing. I learned that pcomplete uses dynamic 
dispatch to find all handlers for completion from:

https://www.masteringemacs.org/article/pcomplete-context-sensitive-completion-emacs

So then I tried undefining `pcomplete/cd` which I thought was responsible with:

```
(fmakunbound 'pcomplete/cd)
```

However... even after starting a new eshelll... the behavior I didn't want was 
still there somehow.

Then I tried the sledgehammer option (or attempted it): remove all pcomplete 
handlers:

#+begin_src emacs-lisp :eval query
(fmakunbound 'pcomplete/ack)
(fmakunbound 'pcomplete/ack-grep)
(fmakunbound 'pcomplete/ag)
(fmakunbound 'pcomplete/bcc)
(fmakunbound 'pcomplete/bcc32)
(fmakunbound 'pcomplete/bzip2)
(fmakunbound 'pcomplete/chgrp)
(fmakunbound 'pcomplete/chown)
(fmakunbound 'pcomplete/cvs)
(fmakunbound 'pcomplete/eshell-mode/alias)
(fmakunbound 'pcomplete/eshell-mode/eshell-debug)
(fmakunbound 'pcomplete/eshell-mode/export)
(fmakunbound 'pcomplete/eshell-mode/setq)
(fmakunbound 'pcomplete/eshell-mode/unset)
(fmakunbound 'pcomplete/find)
(fmakunbound 'pcomplete/ftp)
(fmakunbound 'pcomplete/gdb)
(fmakunbound 'pcomplete/gzip)
(fmakunbound 'pcomplete/kill)
(fmakunbound 'pcomplete/make)
(fmakunbound 'pcomplete/mount)
(fmakunbound 'pcomplete/ncftp)
(fmakunbound 'pcomplete/ping)
(fmakunbound 'pcomplete/pushd)
(fmakunbound 'pcomplete/rlogin)
(fmakunbound 'pcomplete/rm)
(fmakunbound 'pcomplete/rmdir)
(fmakunbound 'pcomplete/rpm)
(fmakunbound 'pcomplete/rsh)
(fmakunbound 'pcomplete/scp)
(fmakunbound 'pcomplete/ssh)
(fmakunbound 'pcomplete/sudo)
(fmakunbound 'pcomplete/tar)
(fmakunbound 'pcomplete/telnet)
(fmakunbound 'pcomplete/time)
(fmakunbound 'pcomplete/tlmgr)
(fmakunbound 'pcomplete/umount)
(fmakunbound 'pcomplete/which)
(fmakunbound 'pcomplete/xargs)
#+end_src

`C-h f pcomplete/<no match>` now shows up in my `emacs -Q` instance and I 
assumed this means pcomplete has no way to complete.

However I still get the directory completions... and I'm not quite sure how to 
proceed or what information I'm missing to solve my current problem.

Can anyone help?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]