* eshell TAB completion for executable files ?
@ 2019-06-20 14:08 jonetsu
2019-06-20 15:04 ` Óscar Fuentes
0 siblings, 1 reply; 4+ messages in thread
From: jonetsu @ 2019-06-20 14:08 UTC (permalink / raw)
To: help-gnu-emacs
Hello,
eshell (emacs 26.1) will not propose an executable file as part of its
TAB completion. Is there a way to obtain the same behaviour regarding
this as a Linux console ?
Cheers.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: eshell TAB completion for executable files ?
2019-06-20 14:08 eshell TAB completion for executable files ? jonetsu
@ 2019-06-20 15:04 ` Óscar Fuentes
2019-06-20 18:07 ` jonetsu
0 siblings, 1 reply; 4+ messages in thread
From: Óscar Fuentes @ 2019-06-20 15:04 UTC (permalink / raw)
To: help-gnu-emacs
jonetsu <jonetsu@teksavvy.com> writes:
> eshell (emacs 26.1) will not propose an executable file as part of its
> TAB completion. Is there a way to obtain the same behaviour regarding
> this as a Linux console ?
It should. Please describe how to reproduce the problem starting with
emacs -Q
Which OS are you using?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: eshell TAB completion for executable files ?
2019-06-20 15:04 ` Óscar Fuentes
@ 2019-06-20 18:07 ` jonetsu
2019-06-20 18:54 ` Óscar Fuentes
0 siblings, 1 reply; 4+ messages in thread
From: jonetsu @ 2019-06-20 18:07 UTC (permalink / raw)
To: help-gnu-emacs
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:
(defmacro with-face (str &rest properties)
`(propertize ,str 'face (list ,@properties)))
(defun shk-eshell-prompt ()
(let ((header-bg ""))
(concat
(with-face (concat (eshell/pwd) " ") :background header-bg)
;; (with-face (format-time-string "(%Y-%m-%d %H:%M)
" (current-time)) :background header-bg :foreground "#888")
(with-face
(or (ignore-errors (format "(%s)" (vc-responsible-backend
default-directory))) "")
:background header-bg)
(with-face "\n" :background header-bg)
;; (with-face user-login-name :foreground "white")
;; "@"
;; (with-face "localhost" :foreground "green")
(if (= (user-uid) 0)
(with-face " #" :foreground "red")
"%")
" ")))
(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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: eshell TAB completion for executable files ?
2019-06-20 18:07 ` jonetsu
@ 2019-06-20 18:54 ` Óscar Fuentes
0 siblings, 0 replies; 4+ messages in thread
From: Óscar Fuentes @ 2019-06-20 18:54 UTC (permalink / raw)
To: help-gnu-emacs
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-20 18:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-20 14:08 eshell TAB completion for executable files ? jonetsu
2019-06-20 15:04 ` Óscar Fuentes
2019-06-20 18:07 ` jonetsu
2019-06-20 18:54 ` Óscar Fuentes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).