Coder Social home page Coder Social logo

Comments (16)

redguardtoo avatar redguardtoo commented on June 12, 2024

69e31f7 detect cli program on window (Chen Bin)

from counsel-etags.

whatacold avatar whatacold commented on June 12, 2024

Thanks for your quick response, as always:)

But why not use executable-find to detect it directly? does it has any side effects?

from counsel-etags.

redguardtoo avatar redguardtoo commented on June 12, 2024

There is already one built in find.exe on Windows.

from counsel-etags.

whatacold avatar whatacold commented on June 12, 2024

ok, thanks.

from counsel-etags.

whatacold avatar whatacold commented on June 12, 2024

After updating, it still complain the below error when M-x counsel-etags-grep

/usr/bin/bash: f:\\cygwin64\\bin\\grep.exe: command not found

It works fine after I changing the path style to:

((file-executable-p (setq rlt (concat "f:/cygwin64/bin/" name ".exe"))))

My emacs version is 25.3.1 on Windows 7.

from counsel-etags.

redguardtoo avatar redguardtoo commented on June 12, 2024

Can you test YOUR solution on Emacs 24.4?

from counsel-etags.

redguardtoo avatar redguardtoo commented on June 12, 2024

Native windows Emacs will start a DOS shell which only recognize the path like "f:\cygwin64\bin\grep.exe".

Cygwin Emacs run the commands in BASH shell which only recognized path like "/user/bin/grep".

Why your windows native Emacs start a bash shell?

I tested on Window, counsel-etags works out of the box.

from counsel-etags.

whatacold avatar whatacold commented on June 12, 2024

According to simple.el of emacs, the shell-file-name is the shell to run, and unfortunately it's bash within my emacs, and there is no such setting in my .emacs.d, still don't know where it's set.

And if I run plain emacs with runemacs -Q, it's a path to cmdproxy.exe , which i think is the expected behavior.

UPDATE:
There are some packages in .emacs.d do touch shell-file-name actually, I will try to spot the culprit if I have more time.

from counsel-etags.

whatacold avatar whatacold commented on June 12, 2024

Just find a workaround, SHELL env is set by emacs I believe:

(when (eq system-type 'windows-nt)
  (setq shell-file-name (getenv "SHELL")))

from counsel-etags.

redguardtoo avatar redguardtoo commented on June 12, 2024

Output of M-x emacs-version? and what's (getenv "SHELL")?

from counsel-etags.

whatacold avatar whatacold commented on June 12, 2024

version: GNU Emacs 25.3.1 (x86_64-w64-mingw32) of 2017-09-27

env: "D:/tools/emacs-25.3_1-x86_64/libexec/emacs/25.3/x86_64-w64-mingw32/cmdproxy.exe", and runemacs.exe is located at D:\tools\emacs-25.3_1-x86_64\bin\runemacs.exe.

There is no SHELL in Windows' environment variables.

from counsel-etags.

whatacold avatar whatacold commented on June 12, 2024

Oh, just found I've set it up within my .custom.el:

(setq shell-file-name "bash")
(setq explicit-shell-file-name shell-file-name)

sorry about that.

from counsel-etags.

redguardtoo avatar redguardtoo commented on June 12, 2024

I don't suggest changing Emacs's default shell. Use variable default-diretory and feed the cli program the relative path instead:

(let* ((default-directory "C:\\\\What-ever-directory\\\\proj1"))
  (shell-command "ls -l .")

Then add ivy, see abo-abo/swiper#591 , it's extremly powerful technique.

from counsel-etags.

whatacold avatar whatacold commented on June 12, 2024

I copied these from somewhere regarding Windows settings, and I've forgot it:(

Thanks for your help and the tip.

from counsel-etags.

redguardtoo avatar redguardtoo commented on June 12, 2024

No worries. To be honest, I have read most Windows settings articles. Most of them are no better than my setup.

from counsel-etags.

whatacold avatar whatacold commented on June 12, 2024

I copied these from 10 Tips for Powerful Emacs on Windows – Gregory Grubbs - gregorygrubbs.com a few months ago, but I only managed to use native Windows emacs recently:( so I forgot about it totally.

Thank you for your emacs.d, it helped me get started with emacs and I learned a lot from it.

from counsel-etags.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.