nedit-ng icon indicating copy to clipboard operation
nedit-ng copied to clipboard

Replace -import mechanism

Open eteran opened this issue 4 years ago • 6 comments

The original nedit had a concept of overlaying your current config file with another by using -import. This made sense in the past when everything was contained in a single file, but things are more divided up now. So we need a better way of handling this:

@marilmanen, I know you use -import, which I don't think was broken by the YAML changes...yet, but I'd like to come up with a better solution going forward. Any thoughts on a workflow that you think would be good?

eteran avatar Dec 18 '19 15:12 eteran

Current import option has been a bit of a problem for me as I have been trying to maintain common configs for a group of people (like macros and window background menu) with the possibility for any user to change some of the other settings settings (line numbers, tab sorting etc) in his own home directory config.ini file. With the import option this has been working as long as imported file has not included settings that the users have possibility to change and the user has modified directly the config.ini file content. Save defaults writes also the imported settings into the users config.ini file and that has caused confusion. Recognition of imported settings and not saving those with Save preferences would be enough for me.

marilmanen avatar Dec 30 '19 04:12 marilmanen

You are using it for something it wasn't designed for, so, yea, you'll get some quirks with that.

I'll take into consideration the idea of local and global configs... Because that's what you REALLY want, and that's not what import really does.

But I can't make any promises it'll happen soon because it would require a pretty big change to the code to support properly. Thanks for letting me know though.

eteran avatar Dec 30 '19 15:12 eteran

Hi Evan @eteran , just looking back through any comments on the "import" option. I'm trying to use the File -> Load Macro File menu option to import a test macro file, but I can't discover the format that nedit-ng wants. Everything gets me a "Syntax Error" popup. My best guess so far is:

nedit.macroCommands: \
  test2:Ctrl+Y::: {\n\
     insert_string("test2")\n\
  }

I never used Load Macro File or nedit -import file in the old days so don't have any background to draw upon. Could you provide an example importable file ?

I'm on Mac Catalina 10.15.7 using your tarball of about Nov 13.

Cheers.

grege2 avatar Nov 30 '20 17:11 grege2

This imports ok ..

#~/Library/Preferences/nedit-ng $ cat dev.nm
define test1 {
  insert_string("test1")
}

# nedit.macroCommands: \
#   test2:Ctrl+Y::: {\n\
#      insert_string("test2")\n\
#   }

and "test1" appears in the Macros menu, and works. If I could get the key-binding in there I'd be ok.

grege2 avatar Nov 30 '20 19:11 grege2

I'll have to look into it since it's not a feature I use regularly :-)

eteran avatar Dec 01 '20 16:12 eteran

Ok. Actually I'm getting by ok by just coding new macros direct in autoload.nm, and running two instances of nedit, ie. one in good shape with an old working autoload.nm, and one starting up with the new macro code. It's all just to have a "testbed" for new macros while not wrecking my base nedit, I don't specifically need to "import" macros. I see some folks work that way though, they import a custom library of macros when they need them.

grege2 avatar Dec 01 '20 18:12 grege2