Subject: bug#18100: 24.4.50; Restore simplicity of (put 'self-insert-command 'delete-selection 'kill)

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 11 May 2022 17:02:16 +0200

Drew Adams <[email-masked]> writes:

> This new bug is about getting that fixed, IOW, restoring the ability to
> use a simple `put' to configure `delete-selection-mode' behavior for a
> given command, rather than having to jump through hoops with
> incomprehensible lambda forms in the `put' value.  IOW not make users do
> things like this:
>
>> (put 'self-insert-command 'delete-selection
>>      (lambda ()
>>        (and (not (run-hook-with-args-until-success
>> 		  'self-insert-uses-region-functions))
>> 	    'kill)))

This was somewhat rewritten in 2015, and there's now a
delete-selection-uses-region-p.  So this would be simpler to express
now:

(put 'self-insert-command 'delete-selection
     (lambda ()
       (and (delete-selection-uses-region-p) 'kill)))

And I think that's sufficient here, and I'm therefore closing this bug
report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no