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: Fri, 06 Sep 2024 14:30:54 +0300 Message-ID: <86frqd10k1.fsf@gnu.org> References: <871q9g8z8k.fsf@posteo.net> <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> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14270"; 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 Fri Sep 06 13:33:01 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 1smXD3-0003XQ-6u for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Sep 2024 13:33:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smXCL-0006Wg-NO; Fri, 06 Sep 2024 07:32:17 -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 1smXCH-0006Ha-K5 for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2024 07:32:14 -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 1smXC7-0001fk-K7 for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2024 07:32:12 -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=FA5uyNroJj7eDB2+jwvVTQmeTH3ve11r6RxOZ/JFfM8=; b=CnWi5m9COP8dBof0Nctc7RXpxM31IOyYxBzS9/5w1oB+8Yrg8vPzBMoNWdn1i4ZueQTK1cNlxL1FtdBMP15GQYMsS5OnmoRaMV1IwKPJtiC/ofJvIQp4tEpvqV7mNUzNDA6JwcmI9cWzd4xqAt3CGhXRypoRggS0p8yCuBi21bVHLQ+LUc1HsBfbb0vgV+tcg3iLqlKepG/bpqoPV4NRb5rHnlSI+NMf8CW1G1HaNwa3uWtdesbi5shEyW1OhYb/5nHEbKMeFAET5SFhsr0Dtn8uy8IESxfB9zrSfSpsZLPV4e+gCj7JnzKbr5HowMODDOJyXCIxrWBSuJjhf5z+YA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1smXC6-0000bN-LD for bug-gnu-emacs@gnu.org; Fri, 06 Sep 2024 07:32: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: Fri, 06 Sep 2024 11:32: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.17256223092283 (code B ref 69097); Fri, 06 Sep 2024 11:32:02 +0000 Original-Received: (at 69097) by debbugs.gnu.org; 6 Sep 2024 11:31:49 +0000 Original-Received: from localhost ([127.0.0.1]:52251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smXBs-0000aj-H7 for submit@debbugs.gnu.org; Fri, 06 Sep 2024 07:31:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smXBq-0000aN-Jg for 69097@debbugs.gnu.org; Fri, 06 Sep 2024 07:31:47 -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 1smXBk-0001c3-Bl; Fri, 06 Sep 2024 07:31:40 -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=FA5uyNroJj7eDB2+jwvVTQmeTH3ve11r6RxOZ/JFfM8=; b=X2qaInMi1jnt r8ypHwqEQdKo+TSyERApJiXczaKJHAPvmIEhuF+yA1oZ/HIAUh5kTIb5vtTq158J786nAFpd05tcf QErlmjAIw4657xnu4C4FmHk/ykhaGjNxUTdxzNcoHcMrW4CL/j7fQQDqtcdBDJHn4nVLBP78/kxd/ +nTKMkVtyErac7tWsWfV32scToeA9Z0iA7muUncfAcOeosInME+9wAE/2447Yi4079SbsjVmGQp84 EgfORMh4G53MWQ8ecjz/yAHG8czJVzPvU2idcBQR+9bMMcnIMxWijAorv9GiFAlqsKuu10OtTqRqh Cr4KLXRNEWcuRG/Nz4Jeng==; In-Reply-To: <877cbpvzkm.fsf@zephyr.silentflame.com> (message from Sean Whitton on Fri, 06 Sep 2024 11:36:25 +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:291304 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: Fri, 06 Sep 2024 11:36:25 +0100 > > I think you're right, but I would like to commit my function first, so > that I get attribution (it did take me some time to figure out what was > useful in this area), and because I think it should be rewritten in > terms of fields. > > Please take a look at the attached. unix-word-rubout to follow. Thanks, but I see no reason to document this command in the manual, certainly not in the ELisp reference (it's a command, not a function). IMO it's obscure enough to be documented only in NEWS. > +(defun forward-unix-word (&optional arg delim) > + "Move forward to the end of the next whitespace-delimited word. > +With argument ARG, do this that many times; the default is once. > +With negative ARG, go backwards to the beginning of whitespace-delimited > +words. > +DELIM is a string specifying what characters are considered whitespace, > +as might be passed to `skip-chars-forward'. > +The default is \"[:space:]\\n\". Do not prefix a `^' character. Should this be "[:space:]\\n\\r" instead? if not, why not? Also note that [:space:] depends on mode-specific syntax table, so I question the wisdom of using it in a command that's supposed to be mode-agnostic. > +This command is like `forward-word' except that words are always > +delimited by whitespace, regardless of the buffer's syntax table. > +Like `forward-word', this command respects fields. > + > +This emulates how C-w at the Unix terminal or shell identifies words. > +See the `unix-word-rubout' command in Info node `(readline)Commands For > +Killing'." This should try to be more explicit about what "word" means for this command. Since it's so different from any notion of "word" in Emacs, I would even seriously consider not to use that word, or maybe quote it (in addition to explaining what it means). Also, since this is a command, its doc string should clearly separate what happens in interactive invocation from what happens when called from Lisp. DELIM belongs to the latter. (Is it even useful to provide that option for Lisp-only calls? what's the use case for that?) And finally, I wonder why we need this command? AFAIU, the original intent was to implement something similar to unix-word-rubout, not a new movement command. If the plan has changed, I think we need to discuss the need once again. Thanks.