Attached is the change that rebuilds the keymap after the user changes the
prefix along with my notes and testing results.
gnu-apl-mode.el
Added a base-constructor to build the common keymap between edit and
interactive mode
Added a constructor to build the edit keymap
Is not interactive because the defcustom doc string explains things
Uses the base keymap constructor
This code from yasnippet shows how to correctly handle referring to the
perhaps not yet initialized value for the prefix. This was key to getting
this defcustom setter working correctly
Added defcustom for prefix
Setter function sets using the default set-value and then rebuilds the
keymap
The keymap is declared using the constructor
gnu-apl-interactive.el (changes are virtually identical)
Added a constructor to build the keymap
Is not interactive because the defcustom doc string explains things
Uses the base keymap constructor
Added defcustom for prefix
Setter function sets using the default set-value and then rebuilds the
keymap
The keymap is declared using the constructor
Testing
Mode
Buffer Open
Set prefix
Expectation
Result
Edit file
No
Session
Set prefix when open, correct prefix
Pass
Edit file
Yes
Session
Set prefix, close buffer, open file, correct prefix
Pass
Edit file
No
Saved
Set prefix when open, correct prefix
Pass
Edit file
Yes
Saved
Set prefix, close buffer, open file, correct prefix
Pass
Interactive
No
Session
Set prefix when open, correct prefix
Pass
Interactive
Yes
Session
Set prefix, close buffer, restart session, correct prefix
Pass
Interactive
No
Saved
Set prefix when open, correct prefix
Pass
Interactive
Yes
Saved
Set prefix, close buffer, restart session, correct prefix
Good evening Elias,
Attached is the change that rebuilds the keymap after the user changes the prefix along with my notes and testing results.
set-value
and then rebuilds the keymapset-value
and then rebuilds the keymapTesting
Sincerely,
Grant Rettke