From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: How to check whether a character (or one-character string) is a letter? Date: Sat, 04 Oct 2014 03:38:46 +0200 Message-ID: <871tqo397d.fsf@gmail.com> References: <87iok0y8wr.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1412386776 8910 80.91.229.3 (4 Oct 2014 01:39:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Oct 2014 01:39:36 +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 03:39:26 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 1XaEJh-0000vc-PO for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Oct 2014 03:39:25 +0200 Original-Received: from localhost ([::1]:41955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaEJh-0003sU-E7 for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Oct 2014 21:39:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaEJQ-0003sD-EP for help-gnu-emacs@gnu.org; Fri, 03 Oct 2014 21:39:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XaEJK-0005hj-BR for help-gnu-emacs@gnu.org; Fri, 03 Oct 2014 21:39:08 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:34640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaEJK-0005hf-4D for help-gnu-emacs@gnu.org; Fri, 03 Oct 2014 21:39:02 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XaEJH-0000n8-6A for help-gnu-emacs@gnu.org; Sat, 04 Oct 2014 03:38:59 +0200 Original-Received: from e178061012.adsl.alicedsl.de ([85.178.61.12]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 04 Oct 2014 03:38:59 +0200 Original-Received: from tjolitz by e178061012.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 04 Oct 2014 03:38:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178061012.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:64zLV635NFGGb5fUS+q8GQpJvuY= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:100257 Archived-At: Marcin Borkowski writes: Hello, > this is a problem I have. > > 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? > > The reason I'm asking is that I'm writing a function which converts an > arbitrary string to a valid (and nice) filename (e.g., only letters and > hyphens) - so basically I want to walk a string character by character > and convert any space to a hyphen and omit any other non-letter. Am I > reinventing the wheel? there is something similar in PicoLisp: #+BEGIN_SRC picolisp :results pp (fold "abc-?/@ä-12 YZ #+ü") #+END_SRC #+results: : "abcä12yzü" but not quite ... -- cheers, Thorsten