From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r115287: * lisp/emacs-lisp/helpers.el (string-empty-p): New function. Date: Fri, 29 Nov 2013 23:29:57 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b604cbc2804a404ec57884d X-Trace: ger.gmane.org 1385760600 973 80.91.229.3 (29 Nov 2013 21:30:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Nov 2013 21:30:00 +0000 (UTC) Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 29 22:30:06 2013 Return-path: Envelope-to: ged-emacs-devel@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 1VmVdW-0007ko-3f for ged-emacs-devel@m.gmane.org; Fri, 29 Nov 2013 22:30:06 +0100 Original-Received: from localhost ([::1]:49535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmVdV-0006fH-Ir for ged-emacs-devel@m.gmane.org; Fri, 29 Nov 2013 16:30:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmVdR-0006dy-95 for emacs-devel@gnu.org; Fri, 29 Nov 2013 16:30:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VmVdO-0002D1-Ko for emacs-devel@gnu.org; Fri, 29 Nov 2013 16:30:01 -0500 Original-Received: from mail-ob0-x233.google.com ([2607:f8b0:4003:c01::233]:39871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmVdO-0002Cu-EU for emacs-devel@gnu.org; Fri, 29 Nov 2013 16:29:58 -0500 Original-Received: by mail-ob0-f179.google.com with SMTP id wm4so10476904obc.38 for ; Fri, 29 Nov 2013 13:29:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=VW4apXU7SaDkxolU6Zv2V3gfJfLNrqC/bSE78+oVufk=; b=K0l04OMO5bf5/ts/KS7EZuatZTPF+j6eySPBotZ0zoBS3MlPxa/APUOhe6rZaJtxfV dpBF1m8uaYG6dRLUaTr6ek8BNkHWqgCyFDdb6wkZJwEXLfrLxuIi5B635qpWfd8gGl8z pmof7PYizqye1gD1yYM76I9cVs8nt1C3KeLYNzjEoXfk7x7LP1V62C5Zjq22uxryDl7f G1X6NFokGI9QUks1V/DqTl4wGaf4rmIUsswCKw/U5IUq6Il9UAVOZO2OA/b692aOZuBY ftDx/j7CU0dMcoC7kjkkGVgcvIS14bhvtMNnOfszhI87mUccjMXm+3gydGymC77sXpwb rjTQ== X-Received: by 10.182.65.36 with SMTP id u4mr44616024obs.31.1385760597474; Fri, 29 Nov 2013 13:29:57 -0800 (PST) Original-Received: by 10.76.175.102 with HTTP; Fri, 29 Nov 2013 13:29:57 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: ORk07oiAUXLrn59gwGyMjA9LY0g X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:165901 Archived-At: --047d7b604cbc2804a404ec57884d Content-Type: text/plain; charset=UTF-8 On 29 November 2013 20:23, Stefan Monnier wrote: > > + (string= string "")) > > I think `equal' is preferable since it avoids signaling an error if > STRING is not a string. > Not sure about that. After all, this function is meant to be used with a STRING argument. On the other hand using `equal' will make it play better with nil. > > > +(defsubst string-blank-p (string) > > + "Check whether STRING is either empty or only whitespace." > > + (string-empty-p (string-trim string))) > > Better use (string-match-p "\\`...\\'" string) to avoid allocating a new > string. > You're right. I'll change this. > > > Stefan > --047d7b604cbc2804a404ec57884d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 29 November 2013 20:23, Stefan Monnier <monnier= @iro.umontreal.ca> wrote:
> + =C2=A0(string=3D string "")= )

I think `equal' is preferable since it avoids signaling an error if
STRING is not a string.

Not sure about = that. After all, this function is meant to be used with a STRING argument. = On the other hand using `equal' will make it play better with nil.=C2= =A0
=C2=A0

> +(defsubst string-blank-p (string)
> + =C2=A0"Check whether STRING is either empty or only whitespace.= "
> + =C2=A0(string-empty-p (string-trim string)))

Better use (string-match-p "\\`...\\'" string) to avoid alloc= ating a new
string.

You're right. I'll chan= ge this.
=C2=A0


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--047d7b604cbc2804a404ec57884d--