3 |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Author: David Gillespie <daveg@synaptics.com> |
;; Author: David Gillespie <daveg@synaptics.com> |
6 |
;; Maintainer: Colin Walters <walters@debian.org> |
;; Maintainers: D. Goel <deego@gnufans.org> |
7 |
|
;; Colin Walters <walters@debian.org> |
8 |
|
|
9 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
10 |
|
|
131 |
|
|
132 |
(defun calc-clean-newlines (s) |
(defun calc-clean-newlines (s) |
133 |
(cond |
(cond |
134 |
|
|
135 |
;; Omit leading/trailing whitespace |
;; Omit leading/trailing whitespace |
136 |
((or (string-match "\\`[ \n\r]+\\([^\001]*\\)\\'" s) |
((or (string-match "\\`[ \n\r]+\\([^\001]*\\)\\'" s) |
137 |
(string-match "\\`\\([^\001]*\\)[ \n\r]+\\'" s)) |
(string-match "\\`\\([^\001]*\\)[ \n\r]+\\'" s)) |
141 |
((string-match "\\`\\(.*\\)[\n\r]+\\([^\001]*\\)\\'" s) |
((string-match "\\`\\(.*\\)[\n\r]+\\([^\001]*\\)\\'" s) |
142 |
(calc-clean-newlines (concat (math-match-substring s 1) "," |
(calc-clean-newlines (concat (math-match-substring s 1) "," |
143 |
(math-match-substring s 2)))) |
(math-match-substring s 2)))) |
144 |
|
|
145 |
(t s))) |
(t s))) |
146 |
|
|
147 |
|
|