2
uname -a Linux antixbox 4.9.235-antix.1-amd64-smp #1 SMP PREEMPT Mon
Sep 14 19:26:52 EEST 2020 x86_64 GNU/Linux
 
emacs --version GNU Emacs 27.1

echo $SHELL /usr/bin/zsh

I'm trying to get the following to work:

em() {   emacs $1 -geometry "56x23" }

I want to use it as follows e.g. with an existing file:

em testfile.txt

Emacs does launch, but no file buffer.

If I edit the function and replace nano for emacs (and get rid of the geometry stuff), the function works perfectly.

Drew
  • 75,699
  • 9
  • 109
  • 225
duke
  • 21
  • 1
  • I have NO idea why the last sentences of my post are in bold!! – duke Apr 06 '21 at 15:00
  • Does it work without a function? i.e., just typing `emacs filename -geometry "56x23"`? – Tyler Apr 06 '21 at 15:27
  • @Tyler Nope! JUST discovered that! I can't finger it out. emacs does launch, but no file shows up. – duke Apr 06 '21 at 15:46
  • Do you use the `dashboard` package? That causes this problem for me. Otherwise, you'll need to investigate your own configuration files to find the culprit. – Tyler Apr 06 '21 at 19:25
  • https://emacs.stackexchange.com/questions/28429/how-do-i-troubleshoot-emacs-problems – Tyler Apr 06 '21 at 19:25
  • @Tyler Thanks for the `dashboard` headsup! I'll have to check in the antiX forum to see if it does get used. Thx for the URL! – duke Apr 07 '21 at 00:16
  • 1
    Problem solved! Nuked emacs-27.1. Re-installed 26.1 All's well! Thx – duke Apr 07 '21 at 14:27
  • In any such function you would definitely want to replace `$1` with `"$@"` – phils May 08 '21 at 01:26

1 Answers1

1

Maybe run Emacs as a server and then edit files with emacsclient?

I have an alias

e='emacsclient -nw'

And is using it like

$ e foobar.txt