From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Proposed extension of show-paren-mode: Highlight parens when point is in L or R margin. Date: Thu, 16 Oct 2014 10:37:56 -0400 Message-ID: References: <20141011134312.GA4148@acm.acm> <20141012100416.GC3148@acm.acm> <20141015091208.GA3093@acm.acm> <20141016095326.GC3421@acm.acm> <20141016133137.GE3421@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1413470301 12714 80.91.229.3 (16 Oct 2014 14:38:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Oct 2014 14:38:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 16 16:38:15 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XemBx-0001Ip-El for ged-emacs-devel@m.gmane.org; Thu, 16 Oct 2014 16:38:13 +0200 Original-Received: from localhost ([::1]:50722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XemBw-0001vU-C8 for ged-emacs-devel@m.gmane.org; Thu, 16 Oct 2014 10:38:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XemBo-0001vL-At for emacs-devel@gnu.org; Thu, 16 Oct 2014 10:38:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XemBi-0001Lm-39 for emacs-devel@gnu.org; Thu, 16 Oct 2014 10:38:04 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:8285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XemBh-0001Lf-Vg for emacs-devel@gnu.org; Thu, 16 Oct 2014 10:37:58 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNFxKjo/2dsb2JhbABZgwY7gw/APYEXF3SCJQEBAQECAVYjEAsOJhIUGA0kiAQIDdIMF456B4Q4BJoBjxiBaoFxgVsh X-IPAS-Result: ArYGAIDvNVNFxKjo/2dsb2JhbABZgwY7gw/APYEXF3SCJQEBAQECAVYjEAsOJhIUGA0kiAQIDdIMF456B4Q4BJoBjxiBaoFxgVsh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="94351194" Original-Received: from 69-196-168-232.dsl.teksavvy.com (HELO pastel.home) ([69.196.168.232]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Oct 2014 10:37:57 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0DCB685A2; Thu, 16 Oct 2014 10:37:57 -0400 (EDT) In-Reply-To: <20141016133137.GE3421@acm.acm> (Alan Mackenzie's message of "Thu, 16 Oct 2014 13:31:37 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:175459 Archived-At: >> > (defface show-paren-mismatch >> > '((((class color)) (:foreground "white" :background "purple")) >> > (t (:inverse-video t))) >> > "Face used for a mismatching paren." >> > :group 'paren-showing-faces) <-------- paren >> > ^ >> > | >> > point >> Ah, so now your periphery extends to the next line. > No, no, no! By the two line arrow symbol, I meant point somewhere before > ":group". Oh, I see. That seems even more weird to me. I think this one is pushing things a bit too far for my taste. I think we should stick to parens that are separated from point only by whitespace (or something semantically equivalent such as comments). And of course, it gets you an ambiguity for (defun foo () (bar)) ^ | point >> That means you get an ambiguity for .... > Oh no I don't! Just to be clear: ambiguities aren't that bad (we have them already when point is between a close and an open paren). >> >> If so, I guess we should also do it in cases such as: >> >> foo(blabla); >> > Hmmm. Maybe. >> OK, sounds good. There have already been requests for that kind of feature. > OK. How about showing the paren (and its match) when > (i) point is touching the paren, and is either outside it (current > implementation), or inside it (new feature), with an "outside" taking > prioirty; Sounds good. That's the feature requested in http://stackoverflow.com/questions/25648067/emacs-matching-parenthesis-when-cursor-is-on-closing-parenthesis > (ii) point is in the periphery and there is a paren at an extreme edge > of the core, one at the nearest (to point) edge taking priority (already > implemented)? I think we should only consider the extreme edge of the core that's closest to point. Stefan