From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Hansen Newsgroups: gmane.emacs.devel Subject: Re: string-strip Date: Mon, 19 Jun 2006 22:20:50 +0200 Message-ID: <44970722.9080900@soem.dk> References: <449266B2.7030500@easy-emacs.de> <4496E618.8090401@soem.dk> <32964.128.165.123.239.1150741470.squirrel@webmail.lanl.gov> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1150748500 24588 80.91.229.2 (19 Jun 2006 20:21:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 19 Jun 2006 20:21:40 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 19 22:21:38 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FsQFS-0005Dq-86 for ged-emacs-devel@m.gmane.org; Mon, 19 Jun 2006 22:21:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsQFQ-0002ep-Df for ged-emacs-devel@m.gmane.org; Mon, 19 Jun 2006 16:21:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FsQFF-0002eN-6z for emacs-devel@gnu.org; Mon, 19 Jun 2006 16:21:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FsQF7-0002cE-2m for emacs-devel@gnu.org; Mon, 19 Jun 2006 16:21:12 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsQF6-0002cB-TV for emacs-devel@gnu.org; Mon, 19 Jun 2006 16:21:04 -0400 Original-Received: from [212.99.225.245] (helo=odin.broadcom.dk) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FsQPS-0005wl-63 for emacs-devel@gnu.org; Mon, 19 Jun 2006 16:31:46 -0400 Original-Received: from pppoe3-ves.broadcom.dk ([212.99.255.42] helo=[10.17.0.131]) by odin.broadcom.dk with esmtp (Exim 4.24; FreeBSD) id 1FsQDT-0001H4-O8; Mon, 19 Jun 2006 22:19:23 +0200 User-Agent: Debian Thunderbird 1.0.2 (X11/20060423) X-Accept-Language: en-us, en Original-To: herring@lanl.gov In-Reply-To: <32964.128.165.123.239.1150741470.squirrel@webmail.lanl.gov> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56008 Archived-At: Stuart D. Herring wrote: >>1. Allow newlines in STR. >>2. Treat newlines as white space. >> >> > >Shouldn't it really be up to the syntax table? Or is this supposed to be >so much in Lisp land that the buffer shouldn't matter? > At least newlines should be allowed. (my-string-strip " foo\n ") => (args-out-of-range " foo\n" 8 9) (my-string-strip " foo\nbar ") => " " is not acceptable IMO. >>3. Return nil when resulting string is empty. >> >> > >Why do we want to do that? > To do something like (defun (str) (setq str (string-strip str)) (if str ;; handle string ... ;; no input ... >"trailing", of course. > :-) >"length", of course. > > :-o