Changes between Version 19 and Version 20 of Emacs
- Timestamp:
- Dec 26, 2010, 12:23:24 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Emacs
v19 v20 43 43 {{{ 44 44 #!html 45 <img src="http://code.djangoproject.com/attachment/wiki/Emacs/nxhtml-django-html-mumamo.png?format=raw" alt="Screenshot of Django template in GNU Emacs with nXhtml." >45 <img src="http://code.djangoproject.com/attachment/wiki/Emacs/nxhtml-django-html-mumamo.png?format=raw" alt="Screenshot of Django template in GNU Emacs with nXhtml." /> 46 46 }}} 47 47 48 == New django-mode, django-html-mode == 49 The latest and greatest mode for all things Django is [http://github.com/myfreeweb/django-mode here]. You can add this as a git submodule if you manage your Emacs configuration with Git, or just download if you don't. 50 This mode includes snippets for [http://code.google.com/p/yasnippet YASnippet], Emacs functions for executing manage.py commands and jumping. Included django-html-mode is based on nxml-mode. Both modes have functions for quickly marking strings for translation. 48 51 52 {{{ 53 #!html 54 <img src="http://files.droplr.com/files/16908652/dA79.Django-emacs-jump.png" alt="Screenshot of jumping in Django-mode" /> 55 }}} 49 56 50 == django-mode == 57 The setup looks like this: 58 {{{ 59 (add-to-list 'load-path "path-to/django-mode/") 60 (require 'django-html-mode) 61 (require 'django-mode) 62 (yas/load-directory "path-to/django-mode/snippets") 63 (add-to-list 'auto-mode-alist '("\\.djhtml$" . django-html-mode)) 64 }}} 65 66 == Old modes == 67 === django-mode === 51 68 52 69 '''Status: old, download link does not work.''' … … 73 90 }}} 74 91 75 == django-html-mode==92 === django-html-mode === 76 93 77 94 '''Status: unmaintained.''' … … 89 106 90 107 Note: The django-html-mode code does not appear to support template tag indentation. 91 92 93 == Yasnippet ==94 95 If you are using [http://code.google.com/p/yasnippet/ Yasnippet], you can get the [https://edge.launchpad.net/django-mode django-mode] with many useful snippets.96 To get, run on a shell:97 {{{98 cd /tmp99 mkdir ~/.emacs/plugins100 101 bzr branch lp:python-mode102 bzr branch lp:django-mode103 104 mv /tmp/python-mode/python-mode.el ~/.emacs.d105 mv /tmp/django-mode/*.el ~/.emacs.d106 mv /tmp/django-mode/snippets ~/.emacs.d/plugins107 }}}108 And append something like:109 {{{110 (add-to-list 'load-path "~/.emacs.d/plugins/yasnippet-0.6.1c")111 (require 'yasnippet)112 (yas/initialize)113 (yas/load-directory "~/.emacs.d/plugins/yasnippet-0.6.1c/snippets")114 (require 'django-html-mode)115 (require 'django-mode)116 (yas/load-directory "~/.emacs.d/plugins/django-mode/snippets")117 }}}118 to your .emacs.119 120 The django-mode yasnippets code depend on python-mode.el, so it also has to be downloaded. Note: there is a difference between python.el (which comes with the native Emacs distribution) and python-mode.el, which has to be downloaded separately.121 122 Also, if you use django-html-mumamo-mode, you should not use Ysnippet since the automatic template tag indenting will not function correctly with the Ysnippet django-html-mode and django-mode code loaded.