From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#69097: [PATCH] Add 'kill-region-or-word' command Date: Tue, 03 Sep 2024 16:55:29 +0200 Message-ID: <87plpku6qm.fsf@gmail.com> References: <871q9g8z8k.fsf@posteo.net> <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> <87ttewu9lo.fsf@gmail.com> <86bk147qxc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14754"; 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, spwhitton@spwhitton.name To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 03 16:57:17 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 1slUy4-0003Xj-Pz for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Sep 2024 16:57:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slUxq-00006G-MZ; Tue, 03 Sep 2024 10:57: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 1slUxo-0008O6-Cw for bug-gnu-emacs@gnu.org; Tue, 03 Sep 2024 10:57:00 -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 1slUxo-00075C-30 for bug-gnu-emacs@gnu.org; Tue, 03 Sep 2024 10:57:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=fzy4pwG2c/ej7uhM77aNTGlzBWy5ldl/kQ9Iaxt/mxE=; b=Y1VCJBn3n9ffvuFWFh/0oN0zkB2Ta4hrrfak4Jp+TO6rYbSkjAyKq4LXa5FI3i7ljm3uApgQo9oorfwTsZVv8QvWQP6nmb9H2s8biad0So1/X746kiiBuDWBauzXHBAlI0jRKoRUuRLZKEKEqBREkiURCSQAinvf9BoQALIo66oWXjEZ6DvyhzW72s0FxC1VoDF3UAlCp/JUsi7cWMnQyLqnT+8dYSWyYds3UaQx37BFFo8XxA8PfQeyoGH5YUAXSr8y45nC5qaJFVEOTEiQ5aaj2SVyHOxHTNV4sQ0rMTv4YwHNibmpYRrgt916fk2JHfcKQH2AoDXRdSdqccnzFg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1slUyo-0006qc-CB for bug-gnu-emacs@gnu.org; Tue, 03 Sep 2024 10:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Sep 2024 14:58: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.172537546326292 (code B ref 69097); Tue, 03 Sep 2024 14:58:02 +0000 Original-Received: (at 69097) by debbugs.gnu.org; 3 Sep 2024 14:57:43 +0000 Original-Received: from localhost ([127.0.0.1]:60518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slUyU-0006py-WB for submit@debbugs.gnu.org; Tue, 03 Sep 2024 10:57:43 -0400 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:46465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slUyS-0006pj-Id for 69097@debbugs.gnu.org; Tue, 03 Sep 2024 10:57:41 -0400 Original-Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-42bb6d3e260so46111325e9.1 for <69097@debbugs.gnu.org>; Tue, 03 Sep 2024 07:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725375332; x=1725980132; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=fzy4pwG2c/ej7uhM77aNTGlzBWy5ldl/kQ9Iaxt/mxE=; b=VsjKhtFV1u8a4GrEnvB9+xlAjL6/OmxmmTWwrwdEP8NZBxwgg3N/KGttpW7MamDA3O RhHN4uO/m9/4gXeeOnarLZicETluyaJJT8aL/dLBFHbWzOUlYwXXBpSE85EFLBOz1WN0 bpVnb+D1rd/Q2MyUBmExi2NXeYQO1YOgq8YZxtZp074Tw32aqwelS/+rPe58E65fDcGj GbX21iV+0GwueHx8ThGdEEg5vi8jcy2ZU9tijlOUvnIk7qHBpKVZjizd2HiRfD/1j1/4 qVdl0WXDtyMTDcMq3wMJ3ojKgr6cKgoXf/n3wSZKUnWVLfaec5Samqe8c2ktW6RXv5K4 7+MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725375332; x=1725980132; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fzy4pwG2c/ej7uhM77aNTGlzBWy5ldl/kQ9Iaxt/mxE=; b=n5kbyhtyQKCj1uLo+ol+nF6GR3OpM24JlELmx3F3o1jZlg7YpmHw22+yT7F8p3j1nk sZIfEmBZqNfMTy8NmtFbaONT+flAbwrXuvl2Ch8qXuBT44kDaoZDIXni8HYlUAFozPbM 88noyVjRpuioFvJxV/bwc2xW4S3nXJRWFyMW63zy6dCFmcUQnIamGSX32gzb+X22Qd2/ +hrBN4i11K5keqHd3vet9Mzh4iob/xoRrGxAJzQ04XYfJ+RqN80+jczUO8waR2cZPUxm BDKLg3oguY06pVJm+6oPnu9KDXlIwve5QVWRS55kMfjmwUThQTN9M3eyktTGpRakN6x7 Iyrw== X-Forwarded-Encrypted: i=1; AJvYcCUVn1xDkCqR/WiY2DVM5cqN/eLXHNUq5MNYlFP/1gJDvU1Zqc7RfGpG2fW1LMOIcv5e5KPZXQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yyo8P2x+03aM86La97RdyccrXpGW1jOUQIM6CbQbmEHQ8d4770J wpnTmh4hFNs1LhiuEcTukeWnx2PALH6Ehm6H/EHlHrvTBKAoXSmG X-Google-Smtp-Source: AGHT+IFEWPSwUnFaCNRnG0XbUp174ypYw6+4YBR4tFf96qKf65wFYgCtyt504tFVEk8j6Z26dmO2YQ== X-Received: by 2002:a05:600c:3503:b0:428:2e9:6573 with SMTP id 5b1f17b1804b1-42bdc6370a2mr76978015e9.17.1725375332042; Tue, 03 Sep 2024 07:55:32 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb51:c8aa:69e8:c66e:716f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42c846d2fdesm62866205e9.22.2024.09.03.07.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 07:55:30 -0700 (PDT) In-Reply-To: <86bk147qxc.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 03 Sep 2024 17:27:59 +0300") 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:291150 Archived-At: >>>>> On Tue, 03 Sep 2024 17:27:59 +0300, Eli Zaretskii said: >> >> + "Behaviour when `kill-region' is invoked without an active reg= ion. >> >> +If set to nil (default), then an error occurs and nothing is kil= led. 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 t= he style >> >> +of a shell like Bash, disregarding the major mode." >> >> + :type '(choice (const :tag "Kill a word like `backward-kill-wo= rd'" emacs-word) >> >> + (const :tag "Kill a word like Bash would" unix-= word) >> >> + (const :tag "Do not kill anything" nil)) >> >> + :group 'killing) >>=20 Eli> :version tag is missing. >>=20 >> Is it worth allowing a user-specified function? Eli> I don't understand what you are asking, sorry. Allow a function w= here Eli> and to do what? The current proposal offers three fixed behaviours. I=CA=BCm wondering if it makes sense for the user option to be allowed to be a user-defined function, in case someone wants a different behaviour, ie +(defcustom kill-word-if-no-region 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. If set to a +function, call that function." + :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) + (symbol :tag "User function") + :group 'killing) Robert --=20