- name: Emacs build-deps
  apt:
    name: emacs25
    state: build-dep
  become: yes

- name: Get Emacs
  get_url:
    url: http://ftp.gnu.org/gnu/emacs/emacs-25.3.tar.gz
    dest: /tmp/emacs.tar.gz

- name: Untar emacs
  unarchive:
    copy: no
    dest: /tmp/
    src: /tmp/emacs.tar.gz

- name: Configure emacs build
  command: ./configure
  args:
    chdir: /tmp/emacs-25.3

- name: Make emacs
  command: make
  args:
    chdir: /tmp/emacs-25.3

- name: Install emacs
  command: make install
  args:
    chdir: /tmp/emacs-25.3
  become: yes

- name: Add Emacs to applications
  copy:
    src: Emacs-25.desktop
    dest: /usr/share/applications/
  become: yes
  

- name: Add emacs specific ppas
  apt_repository:
    repo: ppa:kelleyk/emacs
    update-cache: yes
  become: yes

- name: Get Emacs
  apt:
    name: emacs26
  become: yes

Use ppa for installing emacs
Use ppa for installing emacs
