Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add Emacs Cask support #73

Open
wants to merge 2 commits into
from

Conversation

Projects
None yet
5 participants

As a Emacs user, I'm using orgmode to generate
my blog. And, I really like switch to netlify from github page
and circleci(emacs will compile orgmode files to html on the CI).

I've really like to have Emacs installed as part of netlify's build
tool(hugo can support partially orgmode parsing, but not native completely
support like emacs), and Cask as package management tool for Emacs.

So I can compile
Emacs orgmode files with command such as cask exec emacs --batch -l my-emacs-config.el -f org-publish-all on netlify build, just like any ruby command bundle exec blah

Can you also update this to install the latest version of stable Org?

I don't agree with the choice of PPA here - I'd rather have a non-patched version from official repositories without the major version hardcoded into the package name. I do understand the motivation, since distro versions of Emacs typically lag behind the current Emacs version, but I see this causing more problems than it solves.

Other than that, this LGTM.

Dockerfile
USER root
+RUN add-apt-repository ppa:kelleyk/emacs
@Benaiah

Benaiah Jul 24, 2017 edited

This is a pretty non-standard version of Emacs - it's a third-party (AFAICT, neither the Ubuntu team nor the Emacs maintainers are involved at all), patched version that releases newer versions of Emacs than those available in official Ubuntu repos. If this PPA is ever abandoned, we'll need to find a different one. If Ubuntu updates to the latest version of Emacs, we'll likely want to switch to their version anyway. Using the distro versions off the bat sounds like a better idea to me, and v25.2 isn't all that different from v24.4 (which is, I believe, the current version in the official Ubuntu repos).

@kaushalmodi

kaushalmodi Jul 24, 2017

v25.2 isn't all that different from v24.4

v25.2 has a lot of changes since 24.4. See NEWS.25.

@jcouyang

jcouyang Jul 25, 2017

I'm not a ubuntu user, I'm happy to hear any suggest on how to install emacs 25 on ubuntu officially.

AFAICT ubuntu 14 officially only provide emacs 24.3, but most moden emacs packages require at lease 24.4.

CMIIW i think kelleyk/emacs just provide deb pacakge, it's still build from official emacs source

@Benaiah

Benaiah Jul 25, 2017

True - I meant changes that would affect using Emacs as a build tool, though that's admittedly hard to predict. If the 24->25 upgrade is really affecting build, would it be possible to use the emacs25 package used in newer Ubuntu versions (see https://packages.ubuntu.com/zesty/editors/emacs)?

@jcouyang

jcouyang Jul 25, 2017

If the 24->25 upgrade is really affecting build

sorry I'm not following, this is not an upgrade, the Ubuntu 14 docker don't have any emacs preinstalled, how it's gonna affect v24 build?

@calavera

calavera Jul 25, 2017

Owner

It looks like orgmode should work just fine with v24.4:

http://orgmode.org/Changes.html

From now on, Org expects at least Emacs 24.3, although Emacs 24.4 or above is suggested.

I'd rather use the distro version if the library works the same. We don't need all the emacs features in this case.

@jcouyang

jcouyang Jul 25, 2017 edited

yeah, v24.4 would work just fine, but distro version is 24.3, which is too old and useless, even some common package like scala-mode or clojure-mode (for code highlight in org export) will not work.

to get 24.4 or above IMO there're 3 options:

  1. ppa
  2. build from source code(there's already build-essentials installed, so I guess it would just work)
  3. change the base image from Ubuntu 14 to 16, which have emacs 24.5 included(but could be big impact to other packages in build-image)

what would you prefer? @calavera

Dockerfile
USER root
+RUN add-apt-repository ppa:kelleyk/emacs
+RUN apt-get -y update
+RUN apt-get -y install emacs25-nox
@Benaiah

Benaiah Jul 24, 2017

This line will have to be updated when Emacs gets past 25 (though that's admittedly a ways out at the moment). IMO it'd be better not to use a package with the major version hardcoded. Also, does this install the binary as emacs or emacs25?

Also, this is the nox version, which drops X dependencies. I'm not aware of any implications this would have on somebody using Emacs as a build tool, but this is not the most common build configuration. I think that's fine, since I can't imagine anybody needing graphical frames as part of an automated build, but I wanted to note that.

@calavera

calavera Jul 25, 2017

Owner

We want the nox version here.

jcouyang commented Jul 25, 2017 edited

@kaushalmodi

Can you also update this to install the latest version of stable Org?

org is a package, should be installed as package by user in Cask file

just like ruby or any other lang, you define packages in Gemfile, not when you install ruby

Benaiah commented Jul 25, 2017 edited

@kaushalmodi while Cask files are not what I'd personally recommend (it's infrequently updated, written in Python instead of Elisp for no real reason, and I don't have a great experience working with it), Emacs also has built-in packaging utilities, which include the ability to upgrade to a newer version of org. I personally use use-package with quelpa and quelpa-use-package, but the packaging facilities built into Emacs are decent as well. I don't see a need to upgrade Org in the Dockerfile, particularly since people using the default version may see their scripts break.

Do you know about EVM? Here is how to use it in travis:

before_install:
  - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh
  - evm install $EVM_EMACS --use --skip
  - cask

env:
  - EVM_EMACS=emacs-25.1-travis
  - EVM_EMACS=emacs-25.2-travis
  - EVM_EMACS=emacs-git-snapshot-travis

jcouyang commented Aug 8, 2017

@DamienCassou
EVM looks awesome, but from it's source code, it still build from source, so I think build one on docker is more reasonable to me if ppa is a concern.

@calavera

I'd rather use the distro version if the library works the same

distro version is 24.3, most modern emacs packages require at lease 24.4

@Benaiah configure it as without-x we don't need x window for emacs batch mode

the environment variable CANNOT_DUMP=yes is because the issue moby/moby#22801 but it doesn't affect anything in batch mode so I think that's fine for orgmode parser purpose here.

I'd love to see Emacs being available on Netlify even more now that I have a stable blogging flow of exporting Hugo posts directly from Org (https://ox-hugo.scripter.co).

Any update on this please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment