From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tpeplt Newsgroups: gmane.emacs.help Subject: Re: Matching parenthesis for long constructs Date: Fri, 10 May 2024 15:38:39 -0400 Message-ID: <87wmo1bgow.fsf@gmail.com> References: 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="15156"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Heime , Heime via Users list for the GNU Emacs text editor To: Daniel =?utf-8?Q?Mart=C3=ADn?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 10 21:39:27 2024 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 1s5W5X-0003fM-9B for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 10 May 2024 21:39:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5W4r-0004wo-SH; Fri, 10 May 2024 15:38:45 -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 1s5W4q-0004wb-Sw for help-gnu-emacs@gnu.org; Fri, 10 May 2024 15:38:44 -0400 Original-Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5W4p-000212-BR for help-gnu-emacs@gnu.org; Fri, 10 May 2024 15:38:44 -0400 Original-Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3c9708dca94so1288935b6e.3 for ; Fri, 10 May 2024 12:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715369921; x=1715974721; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yTQZ7GgCA0bD3UkDpm1yeAJXMD0LxZctX0CBLBoBqgY=; b=MEkbx+8ofUd9wJ3Ymo3YV8it4ADOiBb2y1ibkQk/wEw/DO+UbsqKTSYGjmkC/9jr67 JtwIMgqn6uCOlGe/fGe36qAxzXQDAEBnUpfqF8cXn/Ba3jGU1SJ2Mh7NH/Y2FWw8zjco alIKMUrtPt5j8yAjHCM31pk9EreHETQ6WewJoHG+9uVgfk7dZyMpUENvKvhu9QbsGtmR qQL5ubMeqFZgYMhvryVGTaPHArWGT74WpA1uzbwliKQUzH3VYPxchXCzAn7hkY7CslvI NVqvfK/BhT69+GG2DQ7BumXCyZbOmTO+v6eiBuJM72G11ybhOOAg7289pdGErj49hwsW qezA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715369921; x=1715974721; h=content-transfer-encoding:mime-version:user-agent: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=yTQZ7GgCA0bD3UkDpm1yeAJXMD0LxZctX0CBLBoBqgY=; b=p0PRAtWT6EufjRPXyaqy3x+ORJx6WH5MmEJmIv/yruE/BGpyG9QmtJB7c8Na/meY43 UcLv3DrC9DjR1+FEHF3Q9pmCiYmisjQ/u/rN1ROIzcZJXeeD96GHCC/lX0shfAi8P94j tmfOvJO5e/jJPxy8cKKK+6qGXZis7+nkRTLLldeCURyONPwCKXb2YS+ozzWgmVqZ7gWY 8UKeDFMbKJOSXPpIX3BPAhyZTKJxPa2HA/7txAnsTWyZ/MyVxnFJRXc8mWRfCFTOclVq 8WijYQCzpbpWR0h3in5r3VPq+EhpatURpFcqamIZsriCCmuf17c+bL5PjSMm8uQoHyQr hzOw== X-Forwarded-Encrypted: i=1; AJvYcCXip/wgnPh14d+vm+jGpfmq9f4GZRWQPO8By8YMSvU4LD4fLxBWO9cBlBGwsOkP4m81JtCLWxSTHNlACo4b2kBf7dv9IGzy X-Gm-Message-State: AOJu0YxGLfdpNUA2J6NAZx8M+E/AOwulFEfASBhcBmx0zp3nPoTdkrwG vdUz3H6rIrq06ZHvSB47ovujBSGnejeUX3kNtSgTqNtBUsiV8/+M X-Google-Smtp-Source: AGHT+IHbuLtwI+4NgO8Cr9MD5uD4IDlc5FKDXHaB0DOD6e0QHSSoMnRrK6O61A34t/Cw/Ow8FywYRA== X-Received: by 2002:aca:2b19:0:b0:3c9:9489:4a26 with SMTP id 5614622812f47-3c9970cf682mr3389477b6e.55.1715369921395; Fri, 10 May 2024 12:38:41 -0700 (PDT) Original-Received: from t530.local ([2600:8806:a801:3150:6232:a925:a650:ba8c]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6a15f17990bsm20053766d6.13.2024.05.10.12.38.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 12:38:40 -0700 (PDT) In-Reply-To: ("Daniel =?utf-8?Q?Mart=C3=ADn=22's?= message of "Thu, 09 May 2024 23:49:55 +0200") Received-SPF: pass client-ip=2607:f8b0:4864:20::22c; envelope-from=tpeplt@gmail.com; helo=mail-oi1-x22c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=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-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:146661 Archived-At: Daniel Mart=C3=ADn writes: > Heime writes: > >> When I have long constructs the current way that parenthesis are highlig= hted >> is not very useful because the matching parenthesis resides outside the = work >> window. Are there future possibilities or capabilities to address this ? > > If you configure the variable show-paren-context-when-offscreen to t, if > show-paren-mode is enabled, then the echo area will show the context > around the opening parenthesis when you place the cursor at the > corresponding closing parenthesis. Just so it is clear, the option =E2=80=98show-paren-context-when-offscreen= =E2=80=99 was introduced in Emacs 29.1, so it won=E2=80=99t be available to users of earl= ier versions of Emacs. Also, if you are not aware of them, there are the commands =E2=80=98backward-sexp=E2=80=99 and =E2=80=98forward-sexp=E2=80=99. (Both = of these commands have been available since Emacs 21.1.) These commands enable you to move backward and forward by symbolic expressions (sexps). So, when at the end of long sexp, you can easily move to the beginning of expression by typing the key sequence bound to the corresponding command and vice versa to return. By default, =E2=80=98backward-sexp=E2=80=99 is bound to C-M-b (and C-M- and ESC C-). =E2=80=98forward-sexp=E2=80=99 is bound to C-M-f (and C-M-<= right> and and ESC C-). These bindings are not described in the Emacs tutorial (C-h t), which contains the following: >Here is a summary of simple cursor-moving operations, including the >word and sentence moving commands: > > C-f Move forward a character > C-b Move backward a character > > M-f Move forward a word > M-b Move backward a word > > C-n Move to next line > C-p Move to previous line > > C-a Move to beginning of line > C-e Move to end of line > > M-a Move back to beginning of sentence > M-e Move forward to end of sentence Note that moving among units of text is a progression from characters (C-b/C-f) to words (M-b/M-f) to symbolic expressions (M-C-b/M-C-f). Note that with symbolic expressions, you are not limited to expressions in parentheses and you are not limited to the outermost parenthetical expression. It can be used to move among sexps at any level within a nested expression. Some packages that help with moving among sexps and editing them that are available via =E2=80=98list-packages=E2=80=99 are =E2=80=98paredit=E2= =80=99, =E2=80=98smartparens=E2=80=99, =E2=80=98lispy=E2=80=99 (as mentioned by another poster), =E2=80=98evil-sma= rtparens=E2=80=99, =E2=80=98evil-lispops=E2=80=99, and probably some others. --=20 The lyf so short, the craft so long to lerne. - Geoffrey Chaucer, The Parliament of Birds.