From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sergei Lebefev Newsgroups: gmane.emacs.help Subject: HideShow.el configuration for a custom Major Mode Date: Mon, 5 Apr 2010 15:47:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9e159855-ecea-46d4-92f5-100f9f75a505@q15g2000yqj.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1273003476 29328 80.91.229.12 (4 May 2010 20:04:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 20:04:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 04 22:04:35 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9OLu-0003OA-Ms for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 22:04:33 +0200 Original-Received: from localhost ([127.0.0.1]:40248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9OLo-00024O-P3 for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 16:04:16 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!q15g2000yqj.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: 93.181.246.162 Original-X-Trace: posting.google.com 1270507637 17116 127.0.0.1 (5 Apr 2010 22:47:17 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 5 Apr 2010 22:47:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q15g2000yqj.googlegroups.com; posting-host=93.181.246.162; posting-account=-1kA_woAAACqD2nSiHPcFd2kGWR-l3rw User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.8 Safari/533.2,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:177648 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:73121 Archived-At: Hello, I've been making a major mode for a small language called Io. The language syntax is pretty simple, since everything is an object and every construct is a method call. But strangely enough i've ran into some weird problems with hs-special-modes-alist. Here's an example of the code I need to fold: SomeObject := Object clone do( someMethod := method(a, b, c if(a, b println , c println ) ) ) According to hideshow documentation, i must define the start-end regexp pair for the mode to work. So I came up with the following: (unless (assq 'io-mode hs-special-modes-alist) (add-to-list 'hs-special-modes-alist '(io-mode "(" ")")) It was working okay, except for one detail - it folded all off the parenthesized expressions. All of my attempts to make it fold __only__ method(...)'s failed. Here's what I've tried: 1. A different start regexp: "method(" and "method" - both doesn't fold anything 2. Advising hs-hide-block - only top level block got folded, regardless of the point position and contents of the advising function. So the general question is: is there a way to make HideShow hide only the blocks i need? Or how to prevent it from hiding the blocks i don't want to be hidden, "if()" for instance. Thanks, Sergei.