unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: Juri Linkov <juri@jurta.org>, 18100@debbugs.gnu.org
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	[thread overview]
Message-ID: <87k0as6rk7.fsf@gnus.org> (raw)
In-Reply-To: <4aea5d8d-c60c-4213-ad3d-1f701b50792a@default> (Drew Adams's message of "Thu, 24 Jul 2014 10:22:23 -0700 (PDT)")

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	other threads:[~2022-05-11 15:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-24 17:22 bug#18100: 24.4.50; Restore simplicity of (put 'self-insert-command 'delete-selection 'kill) Drew Adams
2022-05-11 15:02 ` Lars Ingebrigtsen [this message]
2022-05-11 20:09   ` Drew Adams
2022-05-12 16:56     ` Juri Linkov
2022-05-12 17:30       ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0as6rk7.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=18100@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=juri@jurta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).