Bug 491165 - letting emacs erlang-mode work out of the box
letting emacs erlang-mode work out of the box
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: erlang (Show other bugs)
13
All Linux
low Severity low
: ---
: ---
Assigned To: Hans Ulrich Niedermann
Fedora Extras Quality Assurance
:
Depends On: 509393
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-19 12:59 EDT by Hans Ulrich Niedermann
Modified: 2010-11-17 18:26 EST (History)
4 users (show)

See Also:
Fixed In Version: erlang-R13B-04.15.fc12
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-17 18:14:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Add subpackages for proper installation of emacs files (5.79 KB, patch)
2009-03-19 12:59 EDT, Hans Ulrich Niedermann
no flags Details | Diff
R13B-03.x: Make doc subpackage noarch on F-11 and newer (1.41 KB, patch)
2009-12-09 06:42 EST, Hans Ulrich Niedermann
no flags Details | Diff
R13B-03.x: Add (X)Emacs subpackages with proper hooks (6.18 KB, patch)
2009-12-09 06:44 EST, Hans Ulrich Niedermann
no flags Details | Diff
Make doc subpackage noarch on F-11 and newer (with Obsoletes) (1.61 KB, patch)
2009-12-09 11:57 EST, Hans Ulrich Niedermann
no flags Details | Diff
Works-for-me patch against erlang-R13B-04.12.fc13 (not emacs guidelines compatible) (5.88 KB, patch)
2010-07-20 05:09 EDT, Hans Ulrich Niedermann
no flags Details | Diff

  None (edit)
Description Hans Ulrich Niedermann 2009-03-19 12:59:34 EDT
Created attachment 335889 [details]
Add subpackages for proper installation of emacs files

Description of problem:

  The erlang package contains the proper elisp files Emacs
  can use to use syntax highlighting and syntax context oriented
  editing, but they are not installed in the proper places and
  not hooked into the Emacs startup sequence.

  A patch adding subpackages which do just that is attached.

Version-Release number of selected component (if applicable):

  erlang-R12B-5.6.fc10.i386

How reproducible:

  100%

Steps to Reproduce:
1. Run "emacs foobar.erl"
  
Actual results:

  emacs opens the file as normal text file ("Fundamental")

Expected results:

  emacs opens the file using erlang-mode ("Erlang")

Additional info:

###### rpmlint output ######
$ rpmlint *emacs*.rpm erlang.spec
emacs-erlang-el.i386: W: no-documentation
emacs-erlang.i386: W: no-documentation
xemacs-erlang-el.i386: W: no-documentation
xemacs-erlang.i386: W: no-documentation
erlang.spec:281: W: macro-in-%changelog _bindir
erlang.spec: W: mixed-use-of-spaces-and-tabs (spaces: line 33, tab: line 42)
erlang.spec: W: patch-not-applied Patch3: otp-sslrpath.patch
5 packages and 1 specfiles checked; 0 errors, 7 warnings.

The documentation is in emacs-common-erlang. The erlang.spec warnings
have not changed over those from the unpatched erlang.spec file.

###### emacs-common-erlang-R12B-5.6.3.fc10.i386.rpm ######
/usr/share/doc/emacs-common-erlang-R12B
/usr/share/doc/emacs-common-erlang-R12B/AUTHORS
/usr/share/doc/emacs-common-erlang-R12B/README

###### emacs-erlang-el-R12B-5.6.3.fc10.i386.rpm ######
/usr/share/emacs/site-lisp/erlang-start.el
/usr/share/emacs/site-lisp/erlang.el

###### emacs-erlang-R12B-5.6.3.fc10.i386.rpm ######
/usr/share/emacs/site-lisp/erlang-start.elc
/usr/share/emacs/site-lisp/erlang.elc
/usr/share/emacs/site-lisp/site-start.d/erlang-init.el

###### xemacs-erlang-el-R12B-5.6.3.fc10.i386.rpm ######
/usr/share/xemacs/site-packages/lisp/erlang-start.el
/usr/share/xemacs/site-packages/lisp/erlang.el

###### xemacs-erlang-R12B-5.6.3.fc10.i386.rpm ######
/usr/share/xemacs/site-packages/lisp/erlang-start.elc
/usr/share/xemacs/site-packages/lisp/erlang.elc
/usr/share/xemacs/site-packages/lisp/site-start.d/erlang-init.el
Comment 1 Xavier Maillard 2009-10-19 16:31:26 EDT
What's the status of this BR ? As an emacs and erlang user, I really want this patch being applied. Sadly, I am too new to fedora to test if this cleanly work.
Comment 2 Xavier Maillard 2009-10-20 17:18:02 EDT
I have tried to build my packages, it worked but I think there is something wrong with the site-lisp/site-start.d/erlang-init.el file.

