Subj : Re: First World Problems.
To : Digital Man
From : Accession
Date : Sun Mar 06 2016 06:10 am
Hello Digital Man,
Ac>> Not sure I understand what you mean here. By "run it from JS" you mean
Ac>> nano?
DM> The editor. The console.editfile() method uses whatever editor the user
DM> has selected as their preferred editor to edit the filename passed.
Even when nano itself is not configured in External Editors? I don't see how the JS could know that the user is actually selecting nano as their editor. See below..
Ac>> I suppose I should explain what is going on. I asked Nightfox if he
Ac>> could rip out the function in SlyEdit that reformats MSGTMP with
Ac>> quoted initials, so I could offer up nano as a message editor as well
Ac>> (and possibly even vim in the future), since they can be used in
Ac>> "restricted" mode where nothing on the disk can be altered except the
Ac>> file loaded, ie: MSGTMP.
Ac>> So after all of that is done, and a new formatted MSGTMP is created,
Ac>> the JS runs nano, where you can edit and save, and then the JS posts
Ac>> the message and exits back to the BBS.
Ac>> So if there's a better way than the first option above you gave, by
Ac>> all means explain it to me in laman's terms and I'll give that a shot
Ac>> as well.
DM> It sounds like you want to use SlyEdit as a quoter, but not an editor?
Something like that. Basically only the function of SlyEdit that retreives the name in the TO field for initials, and quote/reformat/rewrap function of SlyEdit is being used here, so "SlyEdit" as a whole is not being used, correct.
DM> There's really no built-in method in Synchronet to do that (support
DM> external "quoters"). If you just want to use nano as an editor and don't
DM> need anything from SlyEdit, the proper way would be to configure nano in
DM> SCFG->External Programs->External Editors.
Understood. What we've done here is basically strip those mentioned functions out of SlyEdit, and along with some added error checking as well as checking to make sure QUOTES.TXT is present (if not, edit the message as "new"), and check for modifications to MSGTMP (if not, abort the message), and then nano is ran from the script using bbs.exec().
So basically I think we've gotten it to the point where you can run ?msgQuoteWrap.js "/usr/bin/nano [-opts]" %f from the command line in External Editors, the script takes care of the options and editor you choose,aand away you go!
With this being said, vi(m) also seems to work, although it seems some of the backspace/delete stuff may have to be tinkered with on my end, but that's minimal.