0

I'm in a fresh install of Proxmox (the Debian derivative which is a VM hypervisor) and installed the emacs-nox package to use emacs as my default editor. When trying to open a file in emacs from the command line, emacs ignores the argument and opens the scratch buffer.

For example:

root@ibis:~# pwd
/root
root@ibis:~# touch afile.txt
root@ibis:~# emacs afile.txt 

does not open afile.txt, it opens the scratch buffer. There are no errors in the *Messages* buffer. The only thing in *Messages* is:

Loading /etc/emacs/site-start.d/00debian.el (source)...done

Basically I can't figure out how to get emacs to open the file specified in the command line argument.

If I run emacs with no arguments, there is no welcome page, it also goes straight to the scratch buffer.

In Proxmox you work in a root shell somewhat and I have seen other answers suggest not opening emacs as root the first time you use it. So I made a user account, gave it sudo, deleted all ~/emacs.d and /root/emacs.d and tried again, but had the same result.

I have tried apt purge emacs* with no success.

Because there are no errors, I have a suspicion that there's some initialization script which is missing or not run, but I don't understand where to look for that and how to tell. Basically I'm at the edge of my understanding of how emacs actually works under the hood now. Can someone push me in the right direction?

Drew
  • 29,895
  • 7
  • 74
  • 104
Sam Imberman
  • 13
  • 1
  • 4
  • 3
    I'm not familiar with your system, but (a) is there a `afile.txt` buffer, even if it's not getting displayed? (b1) Are you running the emacs executable you think you're running? (b2) Are you inadvertently calling an `emacs` shell alias or function instead of that executable? (c) Is it different if you use `emacs -Q afile.txt` ? – phils Apr 29 '23 at 13:08
  • (a) There is no `afile.txt` buffer at all, just scratch and messages. (b) I think there's only one, but `which emacs` is `/usr/bin/emacs`, and there are no shell aliases defined. (c) `emacs -Q` produces the same result. – Sam Imberman Apr 29 '23 at 20:18
  • It all sounds very strange. Can you visit the file in emacs *after* starting it? – phils Apr 30 '23 at 01:26
  • Yes, no problem visiting the file after I start emacs! I suspect there's some sort of initialization script that isn't being run, for this reason, as well as the fact that I have no welcome buffer if I start emacs with no arguments at all. – Sam Imberman May 01 '23 at 18:13
  • Emacs doesn't need any "initialization script" which isn't part of the standard installation in order to DTRT when you pass it a file argument, so I think the install would need to be badly broken for that to explain things. – phils May 02 '23 at 00:17
  • To rule out a broken adaptation of the client/server system, can you check that `M-x emacs-uptime` gives you the expected (very small) duration if you use that just after starting emacs? – phils May 02 '23 at 00:18
  • Yes, `M-x emacs-uptime` gives a sensible time. – Sam Imberman May 03 '23 at 23:34
  • Can you also report what `C-h v command-line-args` and `C-h v command-line-args-left` contain? *Normally* the latter would be empty, and the former would include the filename(s) you tried to visit. And I would check the `*Messages*` buffer for any messages which might be relevant to the failure to visit the files. – phils May 04 '23 at 00:07
  • As you predict, I have `Its value is ("emacs" "afile.txt")` and `nil` respectively. And `*Messages*` has `Loading /etc/emacs/site-start.d/00debian.el (source)...done` and nothing else. – Sam Imberman May 08 '23 at 20:26
  • I think I'm out of ideas, then. I can't tell what's going on, but I feel like your installation of Emacs is broken in a really weird way, so at this point I would be trying different ways of installing it to see whether I get a different outcome. – phils May 08 '23 at 22:45
  • Ok, thanks for your effort! – Sam Imberman May 09 '23 at 00:30

0 Answers0