From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Finding and fixing the missing brackets for tcl script with Emacs. Date: Thu, 14 Jan 2021 21:34:12 +0800 Message-ID: References: <20210114112206.GB17831@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4467"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 14 14:37:34 2021 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 1l02of-0000xy-MV for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 14 Jan 2021 14:37:33 +0100 Original-Received: from localhost ([::1]:33206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l02oa-0000yg-AX for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 14 Jan 2021 08:37:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l02lf-00070f-ST for help-gnu-emacs@gnu.org; Thu, 14 Jan 2021 08:34:27 -0500 Original-Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]:37580) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l02le-0004Kq-0O for help-gnu-emacs@gnu.org; Thu, 14 Jan 2021 08:34:27 -0500 Original-Received: by mail-qk1-x731.google.com with SMTP id h4so7717105qkk.4 for ; Thu, 14 Jan 2021 05:34:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=u3FdZF8hox1xoyzVQGWkjH0yNvD6DI6Et4MRfwdbt4g=; b=HX/GkDIKrT0Q044aILFZ5s2NgqKtM2SxLP8ItAnAc1KW45cFxulwO1FpDI7ixwOmlv gXCCKFAjrbB3s/yuw7XgIO5ljdyhDP6dsQMvozTWU677WKBny96z0dcUi/gzC8FgQob4 ZnRLB9u0i2G4SZHkar7lfxO+aPhaK2J5se2LHHvhLbLwmr1tj9UMaeCZA6WxHEBIVfPr tb0Tqeh4PLsvD7sFV1r6ev66aLrS+1aIMaCivfFJivH/xXp83KL4NuK4K+CK0A00OGgA jt/vo8ulM6S/GHc/iPCC/OZGmYhXU/fZ3+wWDkORJhEo++2Xfs9gspUx/30M+s/o2Sq2 eFLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=u3FdZF8hox1xoyzVQGWkjH0yNvD6DI6Et4MRfwdbt4g=; b=k/21vDdWzfM8lD8iVpjYjoHml3ZBSTfGdlWqVfwpmiNwpD2hO2yUDTrCbngZUmYoh3 m7I/4iK4P2/ms+3hboOIJmD+uhPPq4lBWWZ+MCqJvb9/jN1X8KzY6/KEadUIylpm5Hw6 YLAJm0qY8Z71ZyxSpfAtTdfOstS5nF72nm+qPOiEI80SR3o+6U50bRvppHCD+MhAi3eh wXje4Yoza/0qXhAYxO/Dhlhn52TJBzl/GEXKMSjG3yXiGs1vgzVDZquhocCyTPAdydJ2 0p+8NelwzsI+JSSAr8Q5pZJzOaUhuP4g0GXOgx21/bN855txHmjwAeH54VQXVpNzFjGt IymQ== X-Gm-Message-State: AOAM531vBYDkDlMTMPSqxyhGmTUKKtM3Y+ovm/kjF+VrnQGk51sH74iz 6oTrQlmNWrJfQ43ewXxrsgDKUU1HIATNjwfIUI+1+pKCi7XaOe9F X-Google-Smtp-Source: ABdhPJzJ0kgjJdJniL5VwPPVMEMqjy+trGoT9iMFcTROe73S0VfJMe3wuNeLIPhEiqwvTCksXdbPvg5IzTDMtwsDMN0= X-Received: by 2002:a25:1386:: with SMTP id 128mr10202480ybt.374.1610631263344; Thu, 14 Jan 2021 05:34:23 -0800 (PST) In-Reply-To: <20210114112206.GB17831@tuxteam.de> Received-SPF: pass client-ip=2607:f8b0:4864:20::731; envelope-from=hongyi.zhao@gmail.com; helo=mail-qk1-x731.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.23 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" Xref: news.gmane.io gmane.emacs.help:127239 Archived-At: On Thu, Jan 14, 2021 at 7:22 PM wrote: > > On Thu, Jan 14, 2021 at 06:30:20PM +0800, Hongyi Zhao wrote: > > See the following TCL script snippet: > > > > --- > > set sendcmds [lmap l [split [string trim $sendcmds] \n] { > > if {[regexp {^\s*#} $l} continue > > string trim $l > > }] > > --- > > > > In the above code snippets, two close brackets are missed. But finding > > and fixing this sort of error manually is indeed a tedious and > > laborious job. Can Emacs help me find the right spot and fix the > > problem quickly for this scenario? > > I'm assuming you use Tcl mode. > > I don't know what kind of help you expect. There are several > possibilities. Among them, I use paren minor mode (enable it > with M-x "show-paren-mode"), which highlights matching parens > and shows you another colour when there is a mismatch. > > This can't be perfect, especially in a language like Tcl (I > don't know whether paren-mode "sees through comments", as > the Tcl parser does -- an uncommon choice :) > > There is a whole section in the Emacs manual dedicated to > this: > > "26.4.3 Matching Parentheses" > > or, on the Internet > > https://www.gnu.org/software/emacs/manual/html_node/emacs/Matching.html Thanks a lot for your information. I find another more powerful package which seems to be dedicated to this kind of work, see for more detailed info. I'll give it a try. Best -- Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Polytechnic University of Science and Technology engineering NO. 552 North Gangtie Road, Xingtai, China