From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pierre Rouleau Newsgroups: gmane.emacs.help Subject: Re: [External] : forward-sexp Date: Sun, 13 Aug 2023 10:02:40 -0400 Message-ID: References: <53741ea9-b3ac-67a6-519f-b8977df30bf9@easy-emacs.de> <0a70992a-8daf-b14b-09a4-d4b89ef29639@easy-emacs.de> <87350pibf2.fsf@dataswamp.org> <87msyvkihg.fsf@dataswamp.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="20772"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 13 16:03:50 2023 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 1qVBh8-0005BZ-93 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 13 Aug 2023 16:03:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVBgV-0006Bw-8n; Sun, 13 Aug 2023 10:03:11 -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 1qVBgG-00068W-QR for help-gnu-emacs@gnu.org; Sun, 13 Aug 2023 10:03:04 -0400 Original-Received: from mail-vs1-xe29.google.com ([2607:f8b0:4864:20::e29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qVBgD-00077i-TQ for help-gnu-emacs@gnu.org; Sun, 13 Aug 2023 10:02:56 -0400 Original-Received: by mail-vs1-xe29.google.com with SMTP id ada2fe7eead31-447823dd96fso975086137.1 for ; Sun, 13 Aug 2023 07:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691935372; x=1692540172; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=C7WB8sPNTIjBglVLmfsvnE1MLEUPHle0yKyzvL+L8l0=; b=QGhdw7cg43lBqj6RUe+epbpYcMY+u6wrYRpfiXGeBIVoess27NbiQcPdA3PcucDkJ1 qV2EVaZxYVwdEfp6mYKOsdt90UaZcn4/6lpNEo5qoAHCm7jegzTbGkGPWvxt7Sw0AI05 1Nq2geAyoZnI6xOUfmdwxV1F9Ai0FSsYXAooaBflYp9uVPlKwMAEtcBB1BX5grZW/mXE Q29mLPuxjDFyBMoX3XE/XE50+8RPLsT837LL446QCI1p3W5rlJker3xkkeYAEeAFQgCc oa+NMOef5y7w4KG9wuQAeDKSGPQLZ72WoaLOp5P5h1VtRFDh+BhUbDF2oeVadWRZuVUj C3Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691935372; x=1692540172; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=C7WB8sPNTIjBglVLmfsvnE1MLEUPHle0yKyzvL+L8l0=; b=EYePJQRl6KrgGlqTEIXX2s9LGOIXsr+Ca35x/DP3cEIX2Nze/RBkJ+WgZcZuEJysx0 NKtYefYwSC50HnlIWek9rp5vTdkj3cJzI9icr9iAIRrq0HGMUpMY2xNChEaBkMti4Zkq i2iI5ze3roF7MM6cVBOLqe2MLhA1wutINWKdOhyd3nXS9UNkQghrq6RDejQyTGfnSwUv Zaz1IfpzAhatxOi8qIeTsJmJIC8BkvmKZ/Rbk4Mxv+JXSzo7cewMqWlrRTO0HUhiMS3/ NEtyc3D5T7VgJecdYTmSTxwQ1YfD2e9Km+8utfuLVN2ZUkp62NWG+Q8iC1fIqyufMErH 9vHw== X-Gm-Message-State: AOJu0YwFG0NpID8o6BpI+yGGnriZxQMGjbuuvUf+FXEHKQF3fIuM8aak IS6JfRtGcGFWg8c5NJ0Y/gG++0Z7nmFxnNOeUP5j7C91 X-Google-Smtp-Source: AGHT+IEyYoaKKBwQVszUrykzeoWGgR3HU/h+ZwAvWftZF4CwP3EQ9JW4oOA40e8wQXtzK7zMfMQ8J9XcqBOaAAWL4zE= X-Received: by 2002:a05:6102:459:b0:443:5cbc:82f9 with SMTP id e25-20020a056102045900b004435cbc82f9mr5054411vsq.31.1691935372055; Sun, 13 Aug 2023 07:02:52 -0700 (PDT) In-Reply-To: <87msyvkihg.fsf@dataswamp.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::e29; envelope-from=prouleau001@gmail.com; helo=mail-vs1-xe29.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:144796 Archived-At: On Sun, Aug 13, 2023 at 8:52=E2=80=AFAM Emanuel Berg = wrote: > Drew Adams wrote: > > >>> But similarly, if you try just ["abc] or ["(abc] then > >>> you'll run into the same group-didn't-end > >>> (no-matching-delimiter) behavior. > >> > >> There should be no incorrect commands, if there are there > >> will be people using them "incorrectly", if you will. > >> But if every command work everywhere none of that can > >> happen, right? > > > > What do you think is incorrect in the examples given? > > When you ask Emacs to go forward in such a way as to take > > into account balanced delimiters such as parens, then if it > > doesn't find a closing delimiter that matches before the end > > of the buffer, it tells you that. Seems like the right > > behavior, to me... > > No, that would be the way to do it, if there is no notion of > symbolic expressions, one would fall back to some other > behavior, preferably something not to far away from both the > name of the function or the usual way it is used in practice, > i.e. what would be thought to be expected to reflect that in > the supposed sexp-less setting ... > > So either one would have a small set of functions that would > work everywhere, but differently depending on the context, > _or_ one would have a huge, always growing set of functions > and every one of those would work in one and only one > context ... > > Would it not help to have a selectable behaviour: - by default the end of a balanced expression expects inner expressions to also be balanced (ignoring nested comments) - another mode would try to match the starting character to the matching end character, ignoring comments and unbalanced/partial expressions made of other characters. So by default: - [ ( ] : would find an unbalanced () and would not find ] - as it behaves now - [ ( { } ) ] : would match fine But when operating in that other (new) "mode": - [ ( ] : would match '[' to ']' regardless of the characters between them, even if there is an unbalanced expression - [ ( { } ) ] : would match any of the 3 balanced pairs. It might be useful to have that other mode. For example: I often have to identify an area of code (in any programming language) that needs to be looked at or changed, or whatever. For that I often write 2 comments surrounding the code area. If the second mode worked as described above, I could write a starting comment like /* [ Beginning of the area */ And later the end comment : /* End of the area ] */ And then I could select the entire area between the '[' in the first comment and the ']' in the last comment with this matching command, regardless of the content of the code, even if that code has unbalanced arrays. --=20 /Pierre