[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/subr.el,v
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/subr.el,v |
Date: |
Mon, 13 Aug 2007 13:42:22 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Miles Bader <miles> 07/08/13 13:41:28
Index: lisp/subr.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v
retrieving revision 1.562
retrieving revision 1.563
diff -u -b -r1.562 -r1.563
--- lisp/subr.el 26 Jul 2007 05:26:34 -0000 1.562
+++ lisp/subr.el 13 Aug 2007 13:41:06 -0000 1.563
@@ -2836,11 +2836,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
@@ -2850,19 +2849,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)))))))
- [Emacs-diffs] Changes to emacs/lisp/subr.el,v,
Miles Bader <=