Mercurial > emacs
changeset 59916:7e83e55fbe19
(calc-embedded-update): Don't put in unnecessary newlines.
Adjust the end of formula marker.
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Fri, 04 Feb 2005 06:22:18 +0000 |
parents | 937e422a1694 |
children | 81a7887c8c82 |
files | lisp/calc/calc-embed.el |
diffstat | 1 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/calc/calc-embed.el Fri Feb 04 06:20:52 2005 +0000 +++ b/lisp/calc/calc-embed.el Fri Feb 04 06:22:18 2005 +0000 @@ -967,19 +967,24 @@ (calc-embedded-original-buffer t info) (or (equal str (aref info 6)) (let ((delta (- (aref info 5) (aref info 3))) + (adjbot 0) (buffer-read-only nil)) (goto-char (aref info 2)) (delete-region (point) (aref info 3)) (and (> (nth 1 entry) (1+ extra)) (aref info 7) (progn - (aset info 7 nil) (delete-horizontal-space) - (insert "\n\n") - (delete-horizontal-space) - (backward-char 1))) + (if (looking-at "\n") + ;; If there's a newline there, don't add one + (insert "\n") + (insert "\n\n") + (delete-horizontal-space) + (setq adjbot 1) +; (setq delta (1+ delta)) + (backward-char 1)))) (insert str) - (set-marker (aref info 3) (point)) + (set-marker (aref info 3) (+ (point) adjbot)) (set-marker (aref info 5) (+ (point) delta)) (aset info 6 str)))))) (if (eq (car-safe val) 'calcFunc-evalto)