From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Herman=2C_G=C3=A9za?= Newsgroups: gmane.emacs.devel Subject: Parenthesis matching should consider the kind of parenthesis during pair-search Date: Mon, 12 Feb 2024 12:49:03 +0100 Message-ID: <87r0hh6g1d.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19485"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 12 13:09:58 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rZV8H-0004qL-Sv for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Feb 2024 13:09:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZV7M-0001Ew-Ph; Mon, 12 Feb 2024 07:09:00 -0500 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 1rZV7K-0001Ei-LU for emacs-devel@gnu.org; Mon, 12 Feb 2024 07:08:58 -0500 Original-Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZV7H-0007iY-NI for emacs-devel@gnu.org; Mon, 12 Feb 2024 07:08:58 -0500 Original-Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-55f50cf2021so4012185a12.1 for ; Mon, 12 Feb 2024 04:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707739729; x=1708344529; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=12ws5PC6HWLv7dLEMRQysmC5rEBrqAC8ZTJpA7p66+w=; b=CQ9tG7dvuERGPJdJWiRIcKnJjlJ0YByCrZ/GwCk1qLC9ZHkvTezFgy4L9GUMhnHt8Z gAGOtDgymhMwKmJydZUH3EW+5dYVuMVSKGTfzmJ6tDqGXcVKhzbA7QFDuHQfSYcK8zSo R1B8UmuR6biXsuDbniEFvW10xtOQT5zDEgdRWYzTWAmqFrqTQJQyTRnp6JxlZrgdx38x edq1MAXASeMJIDWeNDAIC96za0qYLYiRDIEORs49vkvSyfKTFVTaNe+cckLS5+kwpVWC wcmVDZ9jhhObEviAx1LBHm2r6Q37rAuz+ohidiEjXup5IV6W3m3L8X8sutN8PTWuhA8R EoUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707739729; x=1708344529; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=12ws5PC6HWLv7dLEMRQysmC5rEBrqAC8ZTJpA7p66+w=; b=NEPHEMjcicasqIMRb3yEauixSWAxGB/p7rs+oywQapNVBWl78MaN6FjN4B1jIThMGw QNj3/VvPiDRqnelxeYcqX5r+d/9TS77mlbIMUc6xX6Zp8Ksk+GDbafmyIAwd0cwqf7kG /dp5csP7AtzlL0UnqgfitlfaXbpfMRyzTR3OzTaD6xyuGOJGPJeLsQUgJ27NTzrYCtX5 BaPJ4584GEbGjmxDqUorgm/vTgFpQRNFYpVxPOXFPjofNbhs6C5tRdmtkZnzo67TDu6c LizUCWHECQMexKIRAaqCz+laPSD9A2n/RcD+zQJJWeIx/QqPFyibrxKe6mrO2wNANg1Y bEug== X-Gm-Message-State: AOJu0YyRSX0qjeV5j8v4UwLvyzWqNRQ4+kbJ3Dza7WhBiao6l07UA7dU VpNPnQa50oEAMPdSqCZ4LcgqK5Myphdr99z8GB17P2AwnsGOjaIH5kPaRL5+ X-Google-Smtp-Source: AGHT+IHCBkq1lhEmuWNnar3Fpo6w4J8PTezssljK0nXLIF53J7V0ML1tOOcSBIZUZ5Wax2X4XVAQ/A== X-Received: by 2002:a17:906:a44b:b0:a3c:908b:4d77 with SMTP id cb11-20020a170906a44b00b00a3c908b4d77mr2187373ejb.69.1707739728644; Mon, 12 Feb 2024 04:08:48 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWRuzZY4zUVyV5qf0BGVvdl2KMy1yJJN7kMjylPwhtkdzBWZ/MEOTZcY8mJDiFh9ElbOShVRpEFfr8WoOzn4gU0xLarik4= Original-Received: from localhost (netacc-gpn-4-245-216.pool.yettel.hu. [84.224.245.216]) by smtp.gmail.com with ESMTPSA id g24-20020a170906595800b00a3c2e7dbcfdsm155534ejr.12.2024.02.12.04.08.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 04:08:48 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=geza.herman@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 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, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316126 Archived-At: Hi all, Emacs parenthesis matching works differently than I'd have expected (what show-paren-mode shows). As I understand it, it searches for the matching pair by not considering the kind of the parenthesis (no matter whether it's a curly/square/etc bracket). And after it found it, then it considers the kind, and if there is a mismatch then it is shown in red. Usually this is not a problem, because parentheses come in pairs which are usually nested. But if this is not true, then Emacs works unexpectedly in my opinion. See this Makefile example: "$(info })" (this prints a } to stdout). In this case, emacs shows } as the "matching" pair of the (. And as the kind doesn't match, it's a mismatch. But I'd have expected that the pair of ( is the ), and } doesn't have a matching pair (because this is what actually happens in this example). What do you think, shouldn't Emacs consider the kind of parenthesis when during searching for a pair? (in other words, it should ignore all other kinds of parentheses when it searches for a pair) Thanks, Geza