aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJay Belanger <[email protected]>2005-02-04 06:22:18 +0000
committerJay Belanger <[email protected]>2005-02-04 06:22:18 +0000
commit954fc58360d31c5cb80bc059d6363f671a263129 (patch)
tree089c1418862726d841f7301b9bd703b20c41c273 /lisp
parent7592e97042f083f5700778d88d153b2d12443699 (diff)
(calc-embedded-update): Don't put in unnecessary newlines.
Adjust the end of formula marker.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/calc/calc-embed.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index 4c6311c9a5..e3b3b6b5b1 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -967,19 +967,24 @@ The command \\[yank] can retrieve it from there."
(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)