From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: What's the best way to do "string-memq"? Date: Mon, 10 Nov 2008 11:00:55 -0800 Message-ID: <000001c94366$a9511bc0$c2b22382@us.oracle.com> References: <20081110181422.GB1961@muc.de><001501c94360$a6f2ef30$c2b22382@us.oracle.com> <20081110190258.GC1961@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1226343706 1308 80.91.229.12 (10 Nov 2008 19:01:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Nov 2008 19:01:46 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "'Alan Mackenzie'" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 10 20:02:47 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kzc1x-0002Bt-0S for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Nov 2008 20:02:33 +0100 Original-Received: from localhost ([127.0.0.1]:45785 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kzc0p-0007zl-FD for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Nov 2008 14:01:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kzc0V-0007zc-KI for help-gnu-emacs@gnu.org; Mon, 10 Nov 2008 14:01:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kzc0T-0007zH-Td for help-gnu-emacs@gnu.org; Mon, 10 Nov 2008 14:01:02 -0500 Original-Received: from [199.232.76.173] (port=36850 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kzc0T-0007zE-QJ for help-gnu-emacs@gnu.org; Mon, 10 Nov 2008 14:01:01 -0500 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:37741 helo=rgminet12.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kzc0T-0000Qj-DA for help-gnu-emacs@gnu.org; Mon, 10 Nov 2008 14:01:01 -0500 Original-Received: from acsinet13.oracle.com (acsinet13.oracle.com [141.146.126.235]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id mAAJ0pqR026203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 10 Nov 2008 19:00:52 GMT Original-Received: from acsmt700.oracle.com (acsmt700.oracle.com [141.146.40.70]) by acsinet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id mAAJ15ak032678; Mon, 10 Nov 2008 19:01:07 GMT Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 10 Nov 2008 19:00:53 +0000 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <20081110190258.GC1961@muc.de> Thread-Index: AclDZY4BcWXy1MyVSp2z486H7e9v0gAAIELA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt700.oracle.com [141.146.40.70] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.491884E8.0062:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59619 Archived-At: > > (string-match (regexp-quote > > (char-to-string (char-after))) > > skip-chars) > > > (member (char-after) (string-to-list skip-chars)) > > The non-nil isn't a problem at all. > > But thanks for the tip! I probably won't want to use > `string-to-list', since it's in mule, and mule wasn't > included as standard in some previous Emacs, (Was it 20 or 21?). `string-to-list' is available in emacs -Q for both Emacs 20 and 21. That said, you might well not want to create a list here. > But string-to-list is nothing more than: > > (defsubst string-to-list (string) > "Return a list of characters in STRING." > (append string nil)) > > , so I think I can use `append' directly. But what a kludge it is! > > (append "asdf" "1234!) => (?a ?s ?d ?f "1234) > > . It's almost embarrassing. ;-( > > Thanks again! This list always comes up with the goods. `append' with a nil second arg is a typical way to convert sequences (such as strings and vectors) to lists.