emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] trunk r115287: * lisp/emacs-lisp/helpers.el (string-em


From: Bozhidar Batsov
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

On 29 November 2013 20:23, Stefan Monnier <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]