From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Question: add-face-text-property for 'font-lock-face? Date: Sun, 29 Aug 2021 19:50:44 -0400 Message-ID: References: <945E4D23-3D8C-45AB-9C10-992638A30607@gmail.com> <00793DAF-B978-4857-AF5F-60F9C79B2BE0@mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7982"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Yuan Fu , Emacs Devel To: Qiantan Hong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 30 01:52:01 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 1mKUan-0001pF-0A for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Aug 2021 01:52:01 +0200 Original-Received: from localhost ([::1]:46112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKUal-0002KK-3e for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Aug 2021 19:51:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKUZh-0001ac-AZ for emacs-devel@gnu.org; Sun, 29 Aug 2021 19:50:53 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:11648) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKUZc-0006U4-CK for emacs-devel@gnu.org; Sun, 29 Aug 2021 19:50:52 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2587A80A79; Sun, 29 Aug 2021 19:50:47 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DA15F8084B; Sun, 29 Aug 2021 19:50:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1630281045; bh=1F9y5dFSpa8B+iIH11o7XqKzbfaeG2K9h2LGpD28nYI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=UxF0Q0hBVbKlA505oZYaprDjdnNE5RBIy64719UO4jy2TTZlYYANrtQ19mi+SZsuv IE4r7T7hD30JTbJac/9UJCGDI5oi7cER2nj4dw11lS3EzKZ8wjcbq5stL2mSUg7+sB Lc35huwLJndv/jIqjcCkd5QQ3Sr2ZTHVCVVhqvBQEV5qw+0bJaBMdb47UcBP0TkwA6 3xxOrs5z2VT30j6RGCPBh8nrDOKEN3LhEGnpnZNOUo6pbUN67Y+AnYkQb32PNKAV82 JV7xmFITibsIU5TY0pBKLa0HCfXGUMrjFb05rmmXOEFt9eNf8KIAn+d8od+YE0Y1jG G5sjiPj2FLrJA== Original-Received: from alfajor (unknown [104.247.244.135]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9E4F8120315; Sun, 29 Aug 2021 19:50:45 -0400 (EDT) In-Reply-To: <00793DAF-B978-4857-AF5F-60F9C79B2BE0@mit.edu> (Qiantan Hong's message of "Sun, 29 Aug 2021 04:47:11 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=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:273444 Archived-At: > its author. The naive way that create an overlay for each character > clearly doesn=E2=80=99t work (text property however works, because Emacs = itself > always merge them). We would need to look at overlays around the insertion > point and opportunistically merge them. IIRC we have pretty much exactly that need in outline.el where we use overlays to put an `invisible` property. See `outline-flag-region`. AFAICT this code currently doesn't try and merge overlays upon insertion, but it shouldn't be hard to add that functionality. Stefan