bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18100: 24.4.50; Restore simplicity of (put 'self-insert-command 'del


From: Lars Ingebrigtsen
Subject: bug#18100: 24.4.50; Restore simplicity of (put 'self-insert-command 'delete-selection 'kill)
Date: Wed, 11 May 2022 17:02:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Drew Adams <drew.adams@oracle.com> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]