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
4 months ago
3 months ago
No labels applied.

~aren 4 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 4 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 4 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 4 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 3 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 3 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)

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