From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Regexp capturing unicode characters Date: Thu, 01 Aug 2024 13:43:20 +0000 Message-ID: References: <865xskygar.fsf@gnu.org> <2wHi4S9MruOl3ZOkpjKnin3CJxnVnomMkaIdhl-i3OF7AYEda3X-7-1ijhWUrLZ22JwOMXQu5ntZ3FFBuAlmhkpMxgXFbhZ-sS_XMmCrE4g=@protonmail.com> <86le1gwii6.fsf@gnu.org> 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="4939"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 01 15:44:13 2024 Return-path: Envelope-to: geh-help-gnu-emacs@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 1sZW6G-00019t-2Y for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 01 Aug 2024 15:44:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZW5d-0004wf-Ab; Thu, 01 Aug 2024 09:43:33 -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 1sZW5a-0004ss-Ob for help-gnu-emacs@gnu.org; Thu, 01 Aug 2024 09:43:30 -0400 Original-Received: from mail-40130.protonmail.ch ([185.70.40.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZW5X-0006as-Ug; Thu, 01 Aug 2024 09:43:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1722519804; x=1722779004; bh=cBtJQpHWEoSvsDx+k1zMsGqYKHRxDS5ivDIi3WpIuKY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=cvgcds2BnsTdX6OeI78hN5qgk/PLgPGZ822+g1Rqh3CZ7j3fWvzYAmTiyaQ7ai/8h 5Z9Yu44eRLFJbjCfznn4tdxgc3AUpeDovxzkl3Z+J0QyEmmqTx22W81ntuxrK8rDJI Cd0RQ9QGqnANq4RHn5sTXMzggM5gG0r09LNDiLqBflYcybYujOkgBu/9UEkm3sqKfM MlLtfsHzuAMkI5EZMENVF3g/9OyP8qRwi4FrSqmL5Dfdbu1e8CXHsnYfNJJ+IHRkqp z3TdlUkwauyWHsOODTnYlV18y/3LRCw+52jiDxyObMkqYu5hEWa6sYuZ3HnVp8TU7w xVOGxblPXDL0Q== In-Reply-To: <86le1gwii6.fsf@gnu.org> Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 7be0c6e12a3ca3eef3a8558491ff008f7a89626a Received-SPF: pass client-ip=185.70.40.130; envelope-from=heimeborgia@protonmail.com; helo=mail-40130.protonmail.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147483 Archived-At: On Friday, August 2nd, 2024 at 12:10 AM, Eli Zaretskii wrote= : > > Date: Thu, 01 Aug 2024 11:26:40 +0000 > > From: Heime heimeborgia@protonmail.com > > Cc: help-gnu-emacs@gnu.org > >=20 > > On Thursday, August 1st, 2024 at 5:15 PM, Eli Zaretskii eliz@gnu.org wr= ote: > >=20 > > > > Date: Wed, 31 Jul 2024 21:24:46 +0000 > > > > From: Heime heimeborgia@protonmail.com > > > >=20 > > > > I am using unicode characters in my elisp code (e.g. foreign langua= ge symbols in icelandic > > > > and spanish). > > > >=20 > > > > Is the regexp [[:word:]] appropriate to capture them ? > > >=20 > > > No. [[:word:]] matches characters that have the word syntax, so which > > > characters match depends on the major mode. My suggestion is to use > > > either [[:alnum:]] or [[:alpha:]] instead, depending on whether you > > > want or don't want to match digit characters. > > >=20 > > > The meaning of each character class is documented in the "Char > > > Classes" node of the ELisp Reference manual, I suggest to read it and > > > choose the most appropriate one for your needs. > >=20 > > It is difficult to determine from a character class, the actual charact= er. >=20 > Why do you need that? Don't you know which characters you'd like to > match? No, because language insertion in emacs depends upon the user. But I want= =20 to match foreign language characters mostly. =20 > > Is there a way to show the characters that are members of each class ? >=20 > No, but you can check each character whether it matches a class. What is the function name for doing that ? Can one scan the buffer and list the matched character classes ? =20 > > Thought that [:multibyte:] captured the unicode characters. Bet even wh= en > > I applied (set-buffer-multibyte t) to the buffer, I did not get matches= . >=20 > Don't use [:multibyte:], it is hardly ever the right thing nowadays. Can we update the manual with useful information such as with [:multibyte:]= please. =20 > > Does [:word:] mean word in the english language only ? >=20 >=20 > No, it means characters that have the word syntax. IOW, which > character match depends on the major mode's syntax table. If you are > classifying characters from human-readable text, [:word:] is not the > right thing to use. Can one show the syntax table ? For me it is just word syntax table does= =20 not give me enough information. Perhaps give more explanation in the manua= l.