Robert Pluim writes: >>>>>> On Tue, 03 Sep 2024 15:21:54 +0300, Eli Zaretskii said: > > >> From: Philip Kaludercic > >> Cc: Eli Zaretskii , Stefan Kangas , > >> Andrea Corallo , juri@linkov.net, rms@gnu.org, > >> 69097@debbugs.gnu.org > >> Date: Mon, 02 Sep 2024 21:12:01 +0000 > >> > >> I had misremembered the last state of this patch. It is easier to just > >> have a tristate option. Here is the updated proposal: > > Eli> Thanks. > > >> +(defcustom kill-word-if-no-region nil > > Eli> I would call this 'kill-region-dwim' instead. > > >> + "Behaviour when `kill-region' is invoked without an active region. > >> +If set to nil (default), then an error occurs and nothing is killed. If > >> +set to `emacs-word', then kill a the last word as defined by the current > >> +major mode. If set to `unix-word', then kill the last word in the style > >> +of a shell like Bash, disregarding the major mode." > >> + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) > >> + (const :tag "Kill a word like Bash would" unix-word) > >> + (const :tag "Do not kill anything" nil)) > >> + :group 'killing) > > Eli> :version tag is missing. > > Is it worth allowing a user-specified function? That would be possible as well, but to make it manageable with the current approach the function would have to be one that moves the point. So we could rewrite the patch with two default options `backward-word' and `unix-backward-word' (which we would have to add), but I am not sure it would have much use. Perhaps killing the current word, instead of just killing to the beginning? > Robert -- Philip Kaludercic on peregrine