On Thu, 25 Nov 2021 16:48:50 +0000 Debian FTP Masters
<ftpmas...@ftp-master.debian.org> wrote:
> We believe that the bug you reported is fixed in the latest version of
> maxima, which is due to be installed in the Debian FTP archive.
...
>  maxima (5.45.1-6) unstable; urgency=medium
>  .
>    * maxima-emacs conflicts with xemacs21
>    * reverse earlier patch attempts
>    * Bug fix: "fails to install with xemacs21", thanks to Andreas Beckmann
>      (Closes: #999626).

Hi, Camm,

I think that there is no need to make maxima-emacs conflict with
xemacs21, should just not be compiled for it. It is legitimate to have
xemacs21 installed for whatever reason, but use FSF Emacs for maxima
stuff.

While we are with this, I have noticed that maxima-emacs is not
bytecompiled for FSF Emacs because the emacsen-common files are
ancient and do not match current emacs handling.

Please consider attached patch, it has been minimally tested to make
maxima-emacs bytecompile for emacs but not for xemacs. It leaves the
door open to other flavors different from emacs, although I would not
expecl them  (there seems to be no further xemacs deveñopment)

When bytecompiling for emacs some apparently harmless warnings are shown.

---
Install maxima-emacs for emacs
install/maxima: Handling install for emacsen flavor emacs

In toplevel form:
imaxima.el:583:1:Warning: Unused lexical argument ‘process’
imaxima.el:696:1:Warning: Unused lexical variable ‘text-prop’
imaxima.el:696:1:Warning: Unused lexical variable ‘pos’
imaxima.el:696:1:Warning: Unused lexical variable ‘label’
imaxima.el:696:1:Warning: Unused lexical variable ‘pos2’
imaxima.el:862:1:Warning: Unused lexical variable ‘imaxima-error-3’
imaxima.el:862:1:Warning: Unused lexical variable ‘imaxima-error-2’
imaxima.el:1416:1:Warning: Unused lexical variable ‘err’
imaxima.el:1416:1:Warning: Unused lexical variable ‘err’
imaxima.el:1472:1:Warning: Unused lexical variable ‘err’
imaxima.el:1472:1:Warning: Unused lexical variable ‘err’
Install maxima-emacs for xemacs21
install/maxima: Skipping byte-compilation for xemacs21
---

Regards,

-- 
Agustin
From 18b14e632eb26cd469754a9a41b03f0e6e66832e Mon Sep 17 00:00:00 2001
From: Agustin Martin <agmar...@debian.org>
Date: Fri, 26 Nov 2021 16:17:23 +0100
Subject: [PATCH] Fix byte compilation with emacs and disable it for xemacs.

---
 debian/control                      |  7 +++----
 debian/maxima-emacs.emacsen-install | 30 ++++++++++++++++++++++-------
 debian/maxima-emacs.emacsen-remove  | 18 +++++++++++------
 3 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/debian/control b/debian/control
index dd74c39..eb58671 100644
--- a/debian/control
+++ b/debian/control
@@ -85,15 +85,14 @@ Description: Computer algebra system -- x interface
  quite reliable, and has good garbage collection, and no memory leaks.
  It comes with hundreds of self tests.
  .
- This package contains an X Windows interface using the tcl/tk 
- libraries. 
+ This package contains an X Windows interface using the tcl/tk
+ libraries.
 
 Package: maxima-emacs
 Depends:  maxima (>= ${binary:Version}), emacs-gtk | emacsen, emacsen-common (>= 1.4.14), texlive-base-bin, ${misc:Depends}, texlive-latex-recommended, maxima-doc (>= ${source:Version})
 Recommends: mime-support, postscript-viewer, pdf-viewer
 Architecture: all
 Replaces: maxima (<< ${binary:Version})
-Conflicts: xemacs21, xemacs
 Description: Computer algebra system -- emacs interface
  Maxima is a fully symbolic computation program.  It is full featured
  doing symbolic manipulation of polynomials, matrices, rational
@@ -122,5 +121,5 @@ Description: Computer algebra system -- extra code
  quite reliable, and has good garbage collection, and no memory leaks.
  It comes with hundreds of self tests.
  .
- This package contains a set of contributed routines and add-on 
+ This package contains a set of contributed routines and add-on
  packages.
diff --git a/debian/maxima-emacs.emacsen-install b/debian/maxima-emacs.emacsen-install
index 6bddd2f..04501a3 100644
--- a/debian/maxima-emacs.emacsen-install
+++ b/debian/maxima-emacs.emacsen-install
@@ -8,9 +8,24 @@
 FLAVOR=$1
 PACKAGE=maxima
 
-if [ ${FLAVOR} = emacs ]; then exit 0; fi
-
-echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}
+case ${FLAVOR} in
+    xemacs*)
+	# xemacs is not supported by current maxima-emacs
+	echo "install/${PACKAGE}: Skipping byte-compilation for ${FLAVOR}"
+        exit 0
+        ;;
+    emacs19|emacs20|emacs21|emacs22|emacs-snapshot*)
+        # Do not byte-compile anything for above emacsen flavours
+	echo "install/${PACKAGE}: Skipping byte-compilation for ${FLAVOR}"
+        exit 0
+	;;
+    emacs*)
+	echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}
+	;;
+    *)
+        echo install/${PACKAGE}: Ignoring emacsen flavour [${FLAVOR}]
+        exit 0
+esac
 
 SITEFLAG="-no-site-file"
 FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile"
@@ -18,7 +33,7 @@ FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile"
 ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
 ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
 
-# Install-info-altdir does not actually exist. 
+# Install-info-altdir does not actually exist.
 # Maybe somebody will write it.
 if test -x /usr/sbin/install-info-altdir; then
     echo install/${PACKAGE}: install Info links for ${FLAVOR}
@@ -28,9 +43,10 @@ fi
 install -m 755 -d ${ELCDIR}
 cd ${ELDIR}
 FILES=`echo *.el`
-#cp ${FILES} ${ELCDIR}
-cd ${ELCDIR}
-ln -sf ${ELDIR}/*.el ${ELDIR}/*.lisp .
+if [ "${ELDIR}" != "${ELCDIR}" ]; then
+    cd ${ELCDIR}
+    ln -sf ${ELDIR}/*.el ${ELDIR}/*.lisp .
+fi
 
 cat << EOF > path.el
 (setq load-path (cons "." load-path) byte-compile-warnings nil)
diff --git a/debian/maxima-emacs.emacsen-remove b/debian/maxima-emacs.emacsen-remove
index 29fa648..a06ab7f 100644
--- a/debian/maxima-emacs.emacsen-remove
+++ b/debian/maxima-emacs.emacsen-remove
@@ -3,13 +3,19 @@
 
 FLAVOR=$1
 PACKAGE=maxima
+ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
+ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
 
-if [ ${FLAVOR} != emacs ]; then
-    if test -x /usr/sbin/install-info-altdir; then
-        echo remove/${PACKAGE}: removing Info links for ${FLAVOR}
-        install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/info/maxima.info.gz
-    fi
+if test -x /usr/sbin/install-info-altdir; then
+    echo remove/${PACKAGE}: removing Info links for ${FLAVOR}
+    install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/info/maxima.info.gz
+fi
 
+if [ -d ${ELCDIR} ]; then
     echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR}
-    rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+    if [ ${FLAVOR} = emacs ]; then
+	rm -f /usr/share/${FLAVOR}/site-lisp/${PACKAGE}/*.elc
+    else
+	rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+    fi
 fi
-- 
2.33.0

Reply via email to