Stefan Monnier wrote: >> +(define-minor-mode delete-selection-local-mode >> + "Toggle Delete Selection mode in the current buffer. >> + >> +See the command `delete-selection-mode'. >> + >> +For compatibility with features and packages that are aware of >> +`delete-selection-mode', this mode also sets the >> +variable `delete-selection-mode' in the current buffer." >> + :global nil :group 'editing-basics > > Have you tried to use the `:variable (buffer-local-value > 'delete-selection-mode)` instead of introducing a parallel > `delete-selection-local-mode` variable? > > > Stefan > I had not thought to try that. Attached is a patch which uses `buffer-local-value` as a `setf`-able place. I had to include the third argument `(current-buffer)`. Do you think that disabling the local mode should remove the buffer-local version of `delete-selection-mode` via `kill-local-variable`? It seems that once the variable is made buffer local, the global mode can't take effect in the buffer, even when the local mode is disabled. If you do think that the local version of the variable should be removed, do you think that it should be removed selectively or always? Thank you.