File: use-dh-elpa.patch

package info (click to toggle)
macaulay2 1.25.11%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 174,488 kB
  • sloc: cpp: 106,417; ansic: 15,948; javascript: 5,264; sh: 3,877; makefile: 3,703; lisp: 702; yacc: 604; xml: 177; perl: 114; lex: 65; python: 40
file content (56 lines) | stat: -rw-r--r-- 2,455 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Description: Modifications to work with dh_elpa.
 * Only load "M2-init" if we need to (e.g., if elpa-macaulay2 wasn't set up
   properly because the user didn't have the Debian/Ubuntu emacs package
   installed).
 * Warn the user if elpa-macaulay2 isn't installed.
 * Fix path to M2-emacs-help.txt in documentation.
Author: Doug Torrance <dtorrance@debian.org>
Forwarded: not-needed
Last-Update: 2023-11-07

--- a/M2/Macaulay2/m2/files.m2
+++ b/M2/Macaulay2/m2/files.m2
@@ -389,11 +389,17 @@
 ///
 
 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)
+;; Load the Macaulay2 major modes just in case elpa-macaulay2 wasn't set up
+;; properly (e.g., if we're using emacs compiled from source instead of the
+;; Debian/Ubuntu package).
+
+(unless (fboundp 'M2)
+  (let ((m2-el-path "EMACSDIR"))
+    (if (file-readable-p (concat m2-el-path "M2-init.el"))
+	(progn
+	  (add-to-list 'load-path m2-el-path)
+	  (load "M2-init"))
+      (warn "cannot find M2.el -- run \"sudo apt install elpa-macaulay2\""))))
 
 ;; 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
@@ -476,7 +482,8 @@
 setupEmacs = method()
 setup = method()
 mungeEmacs = () -> (
-     dotemacsFix = concatenate(emacsHeader, apply(emacsfixes, (var,dir,templ) -> fix(var,dir,"",templ)), dotemacsFix0);
+     dotemacsFix = replace("EMACSDIR", prefixDirectory | currentLayout#"emacs",
+	 concatenate(emacsHeader, dotemacsFix0));
      supplantStringFile(dotemacsFix,"~/"|M2emacs,false);
      mungeFile("~/"|".emacs", ";; Macaulay 2 start", ";; Macaulay 2 end", M2emacsRead )
      )
--- a/M2/Macaulay2/packages/Macaulay2Doc/ov_editors_emacs.m2
+++ b/M2/Macaulay2/packages/Macaulay2Doc/ov_editors_emacs.m2
@@ -178,7 +178,7 @@
       provides for dynamic completion of symbols in the language.
     Text
       There is an ASCII version of this section of the documentation distributed in the file @TT
-      "share/emacs/site-lisp/macaulay2/M2-emacs-help.txt"@. It might be useful for you to visit that file
+      "/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
       demonstrations below.
     Text