From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#35689: Customizable char-fold Date: Mon, 24 Jun 2019 23:40:17 +0300 Organization: LINKOV.NET Message-ID: <871rzi7owu.fsf@mail.linkov.net> References: <87imug8z4i.fsf@mail.linkov.net> <8736lj3dgm.fsf@mail.linkov.net> <87mujrh0uv.fsf@gmail.com> <87o9466z1t.fsf@mail.linkov.net> <87d0kmgfrp.fsf@gmail.com> <406F1DF2-CB22-441F-B3E2-19770425322A@gnu.org> <87d0kkyesr.fsf@mail.linkov.net> <85v9ya1mng.fsf@gmail.com> <87zhnmgntu.fsf@mail.linkov.net> <87y32zwmtf.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="136355"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 35689@debbugs.gnu.org, npostavs@gmail.com To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 24 22:49:34 2019 Return-path: Envelope-to: geb-bug-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 1hfVu9-000ZIv-IC for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2019 22:49:33 +0200 Original-Received: from localhost ([::1]:54632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfVu8-0005Hp-6J for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2019 16:49:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39315) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfVtt-0005FZ-1z for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 16:49:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfVtj-00087p-Sj for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 16:49:11 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44617) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfVtg-00082a-5C for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 16:49:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfVtg-0004E6-0q for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 16:49:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jun 2019 20:49:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35689 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35689-submit@debbugs.gnu.org id=B35689.156140928816162 (code B ref 35689); Mon, 24 Jun 2019 20:49:03 +0000 Original-Received: (at 35689) by debbugs.gnu.org; 24 Jun 2019 20:48:08 +0000 Original-Received: from localhost ([127.0.0.1]:58158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfVsm-0004Ca-0S for submit@debbugs.gnu.org; Mon, 24 Jun 2019 16:48:08 -0400 Original-Received: from black.elm.relay.mailchannels.net ([23.83.212.19]:34380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfVsi-0004CP-JE for 35689@debbugs.gnu.org; Mon, 24 Jun 2019 16:48:06 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 29CC38C093F; Mon, 24 Jun 2019 20:48:03 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a62.g.dreamhost.com (100-96-87-96.trex.outbound.svc.cluster.local [100.96.87.96]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 6DDE78C1666; Mon, 24 Jun 2019 20:48:02 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a62.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Mon, 24 Jun 2019 20:48:03 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Army-Vacuous: 678be9661f7ee472_1561409282986_4143989842 X-MC-Loop-Signature: 1561409282985:1893293229 X-MC-Ingress-Time: 1561409282985 Original-Received: from pdx1-sub0-mail-a62.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a62.g.dreamhost.com (Postfix) with ESMTP id 9ACC581EE8; Mon, 24 Jun 2019 13:47:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=q3caXctZlYdOqAS8UVz7uXSEAZQ=; b= QuzLIDn9VYxe/A0hpoyikcTpxEn/IK+L05lcugSF8CvsSnjPPowJ63bJcd3b+vl+ DJiMFUHJ8ApSxRUSuLBgAI0HxpWk5IzE2ppPM/VDFAal+PlKS3Sadfqy5hQdzek2 P3gzqwsyjXZ+lPCMPtEiJHLamVh5vz0gIdg8KLkbQ1c= Original-Received: from mail.jurta.org (m91-129-109-209.cust.tele2.ee [91.129.109.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a62.g.dreamhost.com (Postfix) with ESMTPSA id B240E81DCE; Mon, 24 Jun 2019 13:47:53 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a62 In-Reply-To: (Lars Ingebrigtsen's message of "Mon, 24 Jun 2019 19:33:45 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddruddvgdduheejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdelrddvtdelnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtledrvddtledprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehlrghrshhisehgnhhushdrohhrghenucevlhhushhtvghrufhiiigvpedt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161285 Archived-At: >> +(defcustom char-fold-symmetric char-fold--symmetric-default >> + "Include symmetric mappings from composite character back to base letter." >> + :type 'boolean >> + :initialize #'custom-initialize-changed >> + :set (lambda (sym val) >> + (set-default sym val) >> + ;; FIXME: Maybe delay this until after-init-hook, >> + ;; to avoid redundant calls to char-fold-make-table. >> + (setq char-fold-table (char-fold-make-table))) > > OK, here's an uninformed suggestion -- instead of doing all this to > ensure that we have an updated char-fold-table when the user changes > these defaults, why not call char-fold-make-table when needed? > > That is, instead of the char-fold-table variable, you'd have a > char-fold-data, which could be, say, something like this: > > (defvar char-fold-data :uninitialized) > > `char-fold-to-regexp' (and others) would then start with a call to > char-fold-update which would > > be > > (let ((new (list :additional char-fold--include-alist-default > :exclude char-fold--exclude-alist-default > ...))) > (unless (equal char-fold-data new) > (setq char-fold-table (char-fold-make-table) > char-fold-data new))) > > or something along those lines. That is, check whether anything has > changed, and if not, do nothing, but if it has, recompute? Thanks for the idea, I'll try to use such composite value to detect updates in one of three variables.