Questions tagged [environment]

A set of dynamic variables that can affect the running processes.

Filter by
Sorted by
Tagged with
1
vote
1answer
33 views

Function `cd` not working correctly in conjunction with `tramp` and `compile`

For context I am looking at a remote file; for example: /ssh:desktop:/home/user/project/src/file.cpp. I then issue the interactive command compile like so: cd /ssh:desktop:/home/user/project/Release &...
0
votes
2answers
25 views

How does process-environment get initialized and why would it be different from initial-environment?

I'm trying to troubleshoot an issue with my exec-path. It contains a couple of paths prepended to it that I don't want. initial-environment contains the paths that match what I see when I echo $PATH ...
1
vote
1answer
28 views

Emacs on Windows sets DISPLAY to w32

I stumbled upon the fact that Emacs on Windows sets the environment variable DISPLAY to w32 (if the variable is not already set). This causes problems for example with OpenSSH. What is the use case ...
1
vote
1answer
70 views

Run an external program with customized environment/options in current buffer

How can I organize Emacs to run a specific external program with some specific environment/options for the mode or the buffer currently open. My current solution is to use setenv before running the ...
2
votes
1answer
56 views

How do I get ein to find conda packages?

I'm trying to use ein to edit a jupyter notebook. I used conda to install the 'turicreate' package in a virtual environment and activated it. When I run the regular browser based jupyter notebook ...
0
votes
0answers
233 views

Use ssh-agent's SSH_AUTH_SOCK value, not macOS' one [duplicate]

When I run (getenv "SSH_AUTH_SOCK"), I get "/private/tmp/com.apple.launchd.K9OEFgxDgw/Listeners". I want to set it to the value that is returned by echo $SSH_AUTH_SOCK on the command line which is ...
1
vote
0answers
36 views

Storing and Loading Non-Static/Multiple Configs

I'm writing an emacs wrapper to a set of scripts that require a lot of config settings to run. These can be variously environment variables, command line parameters and so forth. They should be user ...
0
votes
1answer
161 views

How can I get files and links to open correctly in emacs?

This used to work, but since a recent update, it hasn't. I'm using spacemacs, with this configuration. Links and files don't open as usual. If I open ansi-term, and type xdg-open test.txt, then I see: ...
1
vote
1answer
157 views

Have shell inherit buffer local process-environment

