New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Emacs Cask support #73

Merged
merged 3 commits into from Nov 13, 2017

Conversation

Projects
None yet
5 participants
@jcouyang
Copy link
Contributor

jcouyang commented Jul 23, 2017

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

@kaushalmodi

This comment has been minimized.

Copy link

kaushalmodi commented Jul 24, 2017

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

@Benaiah
Copy link

Benaiah left a comment

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 Outdated
USER root
RUN add-apt-repository ppa:kelleyk/emacs

This comment has been minimized.

@Benaiah

Benaiah Jul 24, 2017

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).

This comment has been minimized.

@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.

This comment has been minimized.

@jcouyang

jcouyang Jul 25, 2017

Contributor

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

This comment has been minimized.

@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)?

This comment has been minimized.

@jcouyang

jcouyang Jul 25, 2017

Contributor

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?

This comment has been minimized.

@calavera

calavera Jul 25, 2017

Member

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.

This comment has been minimized.

@jcouyang

jcouyang Jul 25, 2017

Contributor

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 Outdated
USER root
RUN add-apt-repository ppa:kelleyk/emacs
RUN apt-get -y update
RUN apt-get -y install emacs25-nox

This comment has been minimized.

@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.

This comment has been minimized.

@calavera

calavera Jul 25, 2017

Member

We want the nox version here.

@jcouyang

This comment has been minimized.

Copy link
Contributor

jcouyang commented Jul 25, 2017

@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

This comment has been minimized.

Copy link

Benaiah commented Jul 25, 2017

@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.

@DamienCassou

This comment has been minimized.

Copy link

DamienCassou commented Aug 1, 2017

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

This comment has been minimized.

Copy link
Contributor

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.

@kaushalmodi

This comment has been minimized.

Copy link

kaushalmodi commented Oct 27, 2017

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?

@kaushalmodi

This comment has been minimized.

Copy link

kaushalmodi commented Nov 7, 2017

@Benaiah It would be nice if a minimal emacs binary is available on Netlify as we won't need GUI frames, etc. .. just enough to run it in batch mode, and load/run other libraries like org-mode.

Emacs is more than a text editor.. it's a lisp environment.

@Benaiah

This comment has been minimized.

Copy link

Benaiah commented Nov 7, 2017

@kaushalmodi to be clear - I'm totally in favor of having Emacs support (I've used it as an SSG myself in the past). The only major issue I originally had with this PR is that 24.4 (which is different from 24.3 in very significant ways) isn't available from the default Ubuntu repos for our version of Ubuntu, but I'm not comfortable building Emacs out of a random PPA. I suggested above (in the discussion on the review comments) that we see if we can get Emacs 25 by pulling it from the source of a newer Ubuntu version - that seems like the simplest option to me. Building from source (as the PR is currently doing) is also acceptable, but @calavera would have to chime in on how feasible that is within our infrastructure, as I'm not an expert on it.

Dockerfile Outdated
RUN apt-get -y update
RUN apt-get -y install emacs25-nox

RUN wget http://ftpmirror.gnu.org/emacs/emacs-25.2.tar.gz && \

This comment has been minimized.

@kaushalmodi

kaushalmodi Nov 7, 2017

@Benaiah Looks like PPA is no longer used in the updated PR.

This comment has been minimized.

@kaushalmodi

kaushalmodi Nov 7, 2017

Sorry, so understood.. you don't have any issue with the updated PR, and we are waiting on feedback from @calavera.

@calavera Please look at this PR.

@calavera

This comment has been minimized.

Copy link
Member

calavera commented Nov 8, 2017

I'll test it out this week with a bunch of other updates we have in the queue to production.

@kaushalmodi

This comment has been minimized.

Copy link

kaushalmodi commented Nov 8, 2017

Very cool! While you are testing it, can you change that URL to get Emacs 25.3 instead of 25.2? @jcouyang Can you update the PR?

@jcouyang

This comment has been minimized.

Copy link
Contributor

jcouyang commented Nov 8, 2017

Thanks @calavera, looking forward to hearing good news from you soon.
great idea, @kaushalmodi I just update and parameterize the emacs version so future upgrade will be easier as well

@calavera

This comment has been minimized.

Copy link
Member

calavera commented Nov 13, 2017

This seems to be working on my tests. I'm going to merge it, but we won't deploy it just yet. I'll leave another comment here when that happens.

@calavera calavera merged commit 9380310 into netlify:master Nov 13, 2017

@kaushalmodi

This comment has been minimized.

Copy link

kaushalmodi commented Dec 7, 2017

@calavera Looks like now emacs available for a while on Netlify! I was waiting for a followup comment to happen here, and I just noticed that emacs from Netlify was being used instead of my version. :)

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