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: Tue, 03 Sep 2024 15:21:54 +0300 Message-ID: <86r0a16i71.fsf@gnu.org> References: <871q9g8z8k.fsf@posteo.net> <87wmob73ds.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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38242"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 03 14:23:13 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 1slSYy-0009mX-JE for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Sep 2024 14:23:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slSYo-0001Z2-K6; Tue, 03 Sep 2024 08:23:02 -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 1slSYn-0001Ye-08 for bug-gnu-emacs@gnu.org; Tue, 03 Sep 2024 08:23:01 -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 1slSYm-00053m-NR for bug-gnu-emacs@gnu.org; Tue, 03 Sep 2024 08:23:00 -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=wiPEP5tQYdH7RRHLjB0s4g7l/rnXtCWMuZRC4ATUXxc=; b=gDmjJDUlOYchQDa35brpuxM20uRhD2TZFq4PF8GPvRbKo96PH1RwBHgOu+9Tvfsdvb91/Sb/v3vxqXUrpH5IsVHjWPB8KWIsmlGuCSDBOwySzcea39l02qZW8DPG0bLdySITOBTNg7XOdk0q8arkYAxogtqi36njX5S8dn8M2crZytUeGr9UT2pnLfFtGsPEfZM3qwv5C5eMTeMSEg2OL6gLGo+JXHupDS+ghE7EyBqRW4ECgv+R2GgEjl4nsPtd/fXCV570cq5d96EKfPCKz84VGgXVcorwbiurGyeVbjopGOu9shhnhH9eCflnZZiMxVwKi4hTHYfHPGyV9YY7zw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1slSZm-00020R-DZ for bug-gnu-emacs@gnu.org; Tue, 03 Sep 2024 08:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Sep 2024 12:24:02 +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.17253661987642 (code B ref 69097); Tue, 03 Sep 2024 12:24:02 +0000 Original-Received: (at 69097) by debbugs.gnu.org; 3 Sep 2024 12:23:18 +0000 Original-Received: from localhost ([127.0.0.1]:59323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slSZ4-0001zC-4t for submit@debbugs.gnu.org; Tue, 03 Sep 2024 08:23:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slSZ2-0001yt-4s for 69097@debbugs.gnu.org; Tue, 03 Sep 2024 08:23:17 -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 1slSXu-0004yV-El; Tue, 03 Sep 2024 08:22:06 -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=wiPEP5tQYdH7RRHLjB0s4g7l/rnXtCWMuZRC4ATUXxc=; b=SjkGFyDHkjMl bTcFMsg+z3oRVfwyTKMLDqvrZMAOuvUEOEuzcJKO0Lp3EIo/GIzcyY43pmu9LiJIQcylzNsUR9W2V LNYY0hc8LXxMYHdf7FWeODhkDV+b47v/o01HZnD4rcyz3IS0AFALvDr4sJkVqwqeKk0OL+MkhlIkA DouytEph7lAzaa8DajtY+r/dEsolJ0IVKw74KMWuGHLfXJsqzCOgmYlIEXH2YjyxOjtmKwRT7GQDH HiAbCEQ+WkY2bZmgm1qHxb9mFkRdtF7J2HEbXLS59+Omeg/p4WQNtb4wOifrfFEsSIaRVsOeWqla7 5Wx2Ofs2T91R26Ar29ar6A==; In-Reply-To: <87zfopep5q.fsf@posteo.net> (message from Philip Kaludercic on Mon, 02 Sep 2024 21:12:01 +0000) 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:291138 Archived-At: > From: Philip Kaludercic > Cc: Eli Zaretskii , Stefan Kangas , > Andrea Corallo , juri@linkov.net, rms@gnu.org, > 69097@debbugs.gnu.org > Date: Mon, 02 Sep 2024 21:12:01 +0000 > > I had misremembered the last state of this patch. It is easier to just > have a tristate option. Here is the updated proposal: Thanks. > +(defcustom kill-word-if-no-region nil I would call this 'kill-region-dwim' instead. > + "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) :version tag is missing. > -Lisp programs should use this function for killing text. > - (To delete text, use `delete-region'.) > -Supply two arguments, character positions BEG and END indicating the > - stretch of text to be killed. If the optional argument REGION is > - non-nil, the function ignores BEG and END, and kills the current > - region instead. Interactively, REGION is always non-nil, and so > - this command always kills the current region." > +Lisp programs should use this function for killing text. (To delete > +text, use `delete-region'.) Supply two arguments, character positions > +BEG and END indicating the stretch of text to be killed. If the > +optional argument REGION is non-nil, the function ignores BEG and END, > +and kills the current region instead. If REGION has the special value Not sure why you decided to reformat this part. Its formatting was not random. This also needs a NEWS entry.