From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69097: [PATCH] Add 'kill-region-or-word' command Date: Wed, 04 Sep 2024 17:21:52 +0300 Message-ID: <86cylj5wjj.fsf@gnu.org> References: <871q9g8z8k.fsf@posteo.net> <861q6jji0i.fsf@gnu.org> <87o79n6uj6.fsf@posteo.net> <86v83vi2kr.fsf@gnu.org> <86seyzi2by.fsf@gnu.org> <87cyq26bt8.fsf@posteo.net> <864jbeixkt.fsf@gnu.org> <874jbe65u0.fsf@posteo.net> <8634qwkbtc.fsf@mail.linkov.net> <86h6fceij2.fsf@gnu.org> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8466"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 04 16:23:16 2024 Return-path: Envelope-to: geb-bug-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 1slquh-00020n-2B for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 Sep 2024 16:23:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slquR-0001bs-I1; Wed, 04 Sep 2024 10:22:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slquQ-0001bc-F0 for bug-gnu-emacs@gnu.org; Wed, 04 Sep 2024 10:22:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slquQ-0007JO-60 for bug-gnu-emacs@gnu.org; Wed, 04 Sep 2024 10:22:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=tq24oaCnROAscIqLjTRv79r9jnpGCbPa+4Qp8ViTKow=; b=pXTmKITW+uVQj7ax+4nEhJ5nB7Txre7wCkBN2uEK4hN511Zx+ICi4lOlhMk7q3/hbYnm6LBwnlGuPtKoustkhhiRnFvqeiVCjhTLseW9t/Lag7+1KKYy9QLzi3XrKRcf9TpALddGEPE0VQgwG++xGUZ1mEBh/qCMCUZKDqWvdb4O5V47m8sxlV/ePXM5Qmb5oj9TS+T/1zgEf4cieirVJaH4leueMnB5QTI3W2ZwrK9JAbNdIoVDIy1Jsea3GuRUhHmCA6i7Px5xZHkYmtyCtDOPoqcVRK+s0P9gKXEjLhZpYLLxr7cKG8uUBoOxOnSsCYlxJAGg8meIT7qQ9+8yRQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1slqvR-0003TG-RX for bug-gnu-emacs@gnu.org; Wed, 04 Sep 2024 10:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Sep 2024 14:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69097 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 69097-submit@debbugs.gnu.org id=B69097.172545980313289 (code B ref 69097); Wed, 04 Sep 2024 14:24:01 +0000 Original-Received: (at 69097) by debbugs.gnu.org; 4 Sep 2024 14:23:23 +0000 Original-Received: from localhost ([127.0.0.1]:35127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slquo-0003SF-UF for submit@debbugs.gnu.org; Wed, 04 Sep 2024 10:23:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slqun-0003S3-0C for 69097@debbugs.gnu.org; Wed, 04 Sep 2024 10:23:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slqtX-00078K-QL; Wed, 04 Sep 2024 10:22:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=tq24oaCnROAscIqLjTRv79r9jnpGCbPa+4Qp8ViTKow=; b=Xj4JnbXVTAEf WuN5bGeA2+2UGI+iJsQjwyh7SA0elzJfiRzN10JLsuyranOEs44pVKZ6yNR/bpYKF9scmywo+jvn8 wiwOX0TKLDkoAOFmj4uzYpVbzWDWOjpm3OJR9O4EFJontapYQCYxWITI+4q9rSszWyhVWIM1Zg+es mSkPrGqEO9b6BtQsfWxl5sKWE/mQcJjSR9o8yRLXMAMyNzey5AcSVNvcgrsoyGr2QhsopHT2ffqn4 KrvXGawFZz/ucguX2CgUkGlCpJgLqy2yZWh1kTt3ekoH04ru4PGcgE2WQCdqKmuabkLQr+s/eb9a1 uNjQjc6UiiC5LoLPPS1CCw==; In-Reply-To: <87a5gnzf5f.fsf@zephyr.silentflame.com> (message from Sean Whitton on Wed, 04 Sep 2024 15:07:08 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291206 Archived-At: > From: Sean Whitton > Cc: Eli Zaretskii , stefankangas@gmail.com, > acorallo@gnu.org, juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org > Date: Wed, 04 Sep 2024 15:07:08 +0100 > > > +(defcustom kill-region-dwim nil > > + "Behaviour when `kill-region' is invoked without an active region. > > +If set to nil (default), then an error occurs and nothing is killed. If > > +set to `emacs-word', then kill a the last word as defined by the current > > +major mode. If set to `unix-word', then kill the last word in the style > > +of a shell like Bash, disregarding the major mode." > > + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) > > + (const :tag "Kill a word like Bash would" unix-word) > > + (const :tag "Do not kill anything" nil)) > > + :group 'killing) > > I think I'm missing something here. When it's nil and there is no > *active* region, but there is a region, it should kill that, surely? > With or without TMM. Yes, you are right. It sounds like we made wrong assumptions about what happens in that case, and should rethink this. C-w signals an error only if there's no mark in the buffer. So I guess we need a new command after all.