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: Tue, 14 May 2019 23:14:12 +0300 Organization: LINKOV.NET Message-ID: <87d0kkyesr.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="181208"; 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: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 14 22:37:18 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQeAn-000kw9-QW for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 May 2019 22:37:18 +0200 Original-Received: from localhost ([127.0.0.1]:53849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQeAm-0004TA-OR for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 May 2019 16:37:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQeAa-0004Si-5G for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 16:37:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQeAZ-0002ZT-2R for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 16:37:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36437) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQeAY-0002Yn-VT for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 16:37:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hQeAY-0004iQ-RG for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 16:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 May 2019 20:37:02 +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 X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, 35689@debbugs.gnu.org, Noam Postavsky Original-Received: via spool by 35689-submit@debbugs.gnu.org id=B35689.155786617418024 (code B ref 35689); Tue, 14 May 2019 20:37:02 +0000 Original-Received: (at 35689) by debbugs.gnu.org; 14 May 2019 20:36:14 +0000 Original-Received: from localhost ([127.0.0.1]:49973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQe9m-0004gd-D0 for submit@debbugs.gnu.org; Tue, 14 May 2019 16:36:14 -0400 Original-Received: from bonobo.maple.relay.mailchannels.net ([23.83.214.22]:54435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQe9j-0004gM-47 for 35689@debbugs.gnu.org; Tue, 14 May 2019 16:36:11 -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 0FB19142620; Tue, 14 May 2019 20:36:10 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a88.g.dreamhost.com (100-96-3-22.trex.outbound.svc.cluster.local [100.96.3.22]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 155DA1423DD; Tue, 14 May 2019 20:36:09 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a88.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); Tue, 14 May 2019 20:36:10 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Tart-Harbor: 714978c66d59264d_1557866169510_119436479 X-MC-Loop-Signature: 1557866169510:4279435080 X-MC-Ingress-Time: 1557866169510 Original-Received: from pdx1-sub0-mail-a88.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a88.g.dreamhost.com (Postfix) with ESMTP id 3B15C806C0; Tue, 14 May 2019 13:36:06 -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=E8dL92CmF5jmtDy3s2L4Dz0VLnE=; b= nXJMnAbXrZVEe73PszOl/96h/Z+nBamUKyUqetskcr7MzT1617u0TVN98usUUKlH hZKUUKe4udVllgfN2iEgRwiW9OsS+IbpjKj+rK9o3Hi+2Q3D/wgcBdxp5UxK1cA4 lGu9d99P4lBQQiX6ujAh86/XLIJ9P+9VLynZ49PTDgY= Original-Received: from mail.jurta.org (m91-129-96-230.cust.tele2.ee [91.129.96.230]) (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-a88.g.dreamhost.com (Postfix) with ESMTPSA id 30C5A806BC; Tue, 14 May 2019 13:36:03 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a88 In-Reply-To: <406F1DF2-CB22-441F-B3E2-19770425322A@gnu.org> (Eli Zaretskii's message of "Tue, 14 May 2019 09:37:14 +0300") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrleeigdduhedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdeliedrvdeftdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdeliedrvdeftddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvlhhiiiesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedu 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:159288 Archived-At: >> > Oh, right. Do you see a problem with a better patch: >> >> > +(eval-and-compile (defcustom char-fold-include-base nil >> > + "Include mappings from composite character to base letter." >> > + :type 'boolean >> > + :set (lambda (sym val) >> > + (set sym val) >> > + (when (boundp 'char-fold-table) >> > + (setq char-fold-table (char-fold-make-table)))) >> >> Looks like it could work (though I haven't tested). The docstrings >> are >> too terse for me easily follow, and they should probably include >> something along the lines of "Setting this variable directly does not >> take effect; either use M-x customize or ..." > > We don't gave defcustoms inside eval-and/when-compile anywhere else. > Do we really need this? For starters, it would defeat cus-dep.el, I think. Indeed, better to try and simplify this. The goal is to pre-compile the default char-table because its calculation is compute-intensive, and to recalculate a new value of char-table only in case when customized values differ from the default values. I can't find a standard way of doing this. So instead of using eval-and-compile I'll try to recalculate the value explicitly when variables are customized: (when (or (get 'char-fold-include-base 'customized-value) (get 'char-fold-include-alist 'customized-value) (get 'char-fold-exclude-alist 'customized-value)) (setq char-fold-table (char-fold-make-table)))