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: jonetsu
Subject: Re: eshell TAB completion for executable files ?
Date: Thu, 20 Jun 2019 14:07:51 -0400

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.









reply via email to

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