---
- name: Clone Emacs config
  git: >
    repo=git@github.com:jcf/emacs.d.git
    dest=~/.emacs.d
  tags: update

# http://emacsformacosx.com/tips
- name: Install Emacs
  mac_pkg: >
    pkg_type=app
    url=http://emacsformacosx.com/emacs-builds/Emacs-2014-06-14_01-33-01-117333-universal-10.6.8.dmg
    archive_type=dmg archive_path=Emacs.app

- name: Create ~/.bin
  file: dest=~/.bin state=directory

- name: Link emacsclient
  file: >
    src=/Applications/Emacs.app/Contents/MacOS/bin/emacsclient
    dest=~/.bin/emacsclient
    state=link

- name: Link executables
  file: src={{ item }} dest=~/.bin/{{ item | basename }} state=link
  with_fileglob:
    - ./*

---
- name: Clone Emacs config
  git: >
    repo=git@github.com:jcf/emacs.d.git
    dest=~/.emacs.d
  tags: update

# http://emacsformacosx.com/tips
- name: Install Emacs
  mac_pkg: >
    pkg_type=app
    url=http://emacsformacosx.com/emacs-builds/Emacs-2014-06-14_01-33-01-117333-universal-10.6.8.dmg
    archive_type=dmg archive_path=Emacs.app

- name: Create ~/.bin
  file: dest=~/.bin state=directory

- name: Link emacsclient
  file: >
    src=/Applications/Emacs.app/Contents/MacOS/bin/emacsclient
    dest=~/.bin/emacsclient
    state=link

- name: Link executables
  file: src={{ item }} dest=~/.bin/{{ item | basename }} state=link
  with_fileglob:
    - ./*

- name: Install GNU global
  homebrew: name=global install_options=with-exuberant-ctags
  tags: gtags

- name: Install pygments
  pip: name=pygments state=latest
  tags: gtags

- name: Clone global-pygments-plugin
  git: >
    repo=git://github.com/yoshizow/global-pygments-plugin.git
    dest=~/.cache/global-pygments-plugin
  tags: gtags

- name: Make global-pygments-plugin
  shell: >
    cd ~/.cache/global-pygments-plugin &&
    sh reconf.sh &&
    ./configure --prefix=/usr/local/bin --with-exuberant-ctags=/usr/local/bin/ctags &&
    make && make install
  # creates: /usr/local/etc/gtags.conf
  tags: gtags

Automate installation of GNU Global, ctags, and Pygments
Automate installation of GNU Global, ctags, and Pygments
