• Stars
    star
    176
  • Rank 216,987 (Top 5 %)
  • Language
    Emacs Lisp
  • License
    GNU General Publi...
  • Created over 15 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Multi Web Mode is a minor mode wich makes web editing in Emacs much easier.

multi-web-mode

Multiple major mode support for web editing in Emacs.

Info

Donations welcome!

Flattr this git repo

Introduction

Multi Web Mode is a minor mode which makes web editing in Emacs much easier.

Basically it selects the appropriate major mode automatically when you move the point and calculates the correct indentation of chunks according to the indentation of the most relevant major mode.

Currently it is focused to work on buffers which contain html, css, javascript and/or php, but adding other modes is really simple: you just need to add your own mode to the mweb-tags. You can do that by using M-x customize-group RET multi-web-mode and looking for the mweb-tags variable.

All third packages were removed from the project repo (they were included with mweb previously), mainly because it is difficult to track new versions for everything and because it favored the user laziness to check the basic configuration :).

The last multi-web-mode release which contained all packages was 0.2.1. It is still available from here:

Why?

At the time I created multi-web-mode I had tried several of the existing stuff that was available, but then I settled with MuMaMo (from the nXhtml package) which I found pretty cool; although I was having some problems with it, like: slow parsing, erroneus indentation and hangs.

When I tried to look at its code to solve some of this stuff I found it really difficult for me to follow. That convinced me to try to write the simplest working version of a package that does multiple major mode support, therefore multi-web-mode was born.

This was a long time ago, and I'm not sure how other packages progressed but I think the key feature of multi-web-mode is the simplicity with which detects the current chunk and indentation (although the code it's not pretty, it was one of my first Emacs Lisp packages and never got cleaned up properly :-). Another thing I consider a feature is that multi-web-mode only focuses on 3 things: detecting the chunk, activating the proper major mode and calculating the indentation for it. It lets unmodified major and minor modes to do its job without stepping in the middle.

Requirements

You don't need any special libraries to run this package. Just the ones you want to integrate to it.

Regarding the version of Emacs, this package was tested successfully with >= 23.0.60.

Installation

To install Multi Web Mode you'll need to do something like this in your .emacs:

(require 'multi-web-mode)
(setq mweb-default-major-mode 'html-mode)
(setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>")
                  (js-mode "<script +\\(type=\"text/javascript\"\\|language=\"javascript\"\\)[^>]*>" "</script>")
                  (css-mode "<style +type=\"text/css\"[^>]*>" "</style>")))
(setq mweb-filename-extensions '("php" "htm" "html" "ctp" "phtml" "php4" "php5"))
(multi-web-global-mode 1)

Usage

Multi Web Mode binds the following keystrokes:

  • M-<f11> : Prompts the user to override the default major mode.
  • M-<f12> : Prompts the user to override the calculated extra indentation. Useful when the automatic calculation is not good enough.

Bug Reports

If you find a bug please report in the github tracker or sending an email to the address listed at the top of the file.

License

multi-web-mode.el is free software under the GPL v3, see LICENSE file for details.

More Repositories

1

python.el

Python's flying circus support for Emacs
Emacs Lisp
265
star
2

python-django.el

An Emacs package for managing Django projects.
Emacs Lisp
66
star
3

region-bindings-mode

A minor mode that enables custom bindings when mark is active.
Emacs Lisp
40
star
4

mu4e-multi

Multiple account facilities for mu4e
Emacs Lisp
33
star
5

dotemacs

My GNU/Emacs configuration
Emacs Lisp
26
star
6

bookapi

NodeJS RESTful API + Postgres + Docker + Kubernetes
JavaScript
17
star
7

swank-python

Swank server for python
Python
10
star
8

gpycomplete

Python code autocompletion and helper suite for GNU/Emacs. Feels like having Ipython in your buffer.
Python
8
star
9

palienwarey

Cross platform Alienware Leds commandline tool, driver and library.
Python
5
star
10

wethemen

WeTheMen Public Site.
Python
3
star
11

projutils.el

Project utils for Emacs
Emacs Lisp
3
star
12

django-fabadmin

Django based fabric admin interface
Python
3
star
13

terminator

multi-view terminal emulation
Emacs Lisp
3
star
14

django-email-usernames

easy_install/pip ready version of http://bitbucket.org/hakanw/django-email-usernames
Python
3
star
15

gorm

Form Generation Library for Kohana
PHP
2
star
16

emms-info-mediainfo

An EMMS info source for the mediainfo program.
Emacs Lisp
2
star
17

startupd.el

Modular loading of Emacs configuration
Emacs Lisp
2
star
18

subdivide

easy fast frame spliting for emacs
2
star
19

ibuffer-rcirc

Ibuffer integration for rcirc
Emacs Lisp
2
star
20

HATE

(X)HTML from (B)Ash Template Engine
Shell
1
star
21

django-seltest

Selenium test integration for Django based projects.
Python
1
star
22

rcirc-alertify

Cross platform notifications for rcirc
Emacs Lisp
1
star
23

django-polyglot

django database tables internationalization facilities
Python
1
star