Questions tagged [system-environment]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
8
votes
1answer
571 views

Can Emacs detect the path of its executable?

Suppose that I have two identical emacs (of the same version) on my system. One is placed at C:\Program Files\Gnu Emacs and the other one at different place, say C:\Program Files\New Gnu Emacs. Can a ...
6
votes
2answers
594 views

How do I retrieve the machine's hostname?

I'm currently hacking on an elisp IRC bot and have a section of code that I want to enable only when it's run on a remote machine with a specific hostname. However, I couldn't find any premade ...
5
votes
4answers
463 views

How can I distinguish between Linux distributions in Emacs?

For example, to distinguish between Linux and Windows, I can use (when (eq system-type 'gnu/linux). Is there a way to distinguish between Linux distributions, such as Ubuntu vs CentOS?
5
votes
2answers
2k views

how to set environment variables={EDITOR, VISUAL} to prefer running emacs?

my usecase I'm currently running GNU Emacs version=24.3.1 graphically (i.e., under GNOME/X though started from a script invoked from a gnome-terminal running bash) on a Debian Linux. Just now I was ...
5
votes
2answers
581 views

How to make emacs running in daemon mode read my bashrc before start?

I run Emacs in the daemon mode as a user's systemd unit. However it won't read my environment variables. How to make it import my .bashrc first? I have multiple paths added in there and want to be ...
4
votes
2answers
264 views

Is there a way Emacs can infer is running on WSL (Windows Subsystem for Linux)?

I would like to identify when Emacs is running on WSL (Windows Subsystem for Linux). Normally I use system-type variable to check if Emacs is on Linux, Windows or MacOS X. Though in this case it ...
3
votes
2answers
2k views

How to detect Windows XP vs Windows 7 in startup file?

Presently, I'm testing for windows like this in my startup for Emacs v23.1.1: (if (eq system-type 'windows-nt) (load-library "visual-basic-mode")) However, this is true for both Windows 7 and ...
2
votes
1answer
603 views

Accessing Windows environment variables in elisp

I am looking for a way to access the value of %HOMEPATH% under Windows (or more generally, any environment variable of the form %name%). The use case is to have a consistent init.el across multiple ...
1
vote
0answers
12 views

Accessing login-shell variables (from counsel-find-file)

With #'counsel-find-file, I can type $ to access environment variables, but it appears these belong to a special emacs environment and are not login-shell-wide. Can I access the latter kind of ...
1
vote
0answers
89 views

Running emacs server via systemd prevents inverse search and nice view

Background: I am using systemd to run my emacs server and my usual workflow always involves invoking emacsclient. Both server and client are on the same computer running Debian Jessie. The method is ...
0
votes
2answers
72 views

Size of default face from environment variable

I'd like the size of the default face be read in an environment variable. Currently my .emacs reads the frame size from the EMACS_HEIGHT var thanks to the following code in the (custom-set-variables ....
0
votes
1answer
57 views

How to get proper hostname instead of NETBIOS name

I'm using emacs 25.2.1 on Windows with spacemacs (0.200.9). I also start emacs as a service using emacsclientw.exe --daemon. I'm attempting to get the current host name using (system-name) as follows: ...
0
votes
0answers
75 views

use-package - load package depending on the OS username

I am not a Java guy at all, but I mess with it quite often for university reasons. I have used this awesome post by peter goldsborough to set up eclim. Which is nice! But this also requires a lot of ...