From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Question: add-face-text-property for 'font-lock-face? Date: Mon, 30 Aug 2021 16:22:52 +0800 Message-ID: <87v93n1gv7.fsf@localhost> References: <59E4B9A5-6C95-4A21-BE95-B071E90EA892@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="26133"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Devel To: Qiantan Hong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 30 10:23:08 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 1mKcZQ-0006ZA-6o for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Aug 2021 10:23:08 +0200 Original-Received: from localhost ([::1]:55586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKcZO-0004WJ-LQ for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Aug 2021 04:23:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKcYS-0003q1-1w for emacs-devel@gnu.org; Mon, 30 Aug 2021 04:22:08 -0400 Original-Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:44555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKcYQ-0003s7-Ir for emacs-devel@gnu.org; Mon, 30 Aug 2021 04:22:07 -0400 Original-Received: by mail-pl1-x632.google.com with SMTP id e1so8075353plt.11 for ; Mon, 30 Aug 2021 01:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=c4+ZWEPLUye4o2ydasFliZdOjD0M/XrlvzfDXyJvDoY=; b=pgN3tYgWCu4YXgdj0ObwRvFRyPV4eao5CdXZPtcGocrFn4/2endCHxsDkuqtvbHCAT qLIdHKywCmeloZSDny9Sz6wkzAju7qDZhKs2MysyuFLkrT3qs3JoMsYBRjnnruZ2uWEo 1q1INHycny5+F/FHuxRZPG4AAcclBYE+eFKkncl7o7AsZ8AljZUUq/Ajzcu8k7Y8F9Z4 8J7XkW16C1AC+4e0dzO2fPIlFb4vvmqJxjk9s0J0PYMm1pq8QEwkKy2NmafSSHoSzfqp T4cjlOeEyfGe9oCcYKSRptPZFm8VzUAetfa9W4pSLLeFdJCI+7J80wM9R85z7iu7W19Y hcww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=c4+ZWEPLUye4o2ydasFliZdOjD0M/XrlvzfDXyJvDoY=; b=Q5QmZ9xHmtmDja2FkwQ3z7fgUqGkp8wzMpCJzJqjrR3MxsmVs9iydOug3HBCv3RYvw yHmvN7V14IgUlMXxYjmrBVgDZPCVed1H+SWSnWBieLAcrxqp0bEzCcoYGzpgZJXXavhu qxc0a0Ehb3DM1bGB4x7R9jL4XsGyq43AqcJesdOzWnOWiavRaReMaH1Kls1A6D2IcLkW uRzBMjh6xSfDfZ3cwS1W/E0tXQEGYIfeEuobZvGCY/7OnFZWfJ5Sx26yAN6sd9aIK6Z3 WU24uxJA4DkIYPn3Ss3xVl2XPUbecV6MgzSK5URQudY04fCRPoytUD+hjqhroqhzwyuF UzHg== X-Gm-Message-State: AOAM532J3i+qAV9sy/1mXsydhShTkIPJT+H2p7AiKFxmohWRu4lFoofO HSJlqtD9OwiVc+/OIKB1bY3HtVNw8dizIuFX X-Google-Smtp-Source: ABdhPJxpE3njkbs5Q7zFuzlQA74gQUvQSfWMLysHIAlvvih4BhQO1S8vaMgRRtzcarctQDpNGhSAkw== X-Received: by 2002:a17:90a:1a12:: with SMTP id 18mr29188170pjk.113.1630311725146; Mon, 30 Aug 2021 01:22:05 -0700 (PDT) Original-Received: from localhost ([206.190.157.238]) by smtp.gmail.com with ESMTPSA id q26sm14051742pff.174.2021.08.30.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Aug 2021 01:22:04 -0700 (PDT) In-Reply-To: <59E4B9A5-6C95-4A21-BE95-B071E90EA892@mit.edu> Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=yantar92@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:273470 Archived-At: Qiantan Hong writes: > That=E2=80=99s an option, but I=E2=80=99m worried about performance becau= se crdt-visuallize-author-mode > need to color code the whole document and that might be too many overlays. > Maybe one can lazily create overlay for visible part only but I feel like > at that point I=E2=80=99ll probably just reinvent an adhoc add-font-lock-= face-text-property in Elisp. What about hooking directly into font-lock? If you change faces as part of font-locking process, they will be properly transferred into 'font-lock-face property. Fontifying within font-lock framework will also benefit form lazy fontification when jit-lock-mode is enabled. Best, Ihor