all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#18100: 24.4.50; Restore simplicity of (put 'self-insert-command 'delete-selection 'kill)
@ 2014-07-24 17:22 Drew Adams
  2022-05-11 15:02 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2014-07-24 17:22 UTC (permalink / raw)
  To: 18100

This is a followup to bug #13312, whose status is "Fixed in version
24.4".

The #13312 bug thread included this exchange between me and Juri Linkov:

From me:
--------

  > But when you want put `kill' as the `delete-selection' property
  > then it's better to use this code:
  > (put 'self-insert-command 'delete-selection
  >      (lambda ()
  >        (and (not (run-hook-with-args-until-success
  > 		  'self-insert-uses-region-functions))
  > 	    'kill)))

  Maybe so, but that is not at all what the `delete-selection-mode' doc
  & comments tell users.  If this is a new requirement/guideline, then
  it needs to be documented.

  But I wonder why this must now be so.  In the past, a user could just
  put `kill' as the property.  The code does not seem so clean now.

  One of the benefits of the `delsel.el' design (and yes, along with
  those benefits come also some disadvantages) is its simplicity for
  users.

  This seems to go against that.  Is it really necessary?  Isn't there
  another way to accomplish the same thing (whatever that is), so we can
  keep the simple and clean design for users?

  What was the reason for introducing
  `self-insert-uses-region-functions'?  It seems it was only for
  `electric-pair-mode'.  IIRC, I wasn't too happy with that hack when it
  was done.  Now it seems to be dirtying (complicating) `delsel.el'.
  Isn't there a better way?

  But again, we should probably be discussing this elsewhere, since it
  does not seem to be only about this bug.

  ...

  Users should be able to `put' a single, understandable symbol as the
  `delete-selection' property value.  They should not need to fiddle
  with obscure lambda forms (or symbols whose names are not simple to
  understand).  Symbol `kill' is simple - it says that you want the
  region to be killed.

  This simplicity was the case before (`delsel.el' is old and simple).
  Someone introduced `electric-pair-mode', and then someone else
  complained about its interaction with `delete-selection-mode'.  The
  fix for that should not have involved screwing
  `delete-selection-mode', as seems to be the case so far.

Juri's reply:
-------------

  I think (run-hook-with-args-until-success
  'self-insert-uses-region-functions) could be moved to the body of
  `delete-selection-helper'.  Then the users again will enjoy the
  simplicity of (put 'self-insert-command 'delete-selection t)
  and (put 'self-insert-command 'delete-selection 'kill)

To which I replied: "That sounds good.  Thank you, Juri."

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)))


In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-06-28 on ODIEONE
Bzr revision: 117431 rgm@gnu.org-20140628015517-eku6hj8mpgcvfnso
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/snapshot/trunk
 --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3'
 LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include''





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-12 17:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2022-05-11 20:09   ` Drew Adams
2022-05-12 16:56     ` Juri Linkov
2022-05-12 17:30       ` Drew Adams

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.