///
dotemacsFix0 = ///
-;; this version will give an error if M2-init.el is not found:
-(load "M2-init")
-
-;; this version will not give an error if M2-init.el is not found:
-;(load "M2-init" t)
-
; You may comment out the following line with an initial semicolon if you
; want to use your f12 key for something else. However, this action
; will be undone the next time you run setup() or setupEmacs().
setupEmacs = method()
setup = method()
mungeEmacs = () -> (
- dotemacsFix = concatenate(emacsHeader, apply(emacsfixes, (var,dir,templ) -> fix(var,dir,"",templ)), dotemacsFix0);
+ dotemacsFix = concatenate(emacsHeader, dotemacsFix0);
supplantStringFile(dotemacsFix,"~/"|M2emacs,false);
- mungeFile("~/"|".emacs", ";; Macaulay 2 start", ";; Macaulay 2 end", M2emacsRead )
- )
+ ret := mungeFile("~/"|".emacs", ";; Macaulay 2 start", ";; Macaulay 2 end", M2emacsRead );
+ if run("dpkg -s elpa-macaulay2 2> /dev/null | " |
+ "grep -q \"^Status:.* installed\"") != 0 then
+ stderr << "--warning: you must run \"apt install elpa-macaulay2\" "
+ << "as root in order to use" << endl
+ << " Macaulay2 with Emacs." << endl;
+ ret)
prelim := () -> (
promptUser = true;
if prefixDirectory === null then error "can't determine Macaulay 2 prefix (prefixDirectory not set)";
It also provides for dynamic completion of symbols in the language.",
PARA{},
"There is an ASCII version of this section of the documentation distributed
- in the file ", TT (Layout#1#"emacs" | "M2-emacs-help.txt"), ". It might be useful for you to visit
+ in the file ", TT "/usr/share/doc/elpa-macaulay2/M2-emacs-help.txt.gz", ". It might be useful for you to visit
that file with emacs now, thereby avoiding having to cut and paste bits of
text into emacs buffers for the deomonstrations below.",
PARA{},