Questions tagged [environment]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

"zsh:1: command not found: git" Emacs App on MacOS

My Emacs App used to work fine until today, it starts to complain that zsh:1: command not found: git git is installed on my computer at /usr/bin/git Other info: MacOS: Monterey Emacs: 27.2
user avatar
0 votes
1 answer
41 views

"latexmk" command not found in emacs

I updated my texlive to 2022 recently and found that the auto-compilation command in tex-mode running latexmk -pdf -pdflatex=xelatex --synctex=1 -interaction=nonstopmode -file-line-error file.tex ...
user avatar
1 vote
1 answer
94 views

Running a program from elisp that runs `emacsclient` set on `$EDITOR`

I'm automating some work tasks, and many of them consist of calling kubectl edit on different objects. kubectl edit basically opens your $EDITOR which I have configured to be emacsclient. My question ...
user avatar
  • 207
0 votes
0 answers
34 views

Using a single Emacs daemon with sudo privileges

I am trying to use virsh with emacsclient which uses the EDITOR variable. I have EDITOR=emacsclient in pam_environment with defaults env_keep += "EDITOR" in my sudoers file. The problem is ...
user avatar
  • 5
0 votes
0 answers
40 views

open file specified via environment variable

Environment variables that points to specific location are of common occurrence. $HOME, $XDG_CACHE_HOME, %LOCALAPPDATA% and many more. It is pretty convenient to open files (and directories) just by ...
user avatar
0 votes
1 answer
270 views

How to read the shell environment variables?

I have the following command in my .emacs (setq org-roam-directory (concat (getenv "BASEDIR") "/data/org-roam/")) The purpose is to the set the directory for org-roam (but ...
user avatar
  • 223
6 votes
1 answer
1k views

How to get the PATH from the SHELL

When launched at system start-up, the Emacs daemon doesn't pick up modifications to the PATH introduced by shell initialization scripts. Emacswiki suggests to use this function to update Emacs' PATH, (...
user avatar
  • 1,414
1 vote
1 answer
191 views

How to make emacs shell the same as system terminal experience?

On macOS, using iTerm2. It looks like In Emacs For Mac OS X, it looks like I copied system's ~/.zshrc file to ~/.profile and ~/.bash_profile, but doesn't they read configrations when start emacs?
user avatar
1 vote
2 answers
2k views

How to use doom emacs as a golang ide quickly?

I installed the newest doom emacs on macOS. Also configed language packages as $ emacs ~/.doom.d/init.el :lang (go +lsp) :tools lsp $ ~/.emacs.d/bin/doom sync When I open a .go file, the code became ...
user avatar
1 vote
1 answer
244 views

How to set env values for eshell in emacs on macOS?

If use iTerm on macOS, we can set env values in its terminal. It also set path such as /usr/local/bin/ in ~/.bashrc. But in emacs' terminal as eshell, run kubectl shown kubectl: No such file or ...
user avatar
  • 13
0 votes
0 answers
216 views

How to set English as the default input method?

For some reason I cannot set english, only british as the input method. I am writing a function to switch language from spanish-postfix to english, but english is not working, only british. I have ...
user avatar
1 vote
0 answers
88 views

Use conda environment in ansi-term

I would like to be able to use conda activate to switch between environments in ansi-term. I am running bash in ansi-term from Emacs 27.1 on MacOS Catalina. Currently, executing conda activate <...
user avatar
  • 11
0 votes
1 answer
284 views

macos environment variables?

I'd like to set things up so that I can use emacs on multiple computers, with the .emacs.d directory shared amongst them (via DropBox). My solution so far has been to use environment variables which ...
user avatar
2 votes
1 answer
263 views

Bash Environmental Variable Not Recognized

I use Bash for my terminal on Debian. In my .bashrc, I've defined an environmental variable like so: SSH_VAULT_VM="ssh-vault" if [ "$SSH_VAULT_VM" != "" ]; then ...
user avatar
  • 160
0 votes
2 answers
455 views

Change $PATH once emacs is running

In my shell (Bash), I can switch among several LaTeX distros setting the $PATH variable. E.g.: export PATH=/usr/local/texlive/2016/bin/x86_64-linux:$PATH or export PATH=/usr/local/texlive/2018/bin/...
user avatar
0 votes
2 answers
123 views

Unable to find files with ssh and environment variables

I have installed exec-path-from-shell as well as included the following in my init.el (when (memq window-system '(mac ns x)) (exec-path-from-shell-initialize)) within my ~/.bash_profile I have ...
user avatar
  • 288
1 vote
0 answers
96 views

How to not display environment variable in org-babel src block?

I want the effect of this: #+BEGIN_SRC shell :dir src CC=gcc-9 make #+END_SRC But I don't want CC=gcc-9 to show up in the output. Is there a way to somehow include the environment variable in the ...
user avatar
1 vote
1 answer
149 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 &...
user avatar
0 votes
2 answers
129 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 ...
user avatar
  • 205
1 vote
1 answer
72 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 ...
user avatar
  • 1,775
1 vote
1 answer
151 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 ...
user avatar
1 vote
0 answers
144 views

problems with rbenv integration

I recently changed from rvm to rbenv to manage my ruby environments and gems with bundle instead of rvm gemsets. It worked well and I'm quite happy with the change. The only big problem is to manage ...
user avatar
  • 697
2 votes
1 answer
185 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 ...
user avatar
0 votes
0 answers
427 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 ...
user avatar
  • 121
1 vote
0 answers
42 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 ...
user avatar
  • 483
0 votes
1 answer
217 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: ...
user avatar
  • 485
1 vote
1 answer
276 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 ...
user avatar
  • 159
4 votes
1 answer
1k 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 ...
user avatar
  • 425
3 votes
1 answer
1k 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;/...
user avatar
  • 483
8 votes
2 answers
954 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 ...
user avatar
  • 1,618
1 vote
0 answers
72 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";; # ...
user avatar
  • 620
0 votes
1 answer
759 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 ...
user avatar
  • 11
5 votes
1 answer
867 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?
user avatar
2 votes
0 answers
159 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 ...
user avatar
  • 121
4 votes
1 answer
487 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'" ...
user avatar
1 vote
1 answer
453 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-...
user avatar
  • 1,639
6 votes
1 answer
1k 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 ...
user avatar
  • 461
4 votes
2 answers
2k 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 ...
user avatar
  • 1,157
5 votes
2 answers
846 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 ...
user avatar
  • 1,157
5 votes
2 answers
1k 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?
user avatar
0 votes
1 answer
182 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 ...
user avatar
  • 115
3 votes
1 answer
3k 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. ...
user avatar
  • 131
1 vote
0 answers
497 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 ...
user avatar
  • 111
3 votes
3 answers
1k 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 ...
user avatar
  • 2,909
1 vote
1 answer
1k 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 ...
user avatar
  • 290
4 votes
1 answer
365 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 ...
user avatar
1 vote
1 answer
127 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 ...
user avatar
  • 113
26 votes
2 answers
14k 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 ...
user avatar
0 votes
1 answer
45 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/...
user avatar
  • 511
1 vote
1 answer
2k 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 ...
user avatar
  • 4,535