From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: delete-selection-mode as default Date: Fri, 7 Sep 2018 09:27:04 -0700 (PDT) Message-ID: <2864b863-7710-4631-86ae-04923e32d516@default> References: <83k1nxvm5j.fsf@gnu.org> <877ejxsm18.fsf@toy.adminart.net> <87mustqugw.fsf@toy.adminart.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1536337702 3375 195.159.176.226 (7 Sep 2018 16:28:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 7 Sep 2018 16:28:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: hw , =?utf-8?B?Q2zDqW1lbnQgUGl0LUNsYXVkZWw=?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 07 18:28:17 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fyJcG-0000lk-Uw for ged-emacs-devel@m.gmane.org; Fri, 07 Sep 2018 18:28:17 +0200 Original-Received: from localhost ([::1]:39530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyJeN-0002kq-Dm for ged-emacs-devel@m.gmane.org; Fri, 07 Sep 2018 12:30:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyJbP-0008Jg-HY for emacs-devel@gnu.org; Fri, 07 Sep 2018 12:27:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fyJbM-0008Gx-2K for emacs-devel@gnu.org; Fri, 07 Sep 2018 12:27:23 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:52156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fyJbG-00086I-FY for emacs-devel@gnu.org; Fri, 07 Sep 2018 12:27:16 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w87GNmVq004619; Fri, 7 Sep 2018 16:27:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=nqi5UN88Lrkb78oEIoKhfzu6L40jD8dTh1n5iNQJ7Uc=; b=oMVD0XVFAC2MzOPpfDpooEWWL0qk9X5aqQ5RdvVQAsit0q+mG5OJ0seBzQpCgj39Eu87 xGVFjSURU6QSDHBm1K/ellYvOauYFben439CqYhZWEW92kcqDutB3nfhL2/Y1KW86xt1 MrfFVKLQJZ/tK2FSrshp0t1AMoGTygRtrLuHh6rH3+b9eQZQpBVgzCCt1srRMT+4gE5w NH4BsfNGj6ICc8IAfW9iyeqU3fCRs4HdF0NYmGhVrRicY7Op7Irvmr3Z3qJhE0FIrWGt wemokNEtD7ykd0mTHH8FwNw0yMqXLXO6ncpmNtJBfKL2bnxUZSrCiB5eMiVuVPkYO64o AQ== Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2m7j6u3mue-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Sep 2018 16:27:07 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w87GR7Re021532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 7 Sep 2018 16:27:07 GMT Original-Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w87GR5R4009002; Fri, 7 Sep 2018 16:27:07 GMT In-Reply-To: <87mustqugw.fsf@toy.adminart.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4735.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9009 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=979 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809070164 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.86 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229427 Archived-At: > I call it a design flaw because if whoever made it this way had given > any thought to it, it would at least be customizable Actually, beyond being customizable by configuring it to be on or off by default, it is customizable (but not just by using Customize), in a fine-grained way. You can easily configure the behavior to use for any given command, by putting a particular `delete-selection' property value on its symbol. These are the possible `delete-selection' property values: * `yank' - For commands that do a yank. Ensures that the region about to be deleted is not yanked. * `supersede' - Delete the active region and ignore the current command: the command just deletes the region. * `kill' - `kill-region' is used on the selection, rather than `delete-region'. (Text selected with the mouse is typically yankable anyway.) * anything else non-nil - Deletes the active region prior to executing the command, which inserts replacement text. This is the usual case. Commands that insert text but do not have property `delete-selection' (or commands for which it's value is nil) do not delete the selection. For example:=20 ;; Don't let `insert-char' delete the selection. (put 'insert-char 'delete-selection nil) More typically is the case where a library defines a new editing command that it wants to make susceptible to `delete-selection-mode'. For example: ;; Let delete-selection mode delete the region.=20 (put 'icicle-delete-char 'delete-selection 'supersede) Simple, elegant command-specific behavior. Trivial to configure - for both users and libraries.