Score:1

Emacs from activities overview behaving differently than emacs from terminal - how to find our what command is run

it flag
jpb

DISCLAIMER: With "activities overview" I mean whatever is invoked when pressing the Super key / Windows key.

I'm using Ubuntu 22.04.1 and depending how I start emacs (v27.1, installed using apt), julia-repl either works or does not:

julia-repl works when I start emacs as follows:

  • typing emacs or /usr/bin/emacs or gtk-launch emacs in the terminal (starts emacs in a GUI)
  • typing emacs -nw or /usr/bin/emacs -nw or gtk-launch emacs-term in the terminal (starts emacs inside the terminal)

julia-repl fails when I start emacs as follows:

  • clicking the Emacs (GUI) icon in the activities overview (starts emacs in a GUI)
  • clicking the Emacs (Terminal) icon in the activities overview (starts emacs in a terminal)

Does anybody know what can cause the divergence in behaviour? Here's the content of my /usr/share/applications/emacs.desktop:

[Desktop Entry]
Version=1.0
Name=Emacs (GUI)
GenericName=Text Editor
Comment=GNU Emacs is an extensible, customizable text editor - and more
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
TryExec=/usr/bin/emacs
Exec=/usr/bin/emacs %F
Icon=emacs
Type=Application
Terminal=false
Categories=Utility;Development;TextEditor;
StartupWMClass=Emacs
Keywords=Text;Editor;

And here's a minimal init.el for which the error occurs:

require 'package)
(setq package-archives '(("elpa" . "https://elpa.gnu.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")
                         ("org" . "https://orgmode.org/elpa/")))
(package-initialize)
(unless package-archive-contents (package-refresh-contents))
(require 'use-package)
(setq use-package-always-ensure t)

(require 'julia-mode)

(add-to-list 'load-path "path-of-julia-binary")
(require 'julia-repl)
(add-hook 'julia-mode-hook 'julia-repl-mode) ;; always use minor mode
vanadium avatar
cn flag
Strange. `gtk-launch emacs`, which works well for you, is equivalent to clicking the launcher in the overview, which does not work for you. That command launches `emacs.desktop`. Are there different versions of `emacs.desktop` in different places on your system?
it flag
jpb
No, the only `emacs.desktop` file on my system is `/usr/share/applications/emacs.desktop`. Is there a way to get more detailed debug information on what goes wrong when I try to start `julia-repl`? What is written in the messages and warnings buffer is pretty generic and nondescript.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.