diff options
| -rw-r--r-- | lisp/calc/calc-embed.el | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el index e6e95cae0ac..c6e0e33e559 100644 --- a/lisp/calc/calc-embed.el +++ b/lisp/calc/calc-embed.el | |||
| @@ -440,7 +440,7 @@ | |||
| 440 | 440 | ||
| 441 | (defun calc-embedded-word () | 441 | (defun calc-embedded-word () |
| 442 | (interactive) | 442 | (interactive) |
| 443 | (calc-embedded '(4))) | 443 | (calc-embedded '(t))) |
| 444 | 444 | ||
| 445 | (defun calc-embedded-mark-formula (&optional body-only) | 445 | (defun calc-embedded-mark-formula (&optional body-only) |
| 446 | "Put point at the beginning of this Calc formula, mark at the end. | 446 | "Put point at the beginning of this Calc formula, mark at the end. |
| @@ -807,20 +807,26 @@ The command \\[yank] can retrieve it from there." | |||
| 807 | (aset info 1 (or cbuf (save-excursion | 807 | (aset info 1 (or cbuf (save-excursion |
| 808 | (calc-create-buffer) | 808 | (calc-create-buffer) |
| 809 | (current-buffer))))) | 809 | (current-buffer))))) |
| 810 | (if (and (integerp calc-embed-top) (not calc-embed-bot)) | 810 | (if (and |
| 811 | (or (integerp calc-embed-top) (equal calc-embed-top '(4))) | ||
| 812 | (not calc-embed-bot)) | ||
| 811 | ; started with a user-supplied argument | 813 | ; started with a user-supplied argument |
| 812 | (progn | 814 | (progn |
| 813 | (if (= (setq calc-embed-arg (prefix-numeric-value calc-embed-arg)) 0) | 815 | (if (equal calc-embed-top '(4)) |
| 814 | (progn | 816 | (progn |
| 815 | (aset info 2 (copy-marker (region-beginning))) | 817 | (aset info 2 (copy-marker (line-beginning-position))) |
| 816 | (aset info 3 (copy-marker (region-end)))) | 818 | (aset info 3 (copy-marker (line-end-position)))) |
| 817 | (aset info (if (> calc-embed-arg 0) 2 3) (point-marker)) | 819 | (if (= (setq calc-embed-arg (prefix-numeric-value calc-embed-arg)) 0) |
| 818 | (if (> calc-embed-arg 0) | ||
| 819 | (progn | 820 | (progn |
| 820 | (forward-line (1- calc-embed-arg)) | 821 | (aset info 2 (copy-marker (region-beginning))) |
| 821 | (end-of-line)) | 822 | (aset info 3 (copy-marker (region-end)))) |
| 822 | (forward-line (1+ calc-embed-arg))) | 823 | (aset info (if (> calc-embed-arg 0) 2 3) (point-marker)) |
| 823 | (aset info (if (> calc-embed-arg 0) 3 2) (point-marker))) | 824 | (if (> calc-embed-arg 0) |
| 825 | (progn | ||
| 826 | (forward-line (1- calc-embed-arg)) | ||
| 827 | (end-of-line)) | ||
| 828 | (forward-line (1+ calc-embed-arg))) | ||
| 829 | (aset info (if (> calc-embed-arg 0) 3 2) (point-marker)))) | ||
| 824 | (aset info 4 (copy-marker (aref info 2))) | 830 | (aset info 4 (copy-marker (aref info 2))) |
| 825 | (aset info 5 (copy-marker (aref info 3)))) | 831 | (aset info 5 (copy-marker (aref info 3)))) |
| 826 | (if (aref info 4) | 832 | (if (aref info 4) |