emacs-devel
[Top][All Lists]
Advanced

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

Re: string-strip


From: Lars Hansen
Subject: Re: string-strip
Date: Mon, 19 Jun 2006 22:20:50 +0200
User-agent: Debian Thunderbird 1.0.2 (X11/20060423)

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





reply via email to

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