From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Frederickson Newsgroups: gmane.emacs.devel Subject: Re: lisp-mode: how to disable parentheses matching on non-ASCII '[({]' '[})]' UTF-8 parenthesis chars ? Date: Tue, 08 Aug 2023 12:10:13 -0500 Message-ID: <87a5v1piiy.fsf@arch.mail-host-address-is-not-set> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5507"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Jason Vas Dias , jason.vas.dias@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 08 19:14:28 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qTQHr-0001BY-8e for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Aug 2023 19:14:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qTQDt-0004KM-Pb; Tue, 08 Aug 2023 13:10:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qTQDr-00045b-Vi for emacs-devel@gnu.org; Tue, 08 Aug 2023 13:10:20 -0400 Original-Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qTQDo-0003my-T1 for emacs-devel@gnu.org; Tue, 08 Aug 2023 13:10:18 -0400 Original-Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-348ccbf27eeso24779905ab.0 for ; Tue, 08 Aug 2023 10:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691514615; x=1692119415; h=content-transfer-encoding:mime-version:message-id:date:cc :references:in-reply-to:subject:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kPrIKdNkRyy7478bok5HE3pcaq89xHnjzQkiJmNB/Cg=; b=HAeLbvN28Fw77xp9C2ol6CM/ZHeSYcmyVkdGRzGNjL/3FtiQIMSPUg01UqyXBCcUT2 5Y5/+FO5EtI6/FjnFKxw1Vn+eysGOyPXO8nGNuB207x/4RMHmA4nEoNGK2PoWxy3ADCM rRqFKVAa8r3HLHpjoxHBWQasPYHQNO9B03FDvmYs5juO4r+et1PC0gDUqS6ep0BnQTAI 8Z/CvEO+4XNKR697ZDvQQVlXC49ZxioIlylg8beQ5qR7hMz40Sm+5ixflw0wnEU5rQn9 xuPL0i2Xgu4RGgGzE+jf4zRfuniFn8bmANjcmloLIkgR309LhIM9RAJ3Jr+HhMRy7TUL N0RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691514615; x=1692119415; h=content-transfer-encoding:mime-version:message-id:date:cc :references:in-reply-to:subject:to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=kPrIKdNkRyy7478bok5HE3pcaq89xHnjzQkiJmNB/Cg=; b=N/1bGVR6M1xmyhJlsGtD7bP1v9/MnTLMPEJ8gSEZqGdUZHVYgvZ0XHDahzlCDD82op tzcM9sN4R/wAqRcb4jm7oZJTdkzVsI1Fe0MbWIxanTl5D6qnQN+lYrbX77Jsb3V9epFt ousIlNAB2FqdJf7W4R/hS52ev2pQ8mgFYiB7JmrVPBGG43IPFPqZYtTS+aGPBSkRlkjL bK+LNuh3ANocuNZsmYvehiLG4ZDE1H8tnnEUMmlPpbY0tr9NhYw00g67pdXDohNmYoeu tXJonMZDfJ6wPHClvFuR/opZZv3Z1tfjCjOu/K6P6/SnWF3b/K61q2VwXbHlGjXR720f 5Kyg== X-Gm-Message-State: AOJu0YyStkesjCsioy23x6CT4YfH3G6Ig3Qkoi3zfthz6qoE4tNXPS/r y+V+iW9VdHM0ykj8HWyssEY= X-Google-Smtp-Source: AGHT+IGWFL3ftRZ07jz+0Ghd7oWl5iWntH3Kv4/Y3kk6PlX0bhnz8CaClJMn7pP6DvqQHG2s4XvGGQ== X-Received: by 2002:a05:6e02:1d03:b0:347:693a:a52b with SMTP id i3-20020a056e021d0300b00347693aa52bmr469535ila.6.1691514615201; Tue, 08 Aug 2023 10:10:15 -0700 (PDT) Original-Received: from localhost ([2604:2d80:6704:d700:66c:59ff:feb0:491f]) by smtp.gmail.com with ESMTPSA id ei2-20020a05663829a200b00428737ce527sm3299745jab.63.2023.08.08.10.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 10:10:14 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::133; envelope-from=ericfrederickson68@gmail.com; helo=mail-il1-x133.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308446 Archived-At: "Jason Vas Dias" writes: > Good day - > > How to get emacs LISP program editing modes to ignore > UTF-8 parentheses characters like '=E3=80=8A' (\U300A) or : > 10088 2768 (3 2) =E2=9D=A8 'MEDIUM LEFT PARENTHESIS ORNAMENT' > 10089 2769 (3 2) =E2=9D=A9 'MEDIUM RIGHT PARENTHESIS ORNAMENT' > 10090 276A (3 2) =E2=9D=AA 'MEDIUM FLATTENED LEFT PARENTHESIS ORNAME= NT' > 10091 276B (3 2) =E2=9D=AB 'MEDIUM FLATTENED RIGHT PARENTHESIS ORNAM= ENT' > 10222 27EE (5 1) =E2=9F=AE 'MATHEMATICAL LEFT FLATTENED PARENTHESIS' > 10223 27EF (5 1) =E2=9F=AF 'MATHEMATICAL RIGHT FLATTENED PARENTHESIS' > 10629 2985 (3 2) =E2=A6=85 'LEFT WHITE PARENTHESIS' > 10630 2986 (3 2) =E2=A6=86 'RIGHT WHITE PARENTHESIS' > 11816 2E28 (5 1) =E2=B8=A8 'LEFT DOUBLE PARENTHESIS' > 11817 2E29 (5 1) =E2=B8=A9 'RIGHT DOUBLE PARENTHESIS' > 64830 FD3E (1 1) =EF=B4=BE 'ORNATE LEFT PARENTHESIS' > 64831 FD3F (1 1) =EF=B4=BF 'ORNATE RIGHT PARENTHESIS' > 12298 300A (1 1) =E3=80=8A 'LEFT DOUBLE ANGLE BRACKET' > 12299 300B (1 1) =E3=80=8B 'RIGHT DOUBLE ANGLE BRACKET' > 65113 FE59 (1 1) =EF=B9=99 'SMALL LEFT PARENTHESIS' > 65114 FE5A (1 1) =EF=B9=9A 'SMALL RIGHT PARENTHESIS' > 65288 FF08 (1 1) =EF=BC=88 'FULLWIDTH LEFT PARENTHESIS' > 65289 FF09 (1 1) =EF=BC=89 'FULLWIDTH RIGHT PARENTHESIS' > 65375 FF5F (3 2) =EF=BD=9F 'FULLWIDTH LEFT WHITE PARENTHESIS' > 65376 FF60 (3 2) =EF=BD=A0 'FULLWIDTH RIGHT WHITE PARENTHESIS' Your problem (although I'm assuming this wouldn't be a problem for most use= rs) is that all the above characters are defined to be opening/closing delimite= rs in the syntax table for elisp-mode. (You can view the syntax table for the current major mode with "C-h s"). In order to disable their treatment as opening or closing delimiters, use t= he modify-syntax-entry funtion as described above on this thread. For instance: (modify-syntax-entry ?=E2=9D=A8 "w") to put MEDIUM-LEFT-PARENTHESIS-ORNAMENT in the word class instead of the opening-delimeter class. Doing this for all the characters you specified wi= ll give you your desired behavior. See this section of the Emacs wiki: https://www.emacswiki.org/emacs/EmacsSyntaxTable#h5o-4 for information on how to put these types configurations in your init file = so that they will be in effect every time you enter elisp-mode. Best, Eric Frederickson > Please could some emacs guru let me know how the 'lisp-mode' based sou= rce > editing modes can be made to ignore / treat as normal characters such = not-ascii-'(' and > not-ascii-')' characters and to NOT attempt to balance them or to > consider them parenthesis syntax ? No LISP parser I am using > considers them to be syntax. > > It is really annoying to have to turn all parenthesis balancing off > when my lisp source code files might contain such valid unicode charac= ters. > > I am running Emacs 28.2 I built as RPM with modified Fedora emacs > spec file under Fedora Linux v36 x86_64 . > > Thanks & Best Regards, > Jason