GNU bug report logs - #18100
24.4.50; Restore simplicity of (put 'self-insert-command 'delete-selection 'kill)

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Thu, 24 Jul 2014 17:24:01 UTC

Severity: wishlist

Found in version 24.4.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 18100 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Juri Linkov <juri <at> jurta.org>, 18100 <at> debbugs.gnu.org
Subject: Re: bug#18100: 24.4.50; Restore simplicity of (put
 'self-insert-command 'delete-selection 'kill)
Date: Wed, 11 May 2022 17:02:16 +0200
Drew Adams <drew.adams <at> 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




This bug report was last modified 3 years and 10 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.