diff options
author | Miles Bader <miles@gnu.org> | 2005-02-06 12:06:02 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2005-02-06 12:06:02 +0000 |
commit | a359f0e0ff878285654e2f0bcc7bd3b4340c778c (patch) | |
tree | cc0aff13c751bb8ab7ccaae29082bab32e15fd13 /lisp/calc | |
parent | f3d3402885646e6fa79f1ad59fb8a1f9017851d7 (diff) | |
parent | 56c30d721096a64f151f9ea6e3c76562380da895 (diff) | |
download | emacs-a359f0e0ff878285654e2f0bcc7bd3b4340c778c.tar.gz emacs-a359f0e0ff878285654e2f0bcc7bd3b4340c778c.tar.bz2 emacs-a359f0e0ff878285654e2f0bcc7bd3b4340c778c.zip |
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-11
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-69
- miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-71
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-72
src/dispextern.h (xassert): Enable unconditionally.
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-73
- miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-81
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-82
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-12
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-13
Update from CVS
Diffstat (limited to 'lisp/calc')
-rw-r--r-- | lisp/calc/calc-embed.el | 15 | ||||
-rw-r--r-- | lisp/calc/calc-lang.el | 29 |
2 files changed, 30 insertions, 14 deletions
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el index 4c6311c9a5b..e3b3b6b5b19 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) diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index d91d78fc461..63d24bb76d5 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el @@ -469,12 +469,12 @@ (put 'latex 'math-function-table (append (get 'tex 'math-function-table) - '(( \\frac . (math-latex-parse-frac /)) - ( \\tfrac . (math-latex-parse-frac /)) - ( \\dfrac . (math-latex-parse-frac /)) - ( \\binom . (math-latex-parse-frac calcFunc-choose)) - ( \\tbinom . (math-latex-parse-frac calcFunc-choose)) - ( \\dbinom . (math-latex-parse-frac calcFunc-choose)) + '(( \\frac . (math-latex-parse-frac)) + ( \\tfrac . (math-latex-parse-frac)) + ( \\dfrac . (math-latex-parse-frac)) + ( \\binom . (math-latex-parse-two-args calcFunc-choose)) + ( \\tbinom . (math-latex-parse-two-args calcFunc-choose)) + ( \\dbinom . (math-latex-parse-two-args calcFunc-choose)) ( \\phi . calcFunc-totient ) ( \\mu . calcFunc-moebius )))) @@ -487,12 +487,23 @@ (put 'latex 'math-complex-format 'i) + (defun math-latex-parse-frac (f val) (let (numer denom) - (setq args (math-read-expr-list)) + (setq numer (car (math-read-expr-list))) + (math-read-token) + (setq denom (math-read-factor)) + (if (and (Math-num-integerp numer) + (Math-num-integerp denom)) + (list 'frac numer denom) + (list '/ numer denom)))) + +(defun math-latex-parse-two-args (f val) + (let (first second) + (setq first (car (math-read-expr-list))) (math-read-token) - (setq margs (math-read-factor)) - (list (nth 2 f) (car args) margs))) + (setq second (math-read-factor)) + (list (nth 2 f) first second))) (defun math-latex-print-frac (a fn) (list 'horiz (nth 1 fn) "{" (math-compose-expr (nth 1 a) -1) |