Mercurial > emacs
comparison lisp/calc/calc-yank.el @ 49598:0d8b17d428b5
Trailing whitepace deleted.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 04 Feb 2003 13:24:35 +0000 |
parents | f4d68f97221e |
children | 695cf19ef79e d7ddb3e565de |
comparison
equal
deleted
inserted
replaced
49597:e88404e8f2cf | 49598:0d8b17d428b5 |
---|---|
1 ;;; calc-yank.el --- kill-ring functionality for Calc | 1 ;;; calc-yank.el --- kill-ring functionality for Calc |
2 | 2 |
3 ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: David Gillespie <daveg@synaptics.com> | 5 ;; Author: David Gillespie <daveg@synaptics.com> |
6 ;; Maintainers: D. Goel <deego@gnufans.org> | 6 ;; Maintainers: D. Goel <deego@gnufans.org> |
7 ;; Colin Walters <walters@debian.org> | 7 ;; Colin Walters <walters@debian.org> |
8 | 8 |
9 ;; This file is part of GNU Emacs. | 9 ;; This file is part of GNU Emacs. |
10 | 10 |
11 ;; GNU Emacs is distributed in the hope that it will be useful, | 11 ;; GNU Emacs is distributed in the hope that it will be useful, |
129 val)) | 129 val)) |
130 val)))))))) | 130 val)))))))) |
131 | 131 |
132 (defun calc-clean-newlines (s) | 132 (defun calc-clean-newlines (s) |
133 (cond | 133 (cond |
134 | 134 |
135 ;; Omit leading/trailing whitespace | 135 ;; Omit leading/trailing whitespace |
136 ((or (string-match "\\`[ \n\r]+\\([^\001]*\\)\\'" s) | 136 ((or (string-match "\\`[ \n\r]+\\([^\001]*\\)\\'" s) |
137 (string-match "\\`\\([^\001]*\\)[ \n\r]+\\'" s)) | 137 (string-match "\\`\\([^\001]*\\)[ \n\r]+\\'" s)) |
138 (calc-clean-newlines (math-match-substring s 1))) | 138 (calc-clean-newlines (math-match-substring s 1))) |
139 | 139 |
140 ;; Convert newlines to commas | 140 ;; Convert newlines to commas |
141 ((string-match "\\`\\(.*\\)[\n\r]+\\([^\001]*\\)\\'" s) | 141 ((string-match "\\`\\(.*\\)[\n\r]+\\([^\001]*\\)\\'" s) |
142 (calc-clean-newlines (concat (math-match-substring s 1) "," | 142 (calc-clean-newlines (concat (math-match-substring s 1) "," |
143 (math-match-substring s 2)))) | 143 (math-match-substring s 2)))) |
144 | 144 |
145 (t s))) | 145 (t s))) |
146 | 146 |
147 | 147 |
148 (defun calc-do-grab-region (top bot arg) | 148 (defun calc-do-grab-region (top bot arg) |
149 (when (memq major-mode '(calc-mode calc-trail-mode)) | 149 (when (memq major-mode '(calc-mode calc-trail-mode)) |