dash-docs-el / helm-dash

Browse Dash docsets inside emacs
511 stars 59 forks source link

sqlite3 not found under Windows when using setenv #150

Closed timmli closed 7 years ago

timmli commented 7 years ago

Under Windows, I would like to use setenv to locally set the PATH variable from within Emacs:

 (setenv "PATH" "/path/to/sqlite3" ";" (getenv "PATH"))

This makes sqlite3 available to the shells, but strangely not to helm-dash. It will complain that it cannot find sqlite3:

helm-dash-sql: Searching for program: No such file or directory, sqlite3

Is there a way to avoid the global modification of the (user) PATH variable?

kidd commented 7 years ago

Hi timmli,

We are using call-process, which doesn't start a shell. I'm not sure if (setenv "PATH" ..) should make it available to child processes....

Can you try to modify the "sqlite3" string to match the full path of your sqlite3 binary? If it works, we can make this a defparameter/defvar, and we can all be happy :).

Thanks for the report

timmli commented 7 years ago

@kidd Thanks for your reply. Sadly, it doesn't work either when specifying the full path to sqlite3. I'm really puzzled, because call-process should take exec-path (where sqlite is meantioned) into account, following the Emacs docs:

The value of exec-path is used by call-process and start-process when the program argument is not an absolute file name.

Generally, you should not modify exec-path directly. Instead, ensure that your PATH environment variable is set appropriately before starting Emacs. Trying to modify exec-path independently of PATH can lead to confusing results.

Confusing it is indeed. I will investigate further.

kidd commented 7 years ago

doh... strange indeed ... :(

timmli commented 7 years ago

OK, found a solution: The problem was that the path to the sqlite binaries was not really propagated to exec-path. This is what was missing from my init.el:

(setq exec-path (append (split-string (expand-file-name (getenv "MYPATH")) ";") exec-path))

Assuming that you only want to add the path to sqlite, it would look like this:

 (setq exec-path (append '("/path/to/sqlite") exec-path))

I think the issue can be closed. Thanks for your help!

kidd commented 7 years ago

good that you could solve it! Enjoy!