From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#14395: 24.3; [PATCH] new feature smie-highlight-matching-block Date: Thu, 16 May 2013 13:51:12 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1368726728 29731 80.91.229.3 (16 May 2013 17:52:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 May 2013 17:52:08 +0000 (UTC) Cc: 14395@debbugs.gnu.org To: Leo Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 16 19:52:06 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Ud2LV-0000F2-5M for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 May 2013 19:52:05 +0200 Original-Received: from localhost ([::1]:51339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ud2LU-0002cZ-QZ for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 May 2013 13:52:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ud2LM-0002be-BM for bug-gnu-emacs@gnu.org; Thu, 16 May 2013 13:52:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ud2LH-00028y-JH for bug-gnu-emacs@gnu.org; Thu, 16 May 2013 13:51:56 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ud2LH-00028s-EG for bug-gnu-emacs@gnu.org; Thu, 16 May 2013 13:51:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Ud2LR-0005mb-Ut for bug-gnu-emacs@gnu.org; Thu, 16 May 2013 13:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 May 2013 17:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14395 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 14395-submit@debbugs.gnu.org id=B14395.136872670022193 (code B ref 14395); Thu, 16 May 2013 17:52:01 +0000 Original-Received: (at 14395) by debbugs.gnu.org; 16 May 2013 17:51:40 +0000 Original-Received: from localhost ([127.0.0.1]:47687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ud2L1-0005lo-Sg for submit@debbugs.gnu.org; Thu, 16 May 2013 13:51:40 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:65333) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ud2Kv-0005lW-Sw for 14395@debbugs.gnu.org; Thu, 16 May 2013 13:51:34 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFG4rwb8/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJC6HcAbBLZEKA6R6gV6DEw X-IPAS-Result: Av4EABK/CFG4rwb8/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJC6HcAbBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="12980637" Original-Received: from 184-175-6-252.dsl.teksavvy.com (HELO pastel.home) ([184.175.6.252]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 16 May 2013 13:51:08 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 8554663364; Thu, 16 May 2013 13:51:12 -0400 (EDT) In-Reply-To: (Leo Liu's message of "Fri, 17 May 2013 00:06:23 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:74336 Archived-At: >> I think the `remove-hook' should be done within the body of the >> smie-highlight-matching-block-mode minor mode rather than here. >> In here, you just need to wrap the add-hook within a test of >> smie-highlight-matching-block-mode. > But the post insert hook is buffer-local. I know, but removing it where you remove it has mostly no effect (it's normally run from a major-mode body, so all the vars have been set back to their global value). > Seems too much trouble to find all of them and remove-hook. That's fine. But doing it where you currently do it is a waste. >> BTW. Is there a non-SMIE version of "highlight-matching-block-mode", >> which does it for parentheses? If yes, maybe >> smie-highlight-matching-block-mode should integrate into it. > I am not sure there is. Doesn't show-paren-mode do that? >> One more thought, maybe you were right that futzing around with >> add/remove-hook is too complicated and it's easier to check a variable. >> But then maybe smie-highlight-matching-block-mode should set >> blink-matching-paren to nil (which brings us back to whether there's >> a global highlight-matching-block-mode working not just for modes using >> SMIE). > Maybe checking smie-highlight-matching-block-mode in > smie-blink-matching-open is the better solution because > post-self-insert-hook is buffer-local. OK. BTW, feel free to commit your current code in the mean time. Stefan