on someword I see the message register '/' set to '\bsomeword\b, however / register isn’t changed, and contains old value. I didn’t specified a -save-regs switch, so I expect my default search register to be changed to the current selection, but it’s not happening. Am I missing something?
So if you don’t want exec to restore registers, you have to do exec -save-regs '' <a-i>w*.
As a side-note, it used to be that both eval and exec restore the default registers, but this was changed somewhat recently.
Having been burned by the (lack of) -save-regs, I have learned to never script things such as exec d or exec *, but write instead exec -save-regs %{} d or exec -save-regs %{} *.
Yet today I was surprised to see the opposite case: with the search command, -save-regs seems unnecessary. On my version at least (the one available on Debian testing/unstable) exec / will open the search prompt and let you search for “foo” the usual way. Typing n will later select the next instance of “foo”, which shows that the search register was updated correctly.
(To complicate things further, scripting exec /foo<ret> will find “foo” correctly once, but typing n will not select the next instance of “foo”.)
Has anyone on the list noticed this behavior? It seems inconsistent with the docs, because / is a normal-mode command and “should” not update the search register in the absence of the -save-regs ... switch.
Presumably this has something to do with the fact that when the search prompt opens, we are in the Prompt mode. Still, isn’t the search command (/) a Normal-mode command?