I have made buffer local changes to `process-environment' using the technique described in How can I get buffer-local environment variables via .dir-locals. I then call shell from that buffer. If I ...
3
votes
1answer
859 views

How to check whether ImageMagick is setup correctly on macOS?

I installed emacs on macOS by brew cask install emacs. But the functionality of resizing images doesn't work as expected. So, how to check whether the emacs distribution is built with imagemagick ...
2
votes
1answer
496 views

emacs daemon and ssh agent forwarding

In order to use ssh agent forwarding with emacs in daemon mode, running on a remote server, I've come-up with the following. I have an alias for the client like so: alias emacsclient="update_agent;/...
5
votes
2answers
532 views

Set environment variables for spawned subprocesses

I would like to set the environment variables for a spawned subprocess only. They are controlled by process-environment. The documentation says: binding that variable with let is also reasonable ...
1
vote
0answers
57 views

Emacs doesn't use macOS's /etc/launchd.conf env variables

Emacs doesn't use macOS's /etc/launchd.conf env variables. I have the following there: function addToPATH { case ":$PATH:" in *":$1:"*) :;; # already there *) PATH="$1:$PATH";; # ...
0
votes
1answer
537 views

How should I solve “no such directory” error at CDPATH with environmental variable on Windows 10 Emacs?

I have installed GNU Emacs on Windows 10. When I open it, I get an error. Warning (initialization): An error occured while loading 'c:/Users/[redacted]/AppData/Roaming/.emacs.d/init.el': error: No ...
1
vote
1answer
553 views

Why does emacs (getenv “TERM”) return incorrect data?

I'm running Emacs 25.2.2 on Ubuntu 17.10. Although my environment has TERM=xterm-256color, (getenv "TERM") returns dumb, which is incorrect. Why does (getenv "TERM") return an incorrect value?
2
votes
0answers
132 views

indent items in auctex

What I would like to achieve is a deeper indentation of lines in items in Auctex. \begin{itemize} \item This is what I would like to achieve. The beginning of the second line aligns with ...
2
votes
1answer
291 views

Interpolate environment variables in string

I am trying to write a function that will interpolate the enviroment variables stored in process-environment in a string. For example, if I have the string "This is $Foo and ${Bar}_none and '$skip'" ...
0
votes
1answer
282 views

ansi colors for bash process

I'm trying to get ansi colors from my bash process, but I can't get this to work. (setq shell-process-name "shell-process-name") (setq shell-process-buffer "*shell-process-buffer*") (defun open-...
5
votes
1answer
775 views

How can I get buffer-local environment variables via .dir-locals?

I'm using emacs for many different projects. For some of them, I need, for example, different entries in $PATH, or different $MAKEFLAGS, whatever, you name it... I thought this would be possible ...
2
votes
2answers
1k views

How can I get some environment variables into init.el to construct file paths?

I want to synchronize my emacs configuration through an identical init.el but needs some settings defined according to the host. For instance although init.el will be the same custom-file will vary ...
4
votes
2answers
583 views

What kind of environment variables does Emacs expect to find in .profile, .bash_profile etc?

When I startup spacemacs I get the following message: You appear to be setting environment variables ("PATH") in your .bashrc or .zshrc: those files are only read by interactive shells, so you ...
5
votes
2answers
768 views

How to determine the initial current directory when emacs is run from command line?

How can I determine (from within Emacs) the current directory as it was when the Shell launched emacs from the command line?
0
votes
1answer
139 views

Garbage prepended to PATH

For some reason, some garbage is prepended to my PATH variable in emacs. Testing from eshell: (M+x eshell): ~/projects/rust/logentries-parser/src $ echo $PATH bash: cannot set terminal process group ...
3
votes
1answer
2k views

Package `exec-path-from-shell` isn't setting PATH variables from `.zshenv` on MacOS

I'm running a GUI Emacs compiled from the master git branch on MacOS El Capitan. I'm using the package exec-path-from-shell to set several environment variables I have configured in my ~/.zshenv file. ...
1
vote
0answers
365 views

load environment variables of virtual environment in emacs

What is the best way to load in emacs the environment variables of a virtualenv? I seem to have got virtualenvwrapper.el working. For example, after using venv-workon my_venv, then M-! printenv ...
2
votes
3answers
862 views

How can Emacs set an environment/shell variable in a subordinate shell?

I often use subordinate shells within Emacs. (I instantiate these shells with M-x shell.) I put all these shells under auto-save-mode (through my shell-mode-hook; see below). Is there some way that ...
1
vote
1answer
650 views

UnicodeEncodeError in inferior python under windows

I have recently started using emacs under Windows as my python IDE. I had some struggle getting python convinced that it was allowed to output UTF-8 to my terminal emulator (mintty does support ...
4
votes
1answer
309 views

How can I use 'emacsclient' as $PAGER in eshell with pipe? or any better PAGER which works well with eshell?

When I typed git diff in eshell, it has weird attribute such like print : in every single line, cannot scroll back, and so on. I think this is because the default eshell env PAGER is set as less, and ...
2
votes
1answer
87 views

Separate Environments for each emacsclient

I have a single emacs server that I use for all of my work. It is located on a machine that I ssh into from every location. My 'browse-url is set to run a bash script that ssh's into the machine I am ...
21
votes
1answer
10k views

Using conda environments in emacs

What is the best way to use conda environmets using emacs as a Python IDE? I have got different conda environments while programming in Python: $ conda info -e # conda environments: # django ...
0
votes
1answer
43 views

Exports in compile command

I'm using the Anaconda distribution for Numpy, Ipython etc. and during the installation the following was added to my .bashrc: # added by Anaconda2 2.4.0 installer export PATH="/home/matthias/...
1
vote
1answer
1k views

Missing modules when debugging Python code in Emacs

For a number of reasons - the main one being that Emacs is amazing! - I am trying to do all my Python development at work in Emacs instead of Pycharm, which I was using previously. The one component ...
2
votes
1answer
3k views

How to activate python virtual environment in init file?

How would I activate a specific virtual environment in my init file? I know how to activate it manually, but I don't like to do it every time I start emacs. To activate it manually I used: pyvenv-...
7
votes
3answers
3k views

How to make terminal/shell spawned inside Emacs running on a Mac inherit the environment variables of the native terminal?

The terminal natively on Mac i.e. spawned through Spotlight or Launchpad, adopts the desired environment variables including the customization in ~/.bash_profile. But when I run Emacs (Emacs.app taken ...
5
votes
1answer
2k views

How do I use a remote virtual environment with emacs?

My particular setup is that my code lives on my machine and is mounted via vagrant onto a linux container upon which the virtual env lives. I'd like to be able to edit all the code, including the ...
6
votes
1answer
1k views

emacs command-line-default-directory variable is not set correctly

I'm using Emacs on Windows. I also have a VirtualBox VM that I connect to using plink. But then, when I use the eshell, and I do cd <some folder> it tells me No such directory found via CDPATH ...
9
votes
1answer
2k views

How do I make tramp+eshell use my environment customized in the remote ~/.bash_profile

I have set up custom $PATH in my ~/.bash_profile on a remote machine (for programs installed user-locally by nix and cabal). I use eshell and tramp to issue commands on the remote machine (cd /...
11
votes
3answers
4k views

Reload environment variables

This question has been asked at superuser is-there-a-way-to-reload-environment-variables-in-emacs, but no good solution was given. I am using EmacsClient with often more than 30 buffers open, if I ...
8
votes
4answers
2k views

How to make shell-command run using shell profile and current directory hooks (ex. direnv)

I am trying to get shell-command and async-shell-command to integrate seamlessly with a couple of programs in my .bashrc file, specifically direnv in this example. I found that if I customized shell-...