Skip to content

Instantly share code, notes, and snippets.

@tbonza2
Last active November 4, 2016 21:39
Show Gist options
  • Select an option

  • Save tbonza2/20757551443a61254aa6 to your computer and use it in GitHub Desktop.

Select an option

Save tbonza2/20757551443a61254aa6 to your computer and use it in GitHub Desktop.

Revisions

  1. tbonza2 revised this gist Jan 3, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -62,6 +62,7 @@ Back to emacs `M-x package-install`, `Install package: mmm-mako`. Once mmm-mako
    'auto-mode-alist '("\\.sls\\'" . yaml-mode))
    (mmm-add-mode-ext-class 'html-mode "\\.sls\\'" 'mako)
    ```

    My full .emacs file can be viewed [here](https://github.com/tbonza/emacs-config/blob/master/.emacs). Also, I want to say thank you to [Zach](http://zwass.com/2011/07/01/installing-emacs-mmm-mako-mode/) for putting together the post about Mako/HTML.

    This approach is a work in progress and I'll update as I find bugs/improvements.
  2. tbonza2 revised this gist Jan 3, 2015. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -54,9 +54,7 @@ Placed the following in my .emacs file
    (add-to-list 'package-archives
    '("melpa" . "http://melpa.org/packages/") t)
    ```
    Back to emacs `M-x package-install`, `Install package: mmm-mako`
    Once mmm-mako is installed then just finish configuring your .emacs
    Back to emacs `M-x package-install`, `Install package: mmm-mako`. Once mmm-mako is installed then just finish configuring your .emacs
    ```elisp
    (add-to-list
  3. tbonza2 revised this gist Jan 3, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,7 @@ Placed the following in my .emacs file
    ```
    Back to emacs `M-x package-install`, `Install package: mmm-mako`
    Once mmm-mako is installed then just finish configuring your .emacs:
    Once mmm-mako is installed then just finish configuring your .emacs
    ```elisp
    (add-to-list
  4. tbonza2 revised this gist Jan 3, 2015. 1 changed file with 27 additions and 1 deletion.
    28 changes: 27 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -40,4 +40,30 @@ My elisp files were installed to /usr/local/share/emacs/site-lisp. You may need
    (require 'mmm-auto)
    (setq mmm-global-mode 'maybe)
    ````
    Make sure it's installed correctly by opening emacs `M-x mmm-mode` to enable MMM-mode.
    Make sure it's installed correctly by opening emacs `M-x mmm-mode` to enable MMM-mode.

    3. Next up, installing MMM-Mako. If I can install something with the package manager then I'll do it. Let's first make sure the package will be available by adding melpa to our .emacs

    ```bash
    $ emacs -nw ~/.emacs
    ```
    Placed the following in my .emacs file

    ```elisp
    (require 'package) ;; You might already have this line
    (add-to-list 'package-archives
    '("melpa" . "http://melpa.org/packages/") t)
    ```
    Back to emacs `M-x package-install`, `Install package: mmm-mako`
    Once mmm-mako is installed then just finish configuring your .emacs:
    ```elisp
    (add-to-list
    ;; Saltstack config
    'auto-mode-alist '("\\.sls\\'" . yaml-mode))
    (mmm-add-mode-ext-class 'html-mode "\\.sls\\'" 'mako)
    ```
    My full .emacs file can be viewed [here](https://github.com/tbonza/emacs-config/blob/master/.emacs). Also, I want to say thank you to [Zach](http://zwass.com/2011/07/01/installing-emacs-mmm-mako-mode/) for putting together the post about Mako/HTML.

    This approach is a work in progress and I'll update as I find bugs/improvements.
  5. tbonza2 revised this gist Jan 3, 2015. 1 changed file with 12 additions and 2 deletions.
    14 changes: 12 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -16,18 +16,28 @@ Setup
    [Multiple Major (MMM) Mode](http://mmm-mode.sourceforge.net/) allows Emacs major modes to be combined. [MMM-Mako Mode](https://bitbucket.org/pjenvey/mmm-mako/overview) provides support for Mako files using MMM. Configuring the setup can be a pain so I wanted to document it:

    1. Download & untar MMM mode from http://sourceforge.net/projects/mmm-mode/files

    ```bash
    mv ~/Downloads/mmm-mode-0.5.1.tar.gz ~/InstalledPrograms/
    tar -xvf mmm-mode-0.5.1.tar.gz && cd mmm-mode-0.5.1/
    whereis emacs
    ```

    2. Make & install MMM mode but first specify where your Emacs is installed. I'm using [Emacs 24](http://www.gnu.org/software/emacs/) installed in `/usr/bin/emacs`.
    ```bash
    EMACS="/usr/bin/emacs"
    ./configure
    make
    sudo make install
    ```
    and then
    My elisp files were installed to /usr/local/share/emacs/site-lisp. You may need to add this directory to the Emacs load path. You will also need to tell Emacs to load the module. Here's what I added to my .emacs configuration.

    ````elisp
    (add-to-list
    ;; Adding mmm-mode
    'load-path "/usr/local/share/emacs/site-lisp")
    (require 'mmm-auto)
    (setq mmm-global-mode 'maybe)
    ````
    Make sure it's installed correctly by opening emacs `M-x mmm-mode` to enable MMM-mode.
  6. tbonza2 revised this gist Jan 3, 2015. 1 changed file with 9 additions and 4 deletions.
    13 changes: 9 additions & 4 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -16,13 +16,18 @@ Setup
    [Multiple Major (MMM) Mode](http://mmm-mode.sourceforge.net/) allows Emacs major modes to be combined. [MMM-Mako Mode](https://bitbucket.org/pjenvey/mmm-mako/overview) provides support for Mako files using MMM. Configuring the setup can be a pain so I wanted to document it:

    1. Download & untar MMM mode from http://sourceforge.net/projects/mmm-mode/files
    ```bash
    mv ~/Downloads/mmm-mode-0.5.1.tar.gz ~/InstalledPrograms/
    tar -xvf mmm-mode-0.5.1.tar.gz && cd mmm-mode-0.5.1/
    whereis emacs
    ```

    2. Make & install MMM mode but first specify where your Emacs is installed. I'm using [Emacs 24](http://www.gnu.org/software/emacs/) installed in `/usr/bin/emacs`.
    ```bash
    EMACS="/usr/bin/emacs"`
    ./configure'
    make'
    sudo make install`
    EMACS="/usr/bin/emacs"
    ./configure
    make
    sudo make install
    ```
    and then
  7. tbonza2 revised this gist Jan 3, 2015. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -18,10 +18,11 @@ Setup
    1. Download & untar MMM mode from http://sourceforge.net/projects/mmm-mode/files

    2. Make & install MMM mode but first specify where your Emacs is installed. I'm using [Emacs 24](http://www.gnu.org/software/emacs/) installed in `/usr/bin/emacs`.
    `EMACS="/usr/bin/emacs"`
    `./configure'
    `make'
    `sudo make install`

    ```bash
    EMACS="/usr/bin/emacs"`
    ./configure'
    make'
    sudo make install`
    ```
    and then

  8. tbonza2 revised this gist Jan 3, 2015. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,13 @@ Setup

    [Multiple Major (MMM) Mode](http://mmm-mode.sourceforge.net/) allows Emacs major modes to be combined. [MMM-Mako Mode](https://bitbucket.org/pjenvey/mmm-mako/overview) provides support for Mako files using MMM. Configuring the setup can be a pain so I wanted to document it:

    1) Download & untar MMM mode from http://sourceforge.net/projects/mmm-mode/files
    1. Download & untar MMM mode from http://sourceforge.net/projects/mmm-mode/files

    2) Make & install MMM mode but first specify where your Emacs is installed. I'm using [Emacs 24](http://www.gnu.org/software/emacs/) installed in `/usr/bin/emacs`.
    2. Make & install MMM mode but first specify where your Emacs is installed. I'm using [Emacs 24](http://www.gnu.org/software/emacs/) installed in `/usr/bin/emacs`.
    `EMACS="/usr/bin/emacs"`
    `./configure'
    `make'
    `sudo make install`

    and then

  9. tbonza2 renamed this gist Jan 3, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  10. tbonza2 renamed this gist Jan 3, 2015. 1 changed file with 13 additions and 1 deletion.
    14 changes: 13 additions & 1 deletion gistfile1.md → emacs_saltstack
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,19 @@ Saltstack mode for emacs

    Earlier today I was looking for a Saltstack mode for emacs. Couldn't find one, so I posted the [question](http://stackoverflow.com/questions/27737557) on Stack overflow. Somebody had a good suggestion about using yaml-mode because a Sublime Text [implementation](https://github.com/saltstack/sublime-text/blob/master/YAML.sublime-settings) appeared to be taking this approach.Another person thought that Saltstack's use of jinja templates would make an emacs mode easy enough to configure. These were both helpful ideas so I wanted to implement parts of each.

    Reasoning
    ----------

    After looking around, I found that [someone](http://zwass.com/2011/07/01/installing-emacs-mmm-mako-mode/) had configured an emacs mode for a similar situation. They needed to combine HTML and Python to use [Mako](http://www.makotemplates.org/) templates for a project not involving Saltstack. Since Edx [uses](https://groups.google.com/forum/#!msg/edx-code/qlMvLjsqVaw/EeU7gh5hcfIJ) Mako templates instead of [jinja](http://jinja.pocoo.org/) in their [Django](https://www.djangoproject.com/) [site](https://github.com/edx/edx-platform), Mako seemed like a good alternative to Jinja templates.

    Since someone previously combined HTML and Python modes it seemed reasonable to combine Mako and Yaml modes in Emacs.

    Setup
    -----

    After looking around, I found that [someone](http://zwass.com/2011/07/01/installing-emacs-mmm-mako-mode/) had configured an emacs mode for a similar situation. They needed to combine HTML and Python to use [Mako](http://www.makotemplates.org/) templates for a project not involving Saltstack. Since Edx [uses](https://groups.google.com/forum/#!msg/edx-code/qlMvLjsqVaw/EeU7gh5hcfIJ) Mako templates instead of [jinja](http://jinja.pocoo.org/) in their [Django](https://www.djangoproject.com/) [site](https://github.com/edx/edx-platform), Mako seemed like a good alternative to Jinja templates.
    [Multiple Major (MMM) Mode](http://mmm-mode.sourceforge.net/) allows Emacs major modes to be combined. [MMM-Mako Mode](https://bitbucket.org/pjenvey/mmm-mako/overview) provides support for Mako files using MMM. Configuring the setup can be a pain so I wanted to document it:

    1) Download & untar MMM mode from http://sourceforge.net/projects/mmm-mode/files

    2) Make & install MMM mode but first specify where your Emacs is installed. I'm using [Emacs 24](http://www.gnu.org/software/emacs/) installed in `/usr/bin/emacs`.

  11. tbonza2 revised this gist Jan 3, 2015. 1 changed file with 2 additions and 11 deletions.
    13 changes: 2 additions & 11 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,9 @@
    Saltstack mode for emacs
    =========================

    Earlier today I was looking for a Saltstack mode for emacs. Couldn't find one, so I posted the [question](http://stackoverflow.com/questions/27737557) on Stack overflow. Somebody had a good suggestion about using yaml-mode because a Sublime Text `implementation`_ appeared to be taking this approach.Another person thought that Saltstack's use of jinja templates would make an emacs mode easy enough to configure. These were both helpful ideas so I wanted to implement parts of each.
    Earlier today I was looking for a Saltstack mode for emacs. Couldn't find one, so I posted the [question](http://stackoverflow.com/questions/27737557) on Stack overflow. Somebody had a good suggestion about using yaml-mode because a Sublime Text [implementation](https://github.com/saltstack/sublime-text/blob/master/YAML.sublime-settings) appeared to be taking this approach.Another person thought that Saltstack's use of jinja templates would make an emacs mode easy enough to configure. These were both helpful ideas so I wanted to implement parts of each.

    Setup
    -----

    After looking around, I found that `someone`_ had configured an emacs mode for a similar situation. They needed to combine HTML and Python to use `Mako`_ templates for a project not involving Saltstack. Since Edx `uses`_ Mako templates instead of `jinja`_ in their `Django`_ `site`_, Mako seemed like a good alternative to Jinja templates.

    .. _question:
    .. _implementation: https://github.com/saltstack/sublime-text/blob/master/YAML.sublime-settings
    .. _someone: http://zwass.com/2011/07/01/installing-emacs-mmm-mako-mode/
    .. _Mako: http://www.makotemplates.org/
    .. _uses: https://groups.google.com/forum/#!msg/edx-code/qlMvLjsqVaw/EeU7gh5hcfIJ
    .. _jinja: http://jinja.pocoo.org/
    .. _Django: https://www.djangoproject.com/
    .. _site: https://github.com/edx/edx-platform
    After looking around, I found that [someone](http://zwass.com/2011/07/01/installing-emacs-mmm-mako-mode/) had configured an emacs mode for a similar situation. They needed to combine HTML and Python to use [Mako](http://www.makotemplates.org/) templates for a project not involving Saltstack. Since Edx [uses](https://groups.google.com/forum/#!msg/edx-code/qlMvLjsqVaw/EeU7gh5hcfIJ) Mako templates instead of [jinja](http://jinja.pocoo.org/) in their [Django](https://www.djangoproject.com/) [site](https://github.com/edx/edx-platform), Mako seemed like a good alternative to Jinja templates.
  12. tbonza2 revised this gist Jan 3, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    Saltstack mode for emacs
    =========================

    Earlier today I was looking for a Saltstack mode for emacs. Couldn't find one, so I posted the `question`_ on Stack overflow. Somebody had a good suggestion about using yaml-mode because a Sublime Text `implementation`_ appeared to be taking this approach.Another person thought that Saltstack's use of jinja templates would make an emacs mode easy enough to configure. These were both helpful ideas so I wanted to implement parts of each.
    Earlier today I was looking for a Saltstack mode for emacs. Couldn't find one, so I posted the [question](http://stackoverflow.com/questions/27737557) on Stack overflow. Somebody had a good suggestion about using yaml-mode because a Sublime Text `implementation`_ appeared to be taking this approach.Another person thought that Saltstack's use of jinja templates would make an emacs mode easy enough to configure. These were both helpful ideas so I wanted to implement parts of each.

    Setup
    -----

    After looking around, I found that `someone`_ had configured an emacs mode for a similar situation. They needed to combine HTML and Python to use `Mako`_ templates for a project not involving Saltstack. Since Edx `uses`_ Mako templates instead of `jinja`_ in their `Django`_ `site`_, Mako seemed like a good alternative to Jinja templates.

    .. _question: http://stackoverflow.com/questions/27737557
    .. _question:
    .. _implementation: https://github.com/saltstack/sublime-text/blob/master/YAML.sublime-settings
    .. _someone: http://zwass.com/2011/07/01/installing-emacs-mmm-mako-mode/
    .. _Mako: http://www.makotemplates.org/
  13. tbonza2 created this gist Jan 3, 2015.
    18 changes: 18 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    Saltstack mode for emacs
    =========================

    Earlier today I was looking for a Saltstack mode for emacs. Couldn't find one, so I posted the `question`_ on Stack overflow. Somebody had a good suggestion about using yaml-mode because a Sublime Text `implementation`_ appeared to be taking this approach.Another person thought that Saltstack's use of jinja templates would make an emacs mode easy enough to configure. These were both helpful ideas so I wanted to implement parts of each.

    Setup
    -----

    After looking around, I found that `someone`_ had configured an emacs mode for a similar situation. They needed to combine HTML and Python to use `Mako`_ templates for a project not involving Saltstack. Since Edx `uses`_ Mako templates instead of `jinja`_ in their `Django`_ `site`_, Mako seemed like a good alternative to Jinja templates.

    .. _question: http://stackoverflow.com/questions/27737557
    .. _implementation: https://github.com/saltstack/sublime-text/blob/master/YAML.sublime-settings
    .. _someone: http://zwass.com/2011/07/01/installing-emacs-mmm-mako-mode/
    .. _Mako: http://www.makotemplates.org/
    .. _uses: https://groups.google.com/forum/#!msg/edx-code/qlMvLjsqVaw/EeU7gh5hcfIJ
    .. _jinja: http://jinja.pocoo.org/
    .. _Django: https://www.djangoproject.com/
    .. _site: https://github.com/edx/edx-platform