Using emacs instead of vis or vim to text

Hello, I am sick today and I am sorry but I have no idea how to submit a patch or anything... I am very new to development and git so please bare with me. I saw on the documentation for SXMO that support for other editors was coming later, and I wanted to contribute what I could.

Anyway, I found that changing line 63 in sxmo_modemtext.sh to emacsclient -c -q -u "$DRAFT" worked out well. But it seems that maybe a check to see if emacsclient is in $EDITOR could allow for this line to work better, as opposed to sxmo_terminal.sh "$EDITOR" "$DRAFT". Calling sxmo_terminal.sh emacsclient -c -q -u "$DRAFT" leaves an empty terminal on the screen while emacsclient is open.

Assigned to
1 year, 10 months ago
1 year, 4 months ago
No labels applied.

~aren 1 year, 10 months ago

This is an interesting challenge, I think having a VISUAL_EDITOR environment variable (rather than using sxmo_terminal.sh $EDITOR) would be the simplest way to support gui editors. It's possible that using xdg-open could also achieve the same thing, I'm not sure which would be better.

~stacyharper 1 year, 10 months ago

I think that using EDITOR="sxmo_terminal.sh vim" and dropping hard coded sxmo_terminal.sh should be enough to allow non terminals to be used as EDITOR. I already patched sxmo to allow multi-word EDITOR so this should be very easy to do.

~stacyharper 1 year, 10 months ago

This patch should cover the need :


You then export EDITOR="emacsclient -c -q -u" from ~/.profile or from ~/.config/sxmo/profile and you should be good !

~noneofyourbusiness 1 year, 10 months ago

Why not just make sxmo_terminal.sh a hook? That way you can customize it as you like. In fact, you could make every script a hook (including the script that calls the hooks) to enhance customizability since you can't know of all possible use cases.

~eloitor 1 year, 9 months ago

Using this patch with vim, will open a new terminal when $EDITOR is called right? I think it is best to keep sxmo_terminal.sh $EDITOR when the script wants to spawn a window. This allows the use $EDITOR in scripts running in a terminal without extra windows opening.

I think using the environment variable VISUAL_EDITOR is a better idea.

~mitch-kyle 1 year, 9 months ago*

Does it make more sense to call sxmo_open.sh on the files and let that decide how to handle text files? (and set the default to sxmo_terminal.sh vim or whatever the current default is)

~kohn 1 year, 4 months ago

Can we make a menu for this (e.g. default programs) and for text we would have several pre-installed (Emacs, Nano, Vim, and a simple GUI)?

Register here or Log in to comment, or comment via email.