From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Another Emacs incompatibilty Date: Tue, 18 Aug 2020 08:47:50 -0700 (PDT) Message-ID: <2a7d658b-972c-46e0-b893-af8c236da401@default> References: <86r1s648dc.fsf@shell.gmplib.org> <86wo1xz4lt.fsf@shell.gmplib.org> <83imdhgsqo.fsf@gnu.org> <86blj9xc2z.fsf@shell.gmplib.org> <87blj8gbmh.fsf@ericabrahamsen.net> <878secyj10.fsf@ebih.ebihd> <875z9gg5qm.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8988"; mail-complaints-to="usenet@ciao.gmane.io" To: Eric Abrahamsen , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 18 17:51:14 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k83tK-0002DT-An for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 18 Aug 2020 17:51:14 +0200 Original-Received: from localhost ([::1]:54412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k83tJ-0005cX-2J for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 18 Aug 2020 11:51:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k83qZ-0002Bv-OJ for help-gnu-emacs@gnu.org; Tue, 18 Aug 2020 11:48:28 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:43486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k83qR-0005E5-Tl for help-gnu-emacs@gnu.org; Tue, 18 Aug 2020 11:48:23 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07IFlH89010847; Tue, 18 Aug 2020 15:47:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=Twt2fenmSKwdqRQpdsPDjKsgz2i0bUqCshUdYnz5PR0=; b=LUApbLigCqKGcydNzrZrwzfi1t4Z5jHq5VHWpCRtAjlxqjFEpDe7DTUcBtg5nENTHFBx +HUaBC0i04Vs8OSjjJy7pkDaHTBz2dnrbT1s5chZQUTE7DHgK8rH01qtQpjhRfljAF1v q1SPonVMdX+jblMlb6TlViJhBEL23fQuU3mXxD4Q5GnZeSRDGliGxoBmUPrlB5KJGxHY 8+pPD/dDKd+ttzb3y6PlaJDT7iQf4P8mUMRjzpg+Heu0wXMLT0lnBO5fVs94Etu8Dujv qJJSpJGRBJg47TvoptmmAE1aRZy9EzMmwBKXlW9jccJW1TYyFF76Dw9+O0Lv0AOEZP2o rQ== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 32x8bn5kd0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 18 Aug 2020 15:47:58 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07IFllQK076077; Tue, 18 Aug 2020 15:47:58 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 32xsm35qjy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Aug 2020 15:47:58 +0000 Original-Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 07IFlpKr000478; Tue, 18 Aug 2020 15:47:51 GMT In-Reply-To: <875z9gg5qm.fsf@ericabrahamsen.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5017.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9716 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 malwarescore=0 mlxscore=0 phishscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008180113 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9716 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 adultscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 clxscore=1011 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008180113 Received-SPF: pass client-ip=156.151.31.85; envelope-from=drew.adams@oracle.com; helo=userp2120.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 11:48:09 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:123715 Archived-At: > Almost by coincidence, I just discovered `delete-selection-mode', which > does the same thing. I also don't understand the utility of this, but > apparently it's useful enough to have been implemented twice! Neither > should be active by default, though. Some of us think that `delete-selection-mode' should be enabled by default - and that this is long overdue. FYI, a similar debate took place for `transient-mark-mode'. It took _decades_ to finally get that turned on by default. Maybe you can't imagine t-m-mode being off by default. Try it. ;-) There are some good arguments for that behavior, as there are against it. I argued then to turn on t-m-mode by default. And I argued (and still do) to also turn on `delete-selection-mode' by default. `delete-selection-mode' is a common behavior outside Emacs: just-select-and-type-to-replace. The default Emacs behavior makes you use `C-w' first. But d-s-mode also lets users and libraries easily _control_ just which commands (actions) delete selected text, which ones kill it, which ones do neither, which ones are yanks (to not then yank the text to be deleted), whether to also perform the command's normal action, or whether to do something else altogether. Here's the relevant part of the `delsel.el' Commentary: ;; Commands which will delete the selection need a `delete-selection' ^ [non-nil] ;; property on their symbols; commands which insert text but don't ;; have this property won't delete the selection. It can be one of ;; the values: ;; ;; `yank' ;; For commands which do a yank; ensures the region about to be ;; deleted isn't immediately yanked back, which would make the ;; command a no-op. ;; `supersede' ;; Delete the active region and ignore the current command, ;; i.e. the command will just delete the region. This is for ;; commands that normally delete small amounts of text, like ;; a single character -- they will instead delete the whole ;; active region. ;; `kill' ;; `kill-region' is used on the selection, rather than ;; `delete-region'. (Text selected with the mouse will typically ;; be yankable anyhow.) ;; t ;; The normal case: delete the active region prior to executing ;; the command which will insert replacement text. ;; FUNCTION ;; For commands which need to dynamically determine this behavior. ;; FUNCTION should take no argument and return one of the above ;; values, or nil. In the latter case, FUNCTION should itself ;; do with the active region whatever is appropriate." That's the Emacs way: a general, default behavior, but also user/code control over it. You can get whatever behavior you want for a given command. The command gets to decide what it does with the active region. (That means you get to decide.) (put 'my-command 'delete-selection nil) ; Ignore d-s-mode.