reddit / emacs

Emacs won't start

Advanced12 · 2022-08-18 18:37
So I have a fresh install of Manjaro Linux (KDE version), everything went smooth, but the only problem I have is that the text editor won't show up. I click on it, it loads for a second and then nothing. Everything is fine when I type **emacs** in the terminal.
MitchellMarquez42 · 2022-08-18 18:48
When you type `emacs ` in the terminal, does it open inside the terminal (text interface), or open a new GUI window?
Advanced12 · 2022-08-18 19:01
Just the text interface.
MitchellMarquez42 · 2022-08-18 19:25
Check the $DISPLAY environment variable. It should be `:0` or similar. Also install `xwayland`. EDIT: as others have pointed out, Xwayland will not be the answer. Manjaro KDE appears to use xorg by default.
PhantomSeahorse · 2022-08-18 19:53
Why xwayland?
[deleted] · 2022-08-18 20:19
[deleted]
janoc · 2022-08-18 20:23
Check that you have actually the X11 version of Emacs installed. I haven't used Manjaro but it has been derived from Mandriva/Mageia and there Emacs packages are split. There is an X11 version (that has X11 support and works in a terminal too) and also a "-nox" version which is text-only. So you may be trying to start a text version from the menu - and it closes right away because it needs terminal.
MitchellMarquez42 · 2022-08-18 22:09
Sorry, I was troubleshooting on autopilot.
arthurno1 · 2022-08-19 07:26
> I haven't used Manjaro but it has been derived from Mandriva/Mageia and there Emacs packages are split. I understand you wish to help and mean well, but Manjaro is a well-known distro based on Arch Linux. Not that it really matters where it comes from though, it is actually irrelevant, since emacs-nox is a separate executable from Emacs; it is not like vanilla Emacs is split in "terminal" and "not terminal" Emacs. Emacs-nox is compiled explicitly without X11 support, so it is a different program/package that has to be built and installed. > So you may be trying to start a text version from the menu - and it closes right away because it needs terminal. Sure, it is a good advice to check it, but it is probably unlikely someone would put a useless entry in a menu. But to be on the sure side, Op should open the terminal and try to start Emacs. I don't know, I don't use Manjaro either, so maybe it is the case, but sounds a bit improbable for a distro whose explicit goal is to be "user-friendly" version of Arch, to put a menu entry for an app that has to be started from command line. At least they would wrap it in a shell script to open a terminal before opening emacs-nox in that case. I don't know. Just my thought.
[deleted] · 2022-08-19 09:16
[deleted]
thetemp_ · 2022-08-19 22:13
Several possibilities here. And from what I recall about Manjaro, there are several spins of it that come pre-customized to varying degrees, so that might be a factor. Menu entries in most Linux DEs (including KDE) are configured via .desktop files. The desktop file could be calling a different command (or script), or the same command with different arguments. Or it could be calling the terminal Emacs command (with the -nw argument) without also invoking a terminal to run it in. Similarly on the command line, it could be that there's an alias or a bash script somewhere that's calling Emacs with different arguments. With a regular full install of Emacs, when you want to intentionally start Emacs in the terminal in order to run it in the terminal, you enter "emacs -nw". I frequently start Emacs from the terminal using just "emacs", but this results in a new window with Emacs running as a GUI program. If you ran "pacman -S emacs" to install Emacs, it should have included the GUI version. And that should be what you get, regardless of whether you start it from a terminal or the menu. But many distributions ship a separate package of Emacs without the GUI (for use on servers or for people who prefer that for whatever reason). So it could be that some way or another that got installed or was pre-installed on your system. Not to criticize or get into a debate about Linux distros, but EndeavourOS is another Arch-based option that I rather enjoyed using for a while. It is pretty much an Arch installer with reasonable defaults and a couple extra utilities, and any packages you install come straight from the Arch repos. So it's closer to the standard expectation. I'm using Fedora now, which I'd also recommend if you're inclined to try a different distro. Tldr; It sounds like either a non-gui Emacs package, or Emacs somehow being called with the "-nw" argument, or some other weird pre-configuration that shouldn't have happened. You'll have to do some troubleshooting with your shell and desktop to figure it out... or if you don't have too much invested in Manjaro yet, you could try a different distro.
quietandproud · 2022-08-21 08:13
Hey, I've been having this problem for a couple weeks and only now have I found a way to solve it. Uninstall the emacs you have install through the GUI package manager and just ran pacman -S emacs. Boom, done. Apparently the version on the GUI pacman installs is a CLI-only version, for some reason.