Questions tagged [system-environment]

23 questions
10
votes
2 answers

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 able to use them in Emacs (but I don't want to…
catemperor
  • 233
  • 2
  • 10
9
votes
1 answer

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 running Emacs detect which one is? For example,…
Name
  • 7,689
  • 4
  • 38
  • 84
9
votes
2 answers

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 function to retrieve the machine's hostname. …
wasamasa
  • 21,803
  • 1
  • 65
  • 97
7
votes
4 answers

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?
yuxuan
  • 781
  • 4
  • 15
6
votes
2 answers

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 using commandline abcde to rip audio CDs when its…
TomRoche
  • 592
  • 3
  • 20
4
votes
3 answers

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 returns gnu/linux: system-type is a variable defined…
nephewtom
  • 2,219
  • 17
  • 29
3
votes
1 answer

Detect the operating system

What is the most Emacs-y way to detect the operating system Emacs is running in? My intention is to conditionally set up package repositories depending on whether they are needed. (If the operating system is one that I know has Emacs packages…
bignose
  • 627
  • 3
  • 15
3
votes
2 answers

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 Windows XP and I do not have visual-basic-mode on my…
WilliamKF
  • 363
  • 5
  • 15
2
votes
2 answers

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 of Emacs that run differently, because they have…
kjo
  • 3,145
  • 14
  • 42
2
votes
1 answer

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 operating systems. In Linux and OS X,…
Kevin
  • 534
  • 1
  • 5
  • 15
1
vote
1 answer

How can I add configuration based on unix or macos machine?

I am using my emacs configuration in macOS and linux. Exact configuration,always crash on macos but does not in linux. Hence I want to add following line only for macOS but not linux: (setq debug-on-error t) Can we apply an if condition like in…
alper
  • 1,238
  • 11
  • 30
1
vote
0 answers

Configure Emacs to Respect Windows File Attributes?

Is it possible to configure Emacs under Windows to respect the 'hidden' and 'system' NTFS file attributes for example by filtering out these files during selection of filename completion candidates in the minibuffer in order to unclutter the…
1
vote
1 answer

What is the system-wide location for init.el?

Is there a way to have a common init.el for several system users? /etc/emacs.d/init.el for example?
andreoss
  • 149
  • 4
1
vote
0 answers

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 variable as well?
Toothrot
  • 3,204
  • 1
  • 12
  • 30
1
vote
0 answers

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 explained in the following…
1
2