From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How to check whether a character (or one-character string) is a letter? Date: Sat, 04 Oct 2014 10:29:38 +0300 Message-ID: <83r3yogun1.fsf@gnu.org> References: <87iok0y8wr.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1412407808 15191 80.91.229.3 (4 Oct 2014 07:30:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Oct 2014 07:30:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 04 09:30:01 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XaJmy-0003EV-N6 for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Oct 2014 09:30:00 +0200 Original-Received: from localhost ([::1]:42868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaJmy-00089x-BE for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Oct 2014 03:30:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaJmi-00089h-MX for help-gnu-emacs@gnu.org; Sat, 04 Oct 2014 03:29:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XaJmb-0000ZE-MV for help-gnu-emacs@gnu.org; Sat, 04 Oct 2014 03:29:44 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:52102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaJmb-0000Z7-Et for help-gnu-emacs@gnu.org; Sat, 04 Oct 2014 03:29:37 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NCW00D00RH3DG00@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Sat, 04 Oct 2014 10:29:36 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NCW00DRYSTBCX40@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Sat, 04 Oct 2014 10:29:36 +0300 (IDT) In-reply-to: <87iok0y8wr.fsf@wmi.amu.edu.pl> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100265 Archived-At: > From: Marcin Borkowski > Date: Sat, 04 Oct 2014 02:29:24 +0200 > > Assume that I have a character (taken from some string, which in turn is > copied from the buffer - so it need not be ASCII). What is the best way > to check whether it is a letter within ASCII range? One way is this: (= 1 (string-bytes (char-to-string ch))) where 'ch' is the character you want to test. Note that this will pass any 7-bit ASCII character, including control characters, digits, and punctuation, not just "letters".