From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Hartmut Goebel Newsgroups: gmane.emacs.help Subject: Re: Folding yaml by markers Date: Wed, 16 Oct 2019 22:33:49 +0200 Organization: crazy-compilers.com Message-ID: <368aaf47-84e7-43de-7046-1a0262b412b1@crazy-compilers.com> References: <3e45ddf0-5bb0-c065-df59-cb38285ed9cb@crazy-compilers.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="119329"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 Cc: help-gnu-emacs@gnu.org To: Robert Pluim Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 16 22:34:13 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iKpzp-000Up9-EU for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Oct 2019 22:34:13 +0200 Original-Received: from localhost ([::1]:48012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKpzn-0005a2-M1 for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Oct 2019 16:34:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41648) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKpzY-0005XP-EC for help-gnu-emacs@gnu.org; Wed, 16 Oct 2019 16:33:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iKpzW-0004l2-VH for help-gnu-emacs@gnu.org; Wed, 16 Oct 2019 16:33:56 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.10]:50562) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iKpzW-0004k9-L5 for help-gnu-emacs@gnu.org; Wed, 16 Oct 2019 16:33:54 -0400 Original-Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46tkXb3XTSz1rVDx; Wed, 16 Oct 2019 22:33:51 +0200 (CEST) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46tkXb3Gmhz1qqkD; Wed, 16 Oct 2019 22:33:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 0q-9Ev8pXsum; Wed, 16 Oct 2019 22:33:50 +0200 (CEST) Original-Received: from hermia.goebel-consult.de (ppp-188-174-63-110.dynamic.mnet-online.de [188.174.63.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Wed, 16 Oct 2019 22:33:50 +0200 (CEST) Original-Received: from [192.168.110.31] (lenashee.fritz.box [192.168.110.31]) by hermia.goebel-consult.de (Postfix) with ESMTP id 35077600A4; Wed, 16 Oct 2019 22:33:54 +0200 (CEST) Autocrypt: addr=h.goebel@crazy-compilers.com; prefer-encrypt=mutual; keydata= mQINBFJQM3oBEACiUXmMppc3+A7JpF3lPz8O/mRhfz1U6F4EOTlacTrCcm7Xg5U2JsPPNapV r5+vHnKBK+xbaX3s/A/G+SwrUZhi1X1HRnSNY1CqL8CT7rZmOtfjg4ExnOuCjie2bKhb9JKm lJ7MrNimIbNQoX1mRcQ4VMEflhyWfaPGbT73siuMkbr020ExhzW8T18JIC01SgWMULYMBXOB oGY21am/vaTFCK8bym1P4HVN8i64uOWL0agkAMHbju6SZtG2fYJ68eS3P/97bXRg1pveEdpa FgaFZhquecw4WdedwLwt1xNcjAg/p6tN73W3asEZTgMHa+iNzbJgcyhWpci09wQZfZ1uL0Hd M+ohng38ccgu9hJx6YzCN7Fe14JooKbPukG/WfClAgAzZSHRKpS4zGdGlg6D6EWayyWWoLR3 KoMA4LIIlaQbqaOhfe85b4mNgB1hqd0uRTHOah/6T+FUoSQ1IAeKLIDqj6rW7X4ISRn1CXGS LGDn2QKqR3KtU3cLf8hAeDeO7Qe1jTvLrG1Mfca8lEmC7/yN1gI7L4/cs6lhmXUgMaevuxss BxO2kkh0OS8HVFf+QQ7LZ5vt91yQVT9HVvOuVob0YtG+3rvkpMaHQilKloNoEkmMiHpwypBa IfAC6NP9smgionvvmQ5RWSEaH5/pfSUAYbqzWbqDxtqEF/mPOwARAQABtC1IYXJ0bXV0IEdv ZWJlbCA8aC5nb2ViZWxAY3JhenktY29tcGlsZXJzLmNvbT6JAj0EEwEKACcCGwMCHgECF4AF CwkIBwM In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.18.0.10 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:121662 Archived-At: Am 14.10.19 um 15:02 schrieb Robert Pluim: > Hartmut> =C2=A0(defvar hs-special-modes-alist > Hartmut> =C2=A0=C2=A0 (mapcar 'purecopy > Hartmut> =C2=A0=C2=A0=C2=A0 '((yaml-mode "[[[" "#\s+]]]" nil)))) > > You probably want to use 'setq' rather than 'defvar'. Thanks for pointing to this. Anway this does not seem to be the relevant issue. I (being an elisp newbie) learned about M-: and added the value manually. Now I'm one step further: Using (add-to-list 'hs-special-modes-alist '(yaml-mode "\\[\\[\\[" "\\]\\]\\]" "xxxx" nil nil)) I was able to add an appropriate entry to hs-special-modes-alist. Using this expression, I was able to make hs-minor-mode fold, BUT ONLY if the brackets are not part of a yaml comment. Which makes me curious! If I understand the code (line 672 in hideshow.el) correctly, `hs-c-start-regex` is st ot the 3rd paramater ("xxxx"), which is documented to be a regex for starting a comment. Thus "xxxx" should defacto disable comment detection. Yet comments are still considered. Any hints on this? The documentation for hs-special-modes-alist is at and the relevant function `|hs-grok-mode-type`|||at . --=20 Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible |