Questions tagged [environment]

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

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

Disable environment variable substitution with $ in find-file

When using find-file, list-directory and other commands, if one types a $ a minibuffer completion appears with a list of currently set environment variables. I have no idea where this is coded, the ...
3 votes
2 answers
99 views

Python on Emacs taking space on disk

I'm kind of a newbie and want to use Python on Emacs. I noticed that there is a folder rpc-venv here: /Users/user/.emacs/elpy/rpc-venv/lib/python3.7/site-packages Where all python packages are ...
  • 123
0 votes
1 answer
42 views

How to make inferior shell inherit environment variable?

I would like to set the environment variables defined within Emacs available to inferior shells launched afterwards. My use-case is to be able to switch Python (conda) environment within Emacs. If I ...
  • 91
1 vote
1 answer
296 views

How to run yarn in a bash script from emacs?

I have a bash script like this: #!/bin/bash cd ~/src/program && rm -rf node_modules && yarn When I invoke this script by executing (shell-command "bash ~/src/helper/script.sh&...
0 votes
0 answers
24 views

How to prevent the "Emacs (Client)" launcher from creating a new "Emacs" instance on the dock?

When I click on the "Emacs (Client)" icon it creates a new client window under the "Emacs" label. This creates two different icons on the dock. How can I merge them together? I ...
  • 26
2 votes
1 answer
131 views

How to give Emacs-started-by-icon-click the same environment as Emacs-started-from-Unix-shell?

On my Mac laptop, I can start Emacs in several ways, including (1) clicking on an icon on the dock, or (2) running % emacs from the Terminal app. These two ways of launching Emacs produce instances ...
  • 3,063
1 vote
0 answers
31 views

.bashrc environment variables not picked up by Spacemacs?

I've added a few environment variables to my .bashrc file, some of these are paths to customized bin/programs, such as: export MY_ENV_PATH_VAR=/home/user/path/to/bin I've refreshed spacemacs' ....
  • 113
1 vote
1 answer
58 views

How can I make emacs load `environment modules`?

I keep packages organized on my laptop using environment modules (http://modules.sourceforge.net/). Hence if I need a particular version of python, I can do module load python39 etc. Now if I first ...
  • 113
1 vote
1 answer
94 views

How to let AUCTeX automatically detect tcolorbox-environments

When I create a new environment via the \newenvironment-Command, AUCTeX automatically detects it and when I type C-c C-e the new environment is suggested and when I chose it, it asks for the right ...
0 votes
1 answer
312 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
0 votes
1 answer
112 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 ...
1 vote
1 answer
108 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 ...
  • 207
0 votes
0 answers
41 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 ...
  • 5
0 votes
0 answers
95 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 ...
0 votes
1 answer
493 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 ...
  • 223
6 votes
1 answer
2k 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, (...
  • 1,424
1 vote
1 answer
300 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?
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 ...
2 votes
1 answer
344 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 ...
  • 23
0 votes
0 answers
301 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 ...
1 vote
0 answers
96 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 <...
  • 11
0 votes
1 answer
330 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 ...
2 votes
1 answer
318 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 ...
  • 220
1 vote
2 answers
752 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/...
0 votes
2 answers
182 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 ...
  • 288
1 vote
0 answers
114 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 ...
1 vote
1 answer
182 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 &...
1 vote
2 answers
203 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 ...
  • 225
1 vote
1 answer
86 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,805
1 vote
1 answer
161 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 ...
1 vote
0 answers
167 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 ...
  • 729
2 votes
1 answer
215 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
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 ...
  • 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 ...
  • 523
0 votes
1 answer
246 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: ...
  • 567
1 vote
1 answer
320 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 ...
  • 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 ...
  • 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;/...
  • 523
8 votes
2 answers
1k 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,710
1 vote
0 answers
78 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";; # ...
  • 728
0 votes
1 answer
804 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 ...
  • 11
5 votes
1 answer
947 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
0 answers
166 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 ...
  • 131
4 votes
1 answer
586 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'" ...
1 vote
1 answer
481 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-...
  • 1,659
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 ...
  • 471
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 ...
  • 1,255
6 votes
1 answer
5k views

Emacs can't find Node when Node was installed using NVM

I've got Node installed using NVM, and Emacs (v25.2.1) isn't able to find Node. When I run M-: (executable-find "node") I get back nil. However, when I run M-: (executable-find "cat") I get "/bin/cat"...
5 votes
2 answers
888 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 ...
  • 1,255
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?