the resulting load-path variable is a real mess just after loading the site file.
Comment 3 Hans Ulrich Niedermann 2009-12-09 06:42:43 EST
Created attachment 377146 [details]
R13B-03.x: Make doc subpackage noarch on F-11 and newer

Requires R13B03 patch from bug 509393 (https://bugzilla.redhat.com/attachment.cgi?id=377145).
Comment 4 Hans Ulrich Niedermann 2009-12-09 06:44:24 EST
Created attachment 377149 [details]
R13B-03.x: Add (X)Emacs subpackages with proper hooks

Adds Erlang mode and hooks it up with the Emacsen.

Requires "noarch doc subpackage" patch (https://bugzilla.redhat.com/attachment.cgi?id=377146).
Comment 5 Hans Ulrich Niedermann 2009-12-09 06:45:52 EST
Add dependency on bug 509393, as my proposed patches here require the R13B03 patch from bug 509393.
Comment 6 Hans Ulrich Niedermann 2009-12-09 06:47:51 EST
(In reply to comment #2)
> I have tried to build my packages, it worked but I think there is something
> wrong with the site-lisp/site-start.d/erlang-init.el file.
> 
> the resulting load-path variable is a real mess just after loading the site
> file.  

Xavier, how is your load-patch variable a "real mess"?

It looks as follows here, and that looks good to me:

("/usr/lib/erlang/lib/tools-2.6.5/emacs" "/usr/share/emacs/site-lisp/auctex" "/usr/share/emacs/23.1/site-lisp" "/usr/share/emacs/site-lisp" "/usr/share/emacs/site-lisp/bbdb" "/usr/share/emacs/site-lisp/ebib" "/usr/share/emacs/site-lisp/gnuplot" "/usr/share/emacs/site-lisp/maxima" "/usr/share/emacs/site-lisp/mew" "/usr/share/emacs/site-lisp/muse" "/usr/share/emacs/site-lisp/psgml" "/usr/share/emacs/site-lisp/site-start.d" "/usr/share/emacs/site-lisp/maxima/site_start.d" "/usr/share/emacs/site-lisp/muse/contrib" "/usr/share/emacs/site-lisp/muse/experimental" "/usr/share/emacs/23.1/lisp" "/usr/share/emacs/23.1/lisp/url" "/usr/share/emacs/23.1/lisp/textmodes" "/usr/share/emacs/23.1/lisp/progmodes" "/usr/share/emacs/23.1/lisp/play" "/usr/share/emacs/23.1/lisp/org" "/usr/share/emacs/23.1/lisp/nxml" "/usr/share/emacs/23.1/lisp/net" "/usr/share/emacs/23.1/lisp/mh-e" "/usr/share/emacs/23.1/lisp/mail" "/usr/share/emacs/23.1/lisp/language" "/usr/share/emacs/23.1/lisp/international" "/usr/share/emacs/23.1/lisp/gnus" "/usr/share/emacs/23.1/lisp/eshell" "/usr/share/emacs/23.1/lisp/erc" "/usr/share/emacs/23.1/lisp/emulation" "/usr/share/emacs/23.1/lisp/emacs-lisp" "/usr/share/emacs/23.1/lisp/calendar" "/usr/share/emacs/23.1/lisp/calc" "/usr/share/emacs/23.1/lisp/obsolete" "/usr/share/emacs/23.1/leim" "/usr/share/emacs/site-lisp/psgml")
Comment 7 Hans Ulrich Niedermann 2009-12-09 11:57:34 EST
Created attachment 377242 [details]
Make doc subpackage noarch on F-11 and newer (with Obsoletes)

We need to "Obsoletes" earlier erlang-doc packages, because they are not noarch yet.
Comment 8 Xavier Maillard 2009-12-10 15:35:14 EST
(In reply to comment #6)
> (In reply to comment #2)
> > I have tried to build my packages, it worked but I think there is something
> > wrong with the site-lisp/site-start.d/erlang-init.el file.
> > 
> > the resulting load-path variable is a real mess just after loading the site
> > file.  
> 
> Xavier, how is your load-patch variable a "real mess"?
> 
> It looks as follows here, and that looks good to me:
> 
> ("/usr/lib/erlang/lib/tools-2.6.5/emacs" "/usr/share/emacs/site-lisp/auctex"
> "/usr/share/emacs/23.1/site-lisp" "/usr/share/emacs/site-lisp"
> "/usr/share/emacs/site-lisp/bbdb" "/usr/share/emacs/site-lisp/ebib"
> "/usr/share/emacs/site-lisp/gnuplot" "/usr/share/emacs/site-lisp/maxima"
> "/usr/share/emacs/site-lisp/mew" "/usr/share/emacs/site-lisp/muse"
> "/usr/share/emacs/site-lisp/psgml" "/usr/share/emacs/site-lisp/site-start.d"
> "/usr/share/emacs/site-lisp/maxima/site_start.d"
> "/usr/share/emacs/site-lisp/muse/contrib"
> "/usr/share/emacs/site-lisp/muse/experimental" "/usr/share/emacs/23.1/lisp"
> "/usr/share/emacs/23.1/lisp/url" "/usr/share/emacs/23.1/lisp/textmodes"
> "/usr/share/emacs/23.1/lisp/progmodes" "/usr/share/emacs/23.1/lisp/play"
> "/usr/share/emacs/23.1/lisp/org" "/usr/share/emacs/23.1/lisp/nxml"
> "/usr/share/emacs/23.1/lisp/net" "/usr/share/emacs/23.1/lisp/mh-e"
> "/usr/share/emacs/23.1/lisp/mail" "/usr/share/emacs/23.1/lisp/language"
> "/usr/share/emacs/23.1/lisp/international" "/usr/share/emacs/23.1/lisp/gnus"
> "/usr/share/emacs/23.1/lisp/eshell" "/usr/share/emacs/23.1/lisp/erc"
> "/usr/share/emacs/23.1/lisp/emulation" "/usr/share/emacs/23.1/lisp/emacs-lisp"
> "/usr/share/emacs/23.1/lisp/calendar" "/usr/share/emacs/23.1/lisp/calc"
> "/usr/share/emacs/23.1/lisp/obsolete" "/usr/share/emacs/23.1/leim"
> "/usr/share/emacs/site-lisp/psgml")  

I tried to reproduce but I got nothing wrong now.
Comment 9 Hans Ulrich Niedermann 2009-12-12 10:28:14 EST
I just did a mock build for F13, and it failed with the following error message. I have yet to find out why.

Compiling /builddir/build/BUILDROOT/erlang-R13B-03.2.fc13.i386/usr/share/xemacs/site-packages/lisp/erlang.el...
While compiling toplevel forms in file /builddir/build/BUILDROOT/erlang-R13B-03.2.fc13.i386/usr/share/xemacs/site-packages/lisp/erlang.el:
  ** Third arg to defvar erlang-font-lock-keywords-1 is not a string: erlang-font-lock-descr-string
  ** Third arg to defvar erlang-font-lock-keywords-2 is not a string: erlang-font-lock-descr-string
  ** Third arg to defvar erlang-font-lock-keywords-3 is not a string: erlang-font-lock-descr-string
  ** Third arg to defvar erlang-font-lock-keywords-4 is not a string: erlang-font-lock-descr-string
  ** Third arg to defvar erlang-font-lock-keywords is not a string: erlang-font-lock-descr-string
>>Error occurred processing /builddir/build/BUILDROOT/erlang-R13B-03.2.fc13.i386/usr/share/xemacs/site-packages/lisp/erlang.el: Cannot open load file: "tempo"
  !! File error (("Cannot open load file" "tempo"))
Doneerror: Bad exit status from /var/tmp/rpm-tmp.HZtUBV (%install)
Comment 10 Peter Lemenkov 2010-03-22 10:38:43 EDT
I'll take care of this issue.
Comment 11 Peter Lemenkov 2010-04-24 08:18:14 EDT
*** Bug 585349 has been marked as a duplicate of this bug. ***
Comment 12 Hans Ulrich Niedermann 2010-07-20 05:05:34 EDT
(In reply to comment #10)
> I'll take care of this issue.    

Do you mind if I assign this bug to me and fix it? I now have commit access to the erlang package, so I can actually work on a fix.

I also now have something minimal that works for me locally on F-13, but I need to have another go over the emacs packaging rules.

The remaining issue is whether to duplicate the *.el files for emacs and xemacs, drop xemacs support altogether, or use a common *.el file location with symlinks to the emacs/xemacs specific locations.

A more detailed brain snapshot follows below.

The emacs lisp files for the erlang mode are in the erlang-tools subpackage at

   /usr/lib/erlang/lib/tools-$VERSION/emacs/*.el

The emacs lisp source files (*.el) and the compiled files (*.elc) for emacs are in

   $ pkg-config emacs --variable sitepkglispdir
   /usr/share/emacs/site-lisp

The emacs lisp source files (*.el) and the compiled files (*.elc) for xemacs are in

   $ pkg-config xemacs --variable sitepkglispdir
   /usr/share/xemacs/site-packages/lisp

The question is what the emacs packaging guidelines suggest here.

I tend towards leaving the *.el files in /usr/lib/erlang/lib/tools-$VERSION/emacs as that is the standard location where everyone with a manual setup will be looking for them. So the question really is whether to symlink those files to the emacs specific site-lisp dirs (potentially in a %{name}-%{version} subdir), or whether to copy them there.
Comment 13 Hans Ulrich Niedermann 2010-07-20 05:09:39 EDT
Created attachment 433108 [details]
Works-for-me patch against erlang-R13B-04.12.fc13 (not emacs guidelines compatible)

This works, but does not comply to Fedora's rules for emacs packages yet.
Comment 14 Peter Lemenkov 2010-07-20 05:17:49 EDT
(In reply to comment #12)
> (In reply to comment #10)
> > I'll take care of this issue.    
> 
> Do you mind if I assign this bug to me and fix it? I now have commit access to
> the erlang package, so I can actually work on a fix.

That would be great! Especially because I don't use emacs at all :)
Comment 15 Hans Ulrich Niedermann 2010-07-26 06:42:25 EDT
Status update: I have spent a few hours on this yesterday, most of the time being required for the test builds which take *ages* to complete on this 2GHz Core Duo.

Summary: My local solution is working in a rudimentary fashion now and also complies to the packaging guidelines. However, there are still enough wrinkles to iron out that I cannot ship this yet. The issues mostly revolve around which *.el files to ship besides erlang.el, and what their exact dependencies are.

(Side note: A quick try to avoid the building and installing of the docs caused so many additional side effects that I quickly gave up on this path towards faster package builds.)

This stuff will be a lot easier to work on after the switch to dist-git next week, so that is what I am counting on right now.
Comment 16 Fedora Update System 2010-07-30 18:11:12 EDT
erlang-R13B-04.14.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/erlang-R13B-04.14.fc12
Comment 17 Fedora Update System 2010-07-30 18:11:18 EDT
erlang-R14A-0.5.fc14 has been submitted as an update for Fedora 14.
http://admin.fedoraproject.org/updates/erlang-R14A-0.5.fc14
Comment 18 Fedora Update System 2010-07-30 18:11:23 EDT
erlang-R13B-04.14.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/erlang-R13B-04.14.fc13
Comment 19 Hans Ulrich Niedermann 2010-07-30 18:17:24 EDT
The new packages are

  emacs-erlang
  emacs-erlang-el
  xemacs-erlang
  xemacs-erlang-el

As usual, the *-el packages contain the elisp sources, and emacs-* is for GNU Emacs while xemacs-* is for XEmacs.

The emacs-common-erlang package is a virtual Provides: instead of an empty RPM package right now.

The F12 and F13 packages are identical, and I have tested it by building and testing on my F13 box.

The F14 package I have built for F13, and tested on my F13 box.

In all cases, erlang-mode appeared to work out of the box just as intended, i.e. without any editing of ~/.emacs or ~/.emacs.d/.
Comment 20 Fedora Update System 2010-08-01 15:24:44 EDT
erlang-R14A-0.5.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update erlang'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/erlang-R14A-0.5.fc14
Comment 21 Fedora Update System 2010-08-02 20:36:48 EDT
erlang-R13B-04.14.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update erlang'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/erlang-R13B-04.14.fc12
Comment 22 Fedora Update System 2010-08-02 20:58:32 EDT
erlang-R13B-04.14.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update erlang'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/erlang-R13B-04.14.fc13
Comment 23 Fedora Update System 2010-08-03 11:40:08 EDT
erlang-R13B-04.15.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/erlang-R13B-04.15.fc12
Comment 24 Fedora Update System 2010-08-03 11:40:19 EDT
erlang-R13B-04.15.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/erlang-R13B-04.15.fc13
Comment 25 Fedora Update System 2010-08-03 11:40:29 EDT
erlang-R14A-0.6.fc14 has been submitted as an update for Fedora 14.
http://admin.fedoraproject.org/updates/erlang-R14A-0.6.fc14
Comment 26 Fedora Update System 2010-08-05 10:26:00 EDT
erlang-R14A-0.6.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update erlang'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/erlang-R14A-0.6.fc14
Comment 27 Fedora Update System 2010-08-05 19:34:12 EDT
erlang-R13B-04.15.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update erlang'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/erlang-R13B-04.15.fc13
Comment 28 Fedora Update System 2010-08-05 19:54:55 EDT
erlang-R13B-04.15.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update erlang'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/erlang-R13B-04.15.fc12
Comment 29 Fedora Update System 2010-09-16 08:48:35 EDT
erlang-R14B-0.1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/erlang-R14B-0.1.fc14
Comment 30 Fedora Update System 2010-09-25 01:38:57 EDT
erlang-R14B-0.1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 31 Fedora Update System 2010-11-17 18:14:35 EST
erlang-R13B-04.15.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 32 Fedora Update System 2010-11-17 18:26:15 EST
erlang-R13B-04.15.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.