Is anyone using mupacs to run Giac in Emacs?
I gave it a shot without any luck.
(Note that I just wanted to see how Giac runs with its various interfaces and won't be using mupacs beyond that. So I don't want anyone to go through any trouble to get it running, I'm just wondering if it's still usable.)
Jay
mupacs
Modérateur : xcasadmin
-
- Messages : 1137
- Inscription : dim. mai 20, 2007 7:09 am
- Localisation : Paris
- Contact :
Re: mupacs
Not me.
I am using the following small code in my .emacs
It is basic but I often put small giac code in comments of my latex files so it is convienient to be able to send it directly to giac. (% at the beginning of a line are removed before sending to giac)
I am using the following small code in my .emacs
It is basic but I often put small giac code in comments of my latex files so it is convienient to be able to send it directly to giac. (% at the beginning of a line are removed before sending to giac)
Code : Tout sélectionner
;;; Giac send line or region
(global-set-key (kbd "<f11>") 'giac-sendcommand)
;
(defun giac ()
"Run Giac in a buffer."
(interactive)
(switch-to-buffer (apply 'make-comint "giac" "giac" nil))
)
;
(defconst giac-commentpattern "//.*$"); for giac mode
;(defconst giac-commentpattern "#.*$"); for maple mode
(defun giac-send-line-or-region (&optional step)
(interactive ())
(let ((proc (get-process "giac"))
pbuf min max command)
(unless proc
(let ((currbuff (current-buffer)))
(giac)
(switch-to-buffer currbuff)
(setq proc (get-process "giac"))
(display-buffer (process-buffer proc) t)
))
(setq pbuff (process-buffer proc))
(if (use-region-p)
(setq min (region-beginning)
max (region-end))
(setq min (point-at-bol)
max (point-at-eol)))
(setq command (buffer-substring min max) )
(while (string-match giac-commentpattern command);remove the inline giac comments
(setq command (replace-match "" t t command)))
(while (string-match "^%" command);removes starting % useful in latex
(setq command (replace-match "" t t command)))
(while (string-match "\n" command)
(setq command (replace-match "" t t command)))
(setq command (concat command "\n"))
(with-current-buffer pbuff
(goto-char (process-mark proc))
(insert command)
(move-marker (process-mark proc) (point))
)
(process-send-string proc command)
;(display-buffer (process-buffer proc) t)
(when step
(next-line))
))
(defun giac-sendcommand ()
(interactive)
(giac-send-line-or-region t))
(defun giac-switch-to-process-buffer ()
(interactive)
(pop-to-buffer (process-buffer (get-process "giac")) t))
;;;Fin Giac
Re: mupacs
I used mupacs a long time ago, but never tried recently. It's probably not too hard to make it work, but unless somebody is really interested in that, I won't try myself:-)
Re: mupacs
Installing mupacs expects MuPAD to be installed, although I'm sure that could be gotten around. Still, it isn't immediate. I was going to mention the various interfaces for Xcas on my web page; perhaps (with his permission) I could mention Frederic Han's code for Emacs users.
Jay
Jay
-
- Messages : 1137
- Inscription : dim. mai 20, 2007 7:09 am
- Localisation : Paris
- Contact :
Re: mupacs
of course, feel free to use it.