Questions tagged [environment]
A set of dynamic variables that can affect the running processes.
69
questions
0
votes
0
answers
55
views
Execute Code with Env Var Set Temporarily
Here's a piece of C++ code (its content is not important) written in an Org file:
#+BEGIN_SRC C++
#include <omp.h>
#include <iostream>
int main() {
#pragma omp parallel
std::...
1
vote
2
answers
31
views
Closure does not capture variable
I wrote the following code, but it does not work:
(progn
(define-prefix-command 'unicode-shortcut-keymap)
(dolist (mapping '(("- >" . "→")))
(let ((keys (car mapping))
...
0
votes
0
answers
32
views
Shell Environment in emacs sessions
I noticed that terminal-based emacs and GUI emacs seems to work differently in terms of shell environment, even if they are started in the same terminal session.
For example, I'm working with roslisp ...
0
votes
1
answer
480
views
Why is getenv not working to read an environment variable in my macOS machine?
I am using macOS and vanilla Emacs.
In my .zshrc file I have the following:
export OPENAI_API_KEY=my-key
The setting of the environment variable works as expected on the terminal (iTerm2):
➜ echo $...
0
votes
1
answer
47
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
107
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 ...
0
votes
1
answer
163
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 ...
1
vote
1
answer
1k
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&...
2
votes
2
answers
170
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 ...
1
vote
0
answers
94
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' ....
1
vote
1
answer
138
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 ...
1
vote
1
answer
98
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
490
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
274
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
144
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 ...
0
votes
0
answers
191
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 ...
1
vote
1
answer
986
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 ...
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
vote
1
answer
455
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?
2
votes
2
answers
3k
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
456
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 ...
0
votes
0
answers
433
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
116
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 <...
0
votes
1
answer
384
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
408
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
...
2
votes
2
answers
1k
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
237
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 ...
1
vote
0
answers
129
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
209
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
269
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
1
answer
98
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
1
answer
198
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
204
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 ...
2
votes
1
answer
257
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 ...
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 ...
0
votes
1
answer
295
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
1
answer
367
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 ...
5
votes
1
answer
2k
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 ...
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;/...
8
votes
3
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
vote
0
answers
98
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
1
answer
856
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 ...
5
votes
1
answer
1k
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
178
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 ...
4
votes
1
answer
715
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
515
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-...
6
votes
1
answer
2k
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 ...
5
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 ...
7
votes
1
answer
6k
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"...