Instead of 0 (zero) priority for providing emacs alternative, it will 
be better to provide negative or very small priority (for example 10).

Zero will be interpreted as default, and this is not appropriate for 
mg, which is last resort to provide emacs functionality. Higher 
priority is granted for real emacs, not for emacs alternative.

Here I provide -10 (minus ten) as alternative priority, so that mg 
will be used as emacs only when there is no better alternative to 
provide emacs symbolic link.

-------------
--- a/debian/postinst
+++ b/debian/postinst
@@ -2,5 +2,8 @@
 set -e
 update-alternatives --install /usr/bin/editor editor /usr/bin/mg 30 \
      --slave /usr/share/man/man1/editor.1.gz editor.1.gz 
/usr/share/man/man1/mg.1.gz
+update-alternatives --install /usr/bin/emacs emacs /usr/bin/mg 10 \
+     --slave /usr/share/man/man1/emacs.1.gz emacs.1.gz \
+     /usr/share/man/man1/mg.1.gz
 
 #DEBHELPER#
--- a/debian/prerm
+++ b/debian/prerm
@@ -1,7 +1,9 @@
 #!/bin/sh
 set -e
 if test remove = "$1"
-then update-alternatives --remove editor /usr/bin/mg
+then
+  update-alternatives --remove editor /usr/bin/mg
+  update-alternatives --remove emacs /usr/bin/mg
 fi
 
 #DEBHELPER#
-------------


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to