From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Q: Invisible text spec + define minor mode macro Date: Wed, 21 Apr 2021 12:02:53 +0200 Message-ID: References: <871rb4x8uj.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8182"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) Cc: emacs-devel@gnu.org To: Joost Kremers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 21 12:04:32 2021 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 1lZ9ih-00022n-Sr for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Apr 2021 12:04:31 +0200 Original-Received: from localhost ([::1]:52290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZ9ig-0005hN-Uz for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Apr 2021 06:04:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZ9hI-0004oE-F8 for emacs-devel@gnu.org; Wed, 21 Apr 2021 06:03:04 -0400 Original-Received: from mail-am7eur06olkn2104.outbound.protection.outlook.com ([40.92.16.104]:33088 helo=EUR06-AM7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZ9h8-0006ko-Ul for emacs-devel@gnu.org; Wed, 21 Apr 2021 06:03:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P0T9uOzFdl2y6jso+VI9vF1Fi/kqGJrsGp7RB+YYz5UvZ6jMlHyXpQSQ63usnsj5BzuXZsnpNtZRsHDXntZcm8yzIoSX7wjnUFXDjRTFbZf5zu4ziGFKmIGZ/4gJoL/iQRSTbAVb9OOpdt8uTJHYo6xuV9UR2HsOzI4EM3lCJ5Ox1CovU3gnLIsDQMPzZkCWORadb29S7KDwl21Xr5asZguNH1EhCo1ef5AoiC+3g0v7NOUVUTTUaQ0/3w2AjUPabxbBGd+7CIvIirlckCylFa3at76a9+CrEWC66c+9xYGWNJcbwhVE9bkFWW1FgkQm7DJR7YlHtGY4PsvZt+74fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T2CJ8yiPGyInD4t4837trmn6vLnoPfdn7cH9od1r5hQ=; b=NP9BwL26ihbFpdhD13HFOLEY5iXAb9mTRxinI07aUHzKLzxqmMTr35x3RKNNXIiyBTnCq82Iub5gdobWKB5FZ4uL+l2GaHPGUYRwVHPSJASWI8J8ppqvAGi1BJ22BRRNVn899eiBm3fwNa+GOSboTdIHUjNbVajOJeaXKJloIcftjvP3nbvwwcn0HdyODkFqnhqHAUnvRgfi3a49GQ3XRxGbARFUmYjxnwVCTE+jItJ46N1WmtD12vs/oRXwJKaaLfv/kGDoxIaolQUIzVV8zWD6x6HrstIHu3Hl8ixF/nNGxyCmwQ5QFoSc0OKP3qoFs4RJgjTcLQF2fpbyUY3hEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T2CJ8yiPGyInD4t4837trmn6vLnoPfdn7cH9od1r5hQ=; b=eMBxtBzOSNk7dDcwKzhMTtos3wVhrCYyUaankliNLIDL6dDLp8kuX4ukJ7/p1oWgORVixTDydg7SI7ZNeNqaL/YRP+2fHuGhUyMsRmyFFnOgtRTfcWnONTBseMUhxASxni5NeF0xHJ84nxJ40spk5Zzb2ynkkgO0jVJO0MI3L4OlC0dtqz5Rp7dg+ZnwPSPY/vP9YsQ6ByXhv3bvSn1EC7mNL4RYi2GTStLTNWLLIF5DES+sghwwbGBLlPuB6qOeEBIroLslBCiBddSp38mKqEbdb6DHFXdRuuk8EPCf0ZSjnvsAegk2lRUoahxqtft0d/H4cCS7cAxG0qvUmjId2Q== Original-Received: from AM7EUR06FT031.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::46) by AM7EUR06HT262.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::320) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Wed, 21 Apr 2021 10:02:52 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc36::50) by AM7EUR06FT031.mail.protection.outlook.com (2a01:111:e400:fc36::374) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21 via Frontend Transport; Wed, 21 Apr 2021 10:02:52 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:8A3CDDC1EA8429F023ACBC57863E46BA1FA3429A2727747FBB8219E0277BA48E; UpperCasedChecksum:E85EA98D1AE510926055AD37E05E87ADFEC53CD26C43159F947AA2B28BA9804B; SizeAsReceived:7481; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b%6]) with mapi id 15.20.4042.024; Wed, 21 Apr 2021 10:02:52 +0000 In-Reply-To: <871rb4x8uj.fsf@fastmail.fm> (Joost Kremers's message of "Wed, 21 Apr 2021 11:36:10 +0200") X-TMN: [zSDxPRdRnUXSo2KoYBblrbRQBSJj/ekq] X-ClientProxiedBy: AM6P192CA0075.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::16) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <82pmyoneeq.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from HP-Laptop.homepc (81.232.177.30) by AM6P192CA0075.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.20 via Frontend Transport; Wed, 21 Apr 2021 10:02:52 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 7c5aeee8-fc2b-4e74-383b-08d904aca08a X-MS-TrafficTypeDiagnostic: AM7EUR06HT262: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gVybGDqxgjCqejN+qvJ6BslV3PC78Ze5VV4ldCB0EsL1yyICZhVVBVQJDFMl7r+lOHqQtVAOhlZd2zpB3PepQvTwogRgNPWKumwV2HIMjwIXAQZ5KbkMX903hyL8fa0cjJLKaSXywJVxpCxqMP8xU35qG3rE7qIpbYfk3j4KzR724Qj1avFwRlZVxF0JcdOq4gWG+o07bbENkvGEdFh9FgAo24BIhu6y/7f6uNJdxQ4mEaoh82EgIESLs9B33nzCsqmCogDpVLGVrlT47/6PE/phchMYfCdHhlNcvjDP89mNy6cTiy1y+FbaJN95V03zCXHBDuUsCWNK8y3JaFlRqdFi8QlwQf8CviQbhs+W7Pm0SCoO67BoQxNFEty2NpDvLv2UEv8TnKoHDIBe2NZfDQ== X-MS-Exchange-AntiSpam-MessageData: UUHq+YmymtzeqF3xF8KuNWrMEWGvQaQHO7/bnitcUipgolz1/akvoxDl1hn1wuSI9iuo9tmf/YEMCRwPcq8Dv55EfMLBoUHyj6g4RNBAvjEKW+Jr/6fS356mI3xLUVXlRdv/BtD8JDg1Ue7QjdnjwA== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c5aeee8-fc2b-4e74-383b-08d904aca08a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2021 10:02:52.6672 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT031.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7EUR06HT262 Received-SPF: pass client-ip=40.92.16.104; envelope-from=arthur.miller@live.com; helo=EUR06-AM7-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:268226 Archived-At: Joost Kremers writes: > On Wed, Apr 21 2021, Arthur Miller wrote: >> I am not sure what is going on here. I have this minor mode defined, >> as shown yesterday, where I just iterate through a buffer and try to >> make certain lines invisible. > > Wouldn't it be easier to use the font lock mechanism for this? That way, you > basically only need to worry about getting the regexp right. Finding matches, > updating the display, etc. is all handled by Emacs. > > The `invisible' property is not normally handled by font lock, I guess, but > there is a variable `font-lock-extra-managed-props', which, by the looks of it, > should be able to remedy that. > > Mind you, I only understand the basics of the font lock mechanism and I haven't > tried this, so it's possible this is a silly suggestion. It's just the first > thing I'd try... I don't think it is a silly, but I think it would be more complicated. I don't know to be honest, I am not so acquinted with font-lock mechanism and I don't wanna dive into that one. I really just need to find each #+begin|end_src which usually start at line beginning and put the invisible property to 't. That is really simple. If you check the code, it is almost trivial. I am embarassed I can't spot what is wrong there :-). The regex in the source file works. I checked, I counted all matches and got 401 for 200 src blocks. I think it should be 400, but I am good with 401 :-). But thanks for the suggestion anyway.