emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/subr.el,v [EMACS_22_BASE]


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/subr.el,v [EMACS_22_BASE]
Date: Sun, 12 Aug 2007 17:59:41 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Richard M. Stallman <rms>       07/08/12 17:59:40

Index: subr.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v
retrieving revision 1.554.2.3
retrieving revision 1.554.2.4
diff -u -b -r1.554.2.3 -r1.554.2.4
--- subr.el     25 Jul 2007 04:47:00 -0000      1.554.2.3
+++ subr.el     12 Aug 2007 17:59:40 -0000      1.554.2.4
@@ -2760,11 +2760,10 @@
                    list)))
     (nreverse list)))
 
-;; (string->strings (strings->string X)) == X
-(defun strings->string (strings &optional separator)
+(defun combine-and-quote-strings (strings &optional separator)
   "Concatenate the STRINGS, adding the SEPARATOR (default \" \").
 This tries to quote the strings to avoid ambiguity such that
-  (string->strings (strings->string strs)) == strs
+  (split-string-and-unquote (combine-and-quote-strings strs)) == strs
 Only some SEPARATORs will work properly."
   (let ((sep (or separator " ")))
     (mapconcat
@@ -2774,19 +2773,19 @@
         str))
      strings sep)))
 
-;; (string->strings (strings->string X)) == X
-(defun string->strings (string &optional separator)
+(defun split-string-and-unquote (string &optional separator)
   "Split the STRING into a list of strings.
-It understands elisp style quoting within STRING such that
-  (string->strings (strings->string strs)) == strs
+It understands Emacs Lisp quoting within STRING, such that
+  (split-string-and-unquote (combine-and-quote-strings strs)) == strs
 The SEPARATOR regexp defaults to \"\\s-+\"."
   (let ((sep (or separator "\\s-+"))
        (i (string-match "[\"]" string)))
-    (if (null i) (split-string string sep t)   ; no quoting:  easy
+    (if (null i)
+       (split-string string sep t)     ; no quoting:  easy
       (append (unless (eq i 0) (split-string (substring string 0 i) sep t))
              (let ((rfs (read-from-string string i)))
                (cons (car rfs)
-                     (string->strings (substring string (cdr rfs))
+                     (split-string-and-unquote (substring string (cdr rfs))
                                           sep)))))))
 
 




reply via email to

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