|
From: Jay B. <bel...@us...> - 2001-12-09 19:31:46
|
Update of /cvsroot/maxima/maxima-pre59/emacs
In directory usw-pr-cvs1:/tmp/cvs-serv27836/Maxima/maxima-pre59/emacs
Modified Files:
maxima.el
Log Message:
The keybindings were changed to be more standard.
Various minor changes and bugfixes.
Index: maxima.el
===================================================================
RCS file: /cvsroot/maxima/maxima-pre59/emacs/maxima.el,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** maxima.el 2001/11/11 01:53:21 1.2
--- maxima.el 2001/12/09 19:31:43 1.3
***************
*** 39,44 ****
;; Quick intro
;;
! ;; To install, put this file (as well as maxima-font-lock.el and maxima-symbols.el)
! ;; somewhere in your emacs load path.
;; To make sure that `maxima.el' is loaded when necessary, whether to
;; edit a file in maxima mode or interact with Maxima in an Emacs buffer,
--- 39,44 ----
;; Quick intro
;;
! ;; To install, put this file (as well as maxima-font-lock.el and
! ;; maxima-symbols.el) somewhere in your emacs load path.
;; To make sure that `maxima.el' is loaded when necessary, whether to
;; edit a file in maxima mode or interact with Maxima in an Emacs buffer,
***************
*** 69,81 ****
;; Maxima mode provides the following motion commands:
! ;; C-c C-a: Move to the beginning of the form.
! ;; C-c C-e: Move to the end of the form.
! ;; C-c (: Move to the beginning of the sexp.
! ;; C-c ): Move to the end of the sexp.
;; and the following miscellaneous commands.
! ;; C-c C-f: Mark the current form
! ;; C-c C-p: Check the current region for balanced parentheses.
! ;; C-c C-g: Check the current form for balanced parentheses.
;; Maxima mode has the following completions commands:
--- 69,81 ----
;; Maxima mode provides the following motion commands:
! ;; M-C-a: Move to the beginning of the form.
! ;; M-C-e: Move to the end of the form.
! ;; M-C-b: Move to the beginning of the sexp.
! ;; M-C-f: Move to the end of the sexp.
;; and the following miscellaneous commands.
! ;; M-C-h: Mark the current form
! ;; C-c): Check the current region for balanced parentheses.
! ;; C-cC-): Check the current form for balanced parentheses.
;; Maxima mode has the following completions commands:
***************
*** 86,105 ****
;; Portions of the buffer can be sent to a Maxima process. (If a process is
;; not running, one will be started.)
! ;; C-M-r: Send the region to Maxima.
! ;; C-M-b: Send the buffer to Maxima.
! ;; C-M-l: Send the line to Maxima.
! ;; C-M-f: Send the form to Maxima.
;; C-RET: Send the smallest set of lines which contains
;; the cursor and contains no incomplete forms, and go to the next form.
;; M-RET: As above, but with the region instead of the current line.
;;
;; When something is sent to Maxima, a buffer running an inferior Maxima
;; process will appear. It can also be made to appear by using the command
! ;; C-c C-d.
;; When a command is given to send information to Maxima, the region
;; (buffer, line, form) is first checked to make sure the parentheses
;; are balanced. With an argument, they will not be checked first.
;; The Maxima process can be killed, after asking for confirmation
! ;; with C-M-k. To kill without confirmation, give C-M-k
;; an argument.
--- 86,106 ----
;; Portions of the buffer can be sent to a Maxima process. (If a process is
;; not running, one will be started.)
! ;; C-cC-r: Send the region to Maxima.
! ;; C-cC-b: Send the buffer to Maxima.
! ;; C-cC-c: Send the line to Maxima.
! ;; C-cC-e: Send the form to Maxima.
;; C-RET: Send the smallest set of lines which contains
;; the cursor and contains no incomplete forms, and go to the next form.
;; M-RET: As above, but with the region instead of the current line.
+ ;; C-cC-l: Prompt for a file name to load into Maxima.
;;
;; When something is sent to Maxima, a buffer running an inferior Maxima
;; process will appear. It can also be made to appear by using the command
! ;; C-c C-p.
;; When a command is given to send information to Maxima, the region
;; (buffer, line, form) is first checked to make sure the parentheses
;; are balanced. With an argument, they will not be checked first.
;; The Maxima process can be killed, after asking for confirmation
! ;; with C-cC-k. To kill without confirmation, give C-cC-k
;; an argument.
***************
*** 122,132 ****
;; To get help on a Maxima topic, use:
! ;; C-c C-h.
;; To read the Maxima info manual, use:
! ;; C-c TAB.
;; To get help with the symbol under point, use:
! ;; f12.
;; To get apropos with the symbol under point, use:
! ;; M-f12.
--- 123,133 ----
;; To get help on a Maxima topic, use:
! ;; C-c C-d.
;; To read the Maxima info manual, use:
! ;; C-c C-m.
;; To get help with the symbol under point, use:
! ;; C-cC-h or f12.
;; To get apropos with the symbol under point, use:
! ;; C-cC-a or M-f12.
***************
*** 143,149 ****
;; <C-M-tab> will complete the input line, based on previous input lines.
! ;; C-c C-h will get help on a Maxima topic.
! ;; C-c TAB will bring up the Maxima info manual.
! ;; C-M-k will kill the process and the buffer, after asking for
;; confirmation. To kill without confirmation, give C-M-k an
;; argument.
--- 144,150 ----
;; <C-M-tab> will complete the input line, based on previous input lines.
! ;; C-c C-d will get help on a Maxima topic.
! ;; C-c C-m will bring up the Maxima info manual.
! ;; C-cC-k will kill the process and the buffer, after asking for
;; confirmation. To kill without confirmation, give C-M-k an
;; argument.
***************
*** 179,185 ****
;; buffer.)
- ;; A short help page on debugging can be accessed through
- ;; C-c C-d
-
;;; Code:
--- 180,183 ----
***************
*** 226,229 ****
--- 224,232 ----
:type '(file))
+ (defcustom maxima-command "maxima"
+ "*The command used to start Maxima."
+ :group 'maxima
+ :type 'file)
+
;;;; The other variables
***************
*** 232,237 ****
(defvar inferior-maxima-computing-p nil
! "Status of Maxima process filter: t if enabled, else nil.")
(defvar inferior-maxima-lisp-level-flag nil
"Non-nil means that the inferior Maxima process is in Lisp mode.")
--- 235,248 ----
(defvar inferior-maxima-computing-p nil
! "Non-nil if Maxima process is computing.")
!
! (defvar inferior-maxima-running-p nil
! "Non-nil if Maxima process is alive.")
+ (defvar inferior-maxima-question-p nil)
+
+ (defvar inferior-maxima-result nil
+ "The last output of the Maxima process.")
+
(defvar inferior-maxima-lisp-level-flag nil
"Non-nil means that the inferior Maxima process is in Lisp mode.")
***************
*** 268,271 ****
--- 279,283 ----
(defvar maxima-special-symbol-letters "!:='")
+ (defvar inferior-maxima-exit-hook '())
;;;; Utility functions
***************
*** 1139,1142 ****
--- 1151,1158 ----
(maxima-check-parens beg end)))
+ (defun maxima-load-file (file)
+ "Prompt for a Maxima file to load."
+ (interactive "fMaxima file: ")
+ (maxima-string (concat "load(\"" (expand-file-name file) "\");")))
;;;; Syntax table
***************
*** 1170,1174 ****
(modify-syntax-entry ?' "' " maxima-mode-syntax-table)
(modify-syntax-entry ?, "' " maxima-mode-syntax-table)
! (modify-syntax-entry ?. "' " maxima-mode-syntax-table)
(modify-syntax-entry ?# "' " maxima-mode-syntax-table)
(modify-syntax-entry ?\\ "\\" maxima-mode-syntax-table)
--- 1186,1190 ----
(modify-syntax-entry ?' "' " maxima-mode-syntax-table)
(modify-syntax-entry ?, "' " maxima-mode-syntax-table)
! (modify-syntax-entry ?. "w" maxima-mode-syntax-table)
(modify-syntax-entry ?# "' " maxima-mode-syntax-table)
(modify-syntax-entry ?\\ "\\" maxima-mode-syntax-table)
***************
*** 1199,1212 ****
(let ((map (make-sparse-keymap)))
;; Motion
! (define-key map "\C-c\C-a" 'maxima-beginning-of-form)
! (define-key map "\C-c\C-e" 'maxima-end-of-form)
! (define-key map "\C-c(" 'maxima-beginning-of-sexp)
! (define-key map "\C-c)" 'maxima-end-of-sexp)
;; Process
! (define-key map "\M-\C-p" 'maxima-display-buffer)
! (define-key map "\M-\C-r" 'maxima-send-region)
! (define-key map "\M-\C-b" 'maxima-send-buffer)
! (define-key map "\M-\C-l" 'maxima-send-line)
! (define-key map "\M-\C-f" 'maxima-send-form)
(define-key map [(control return)]
'maxima-send-full-line-and-goto-next-form)
--- 1215,1228 ----
(let ((map (make-sparse-keymap)))
;; Motion
! (define-key map "\M-\C-a" 'maxima-beginning-of-form)
! (define-key map "\M-\C-e" 'maxima-end-of-form)
! (define-key map "\M-\C-b" 'maxima-beginning-of-sexp)
! (define-key map "\M-\C-f" 'maxima-end-of-sexp)
;; Process
! (define-key map "\C-c\C-p" 'maxima-display-buffer)
! (define-key map "\C-c\C-r" 'maxima-send-region)
! (define-key map "\C-c\C-b" 'maxima-send-buffer)
! (define-key map "\C-c\C-c" 'maxima-send-line)
! (define-key map "\C-c\C-e" 'maxima-send-form)
(define-key map [(control return)]
'maxima-send-full-line-and-goto-next-form)
***************
*** 1214,1225 ****
'maxima-send-completed-region-and-goto-next-form)
(define-key map [(control meta return)] 'maxima-send-buffer)
! (define-key map "\M-\C-k" 'maxima-stop)
;; Completion
(define-key map (kbd "M-TAB") 'maxima-complete)
(define-key map [(control tab)] 'maxima-dynamic-complete)
;; Commenting
! (define-key map "\C-c\C-c" 'comment-region)
! (define-key map "\C-c:" 'maxima-insert-short-comment)
! (define-key map "\C-c;" 'maxima-insert-long-comment)
;; Indentation
(define-key map "\t" 'maxima-indent-line)
--- 1230,1243 ----
'maxima-send-completed-region-and-goto-next-form)
(define-key map [(control meta return)] 'maxima-send-buffer)
! (define-key map "\C-c\C-k" 'maxima-stop)
! (define-key map "\C-c\C-l" 'maxima-load-file)
;; Completion
(define-key map (kbd "M-TAB") 'maxima-complete)
(define-key map [(control tab)] 'maxima-dynamic-complete)
;; Commenting
! (define-key map "\C-c;" 'comment-region)
! (define-key map "\C-c:" 'maxima-uncomment-region)
! (define-key map "\M-;" 'maxima-insert-short-comment)
! (define-key map "\C-c*" 'maxima-insert-long-comment)
;; Indentation
(define-key map "\t" 'maxima-indent-line)
***************
*** 1228,1239 ****
; (define-key map [(control tab)] 'maxima-untab)
;; Help
! (define-key map "\C-c\C-h" 'maxima-help)
! (define-key map "\C-c\C-i" 'maxima-info)
(define-key map [(f12)] 'maxima-completion-help)
(define-key map [(meta f12)] 'maxima-apropos-help)
;; Misc
! (define-key map "\C-c\C-f" 'maxima-mark-form)
! (define-key map "\C-c\C-p" 'maxima-check-parens)
! (define-key map "\C-c\C-g" 'maxima-check-form-parens)
(define-key map "\177" 'backward-delete-char-untabify)
(define-key map "\C-x " 'maxima-debug-set-break)
--- 1246,1259 ----
; (define-key map [(control tab)] 'maxima-untab)
;; Help
! (define-key map "\C-c\C-d" 'maxima-help)
! (define-key map "\C-c\C-m" 'maxima-info)
(define-key map [(f12)] 'maxima-completion-help)
+ (define-key map "\C-c\C-h" 'maxima-completion-help)
(define-key map [(meta f12)] 'maxima-apropos-help)
+ (define-key map "\C-c\C-a" 'maxima-apropos-help)
;; Misc
! (define-key map "\M-\C-h" 'maxima-mark-form)
! (define-key map "\C-c\)" 'maxima-check-parens)
! (define-key map "\C-cC-\)" 'maxima-check-form-parens)
(define-key map "\177" 'backward-delete-char-untabify)
(define-key map "\C-x " 'maxima-debug-set-break)
***************
*** 1255,1258 ****
--- 1275,1279 ----
["Send line" maxima-send-line t]
["Send form" maxima-send-form t]
+ ["Load file" maxima-load-file t]
"----"
["Display buffer" maxima-display-buffer t]
***************
*** 1334,1337 ****
--- 1355,1359 ----
\\[maxima-send-completed-region-and-goto-next-form]: As above, but with
the region instead of the current line.
+ \\[maxima-load-file] will prompt for a filename and load it into Maxima
When something is sent to Maxima, a buffer running an inferior Maxima
process will appear. It can also be made to appear by using the command
***************
*** 1397,1405 ****
(unless (processp inferior-maxima-process)
(setq inferior-maxima-computing-p t)
! (let ((mbuf (make-comint "maxima" "maxima")))
(save-excursion
(set-buffer mbuf)
(setq inferior-maxima-process (get-buffer-process mbuf))
! (inferior-maxima-mode)))))
(defun maxima-stop (&optional arg)
--- 1419,1430 ----
(unless (processp inferior-maxima-process)
(setq inferior-maxima-computing-p t)
! (setq inferior-maxima-running-p t)
! (setq inferior-maxima-question-p nil)
! (let ((mbuf (make-comint "maxima" maxima-command)))
(save-excursion
(set-buffer mbuf)
(setq inferior-maxima-process (get-buffer-process mbuf))
! (inferior-maxima-mode)))
! (maxima-wait)))
(defun maxima-stop (&optional arg)
***************
*** 1409,1432 ****
(if arg
(progn
! (delete-process "maxima")
(kill-buffer "*maxima*")
(setq inferior-maxima-process nil))
(if (y-or-n-p "Really quit Maxima? ")
(progn
! (delete-process "maxima")
(kill-buffer "*maxima*")
(setq inferior-maxima-process nil))))))
- (defun maxima-done-computing (string)
- "Tells whether the process is done computing (by looking at the prompt)."
- (if (or
- (string-match inferior-maxima-prompt string)
- (string-match "Inferior Maxima finished"))
- (setq inferior-maxima-computing-p nil)))
-
(defun maxima-wait ()
"Waits until the Maxima process is finished with a computation."
! (while inferior-maxima-computing-p
! (sleep-for 1)))
;;;; Sending information to the process
--- 1434,1469 ----
(if arg
(progn
! (delete-process inferior-maxima-process)
(kill-buffer "*maxima*")
(setq inferior-maxima-process nil))
(if (y-or-n-p "Really quit Maxima? ")
(progn
! (delete-process inferior-maxima-process)
(kill-buffer "*maxima*")
(setq inferior-maxima-process nil))))))
(defun maxima-wait ()
"Waits until the Maxima process is finished with a computation."
! (if (not inferior-maxima-running-p)
! (if running-xemacs
! (sit-for 1)
! (sleep-for 1)))
! (while (and
! inferior-maxima-computing-p
! inferior-maxima-running-p
! (not inferior-maxima-question-p))
! (if running-xemacs
! (sleep-for 1)
! (sleep-for 0 100)))
! (when inferior-maxima-question-p
! (let ((ans (read-string (maxima-question))))
! (unless (string-match "[;$]" ans)
! (setq ans (concat ans ";")))
! (save-excursion
! (set-buffer (process-buffer inferior-maxima-process))
! (insert ans "\n")
! (set-marker (process-mark inferior-maxima-process) (point)))
! (maxima-string-nodisplay ans)
! (maxima-wait))))
;;;; Sending information to the process
***************
*** 1439,1442 ****
--- 1476,1486 ----
(maxima-start)
(setq inferior-maxima-computing-p t)
+ (if (or
+ (string-match "quit();" string)
+ (string-match "" string))
+ (setq inferior-maxima-running-p nil)
+ (setq inferior-maxima-running-p t))
+ ; (setq inferior-maxima-running-p t)
+ (setq inferior-maxima-question-p nil)
(comint-send-string inferior-maxima-process (concat string "\n"))
(maxima-display-buffer))
***************
*** 1446,1455 ****
(maxima-start)
(setq inferior-maxima-computing-p t)
(comint-send-string inferior-maxima-process (concat string "\n")))
!
(defun maxima-region (beg end)
"Send the region to the Maxima process."
(maxima-start)
(setq inferior-maxima-computing-p t)
(comint-send-region inferior-maxima-process beg end)
(comint-send-string inferior-maxima-process "\n")
--- 1490,1508 ----
(maxima-start)
(setq inferior-maxima-computing-p t)
+ (if (or
+ (string-match "quit();" string)
+ (string-match "" string))
+ (setq inferior-maxima-running-p nil)
+ (setq inferior-maxima-running-p t))
+ ; (setq inferior-maxima-running-p t)
+ (setq inferior-maxima-question-p nil)
(comint-send-string inferior-maxima-process (concat string "\n")))
!
(defun maxima-region (beg end)
"Send the region to the Maxima process."
(maxima-start)
(setq inferior-maxima-computing-p t)
+ (setq inferior-maxima-running-p t)
+ (setq inferior-maxima-question-p nil)
(comint-send-region inferior-maxima-process beg end)
(comint-send-string inferior-maxima-process "\n")
***************
*** 1461,1464 ****
--- 1514,1519 ----
(maxima-start)
(setq inferior-maxima-computing-p t)
+ (setq inferior-maxima-running-p t)
+ (setq inferior-maxima-question-p nil)
(comint-send-region inferior-maxima-process beg end)
(comint-send-string inferior-maxima-process "\n"))
***************
*** 1702,1719 ****
(defun maxima-check-level (string)
"Tell when the process is done computing (by looking for the prompt)."
(if (string-match inferior-maxima-prompt string) ;"^(C[0-9]+).*" string)
! (setq inferior-maxima-computing-p nil)
! (cond ((string-match "MAXIMA>>" string)
! (setq inferior-maxima-lisp-level-flag t)
! (setq inferior-maxima-top-level-flag nil)
! (setq inferior-maxima-debug-level-flag nil))
! ((string-match "\(dbm.*" string)
! (setq inferior-maxima-lisp-level-flag nil)
! (setq inferior-maxima-top-level-flag nil)
! (setq inferior-maxima-debug-level-flag t))
! (t
! (setq inferior-maxima-lisp-level-flag nil)
! (setq inferior-maxima-top-level-flag t)
! (setq inferior-maxima-debug-level-flag nil)))))
(defun inferior-maxima-filter (string)
--- 1757,1784 ----
(defun maxima-check-level (string)
"Tell when the process is done computing (by looking for the prompt)."
+ (setq inferior-maxima-result string)
(if (string-match inferior-maxima-prompt string) ;"^(C[0-9]+).*" string)
! (progn
! (setq inferior-maxima-computing-p nil)
! (setq inferior-maxima-question-p nil)
! (cond ((string-match "MAXIMA>>" string)
! (setq inferior-maxima-lisp-level-flag t)
! (setq inferior-maxima-top-level-flag nil)
! (setq inferior-maxima-debug-level-flag nil))
! ((string-match "\(dbm.*" string)
! (setq inferior-maxima-lisp-level-flag nil)
! (setq inferior-maxima-top-level-flag nil)
! (setq inferior-maxima-debug-level-flag t))
! (t
! (setq inferior-maxima-lisp-level-flag nil)
! (setq inferior-maxima-top-level-flag t)
! (setq inferior-maxima-debug-level-flag nil))))
! (if (string-match "?" string)
! (setq inferior-maxima-question-p t)))
! ; (if (string= string "\n")
! ; (setq inferior-maxima-running-p nil)))
! (if (not (and (processp inferior-maxima-process)
! (eq (process-status inferior-maxima-process) 'run)))
! (setq inferior-maxima-running-p nil)))
(defun inferior-maxima-filter (string)
***************
*** 1731,1734 ****
--- 1796,1808 ----
"")
+ (defun maxima-question ()
+ "Return inferior-maxima-result with whitespace trimmed off the ends.
+ For use when the process asks a question."
+ (let ((beg (string-match "[^ \n]" inferior-maxima-result))
+ (end (string-match "?" inferior-maxima-result)))
+ (concat
+ (substring inferior-maxima-result beg (1+ end))
+ " ")))
+
(defun maxima-last-output ()
"Copy the last output from Maxima."
***************
*** 1745,1749 ****
(save-excursion
(end-of-buffer)
! (re-search-backward inferior-maxima-prompt)
(setq out-end (point))
(re-search-backward inferior-maxima-prompt)
--- 1819,1824 ----
(save-excursion
(end-of-buffer)
! (if inferior-maxima-running-p
! (re-search-backward inferior-maxima-prompt))
(setq out-end (point))
(re-search-backward inferior-maxima-prompt)
***************
*** 1758,1790 ****
"Return the last Maxima output, without the prompts"
(interactive)
! (let* ((output (maxima-last-output))
! (newstring)
! (i 0)
! (beg (string-match "\\(^([D][0-9]*) \\)" output))
! (end (1+ (string-match ")" output beg)))
! (k (- end beg)))
;; Replace the output prompt with spaces
! (setq newstring (substring output 0 beg))
! (while (< i k)
! (setq newstring (concat newstring " "))
! (setq i (1+ i)))
! (concat newstring
! (substring output
! end))))
!
! (defun maxima-last-output-tex ()
! "Return the last Maxima output, between the dollar signs."
! (interactive)
! (let* ((output (maxima-last-output))
! (begtex (string-match "\\$\\$" output))
! (endtex (string-match "\\$\\$" output (1+ begtex))))
! (begprompt (string-match "(" output (1+ endtex)))
! (endprompt (string-match ")" output (1+ begprompt))))
! (concat
! "\\texttt{"
! (substring output begprompt (1+ endprompt))
! "}\n"
! (substring output begtex (+ endtex 2))
! "\n"))
(defun maxima-last-output-tex-noprompt ()
--- 1833,1857 ----
"Return the last Maxima output, without the prompts"
(interactive)
! (if (not inferior-maxima-running-p)
! (maxima-last-output)
! (let* ((output (maxima-last-output))
! (newstring)
! (i 0)
! (beg)
! (end)
! (k))
;; Replace the output prompt with spaces
! (setq beg (string-match "\\(^([D][0-9]*) \\)" output))
! (if (not beg)
! output
! (setq end (1+ (string-match ")" output beg)))
! (setq newstring (substring output 0 beg))
! (setq k (- end beg))
! (while (< i k)
! (setq newstring (concat newstring " "))
! (setq i (1+ i)))
! (concat newstring
! (substring output
! end))))))
(defun maxima-last-output-tex-noprompt ()
***************
*** 1798,1868 ****
"\n")))
- (defun maxima-last-output ()
- "Copy the last output from Maxima."
- (interactive)
- (let ((out-start)
- (out-end)
- (old-buffer (current-buffer))
- (maxima-buffer (get-buffer "*maxima*"))
- (output))
- (maxima-wait)
- (if (null maxima-buffer)
- (message "No Maxima output buffer")
- (set-buffer maxima-buffer)
- (save-excursion
- (end-of-buffer)
- (re-search-backward inferior-maxima-prompt)
- (setq out-end (point))
- (re-search-backward inferior-maxima-prompt)
- (forward-line 1)
- (setq out-start (point))
- (setq output
- (buffer-substring-no-properties out-start out-end))))
- (set-buffer old-buffer)
- output))
-
- (defun maxima-last-input-prompt ()
- "Copy the last input-prompt from Maxima."
- (interactive)
- (let ((old-buffer (current-buffer))
- (maxima-buffer (get-buffer "*maxima*"))
- (prompt))
- (maxima-wait)
- (if (null maxima-buffer)
- (message "No Maxima output buffer")
- (set-buffer maxima-buffer)
- (save-excursion
- (end-of-buffer)
- (re-search-backward inferior-maxima-prompt (point-min) nil 2)
- (setq prompt
- (buffer-substring-no-properties (match-beginning 0) (match-end 0))))
- (set-buffer old-buffer)
- prompt)))
-
- ;; (defun maxima-last-input-and-output ()
- ;; "Copy the last input and output from Maxima."
- ;; ;; Since the last input doesn't show up, this isn't terribly
- ;; ;; useful
- ;; (interactive)
- ;; (let ((out-start)
- ;; (out-end)
- ;; (old-buffer (current-buffer))
- ;; (maxima-buffer (get-buffer "*maxima*"))
- ;; (output))
- ;; (maxima-wait)
- ;; (if (null maxima-buffer)
- ;; (message "No Maxima output buffer")
- ;; (set-buffer maxima-buffer)
- ;; (save-excursion
- ;; (end-of-buffer)
- ;; (re-search-backward inferior-maxima-prompt)
- ;; (setq out-end (point))
- ;; (re-search-backward inferior-maxima-prompt)
- ;; (setq out-start (point))
- ;; (setq output
- ;; (buffer-substring-no-properties out-start out-end))))
- ;; (set-buffer old-buffer)
- ;; output))
-
(defun inferior-maxima-filter-accumulate-marker (string)
(setq maxima-debug-filter-accumulator nil)
--- 1865,1868 ----
***************
*** 2308,2313 ****
--- 2308,2317 ----
(progn
(setq inferior-maxima-computing-p t)
+ (setq inferior-maxima-running-p t)
+ (setq inferior-maxima-question-p nil)
(comint-send-input))))
(setq inferior-maxima-computing-p t)
+ (setq inferior-maxima-running-p t)
+ (setq inferior-maxima-question-p nil)
(comint-send-input))))
***************
*** 2316,2319 ****
--- 2320,2325 ----
(interactive)
(setq inferior-maxima-computing-p t)
+ (setq inferior-maxima-running-p t)
+ (setq inferior-maxima-question-p nil)
(comint-send-input))
***************
*** 2400,2408 ****
(define-key map [(meta tab)] 'maxima-complete)
(define-key map [(meta control tab)] 'maxima-smart-complete)
! (define-key map "\C-c\C-h" 'maxima-help)
! (define-key map "\C-c\C-i" 'maxima-info)
! (define-key map "\C-c\C-d" 'maxima-debug-level-help)
(define-key map "\177" 'backward-delete-char-untabify)
! (define-key map "\M-\C-k" 'maxima-stop)
(define-key map "\C-c\C-l" 'maxima-debug-find-and-display-line)
(define-key map "\C-x " 'maxima-debug-set-break)
--- 2406,2414 ----
(define-key map [(meta tab)] 'maxima-complete)
(define-key map [(meta control tab)] 'maxima-smart-complete)
! (define-key map "\C-c\C-d" 'maxima-help)
! (define-key map "\C-c\C-m" 'maxima-info)
! ; (define-key map "\C-c\C-d" 'maxima-debug-level-help)
(define-key map "\177" 'backward-delete-char-untabify)
! (define-key map "\C-c\C-k" 'maxima-stop)
(define-key map "\C-c\C-l" 'maxima-debug-find-and-display-line)
(define-key map "\C-x " 'maxima-debug-set-break)
***************
*** 2517,2521 ****
\\{inferior-maxima-mode-map}
"
! (interactive)
(comint-mode)
(setq comint-prompt-regexp inferior-maxima-prompt)
--- 2523,2527 ----
\\{inferior-maxima-mode-map}
"
! (interactive)
(comint-mode)
(setq comint-prompt-regexp inferior-maxima-prompt)
***************
*** 2535,2539 ****
(add-to-list 'comint-preoutput-filter-functions 'inferior-maxima-filter)
(add-to-list 'comint-output-filter-functions 'maxima-check-level)))
! (set-process-sentinel inferior-maxima-process 'inferior-maxima-sentinel)
(run-hooks 'inferior-maxima-mode-hook))
--- 2541,2553 ----
(add-to-list 'comint-preoutput-filter-functions 'inferior-maxima-filter)
(add-to-list 'comint-output-filter-functions 'maxima-check-level)))
! (unless running-xemacs
! (set-process-sentinel inferior-maxima-process 'inferior-maxima-sentinel))
! (add-hook 'kill-buffer-hook
! (function
! (lambda ()
! (if (processp inferior-maxima-process)
! (delete-process inferior-maxima-process))
! (setq inferior-maxima-process nil)
! (run-hooks 'inferior-maxima-exit-hook))) t t)
(run-hooks 'inferior-maxima-mode-hook))
|