From unknown Wed Jun 18 23:03:34 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#35689 <35689@debbugs.gnu.org> To: bug#35689 <35689@debbugs.gnu.org> Subject: Status: Customizable char-fold Reply-To: bug#35689 <35689@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:03:34 +0000 retitle 35689 Customizable char-fold reassign 35689 emacs submitter 35689 Juri Linkov severity 35689 wishlist tag 35689 fixed patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat May 11 17:31:42 2019 Received: (at submit) by debbugs.gnu.org; 11 May 2019 21:31:42 +0000 Received: from localhost ([127.0.0.1]:41339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPZao-0006I0-Cf for submit@debbugs.gnu.org; Sat, 11 May 2019 17:31:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49937) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPZam-0006Ho-QT for submit@debbugs.gnu.org; Sat, 11 May 2019 17:31:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:42588) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hPZah-0003lk-JP for submit@debbugs.gnu.org; Sat, 11 May 2019 17:31:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPZag-0000vD-Er for bug-gnu-emacs@gnu.org; Sat, 11 May 2019 17:31:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPZaf-0003kO-8u for bug-gnu-emacs@gnu.org; Sat, 11 May 2019 17:31:34 -0400 Received: from firebrick.maple.relay.mailchannels.net ([23.83.214.59]:35650) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hPZae-0003jw-O4 for bug-gnu-emacs@gnu.org; Sat, 11 May 2019 17:31:33 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 4AFE9125D42 for ; Sat, 11 May 2019 21:31:31 +0000 (UTC) Received: from pdx1-sub0-mail-a85.g.dreamhost.com (unknown [100.96.16.23]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 0F4AD125CDC for ; Sat, 11 May 2019 21:31:31 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a85.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Sat, 11 May 2019 21:31:31 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Cure-Cure: 4e623ae72ffab6c2_1557610291139_586258253 X-MC-Loop-Signature: 1557610291139:1706454231 X-MC-Ingress-Time: 1557610291138 Received: from pdx1-sub0-mail-a85.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a85.g.dreamhost.com (Postfix) with ESMTP id C375E803A3 for ; Sat, 11 May 2019 14:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:date:message-id:mime-version:content-type; s= linkov.net; bh=BvHq9SUVqt5J2HHnAPJAdWyEzPI=; b=1W1DmWnOYLecv0T7b KwRXw5rpWNuSbgJo09CFEpifodXEI+MJj/FaItPV8OwJBsQfpRz2hDFun1O7LKqS P02RwB5OCM+P5AjChOhFTO2V2vpomIzZAK7FAgO81Obw8A39sEH7yTF5K98idF5t DFLD21EdVEJsq0N1jrFP0CP3Eo= 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-a85.g.dreamhost.com (Postfix) with ESMTPSA id 83A2F8039D for ; Sat, 11 May 2019 14:31:28 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a85 From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: Customizable char-fold Organization: LINKOV.NET Date: Sun, 12 May 2019 00:22:53 +0300 Message-ID: <87imug8z4i.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrledtgdduieehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohffkfgfgggtsehmtderredtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledrleeirddvfedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleeirddvfedtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepsghughdqghhnuhdqvghmrggtshesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.214.59 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch This patch adds long-awaited customization to char-fold.el: --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=char-fold-defcustom.patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/char-fold.el b/lisp/char-fold.el index e61bc3edc6..24882008a4 100644 --- a/lisp/char-fold.el +++ b/lisp/char-fold.el @@ -24,6 +24,30 @@ =20 (eval-and-compile (put 'char-fold-table 'char-table-extra-slots 1)) =0C +(defcustom char-fold-include-base nil + "Include mappings from composite character to base letter." + :type 'boolean + :group 'matching + :version "27.1") + +(defcustom char-fold-include-alist + '((?\" "=EF=BC=82" "=E2=80=9C" "=E2=80=9D" "=E2=80=9D" "=E2=80=9E" "=E2= =B9=82" "=E3=80=9E" "=E2=80=9F" "=E2=80=9F" "=E2=9D=9E" "=E2=9D=9D" "=E2=9D= =A0" "=E2=80=9C" "=E2=80=9E" "=E3=80=9D" "=E3=80=9F" "=F0=9F=99=B7" "=F0=9F= =99=B6" "=F0=9F=99=B8" "=C2=AB" "=C2=BB") + (?' "=E2=9D=9F" "=E2=9D=9B" "=E2=9D=9C" "=E2=80=98" "=E2=80=99" "=E2= =80=9A" "=E2=80=9B" "=E2=80=9A" "=F3=A0=80=A2" "=E2=9D=AE" "=E2=9D=AF" "=E2= =80=B9" "=E2=80=BA") + (?` "=E2=9D=9B" "=E2=80=98" "=E2=80=9B" "=F3=A0=80=A2" "=E2=9D=AE" "= =E2=80=B9")) + "Additional character mappings to include." + :type '(alist :key-type (character :tag "From") + :value-type (repeat (string :tag "To"))) + :group 'lisp + :version "27.1") + +(defcustom char-fold-exclude-alist nil + "Character mappings to exclude from default setting." + :type '(alist :key-type (character :tag "From") + :value-type (character :tag "To")) + :group 'lisp + :version "27.1") + +=0C (defconst char-fold-table (eval-when-compile (let ((equiv (make-char-table 'char-fold-table)) @@ -76,7 +106,11 @@ char-fold-table (aref equiv-multi (car decomp)))) (aset equiv (car decomp) (cons (char-to-string char) - (aref equiv (car decomp)))))))) + (aref equiv (car decomp)))) + (when char-fold-include-base + (aset equiv char + (cons (char-to-string (car decomp)) + (aref equiv (car decomp))))))))) (funcall make-decomp-match-char decomp char) ;; Do it again, without the non-spacing characters. ;; This allows 'a' to match '=C3=A4'. @@ -98,13 +132,18 @@ char-fold-table table) =20 ;; Add some manual entries. - (dolist (it '((?\" "=EF=BC=82" "=E2=80=9C" "=E2=80=9D" "=E2=80=9D"= "=E2=80=9E" "=E2=B9=82" "=E3=80=9E" "=E2=80=9F" "=E2=80=9F" "=E2=9D=9E" = "=E2=9D=9D" "=E2=9D=A0" "=E2=80=9C" "=E2=80=9E" "=E3=80=9D" "=E3=80=9F" "= =F0=9F=99=B7" "=F0=9F=99=B6" "=F0=9F=99=B8" "=C2=AB" "=C2=BB") - (?' "=E2=9D=9F" "=E2=9D=9B" "=E2=9D=9C" "=E2=80=98" = "=E2=80=99" "=E2=80=9A" "=E2=80=9B" "=E2=80=9A" "=F3=A0=80=A2" "=E2=9D=AE= " "=E2=9D=AF" "=E2=80=B9" "=E2=80=BA") - (?` "=E2=9D=9B" "=E2=80=98" "=E2=80=9B" "=F3=A0=80=A2= " "=E2=9D=AE" "=E2=80=B9"))) + (dolist (it char-fold-include-alist) (let ((idx (car it)) (chars (cdr it))) (aset equiv idx (append chars (aref equiv idx))))) =20 + ;; Remove some entries. + (dolist (it char-fold-exclude-alist) + (let ((idx (car it)) + (char (cdr it))) + (when (aref equiv idx) + (aset equiv idx (remove (char-to-string char) (aref equiv id= x)))))) + ;; Convert the lists of characters we compiled into regexps. (map-char-table (lambda (char dec-list) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun May 12 15:28:06 2019 Received: (at 35689) by debbugs.gnu.org; 12 May 2019 19:28:06 +0000 Received: from localhost ([127.0.0.1]:43349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPu8k-0001hQ-2T for submit@debbugs.gnu.org; Sun, 12 May 2019 15:28:06 -0400 Received: from ladybird.maple.relay.mailchannels.net ([23.83.214.98]:21554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPu8g-0001gr-3w for 35689@debbugs.gnu.org; Sun, 12 May 2019 15:28:03 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id C1A961257F1 for <35689@debbugs.gnu.org>; Sun, 12 May 2019 19:28:00 +0000 (UTC) Received: from pdx1-sub0-mail-a64.g.dreamhost.com (unknown [100.96.16.23]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 77ECC1249D4 for <35689@debbugs.gnu.org>; Sun, 12 May 2019 19:28:00 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a64.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Sun, 12 May 2019 19:28:00 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Tasty-Hook: 0fefc26e18c1687b_1557689280565_1890213145 X-MC-Loop-Signature: 1557689280565:2894840668 X-MC-Ingress-Time: 1557689280565 Received: from pdx1-sub0-mail-a64.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a64.g.dreamhost.com (Postfix) with ESMTP id 35EB680510 for <35689@debbugs.gnu.org>; Sun, 12 May 2019 12:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=3sRNM7PbeOs5dZ56za24v30VKeU=; b= NUhUURWfG+88qh1qGfOL97Obh9VcGS0L1QLvxmQN4MoSNffmJ2dbdqNxH/G3V8Z1 G8TV/vsp9cJGyOjvtSG0I88I1apW7kq3BLXRCeUbDMX90f/tPydUY5DPiy1eSXqf pMLTPO6H22e79XIsqa6r2BrTs0BYT6DyWJJ6Ov0Hv/4= 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-a64.g.dreamhost.com (Postfix) with ESMTPSA id 325658050F for <35689@debbugs.gnu.org>; Sun, 12 May 2019 12:27:58 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a64 From: Juri Linkov To: 35689@debbugs.gnu.org Subject: Re: bug#35689: Customizable char-fold Organization: LINKOV.NET References: <87imug8z4i.fsf@mail.linkov.net> Date: Sun, 12 May 2019 22:12:01 +0300 In-Reply-To: <87imug8z4i.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 12 May 2019 00:22:53 +0300") Message-ID: <8736lj3dgm.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrledvgddugedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtsehmtderredtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledrleeirddvfedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleeirddvfedtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepfeehieekleesuggvsggsuhhgshdrghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35689 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain > This patch adds long-awaited customization to char-fold.el: I noticed that its compilation fails with: ELC char-fold.elc In toplevel form: char-fold.el:153:31:Error: Symbol's value as variable is void: char-fold-include-base Makefile:296: recipe for target 'char-fold.elc' failed make[2]: *** [char-fold.elc] Error 1 So a new patch added 'eval-and-compile' to all defcustoms: --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=char-fold-defcustom.2.patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/char-fold.el b/lisp/char-fold.el index e61bc3edc6..a60d49dd8e 100644 --- a/lisp/char-fold.el +++ b/lisp/char-fold.el @@ -24,6 +24,30 @@ =20 (eval-and-compile (put 'char-fold-table 'char-table-extra-slots 1)) =0C +(eval-and-compile (defcustom char-fold-include-base nil + "Include mappings from composite character to base letter." + :type 'boolean + :group 'matching + :version "27.1")) + +(eval-and-compile (defcustom char-fold-include-alist + '((?\" "=EF=BC=82" "=E2=80=9C" "=E2=80=9D" "=E2=80=9D" "=E2=80=9E" "=E2= =B9=82" "=E3=80=9E" "=E2=80=9F" "=E2=80=9F" "=E2=9D=9E" "=E2=9D=9D" "=E2=9D= =A0" "=E2=80=9C" "=E2=80=9E" "=E3=80=9D" "=E3=80=9F" "=F0=9F=99=B7" "=F0=9F= =99=B6" "=F0=9F=99=B8" "=C2=AB" "=C2=BB") + (?' "=E2=9D=9F" "=E2=9D=9B" "=E2=9D=9C" "=E2=80=98" "=E2=80=99" "=E2= =80=9A" "=E2=80=9B" "=E2=80=9A" "=F3=A0=80=A2" "=E2=9D=AE" "=E2=9D=AF" "=E2= =80=B9" "=E2=80=BA") + (?` "=E2=9D=9B" "=E2=80=98" "=E2=80=9B" "=F3=A0=80=A2" "=E2=9D=AE" "= =E2=80=B9")) + "Additional character mappings to include." + :type '(alist :key-type (character :tag "From") + :value-type (repeat (string :tag "To"))) + :group 'lisp + :version "27.1")) + +(eval-and-compile (defcustom char-fold-exclude-alist nil + "Character mappings to exclude from default setting." + :type '(alist :key-type (character :tag "From") + :value-type (character :tag "To")) + :group 'lisp + :version "27.1")) + +=0C (defconst char-fold-table (eval-when-compile (let ((equiv (make-char-table 'char-fold-table)) @@ -76,7 +109,11 @@ char-fold-table (aref equiv-multi (car decomp)))) (aset equiv (car decomp) (cons (char-to-string char) - (aref equiv (car decomp)))))))) + (aref equiv (car decomp)))) + (when char-fold-include-base + (aset equiv char + (cons (char-to-string (car decomp)) + (aref equiv (car decomp))))))))) (funcall make-decomp-match-char decomp char) ;; Do it again, without the non-spacing characters. ;; This allows 'a' to match '=C3=A4'. @@ -98,13 +135,18 @@ char-fold-table table) =20 ;; Add some manual entries. - (dolist (it '((?\" "=EF=BC=82" "=E2=80=9C" "=E2=80=9D" "=E2=80=9D"= "=E2=80=9E" "=E2=B9=82" "=E3=80=9E" "=E2=80=9F" "=E2=80=9F" "=E2=9D=9E" = "=E2=9D=9D" "=E2=9D=A0" "=E2=80=9C" "=E2=80=9E" "=E3=80=9D" "=E3=80=9F" "= =F0=9F=99=B7" "=F0=9F=99=B6" "=F0=9F=99=B8" "=C2=AB" "=C2=BB") - (?' "=E2=9D=9F" "=E2=9D=9B" "=E2=9D=9C" "=E2=80=98" = "=E2=80=99" "=E2=80=9A" "=E2=80=9B" "=E2=80=9A" "=F3=A0=80=A2" "=E2=9D=AE= " "=E2=9D=AF" "=E2=80=B9" "=E2=80=BA") - (?` "=E2=9D=9B" "=E2=80=98" "=E2=80=9B" "=F3=A0=80=A2= " "=E2=9D=AE" "=E2=80=B9"))) + (dolist (it char-fold-include-alist) (let ((idx (car it)) (chars (cdr it))) (aset equiv idx (append chars (aref equiv idx))))) =20 + ;; Remove some entries. + (dolist (it char-fold-exclude-alist) + (let ((idx (car it)) + (char (cdr it))) + (when (aref equiv idx) + (aset equiv idx (remove (char-to-string char) (aref equiv id= x)))))) + ;; Convert the lists of characters we compiled into regexps. (map-char-table (lambda (char dec-list) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun May 12 16:30:43 2019 Received: (at 35689) by debbugs.gnu.org; 12 May 2019 20:30:43 +0000 Received: from localhost ([127.0.0.1]:43429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPv7K-0003H1-S9 for submit@debbugs.gnu.org; Sun, 12 May 2019 16:30:43 -0400 Received: from mail-io1-f54.google.com ([209.85.166.54]:44535) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPv7I-0003Gk-BP for 35689@debbugs.gnu.org; Sun, 12 May 2019 16:30:41 -0400 Received: by mail-io1-f54.google.com with SMTP id f22so8242237iol.11 for <35689@debbugs.gnu.org>; Sun, 12 May 2019 13:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=rDhdEV0rmcdQ/xyBjLNISLOc9869b8iQpHC+FB1QhDE=; b=h9aRPbvL0qwyftXmO61/rrOEukWebfi5G8u0oiC/8b3K3+Edk0Gp40W7Yc4moUaDzh 1Ju4mx8jqAEzPo9ivxMYDC4crpUlayEpN9gPY0vl2Fzbi2iTfgtAgySfxUwOtUWxWiyH qDL1iDWTSm3GhkXRWI2lk6n3jLWVXjVhOn+4qthaMR3VqIEXcfJ4k0mYE5aTwtdD8yMO mpF1GoH3QBEwcmdFRuFHAIQ9BeLRh4IjgvBNmjUGeTsZnA0HTrAt+2Xtsc6Qe/5vrFK3 ycsgXXpsZO6MqB3fe6XFkLtPPpJ9Tqs7HApMkvh6Bm3UwsdpSHNU7sQ/821RLS23ZXB/ 4hHQ== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=rDhdEV0rmcdQ/xyBjLNISLOc9869b8iQpHC+FB1QhDE=; b=LGyTydnRI/5kidlQEmNhzc903bUKS7vLQDNieLahVWEm8Wacfjg+3baKPSuayFkwm2 mU4PwZp4XK9zR2iNIelXM5nQTRJ7abXL6DQpmFftDf56WvKkey6Ho7H0ufo3NVve6xMf FaXsThnztppExEoz2jBy7AQVNlKY/ZDzh+DyL9rFd+eMjCvmNtQ95U6RsxscKdOOhyEZ Ow/J90dNr8qI7hYnLA6DHegZ0BtXAkS72il7/kVjT+vjY9Sr6Kta5NpZkYZTaM7Qr+6R OtEul7F7IEa6PaKRoqMyI3AftYUPM7qpmvj+lC6l2MZSJ+cSGbQ+/1E3alQgxI+2zRqd HjKQ== X-Gm-Message-State: APjAAAWH8cPYuaTHFPOjP1ojWr/Jl2T3SLeYqNLBejNDDN0pYukUwr/f l009NBUbSJJ0tW/0ujZAA89zF3Vh X-Google-Smtp-Source: APXvYqy+WAfDxCcPDNzd6/SDG+YFDSYwofFfgyFtouYzwRMIo0pGEb9V9OZZfNwlVIOUtblgI5qPpQ== X-Received: by 2002:a5e:c817:: with SMTP id y23mr14748460iol.290.1557693034377; Sun, 12 May 2019 13:30:34 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id r62sm1569020ita.37.2019.05.12.13.30.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 May 2019 13:30:33 -0700 (PDT) From: Noam Postavsky To: Juri Linkov Subject: Re: bug#35689: Customizable char-fold References: <87imug8z4i.fsf@mail.linkov.net> <8736lj3dgm.fsf@mail.linkov.net> Date: Sun, 12 May 2019 16:30:32 -0400 In-Reply-To: <8736lj3dgm.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 12 May 2019 22:12:01 +0300") Message-ID: <87mujrh0uv.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35689 Cc: 35689@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >> This patch adds long-awaited customization to char-fold.el: > > I noticed that its compilation fails with: > > ELC char-fold.elc > In toplevel form: > char-fold.el:153:31:Error: Symbol's value as variable is void: char-fold-include-base > Makefile:296: recipe for target 'char-fold.elc' failed > make[2]: *** [char-fold.elc] Error 1 > > So a new patch added 'eval-and-compile' to all defcustoms: Will it actually work for a user to customize this? It looks like the values are used during compile time, so after changing the value the user would have to recompile char-fold.el? From debbugs-submit-bounces@debbugs.gnu.org Mon May 13 16:41:48 2019 Received: (at 35689) by debbugs.gnu.org; 13 May 2019 20:41:48 +0000 Received: from localhost ([127.0.0.1]:46450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQHlc-0006oO-3w for submit@debbugs.gnu.org; Mon, 13 May 2019 16:41:48 -0400 Received: from catfish.maple.relay.mailchannels.net ([23.83.214.32]:25760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQHlX-0006oB-Qw for 35689@debbugs.gnu.org; Mon, 13 May 2019 16:41:46 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 497FB3E4AB9; Mon, 13 May 2019 20:41:42 +0000 (UTC) Received: from pdx1-sub0-mail-a99.g.dreamhost.com (unknown [100.96.16.23]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id C030E3E4DD2; Mon, 13 May 2019 20:41:39 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a99.g.dreamhost.com (pop.dreamhost.com [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, 13 May 2019 20:41:42 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Juvenile-Trouble: 3b49a7b1439062a8_1557780100062_3790611253 X-MC-Loop-Signature: 1557780100062:3823219142 X-MC-Ingress-Time: 1557780100061 Received: from pdx1-sub0-mail-a99.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a99.g.dreamhost.com (Postfix) with ESMTP id 10A137FB7F; Mon, 13 May 2019 13:41:35 -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=pXCHWY9yhn68pXO+Gzd1Hq4dLbA=; b= aS0mZnLQCxa0+03sdciEhd5nw02/YnEKT8SNE0Iin8pyGfZt+5aNST/6kfWnQ1Xz JTQ7POGNupnEtbq8R+n1eovxRGSwiV3L0zXmXLd4UqhwxKhgGBjzfKIbt0ASQMIC xnUb5HB9rfvu6tfr5KPQCDnEG7WAMbd0FgTPz8ijACM= 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-a99.g.dreamhost.com (Postfix) with ESMTPSA id AC06F7FB8C; Mon, 13 May 2019 13:41:33 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a99 From: Juri Linkov To: Noam Postavsky Subject: Re: bug#35689: Customizable char-fold Organization: LINKOV.NET References: <87imug8z4i.fsf@mail.linkov.net> <8736lj3dgm.fsf@mail.linkov.net> <87mujrh0uv.fsf@gmail.com> Date: Mon, 13 May 2019 23:31:58 +0300 In-Reply-To: <87mujrh0uv.fsf@gmail.com> (Noam Postavsky's message of "Sun, 12 May 2019 16:30:32 -0400") Message-ID: <87o9466z1t.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrleeggdduhedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdeliedrvdeftdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdeliedrvdeftddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehnphhoshhtrghvshesghhmrghilhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35689 Cc: 35689@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain >>> This patch adds long-awaited customization to char-fold.el: >> >> I noticed that its compilation fails with: >> >> ELC char-fold.elc >> In toplevel form: >> char-fold.el:153:31:Error: Symbol's value as variable is void: char-fold-include-base >> Makefile:296: recipe for target 'char-fold.elc' failed >> make[2]: *** [char-fold.elc] Error 1 >> >> So a new patch added 'eval-and-compile' to all defcustoms: > > Will it actually work for a user to customize this? It looks like the > values are used during compile time, so after changing the value the > user would have to recompile char-fold.el? Oh, right. Do you see a problem with a better patch: --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=char-fold-defcustom.3.patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/char-fold.el b/lisp/char-fold.el index e61bc3edc6..6c3f809c2b 100644 --- a/lisp/char-fold.el +++ b/lisp/char-fold.el @@ -24,8 +24,43 @@ =20 (eval-and-compile (put 'char-fold-table 'char-table-extra-slots 1)) =0C -(defconst char-fold-table - (eval-when-compile +(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)))) + :group 'matching + :version "27.1")) + +(eval-and-compile (defcustom char-fold-include-alist + '((?\" "=EF=BC=82" "=E2=80=9C" "=E2=80=9D" "=E2=80=9D" "=E2=80=9E" "=E2= =B9=82" "=E3=80=9E" "=E2=80=9F" "=E2=80=9F" "=E2=9D=9E" "=E2=9D=9D" "=E2=9D= =A0" "=E2=80=9C" "=E2=80=9E" "=E3=80=9D" "=E3=80=9F" "=F0=9F=99=B7" "=F0=9F= =99=B6" "=F0=9F=99=B8" "=C2=AB" "=C2=BB") + (?' "=E2=9D=9F" "=E2=9D=9B" "=E2=9D=9C" "=E2=80=98" "=E2=80=99" "=E2= =80=9A" "=E2=80=9B" "=E2=80=9A" "=F3=A0=80=A2" "=E2=9D=AE" "=E2=9D=AF" "=E2= =80=B9" "=E2=80=BA") + (?` "=E2=9D=9B" "=E2=80=98" "=E2=80=9B" "=F3=A0=80=A2" "=E2=9D=AE" "= =E2=80=B9")) + "Additional character mappings to include." + :type '(alist :key-type (character :tag "From") + :value-type (repeat (string :tag "To"))) + :set (lambda (sym val) + (set sym val) + (when (boundp 'char-fold-table) + (setq char-fold-table (char-fold-make-table)))) + :group 'lisp + :version "27.1")) + +(eval-and-compile (defcustom char-fold-exclude-alist nil + "Character mappings to exclude from default setting." + :type '(alist :key-type (character :tag "From") + :value-type (character :tag "To")) + :set (lambda (sym val) + (set sym val) + (when (boundp 'char-fold-table) + (setq char-fold-table (char-fold-make-table)))) + :group 'lisp + :version "27.1")) + +(eval-and-compile + (defun char-fold-make-table () (let ((equiv (make-char-table 'char-fold-table)) (equiv-multi (make-char-table 'char-fold-table)) (table (unicode-property-table-internal 'decomposition))) @@ -76,7 +123,11 @@ char-fold-table (aref equiv-multi (car decomp)))) (aset equiv (car decomp) (cons (char-to-string char) - (aref equiv (car decomp)))))))) + (aref equiv (car decomp)))) + (when char-fold-include-base + (aset equiv char + (cons (char-to-string (car decomp)) + (aref equiv (car decomp))))))))) (funcall make-decomp-match-char decomp char) ;; Do it again, without the non-spacing characters. ;; This allows 'a' to match '=C3=A4'. @@ -98,13 +149,18 @@ char-fold-table table) =20 ;; Add some manual entries. - (dolist (it '((?\" "=EF=BC=82" "=E2=80=9C" "=E2=80=9D" "=E2=80=9D"= "=E2=80=9E" "=E2=B9=82" "=E3=80=9E" "=E2=80=9F" "=E2=80=9F" "=E2=9D=9E" = "=E2=9D=9D" "=E2=9D=A0" "=E2=80=9C" "=E2=80=9E" "=E3=80=9D" "=E3=80=9F" "= =F0=9F=99=B7" "=F0=9F=99=B6" "=F0=9F=99=B8" "=C2=AB" "=C2=BB") - (?' "=E2=9D=9F" "=E2=9D=9B" "=E2=9D=9C" "=E2=80=98" = "=E2=80=99" "=E2=80=9A" "=E2=80=9B" "=E2=80=9A" "=F3=A0=80=A2" "=E2=9D=AE= " "=E2=9D=AF" "=E2=80=B9" "=E2=80=BA") - (?` "=E2=9D=9B" "=E2=80=98" "=E2=80=9B" "=F3=A0=80=A2= " "=E2=9D=AE" "=E2=80=B9"))) + (dolist (it char-fold-include-alist) (let ((idx (car it)) (chars (cdr it))) (aset equiv idx (append chars (aref equiv idx))))) =20 + ;; Remove some entries. + (dolist (it char-fold-exclude-alist) + (let ((idx (car it)) + (char (cdr it))) + (when (aref equiv idx) + (aset equiv idx (remove (char-to-string char) (aref equiv id= x)))))) + ;; Convert the lists of characters we compiled into regexps. (map-char-table (lambda (char dec-list) @@ -113,7 +169,11 @@ char-fold-table (set-char-table-range equiv char re) (aset equiv char re)))) equiv) - equiv)) + equiv))) + +(defconst char-fold-table + (eval-when-compile + (char-fold-make-table)) "Used for folding characters of the same group during search. This is a char-table with the `char-fold-table' subtype. =20 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon May 13 18:18:29 2019 Received: (at 35689) by debbugs.gnu.org; 13 May 2019 22:18:29 +0000 Received: from localhost ([127.0.0.1]:46545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQJHB-0000ca-J3 for submit@debbugs.gnu.org; Mon, 13 May 2019 18:18:29 -0400 Received: from mail-it1-f178.google.com ([209.85.166.178]:36488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQJH9-0000cM-Kx for 35689@debbugs.gnu.org; Mon, 13 May 2019 18:18:28 -0400 Received: by mail-it1-f178.google.com with SMTP id e184so1670097ite.1 for <35689@debbugs.gnu.org>; Mon, 13 May 2019 15:18:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=F55e/xiQgQQpj908eitQxHpF5gbRAfrIGGDQ188sEFI=; b=bk9aP56ZJ/pvNUAnIxxsi1wTp7mPueZnd1Wjv7wV8YbdB1RysLVfkcP1xtwuLZ998z 1FQ9XJtdrGdtdPEbc1Ke50LK7aAn8rqlIGmbSdFL133fHJCoen4y6bnXs7xqxnfikMJr 2UnmxWA86r3/yzZ8owOA6eMZxpeyOoiymXAB6nOYjlmmERz3wD4zlcsBY9c7+ncbDYf5 rvWUBpTxwSkRhUVQtgaiBKEITyHnb7dNN+6uyTyJSU5xWuzpFu7H6pIPSymRJcggkXeO rT5DhuzaXU2VVtM5zLwUrNgHpGzgrLPwgk0rxXaTYzSvNtQ3u8pq5/iPX5R/hPTIGUgg vp7A== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=F55e/xiQgQQpj908eitQxHpF5gbRAfrIGGDQ188sEFI=; b=kMYAI0PPvfxUvQEogjVxtAh6M6CMEoFTYYuZCefI6frIPgaOv+7SacSX7dpD3q6QoX p/2WCTenc6PLdkNv7xorpWbNFiM0fZao9bURJW9Hi4QopEcK4REEZLlLqP+T5Ya80Hi+ PWbYlfpFOTws6ytdEzrYQzb8SMF1eF3MUefNTcSKfOWo3HfLcbU9Qd8BJ5gyloqgUyeU tqdR+HJWV3ssuug5Sp585JNu/tkDgjAvLCsozYJcxZ7Vz4sRF8+r4uYByT1s4vvN2OYJ owyYiZKFrLUKVh9wSpaIFIthVh1daVCdfqORvp1ThCYNMAG5oLPdYVGHI6eIvOysCLJr CJRg== X-Gm-Message-State: APjAAAWVCxPRhhiuS+9g7Qb/XBT+4zCD8vF0xZoH655nByjOseQhm2H5 omLAclHt5WZMjoB/BMAi7ckZKODf X-Google-Smtp-Source: APXvYqyMYEx6Jz9NXnxdg90SN2LUWzwKdFt6M9nzgt1JIKos5dqqnjBc/6xBGeAZ5sR8/TtkH2jzsw== X-Received: by 2002:a24:454a:: with SMTP id y71mr1200687ita.135.1557785901774; Mon, 13 May 2019 15:18:21 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id 10sm4682786ioo.27.2019.05.13.15.18.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 May 2019 15:18:20 -0700 (PDT) From: Noam Postavsky To: Juri Linkov Subject: Re: bug#35689: Customizable char-fold References: <87imug8z4i.fsf@mail.linkov.net> <8736lj3dgm.fsf@mail.linkov.net> <87mujrh0uv.fsf@gmail.com> <87o9466z1t.fsf@mail.linkov.net> Date: Mon, 13 May 2019 18:18:18 -0400 In-Reply-To: <87o9466z1t.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 13 May 2019 23:31:58 +0300") Message-ID: <87d0kmgfrp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35689 Cc: 35689@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > 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 ..." From debbugs-submit-bounces@debbugs.gnu.org Tue May 14 02:37:28 2019 Received: (at submit) by debbugs.gnu.org; 14 May 2019 06:37:28 +0000 Received: from localhost ([127.0.0.1]:46979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQR44-0006Jw-E5 for submit@debbugs.gnu.org; Tue, 14 May 2019 02:37:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52897) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQR41-0006JW-Sw for submit@debbugs.gnu.org; Tue, 14 May 2019 02:37:26 -0400 Received: from lists.gnu.org ([209.51.188.17]:60797) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQR3w-0002jR-O0 for submit@debbugs.gnu.org; Tue, 14 May 2019 02:37:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQR3v-0001dt-Bk for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 02:37:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED,BAYES_50, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQR3u-0002hu-Tu; Tue, 14 May 2019 02:37:18 -0400 Received: from [109.253.209.140] (port=38139 helo=[10.131.78.115]) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1hQR3u-0002gJ-1A; Tue, 14 May 2019 02:37:18 -0400 Date: Tue, 14 May 2019 09:37:14 +0300 User-Agent: K-9 Mail for Android In-Reply-To: <87d0kmgfrp.fsf@gmail.com> References: <87imug8z4i.fsf@mail.linkov.net> <8736lj3dgm.fsf@mail.linkov.net> <87mujrh0uv.fsf@gmail.com> <87o9466z1t.fsf@mail.linkov.net> <87d0kmgfrp.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: bug#35689: Customizable char-fold To: bug-gnu-emacs@gnu.org, Noam Postavsky , Juri Linkov From: Eli Zaretskii Message-ID: <406F1DF2-CB22-441F-B3E2-19770425322A@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: 35689@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On May 14, 2019 1:18:18 AM GMT+03:00, Noam Postavsky = wrote: > Juri Linkov writes: >=20 > > Oh, right=2E Do you see a problem with a better patch: >=20 > > +(eval-and-compile (defcustom char-fold-include-base nil > > + "Include mappings from composite character to base letter=2E" > > + :type 'boolean > > + :set (lambda (sym val) > > + (set sym val) > > + (when (boundp 'char-fold-table) > > + (setq char-fold-table (char-fold-make-table)))) >=20 > Looks like it could work (though I haven't tested)=2E 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 =2E=2E=2E" We don't gave defcustoms inside eval-and/when-compile anywhere else=2E Do= we really need this? For starters, it would defeat cus-dep=2Eel, I think= =2E From debbugs-submit-bounces@debbugs.gnu.org Tue May 14 16:36:21 2019 Received: (at submit) by debbugs.gnu.org; 14 May 2019 20:36:21 +0000 Received: from localhost ([127.0.0.1]:49979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQe9t-0004hA-57 for submit@debbugs.gnu.org; Tue, 14 May 2019 16:36:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQe9q-0004gc-QD for submit@debbugs.gnu.org; Tue, 14 May 2019 16:36:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:37689) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQe9l-0000ri-JU for submit@debbugs.gnu.org; Tue, 14 May 2019 16:36:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQe9k-0004QF-GK for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 16:36:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQe9j-0000oT-KP for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 16:36:12 -0400 Received: from catfish.maple.relay.mailchannels.net ([23.83.214.32]:62769) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQe9j-0000lw-Bd; Tue, 14 May 2019 16:36:11 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org 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) 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 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 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= 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 From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#35689: Customizable char-fold Organization: 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> Date: Tue, 14 May 2019 23:14:12 +0300 In-Reply-To: <406F1DF2-CB22-441F-B3E2-19770425322A@gnu.org> (Eli Zaretskii's message of "Tue, 14 May 2019 09:37:14 +0300") Message-ID: <87d0kkyesr.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrleeigdduhedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdeliedrvdeftdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdeliedrvdeftddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvlhhiiiesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedu X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.214.32 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: bug-gnu-emacs@gnu.org, 35689@debbugs.gnu.org, Noam Postavsky X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) >> > 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))) From debbugs-submit-bounces@debbugs.gnu.org Thu May 16 07:59:42 2019 Received: (at control) by debbugs.gnu.org; 16 May 2019 11:59:42 +0000 Received: from localhost ([127.0.0.1]:54499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRF30-0006XH-Kp for submit@debbugs.gnu.org; Thu, 16 May 2019 07:59:42 -0400 Received: from mail-it1-f178.google.com ([209.85.166.178]:52119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRF2y-0006X4-3q for control@debbugs.gnu.org; Thu, 16 May 2019 07:59:40 -0400 Received: by mail-it1-f178.google.com with SMTP id m3so1843114itl.1 for ; Thu, 16 May 2019 04:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=iIQTvoQALqYcrFunz8Wl8ZJQukT5bCajWGqJAOQg4W0=; b=eAX9TZOBti17CCupFX0qqVmYJWU20RPF7bSKCB1u7BzaFNytRO/H7TpkLbqDrp17eS 5uadIyaSeWoYAkIC4eihC9Q3CdKX+/xPhfNBhZBVeueHBhsyPnDeBCFpoGp7Be+QWU/V nGYAPQXvIJ53YWgsBgo7MKyD5Ma2xPNc0m/kSZkcSmsHe4xeauDlTk4O4mb1IFtL+dTc /Myf9NLKyU6g4FprRLxTAtiOX88LsW2kRM+fT7uGksWQu+K8cU3Oa4Qq2sH6RA4x4+e2 056zBzMyja/wnJ6HZxX0O/M7qw3anYiN1dRkf1Vxrk4h87+E6nspl3BOnotvtFTNOeBK 3jNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=iIQTvoQALqYcrFunz8Wl8ZJQukT5bCajWGqJAOQg4W0=; b=jyxzZpT+VLTY4Dn+/vk0Ym+aA8mnQjblX8tWdTaUuIist0v3gStqcSXmE6TelSKtWG SY+lMBjwDildqJrL8jzCzGSOCJ/nFwLClaazoizP8AJD437T4TAYvXcmtC5GcI11xSNJ kq8Sal1srckinCRbRIHQQnQARN7HPEY3pOco1Ah3wwy7pkq35L44kVdsYUR/WXt+Z6SK zseZe4IOWX/P/g++JmtGLl58TDVdDuT2HDFoP62NabBmK1+5v7RM/Vn67ZrEvbDBVkAt mawVrsZ99sv+dzcJoNGHEgvuOmA41YJn2PDV+ruHWiAjjh/7dQ7gWhT4tewwhF5W3xqL /7zQ== X-Gm-Message-State: APjAAAWKIRHriwn90Xzpt1wdoen49n/DrubQh0mXpfhwRd2F4B3/IcUu ksr7walIKZB7zh1cbCPofGzgTp3q X-Google-Smtp-Source: APXvYqyGgOKtQ2QG6OsF4zNmPVz+6NdTG4xzx9hYzofApqq3tNMSGC/paq3HnmerpHozkqfVCX9F0Q== X-Received: by 2002:a02:b89:: with SMTP id 131mr32958141jad.58.1558007973126; Thu, 16 May 2019 04:59:33 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id s69sm1779070ios.30.2019.05.16.04.59.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 May 2019 04:59:31 -0700 (PDT) From: Noam Postavsky To: control@debbugs.gnu.org Subject: control message, adjust some bug severities Date: Thu, 16 May 2019 07:59:29 -0400 Message-ID: <87tvduehjy.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 35756 minor severity 35724 minor severity 35689 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Thu May 16 10:47:57 2019 Received: (at 35689) by debbugs.gnu.org; 16 May 2019 14:47:57 +0000 Received: from localhost ([127.0.0.1]:56043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRHfp-0000QT-Eg for submit@debbugs.gnu.org; Thu, 16 May 2019 10:47:57 -0400 Received: from mail-io1-f43.google.com ([209.85.166.43]:35732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRHfn-0000QH-R2 for 35689@debbugs.gnu.org; Thu, 16 May 2019 10:47:56 -0400 Received: by mail-io1-f43.google.com with SMTP id p2so2820557iol.2 for <35689@debbugs.gnu.org>; Thu, 16 May 2019 07:47:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=KIPPRjhMQdyzEpLkKrF1Kz8c5ZrBKvbxVNzLvap0ckE=; b=FBvn4ykKdvH9bU6Q3jHVrE9xoM4KA+a5CT71fBBpFyMBJt6q8u6jeiytnpfbj7NC3P wTaRywPNTcv+x/hAXrhh4vDSxGaG71IPfLobpLrQRw7iwLaPiWHKenlki01IIhJx/uYY GxuZ5mWSU84GEoZsrp/yNtN3HkgXU3Ws5vEnMTBTNjOBi3QWpZUjPWrkRM6d3wwaanAC Nx5rb03wkxhmnhk5Vd6uStXHucQC2tIjhsA7rJvFciSuqA9oelhVIGCqhcnXea6PdBXg VCnRyHkYZrpDPT8LlIsmPF2sksxtX1yqBXU0KccvLCTt9Dz666mJWlKeHx3leJswaiI1 iCUA== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=KIPPRjhMQdyzEpLkKrF1Kz8c5ZrBKvbxVNzLvap0ckE=; b=EuWNB4zidD4J66A/MhbQ7PhdSBxY+EIwsLsSkl0+ZLldWqHdiBHk+TaXeFnCH+5Dwh lQQCQ/vIEpPO5I7N+40U1cjK/Kn6RKySjQzx0kHq07RFIhgWViwqo/02tygUyZ83YWNX dpi9OWr48rB2YB1pj9kHayJgFGI1hBWzoQxPa43TcGk6MMpyOsIfomRMnqHpGCLIY0sc LHOToDOc0Vm6G9udRKCY37YFq77MZrFq+1bNmYVdDch545wEOHDnlNDDfceXbPfqUoGL yH2ilcWbw3cbm+pWSD5m9piqohjfd8ipd7tDuOXibkNrKGbVeA5JdslNKfxPYXBdgxhK niag== X-Gm-Message-State: APjAAAXMomCCTF2e4dJE0YGaoKuG3MRS6J2cbjn5hVwrPo+I/TBpXlD1 CvM4E1pXbB+0QZJ82QGEFF4= X-Google-Smtp-Source: APXvYqyxmzYA2ROvpfyIkiHLbwkXocfy36cqKk7RnSmdnUzRZSJGgOqcinl1QGFo6hbwJsl3RQqClA== X-Received: by 2002:a6b:6f17:: with SMTP id k23mr1308166ioc.305.1558018069080; Thu, 16 May 2019 07:47:49 -0700 (PDT) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id f1sm1742314iop.53.2019.05.16.07.47.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 May 2019 07:47:48 -0700 (PDT) From: npostavs@gmail.com To: Juri Linkov Subject: Re: bug#35689: Customizable char-fold 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> Date: Thu, 16 May 2019 10:47:47 -0400 In-Reply-To: <87d0kkyesr.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 14 May 2019 23:14:12 +0300") Message-ID: <85v9ya1mng.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35689 Cc: Eli Zaretskii , 35689@debbugs.gnu.org, npostavs@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >> 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))) Instead of looking at symbol property values, which can make for a confusing time when setting variables outside of customize, I think it would be nicer to do something like this: (eval-and-compile (defconst char-fold--include-base-default ...)) (defcustom char-fold-include-base char-fold--include-base-default :initialize #'custom-initialize-changed :set (lambda (sym val) (set-default sym val) ;; FIXME: Maybe delay this until after-init-time, ;; to avoid redundant calls to char-fold-make-table. (setq char-fold-table (char-fold-make-table))) ...) (eval-and-compile (defun char-fold-make-table () ... (or (bound-and-true-p 'char-fold-include-base) char-fold--include-base-default) ...)) From debbugs-submit-bounces@debbugs.gnu.org Thu May 16 16:25:40 2019 Received: (at 35689) by debbugs.gnu.org; 16 May 2019 20:25:40 +0000 Received: from localhost ([127.0.0.1]:56565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRMwd-00033I-Pt for submit@debbugs.gnu.org; Thu, 16 May 2019 16:25:40 -0400 Received: from purple.birch.relay.mailchannels.net ([23.83.209.150]:3424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRMwR-000328-Hf for 35689@debbugs.gnu.org; Thu, 16 May 2019 16:25:38 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7E1631A3D79; Thu, 16 May 2019 20:17:35 +0000 (UTC) Received: from pdx1-sub0-mail-a63.g.dreamhost.com (100-96-14-60.trex.outbound.svc.cluster.local [100.96.14.60]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id BABA61A3D74; Thu, 16 May 2019 20:17:34 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a63.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); Thu, 16 May 2019 20:17:35 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Belong-Reaction: 76fd76f665ac8366_1558037855272_4168144332 X-MC-Loop-Signature: 1558037855272:1543746409 X-MC-Ingress-Time: 1558037855271 Received: from pdx1-sub0-mail-a63.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a63.g.dreamhost.com (Postfix) with ESMTP id 1155C83569; Thu, 16 May 2019 13:17:33 -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=NmSim9bCFdtAsnUN5gnnGbDUyiM=; b= J60cnqcnGX+CWDbj8wJhDoLjwU8FzJPTPJVtNsqDaFhb8p9lgnofoy8GCpDaLEdi TqI1A2cjutErmLntXgePhGE7TpC1QEgyKufNxoho4Oofh/u3Nxbn98UREvx9xvl1 wrDWWlX1npgsls9GnqpBaKRRSrlBNXZjgZeQXDj3ru8= 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-a63.g.dreamhost.com (Postfix) with ESMTPSA id 3E7EA83564; Thu, 16 May 2019 13:17:29 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a63 From: Juri Linkov To: npostavs@gmail.com Subject: Re: bug#35689: Customizable char-fold Organization: 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> Date: Thu, 16 May 2019 23:13:17 +0300 In-Reply-To: <85v9ya1mng.fsf@gmail.com> (npostavs@gmail.com's message of "Thu, 16 May 2019 10:47:47 -0400") Message-ID: <87zhnmgntu.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddruddttddgudeghecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledrleeirddvfedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleeirddvfedtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepnhhpohhsthgrvhhssehgmhgrihhlrdgtohhmnecuvehluhhsthgvrhfuihiivgepvd X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35689 Cc: Eli Zaretskii , 35689@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> 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))) > > Instead of looking at symbol property values, which can make for a > confusing time when setting variables outside of customize, I think it > would be nicer to do something like this: > > (eval-and-compile (defconst char-fold--include-base-default ...)) > > (defcustom char-fold-include-base char-fold--include-base-default > :initialize #'custom-initialize-changed I tried different possible values of :initialize, but not custom-initialize-changed. I'll try this now. The problem I encountered with the previous solution it that calling `(setq char-fold-table (char-fold-make-table))' above while loading char-fold.el by autoload, garbled data returned from `(unicode-property-table-internal 'decomposition)', it just returned garbage, maybe due to a broken coding. I was busy debugging unidata-get-decomposition to understand where this data corruption occurs. From debbugs-submit-bounces@debbugs.gnu.org Tue May 21 16:55:43 2019 Received: (at 35689) by debbugs.gnu.org; 21 May 2019 20:55:43 +0000 Received: from localhost ([127.0.0.1]:41120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTBnT-0004dS-0U for submit@debbugs.gnu.org; Tue, 21 May 2019 16:55:43 -0400 Received: from insect.birch.relay.mailchannels.net ([23.83.209.93]:26538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTBnO-0004dF-GR for 35689@debbugs.gnu.org; Tue, 21 May 2019 16:55:42 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 51BEA5E2A0C; Tue, 21 May 2019 20:55:37 +0000 (UTC) Received: from pdx1-sub0-mail-a9.g.dreamhost.com (100-96-86-18.trex.outbound.svc.cluster.local [100.96.86.18]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id C049D5E3306; Tue, 21 May 2019 20:55:36 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a9.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, 21 May 2019 20:55:37 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Fumbling-Wipe: 05df0efd71dc9d30_1558472137170_1769330798 X-MC-Loop-Signature: 1558472137170:3065849930 X-MC-Ingress-Time: 1558472137170 Received: from pdx1-sub0-mail-a9.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a9.g.dreamhost.com (Postfix) with ESMTP id 386908046D; Tue, 21 May 2019 13:55:35 -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=Kkw8RflGtZi/r/UKU5OgCOZQbpc=; b= 1ASTiLJ1womgziwbcOyJ2KJsS6aY4SJ86I5ANe0jGvnZPTMjxNjH94Na+XieGxGu USb6v15LNGgjJeULQEldTWCxAJUfnIjWcy9rAO9WhT4QbcKwjQUxOliNugkSU2KV CEbvzlo/lvBAMPpAl2OpNPduVLHagZTkNOQL89/QwS8= 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-a9.g.dreamhost.com (Postfix) with ESMTPSA id 2071D8045B; Tue, 21 May 2019 13:55:33 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a9 From: Juri Linkov To: npostavs@gmail.com Subject: Re: bug#35689: Customizable char-fold Organization: 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> Date: Tue, 21 May 2019 23:34:20 +0300 In-Reply-To: <87zhnmgntu.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 16 May 2019 23:13:17 +0300") Message-ID: <87y32zwmtf.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddruddutddgudehjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdeliedrvdeftdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdeliedrvdeftddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehnphhoshhtrghvshesghhmrghilhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35689 Cc: 35689@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain >>> 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))) >> >> Instead of looking at symbol property values, which can make for a >> confusing time when setting variables outside of customize, I think it >> would be nicer to do something like this: >> >> (defcustom char-fold-include-base char-fold--include-base-default >> :initialize #'custom-initialize-changed >> :set (lambda (sym val) >> (set-default sym val) >> ;; FIXME: Maybe delay this until after-init-time, >> ;; to avoid redundant calls to char-fold-make-table. > > I tried different possible values of :initialize, > but not custom-initialize-changed. I'll try this now. I see no problems other than redundant calls to char-fold-make-table when more than one variable is customized. char-fold.el is autoloaded when isearch calls char-fold-to-regexp for the first time, so I'm not sure how after-init-hook could help in this case. --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=char-fold-defcustom.4.patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/char-fold.el b/lisp/char-fold.el index 426b1a9f84..16d6d484f0 100644 --- a/lisp/char-fold.el +++ b/lisp/char-fold.el @@ -21,13 +21,22 @@ =20 ;;; Code: =20 -(eval-and-compile (put 'char-fold-table 'char-table-extra-slots 1)) +(eval-and-compile + (put 'char-fold-table 'char-table-extra-slots 1) + (defconst char-fold--symmetric-default nil) + (defconst char-fold--include-alist-default + '((?\" "=EF=BC=82" "=E2=80=9C" "=E2=80=9D" "=E2=80=9D" "=E2=80=9E" "= =E2=B9=82" "=E3=80=9E" "=E2=80=9F" "=E2=80=9F" "=E2=9D=9E" "=E2=9D=9D" "=E2= =9D=A0" "=E2=80=9C" "=E2=80=9E" "=E3=80=9D" "=E3=80=9F" "=F0=9F=99=B7" "=F0= =9F=99=B6" "=F0=9F=99=B8" "=C2=AB" "=C2=BB") + (?' "=E2=9D=9F" "=E2=9D=9B" "=E2=9D=9C" "=E2=80=98" "=E2=80=99" "=E2= =80=9A" "=E2=80=9B" "=E2=80=9A" "=F3=A0=80=A2" "=E2=9D=AE" "=E2=9D=AF" "=E2= =80=B9" "=E2=80=BA") + (?` "=E2=9D=9B" "=E2=80=98" "=E2=80=9B" "=F3=A0=80=A2" "=E2=9D=AE"= "=E2=80=B9"))) + (defconst char-fold--exclude-alist-default nil)) + =0C -(defconst char-fold-table - (eval-when-compile - (let ((equiv (make-char-table 'char-fold-table)) - (equiv-multi (make-char-table 'char-fold-table)) - (table (unicode-property-table-internal 'decomposition))) +(eval-and-compile + (defun char-fold-make-table () + (let* ((equiv (make-char-table 'char-fold-table)) + (equiv-multi (make-char-table 'char-fold-table)) + (search-spaces-regexp nil) ; bug#35802 + (table (unicode-property-table-internal 'decomposition))) (set-char-table-extra-slot equiv 0 equiv-multi) =20 ;; Ensure the table is populated. @@ -75,7 +84,12 @@ char-fold-table (aref equiv-multi (car decomp)))) (aset equiv (car decomp) (cons (char-to-string char) - (aref equiv (car decomp)))))))) + (aref equiv (car decomp)))) + (when (or (bound-and-true-p char-fold-symmetric) + char-fold--symmetric-default) + (aset equiv char + (cons (char-to-string (car decomp)) + (aref equiv (car decomp))))))))) (funcall make-decomp-match-char decomp char) ;; Do it again, without the non-spacing characters. ;; This allows 'a' to match '=C3=A4'. @@ -97,13 +111,20 @@ char-fold-table table) =20 ;; Add some manual entries. - (dolist (it '((?\" "=EF=BC=82" "=E2=80=9C" "=E2=80=9D" "=E2=80=9D"= "=E2=80=9E" "=E2=B9=82" "=E3=80=9E" "=E2=80=9F" "=E2=80=9F" "=E2=9D=9E" = "=E2=9D=9D" "=E2=9D=A0" "=E2=80=9C" "=E2=80=9E" "=E3=80=9D" "=E3=80=9F" "= =F0=9F=99=B7" "=F0=9F=99=B6" "=F0=9F=99=B8" "=C2=AB" "=C2=BB") - (?' "=E2=9D=9F" "=E2=9D=9B" "=E2=9D=9C" "=E2=80=98" = "=E2=80=99" "=E2=80=9A" "=E2=80=9B" "=E2=80=9A" "=F3=A0=80=A2" "=E2=9D=AE= " "=E2=9D=AF" "=E2=80=B9" "=E2=80=BA") - (?` "=E2=9D=9B" "=E2=80=98" "=E2=80=9B" "=F3=A0=80=A2= " "=E2=9D=AE" "=E2=80=B9"))) + (dolist (it (or (bound-and-true-p char-fold-include-alist) + char-fold--include-alist-default)) (let ((idx (car it)) (chars (cdr it))) (aset equiv idx (append chars (aref equiv idx))))) =20 + ;; Remove some entries. + (dolist (it (or (bound-and-true-p char-fold-exclude-alist) + char-fold--exclude-alist-default)) + (let ((idx (car it)) + (char (cdr it))) + (when (aref equiv idx) + (aset equiv idx (remove (char-to-string char) (aref equiv id= x)))))) + ;; Convert the lists of characters we compiled into regexps. (map-char-table (lambda (char dec-list) @@ -112,7 +133,11 @@ char-fold-table (set-char-table-range equiv char re) (aset equiv char re)))) equiv) - equiv)) + equiv))) + +(defconst char-fold-table + (eval-when-compile + (char-fold-make-table)) "Used for folding characters of the same group during search. This is a char-table with the `char-fold-table' subtype. =20 @@ -135,6 +160,40 @@ char-fold-table =20 Exceptionally for the space character (32), ALIST is ignored.") =20 +(defcustom char-fold-symmetric char-fold--symmetric-default + "Include symmetric mappings from composite character back to base lett= er." + :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))) + :group 'matching + :version "27.1") + +(defcustom char-fold-include-alist char-fold--include-alist-default + "Additional character mappings to include." + :type '(alist :key-type (character :tag "From") + :value-type (repeat (string :tag "To"))) + :initialize #'custom-initialize-changed + :set (lambda (sym val) + (set-default sym val) + (setq char-fold-table (char-fold-make-table))) + :group 'lisp + :version "27.1") + +(defcustom char-fold-exclude-alist char-fold--exclude-alist-default + "Character mappings to exclude from default setting." + :type '(alist :key-type (character :tag "From") + :value-type (character :tag "To")) + :initialize #'custom-initialize-changed + :set (lambda (sym val) + (set-default sym val) + (setq char-fold-table (char-fold-make-table))) + :group 'lisp + :version "27.1") + (defun char-fold--make-space-string (n) "Return a string that matches N spaces." (format "\\(?:%s\\|%s\\)" --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 21 17:46:06 2019 Received: (at 35689) by debbugs.gnu.org; 21 May 2019 21:46:07 +0000 Received: from localhost ([127.0.0.1]:41172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTCaE-0005u0-Jw for submit@debbugs.gnu.org; Tue, 21 May 2019 17:46:06 -0400 Received: from mail-it1-f181.google.com ([209.85.166.181]:37264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTCa9-0005tJ-S1 for 35689@debbugs.gnu.org; Tue, 21 May 2019 17:46:03 -0400 Received: by mail-it1-f181.google.com with SMTP id m140so176422itg.2 for <35689@debbugs.gnu.org>; Tue, 21 May 2019 14:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=5g/CpX0Mkha4IIztV705L5r0Dp0Ou3k0QI/nCTy+wbo=; b=MtAOjovphypbvi0fBmort08f9ET3YhUnf/7KAd5hR1odvthJSbsyLB09TE2AuPFJTD 0x8LmS8BJLJwN9g3x70SYsmBPYaJPx0/KjJeboi2Lx/6NT+QeImZ4FjpfWUcuhkG/XVo b0tkogyVYxZ4SrPtaFCSIa8N4jlv3SaGjUTlR8QXnPlj8ocvpczihFEKn8ACtZ6SueiD wimtiG2eRb9EoVbWRrjNWd8btzf8gKbP6LGB2QcRdEa5DnzoSRnXwjXfrxZXFbEETfdG vzeibqLZBlKbCf8Wv+ezejT9julDva50eCqNhXpNxoG92t+JQB1MlFTaHWaLAZ12vZG7 UkPA== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=5g/CpX0Mkha4IIztV705L5r0Dp0Ou3k0QI/nCTy+wbo=; b=ViTOouNEXBym6pBPgB5Q5huF6gYrSI4g1n+pwcXYUCQYeAkCpbDUXSonATLGaOTntP OQxfi/KpMUPeJQyV/8/gEAIzYFKh7zypqAAe7IbWeU+Gqq0bd+LvcSQuNz5JXVEZyEEH WNxFqJdEeYGIlv865KbDinK8WjIAqOC1GbRENMmgOGABfFnSMVZT39NiYXGxS9BONH0g L8NG6NWot8gv2dy5x1Ixbv/TZHz8WwgnAKLzZzLBXP9kjRxPy1e7R18gz3WOrZ/93unS ILgtcC6rSaHnkpkpYa5dUrnxvEbES5KXVMJLNJFQ6RS2SCfuLL5TptdPo290suQFnJEJ 7ufA== X-Gm-Message-State: APjAAAXN553Ch+9YEwIpmdXRbLJ0010jL/8bdPM4f7ZOc7xBjXMkNQMG 2vKCwujrQW0k8vStbi2w6jeJFSnd X-Google-Smtp-Source: APXvYqyLCQwf7eeunhqbg0T92Kvbn21fi508KlIFafXCbqdRiGIWA7HCMzQ2V5lkyMnoiDZvQbXRBA== X-Received: by 2002:a02:6911:: with SMTP id e17mr9594167jac.144.1558475155925; Tue, 21 May 2019 14:45:55 -0700 (PDT) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id x23sm7056696iob.57.2019.05.21.14.45.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 14:45:55 -0700 (PDT) From: npostavs@gmail.com To: Juri Linkov Subject: Re: bug#35689: Customizable char-fold 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> Date: Tue, 21 May 2019 17:45:55 -0400 In-Reply-To: <87y32zwmtf.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 21 May 2019 23:34:20 +0300") Message-ID: <85woijcwh8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 35689 Cc: 35689@debbugs.gnu.org, npostavs@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) Juri Linkov writes: >>> :set (lambda (sym val) >>> (set-default sym val) >>> ;; FIXME: Maybe delay this until after-init-time, >>> ;; to avoid redundant calls to char-fold-make-table. >> >> I tried different possible values of :initialize, >> but not custom-initialize-changed. I'll try this now. > > I see no problems other than redundant calls to char-fold-make-table > when more than one variable is customized. char-fold.el is autoloaded > when isearch calls char-fold-to-regexp for the first time, so I'm not > sure how after-init-hook could help in this case. Ah, sorry, I had somehow got it into my head that char-fold.el is preloaded. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 06 16:53:54 2019 Received: (at 35689) by debbugs.gnu.org; 6 Jun 2019 20:53:54 +0000 Received: from localhost ([127.0.0.1]:50668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYzOU-0000bG-0o for submit@debbugs.gnu.org; Thu, 06 Jun 2019 16:53:54 -0400 Received: from anteater.elm.relay.mailchannels.net ([23.83.212.3]:30051) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYzOQ-0000at-1H for 35689@debbugs.gnu.org; Thu, 06 Jun 2019 16:53:50 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id DAEC93413F6; Thu, 6 Jun 2019 20:53:48 +0000 (UTC) Received: from pdx1-sub0-mail-a51.g.dreamhost.com (100-96-14-97.trex.outbound.svc.cluster.local [100.96.14.97]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 036E634013F; Thu, 6 Jun 2019 20:53:48 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a51.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); Thu, 06 Jun 2019 20:53:48 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Madly-Shade: 28ea16946c4dc19a_1559854428714_614976920 X-MC-Loop-Signature: 1559854428714:2285077579 X-MC-Ingress-Time: 1559854428713 Received: from pdx1-sub0-mail-a51.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a51.g.dreamhost.com (Postfix) with ESMTP id 5C5DF83614; Thu, 6 Jun 2019 13:53:47 -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=+IEQMloKeatM7pWWmWGbMY7JlHE=; b= hd6CZVsWAFY4apxKXExdwV2qDgjTDHjbRL3+qCi3ZgbT0fpUCcVPspT826pWcHN3 RogxNuH1uXyqUn/0VGNJcON/lzvZ9Tqm8aHmBZ9HMekINEhvAP21Usi6BLkNQe7w sSEjFk6bQjt/DcD6lJv3KN2V7OXWuK7blE1sIzefb0g= Received: from mail.jurta.org (m91-129-96-73.cust.tele2.ee [91.129.96.73]) (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-a51.g.dreamhost.com (Postfix) with ESMTPSA id CB2318361A; Thu, 6 Jun 2019 13:53:45 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a51 From: Juri Linkov To: npostavs@gmail.com Subject: Re: bug#35689: Customizable char-fold Organization: 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> <85woijcwh8.fsf@gmail.com> Date: Thu, 06 Jun 2019 23:49:45 +0300 In-Reply-To: <85woijcwh8.fsf@gmail.com> (npostavs@gmail.com's message of "Tue, 21 May 2019 17:45:55 -0400") Message-ID: <87r286e8wm.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrudeggedgudehiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdeliedrjeefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleeirdejfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehnphhoshhtrghvshesghhmrghilhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35689 Cc: 35689@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>> :set (lambda (sym val) >>>> (set-default sym val) >>>> ;; FIXME: Maybe delay this until after-init-time, >>>> ;; to avoid redundant calls to char-fold-make-table. >>> >>> I tried different possible values of :initialize, >>> but not custom-initialize-changed. I'll try this now. >> >> I see no problems other than redundant calls to char-fold-make-table >> when more than one variable is customized. char-fold.el is autoloaded >> when isearch calls char-fold-to-regexp for the first time, so I'm not >> sure how after-init-hook could help in this case. > > Ah, sorry, I had somehow got it into my head that char-fold.el is > preloaded. I still haven't found a way to avoid calling char-fold-make-table 3 times when 3 variables are customized. Maybe this is not possible because currently customizable variables have no dependency on each other. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 24 13:33:52 2019 Received: (at 35689) by debbugs.gnu.org; 24 Jun 2019 17:33:52 +0000 Received: from localhost ([127.0.0.1]:57901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfSqm-0006S3-Iv for submit@debbugs.gnu.org; Mon, 24 Jun 2019 13:33:52 -0400 Received: from quimby.gnus.org ([80.91.231.51]:33942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfSqk-0006Rr-Qp for 35689@debbugs.gnu.org; Mon, 24 Jun 2019 13:33:51 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfSqg-0005qp-4T; Mon, 24 Jun 2019 19:33:48 +0200 From: Lars Ingebrigtsen To: Juri Linkov Subject: Re: bug#35689: Customizable char-fold 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> Date: Mon, 24 Jun 2019 19:33:45 +0200 In-Reply-To: <87y32zwmtf.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 21 May 2019 23:34:20 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: > -(defconst char-fold-table [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35689 Cc: 35689@debbugs.gnu.org, npostavs@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > -(defconst char-fold-table [...] > +(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? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 24 16:48:08 2019 Received: (at 35689) by debbugs.gnu.org; 24 Jun 2019 20:48:08 +0000 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 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 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) 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 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 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= 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 From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#35689: Customizable char-fold Organization: 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> Date: Mon, 24 Jun 2019 23:40:17 +0300 In-Reply-To: (Lars Ingebrigtsen's message of "Mon, 24 Jun 2019 19:33:45 +0200") Message-ID: <871rzi7owu.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddruddvgdduheejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdelrddvtdelnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtledrvddtledprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehlrghrshhisehgnhhushdrohhrghenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35689 Cc: 35689@debbugs.gnu.org, npostavs@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> +(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. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 23 16:30:14 2019 Received: (at 35689-done) by debbugs.gnu.org; 23 Jul 2019 20:30:14 +0000 Received: from localhost ([127.0.0.1]:35687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hq1QM-0006U6-AK for submit@debbugs.gnu.org; Tue, 23 Jul 2019 16:30:14 -0400 Received: from caracal.birch.relay.mailchannels.net ([23.83.209.30]:9675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hq1QJ-0006Tt-Tb for 35689-done@debbugs.gnu.org; Tue, 23 Jul 2019 16:30:12 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 96FCF22A06 for <35689-done@debbugs.gnu.org>; Tue, 23 Jul 2019 20:30:10 +0000 (UTC) Received: from pdx1-sub0-mail-a97.g.dreamhost.com (100-96-38-36.trex.outbound.svc.cluster.local [100.96.38.36]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id BA8B622991 for <35689-done@debbugs.gnu.org>; Tue, 23 Jul 2019 20:30:04 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a97.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.3); Tue, 23 Jul 2019 20:30:10 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Callous-Juvenile: 709e8f6f27f36d0b_1563913804876_940704726 X-MC-Loop-Signature: 1563913804876:2661339323 X-MC-Ingress-Time: 1563913804876 Received: from pdx1-sub0-mail-a97.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a97.g.dreamhost.com (Postfix) with ESMTP id 644B280AAA for <35689-done@debbugs.gnu.org>; Tue, 23 Jul 2019 13:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=kAz+5Mnsga8gOY34ECrejsIFZiE=; b= YEgmcha/9NCKZmOJ0yMJxG6hdcXvgxQqvosgMq2oTeCir++ObVMCeCbv85vEtC5y ggTEtSeM6RoEUo3kNE8caY/R15xXFg4XiKKxb4aY/qpZNHZJ2WIJGuLmwISUOS2E wn4onXH/drlpYTCiRSoEnK5V4tDYHTnE95wE2owLgOk= Received: from mail.jurta.org (m91-129-106-30.cust.tele2.ee [91.129.106.30]) (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-a97.g.dreamhost.com (Postfix) with ESMTPSA id 104CD80AA6 for <35689-done@debbugs.gnu.org>; Tue, 23 Jul 2019 13:29:58 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a97 From: Juri Linkov To: 35689-done@debbugs.gnu.org Subject: Re: bug#35689: Customizable char-fold References: <87imug8z4i.fsf@mail.linkov.net> Date: Tue, 23 Jul 2019 23:28:09 +0300 In-Reply-To: <87imug8z4i.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 12 May 2019 00:22:53 +0300") Message-ID: <87sgqwv6li.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrjeekgddugeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdeirdeftdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdeirdeftddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopeefheeikeelqdguohhnvgesuggvsggsuhhgshdrghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35689-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thanks to everyone who helped! Pushed to master as 376f5df3cc. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 28 18:48:24 2019 Received: (at 35689) by debbugs.gnu.org; 28 Jul 2019 22:48:24 +0000 Received: from localhost ([127.0.0.1]:47327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrrxo-0005Eb-6S for submit@debbugs.gnu.org; Sun, 28 Jul 2019 18:48:24 -0400 Received: from fossa.birch.relay.mailchannels.net ([23.83.209.62]:64871) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrrxl-0005EJ-9x; Sun, 28 Jul 2019 18:48:22 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id BC6945009B0; Sun, 28 Jul 2019 22:48:19 +0000 (UTC) Received: from pdx1-sub0-mail-a90.g.dreamhost.com (100-96-14-95.trex.outbound.svc.cluster.local [100.96.14.95]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 35546500E66; Sun, 28 Jul 2019 22:48:19 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a90.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.3); Sun, 28 Jul 2019 22:48:19 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Stretch-Suffer: 57f980a00a4d607a_1564354099488_3693519063 X-MC-Loop-Signature: 1564354099488:2765408791 X-MC-Ingress-Time: 1564354099488 Received: from pdx1-sub0-mail-a90.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a90.g.dreamhost.com (Postfix) with ESMTP id AF35B7FD13; Sun, 28 Jul 2019 15:48:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=fIqKrDjLCxzWLirbV313Xm+IPGU=; b= UaYAMjvbjkjLd5oDyTnzYYZS3YZrNYYVeVOOPY078C8UxuYoFZ9tdVDsNL8sSk4R 46tEV2U/VSpUoNrbLnTcDB6zmrplG8HSQrJWt1olGvHrhwOhIJo22is8Rqos929p Bw9WbpXbogThJYRicYmITg32vvPZpjym9f0HT8WB4XY= Received: from mail.jurta.org (m91-129-103-76.cust.tele2.ee [91.129.103.76]) (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-a90.g.dreamhost.com (Postfix) with ESMTPSA id 190B17FD0F; Sun, 28 Jul 2019 15:48:12 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a90 From: Juri Linkov To: 35689@debbugs.gnu.org Subject: Re: bug#35689: Customizable char-fold References: <87imug8z4i.fsf@mail.linkov.net> Date: Mon, 29 Jul 2019 01:46:55 +0300 In-Reply-To: <87imug8z4i.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 12 May 2019 00:22:53 +0300") Message-ID: <877e81pyjk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrledtgddufecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhfffgjkfgfgggtsehmtderredtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtfedrjeeinecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtfedrjeeipdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepfeehieekleesuggvsggsuhhgshdrghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35689 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain tags 35689 + fixed close 35689 27.0.50 quit I'm closing this customization feature request. More default values for char-folding could be added depending on user's locale. But this is another feature that could be implemented within i18n efforts. PS: As a demonstration what the current customization feature can achieve, I'm attaching a short snippet that allows searching using Cyrillic translit: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=char-fold-translit.el Content-Transfer-Encoding: quoted-printable (require 'char-fold) (setq char-fold-symmetric t) ;; Allow searching with Cyrillic translit ;; https://en.wikipedia.org/wiki/Transliteration ;; https://en.wikipedia.org/wiki/Romanization_of_Russian#Transliteration_ta= ble (setq char-fold-include (append char-fold-include '((?=D0=B0 "a") (?=D0=B1 "b") (?=D0=B2 "v" "w") (?=D0=B3 "g") (?=D0=B4 "d") (?=D0=B5 "e") (?=D1=91 "jo" "yo") (?=D0=B6 "zh") (?=D0=B7 "z") (?=D0=B8 "i") (?=D0=B9 "j" "y") (?=D0=BA "k") (?=D0=BB "l") (?=D0=BC "m") (?=D0=BD "n") (?=D0=BE "o") (?=D0=BF "p") (?=D1=80 "r") (?=D1=81 "s") (?=D1=82 "t") (?=D1=83 "u") (?=D1=84 "f") (?=D1=85 "h") (?=D1=86 "c") (?=D1=87 "ch") (?=D1=88 "sh") (?=D1=89 "sch") (?=D1=8B "y") (?=D1=8D "e") (?=D1=8E "ju" "yu") (?=D1=8F "ja" "ya")))) ;; Also allow search to match accented Cyrillic chars, so e.g. in etc/HELLO ;; =E2=80=9C=D0=97=D0=B4=D1=80=D0=B0=D0=B2=D1=81=D1=82=D0=B2=D1=83=D0=B9=D1= =82=D0=B5=E2=80=9D will match =E2=80=9C=D0=97=D0=B4=D1=80=D0=B0=CC=81=D0=B2= =D1=81=D1=82=D0=B2=D1=83=D0=B9=D1=82=D0=B5=E2=80=9D and vice versa: (setq char-fold-include (append char-fold-include '((?=D0=B0 "=D0=B0=CC=81") (?=D0=90 "=D0=90=CC=81") (?=D0=B5 "=D0=B5=CC=81") (?=D0=95 "=D0=95=CC=81") (?=D0=B8 "=D0=B8=CC=81") (?=D0=98 "=D0=98=CC=81") (?=D0=BE "=D0=BE=CC=81") (?=D0=9E "=D0=9E=CC=81") (?=D1=83 "=D1=83=CC=81") (?=D0=A3 "=D0=A3=CC=81") (?=D1=8B "=D1=8B=CC=81") (?=D0=AB "=D0=AB=CC=81") (?=D1=8D "=D1=8D=CC=81") (?=D0=AD "=D0=AD=CC=81") (?=D1=8E "=D1=8E=CC=81") (?=D0=AE "=D0=AE=CC=81") (?=D1=8F "=D1=8F=CC=81") (?=D0=AF "=D0=AF=CC=81")))) (char-fold-update-table) --=-=-=-- From unknown Wed Jun 18 23:03:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 26 Aug 2019 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator