diff options
| author | David Aspinall | 2009-08-19 23:05:24 +0000 |
|---|---|---|
| committer | David Aspinall | 2009-08-19 23:05:24 +0000 |
| commit | b0b343eab1fa57702b3fdea643baee0f108805f7 (patch) | |
| tree | 29faf5e5ba3ca1539ab00a781e02830e2bda3e45 | |
| parent | 73d3da428ea01ca680e5ff64c07ed1ca26a6f167 (diff) | |
proof-splice-separator: ignore nil entries for convenience
| -rw-r--r-- | generic/proof-syntax.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/proof-syntax.el b/generic/proof-syntax.el index 0d6b0087..292d49af 100644 --- a/generic/proof-syntax.el +++ b/generic/proof-syntax.el @@ -285,13 +285,15 @@ Any other %-prefixed character inserts itself." ;;;###autoload (defun proof-splice-separator (sep strings) - "Splice SEP into list of STRINGS." + "Splice SEP into list of STRINGS, ignoring nil entries." (let (stringsep) (while strings - (setq stringsep (concat stringsep (car strings))) - (setq strings (cdr strings)) - (if strings (setq stringsep - (concat stringsep sep)))) + (when (car strings) ; suppress nils + (setq stringsep (concat stringsep (car strings))) + (if (and (cdr strings) (cadr strings)) + (setq stringsep + (concat stringsep sep)))) + (setq strings (cdr strings))) stringsep)) (provide 'proof-syntax) |
