#759184 Add mg as alternative for emacs

Package:
mg
Source:
mg
Description:
microscopic GNU Emacs-style editor
Submitter:
"Alif M. Ahmad"
Date:
2014-08-27 03:27:09 UTC
Severity:
normal
#759184#5
Date:
2014-08-25 03:47:44 UTC
From:
To:
Since mg provides emacs-like editing capabilities, it would be
better for mg to provide alternative setup for emacs. So that,
it will be possible to call mg using emacs command provided by
update-alternatives.

Users can issue "sudo update-alternatives --config emacs" and
select mg to provide symbolic link for emacs command.

Here is patch to do the job.
----------------------
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,7 @@ Vcs-Browser: https://darcs.debian.org/co
 Package: mg
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Provides: editor
+Provides: editor, emacs
 Description: microscopic GNU Emacs-style editor
  This program is intended to be a small, fast, and portable
  editor for people who can't (or don't want to) run real
----------------------

#759184#10
Date:
2014-08-25 04:11:18 UTC
From:
To:
Previous patch is incomplete. Here is additional patch to get
the job done. I hope this would be useful.
------------- --- 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 0 \ + --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# -------------
#759184#15
Date:
2014-08-25 05:13:58 UTC
From:
To:
This will break packages that rely on actual emacs functionality
(e.g. elisp support), such as w3m-el and debian-el.

What is the benefit of claiming to be an emacs,
rather than just an editor?

#759184#20
Date:
2014-08-25 08:31:21 UTC
From:
To:
If providing emacs dependency will break other packages, no need to modify
Provides field on debian/control. Just add an update-alternatives for emacs
symbolic link, not for satisfying dependencies for other packages.

I just inspired by jove that able to provide emacs symbolic link
alternative, without altering real emacs package dependency. It's just a
lightweight editor to provide emacs-style editing.

My only wish is just alternative symbolic link for emacs. So that, mg can
be launched as fake emacs editor on multiuser system without need to run
real emacs.

#759184#25
Date:
2014-08-27 03:25:39 UTC
From:
To:
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# -------------