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

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

Re: eshell TAB completion for executable files ?


From: Óscar Fuentes
Subject: Re: eshell TAB completion for executable files ?
Date: Thu, 20 Jun 2019 20:54:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

jonetsu <jonetsu@teksavvy.com> writes:

> On Thu, 20 Jun 2019 17:04:40 +0200
> Óscar Fuentes <ofv@wanadoo.es> wrote:
>
>> It should. Please describe how to reproduce the problem starting with
>> 
>> emacs -Q
>> 
>> Which OS are you using?
>
> Linux.  Although with 'emacs -Q' it works fine.  So there must be
> something somewhere in the .emacs file that's altering this behaviour.
>
> I've added yesterday a snippet in order to have a better prompt in
> eshell.  By better I mean that when it's located in a folder whose
> path is quite long, I'd like to have the cursor right at the first
> column and not way down to the right, sometimes unseen.
>
> So took the following from the emacs wiki:
>

[...]

> (setq eshell-prompt-function 'shk-eshell-prompt)
> (setq eshell-highlight-prompt nil)
>
>
> Of which I commented out some things I did not want and also redefined
> header-bg from a white colour to nothing.
>
> Commenting out that snippet and retesting, the behaviour becomes as
> expected.  So there's something in that snippet that "kills" the
> completion feature regarding executable files.  It will complete with C
> source file of the same name, but not with the executable.  I'm
> certainly no expert, far from it, in lisp and emacs so I can't see what
> that could be.

You are changing eshell-prompt-function, which documentation reads:

  A function that returns the Eshell prompt string.
  Make sure to update ‘eshell-prompt-regexp’ so that it will match your
  prompt.

And eshell-prompt-regexp:

    A regexp which fully matches your eshell prompt.
    This setting is important, since it affects how eshell will interpret
    the lines that are passed to it.
    If this variable is changed, all Eshell buffers must be exited and
    re-entered for it to take effect.

So TAB completion for executables is failing because eshell no longer
can distinguish the prompt from the rest of the text. It acts as if you
already introduced the executable, so it only accepts completion for
commandline parameters suchs as filenames.




reply via email to

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