Giter VIP home page Giter VIP logo

multi-web-mode's People

Contributors

fgallina avatar ljos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multi-web-mode's Issues

how about adding some functions?

I once used web-mode in web-mode.org. It has some advantages, such as when you set colour in HTML, the colour-character's background will become to the corresponding colour. and it also auto-close the tag in HTML when we press '/'. I'm looking forward these functions.
I also love multi-web-mode, so I want it will be better.

Not a bug, but a thank you!

For 20 years i've been fighting with emacs' indentation of JS code in SCRIPT tags. Three minutes after installing this (which i stumbled across in a stackoverflow answer), my problems are solved and i can finally stop cursing at emasc every time i tap enter inside a SCRIPT tag.

THANK YOU!

REQUEST: Multi-minted-mode

Hello,
I was wondering if multi-web-mode could be re-engineered to work inside minted environments on AucTeX for all the programming languages covered by Pygments. This would allow maximum flexibility when writing LaTeX documents. I think several other people could be interested in this feature. Maybe this could be started as a fork of multi-web-mode? I've also mentioned this feature on stackoverflow here. Thanks.

Problems with handling apostrophes in html

Consider this file:

<h1>I'm using multi-web-mode</h1>
<script>
function a() {
  console.log("a");
}
</script>

When I move down inside the script multi-web-mode enables javascript-mode on the whole buffer. But javascript-mode gets confused by the apostrophe in the h1, thinks that we're inside a quote, and doesn't know how to indent properly:

screenshot

error in Emacs 24

installing multi-web-mode exactly as instructed (for the elisp part) I get the following error when opening a HTML or PHP file:

Error in post-command-hook (mweb-post-command-hook): (invalid-function (quote mode))

The file is then opened as if multi-web-mode wasn't active (when in fact it is)

template systems compatible?

I wonder if multi-web-mode can be made templates-system-compatible (like jinja2/django). It would be very useful!

Doesn't really work without (multi-web-global-mode 1)

Hello,

First of all thanks, I think this is the first multi-mode emacs plugin I try that I find nice & simple.

Now my problem: if I don't use multi-web-global-mode, for example with coffee-mode and erb, then it always "jumps out" of multi-web-mode:

(defun multi-web-mode-coffee-erb ()
  (setq mweb-default-major-mode 'coffee-mode)
  (setq mweb-tags '((ruby-mode "<%==\\|<%=\\|<%#\\|<%" "%>")))
  (setq mweb-filename-extensions '("erb"))
  (multi-web-mode))

(add-to-list 'auto-mode-alist '("\\coffee\\.erb\\'" . multi-web-mode-coffee-erb))

After some investiguation, I see that in mweb-change-major-mode when it changes mode (calls ruby-mode) then multi-web-mode is disabled, and one has to call M-x multi-web-mode again to reenable it... which will work until you change mode again.

[EDIT] I just checked and this also happens in plain PHP/HTML mode.

request for reindentation via TAB key invokes php-mode-hook

Hi,

at first I would like to thank you for making this mode! It's the only "multiple mode" extension for Emacs that works for me when editing mixed HTML/PHP files. :-)

Unfortunately I am experiencing a small hitch. The following code is the only thing that I have in my init.el file.

(add-to-list 'load-path "~/.emacs.d/plugins/php-mode/")
(require 'php-mode)

(add-hook 'php-mode-hook (lambda () (message "Hello")))

(add-to-list 'load-path "~/.emacs.d/plugins/multi-web-mode/")
(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)

The problem is that whenever I press a TAB key to automatically indent some line within a PHP chunk the php-mode-hook is invoked (according to those Hello messages printed into the Messages buffer). Is this a correct behaviour? For me it's a little bit annoying and it slows me down during editing (I have some nontrivial config hooked to that hook and it takes some time to fulfill it).

Please will you find some time to look at this issue? I'm currently using Emacs 24.2.1 with the latest version of your mode.

Thank you very much!

Mixing ruby-mode with html-mode for .erb doesn't seem to be working

Hi,

Thanks for making this! I've been playing around with other multi-mode alternatives and this one seems the most appealing :) I'm having an issue that's probably down to my own mistake, however. I'm triggering the mode using a hook like this:

(defun multi-web-mode-html-erb ()
    (setq mweb-default-major-mode 'html-mode)
    (setq mweb-tags '((ruby-mode "<%==|<%=|<%#|<%" "%>")))
    (setq mweb-filename-extensions '("html.erb"))
    (multi-web-mode))

(defun multi-web-mode-text-erb ()
    (setq mweb-default-major-mode 'text-mode)
    (setq mweb-tags '((ruby-mode "<%==|<%=|<%#|<%" "%>")))
    (setq mweb-filename-extensions '("text.erb"))
    (multi-web-mode))

(add-to-list 'auto-mode-alist '("\.html\.erb$" . multi-web-mode-html-erb))
(add-to-list 'auto-mode-alist '("\.text\.erb$" . multi-web-mode-text-erb))

I'm doing it this way so that I can get better customization per file extension than with a global mode. It is being triggered correctly, but when I open a .html.erb file it just renders as HTML everywhere, with the blocks of Ruby not being highlighted at all (unless I throw some bogus HTML inside the <% ... %> blocks, which causes the HTML to be highlighted, like multi-web-mode isn't recognising the ERB tags.

.text.erb files just get rendered with no highlighting, due to them being interpreted as all-text, with no ERB.

Is there's a problem with the patterns I'm setting for the <% erb %> tags? They're a lot like tags really :)

Chris

indent-region deletes part of the region

The situation is as follows:

Issue: indent-region() deletes much of the region. It is clear that there is some point in the file that triggers some failure where, depending on whether mark was placed at the beginning or end of region, will delete from the trigger point to mark.

If not in multi-web-mode, the indent-region works as expected (i.e. nothing is deleted, and the indentation is sometimes wrong because of the mixed mode file, but that is expected).

This is something related to v.24 of Emacs. The same file, sourcing the same startup scripts in v.23 works fine.

The file is a PHP file, and the mode list is (XHMTL yas Multi-Web).

I have removed everything from startup except php-mode (1.5.0) and multi-web-mode with the same result. Except for extra files extensions, the startup is exactly as provided in the standard config.

If I am following things right, it looks like the actual function being called is the built-in sgml-indent-line()

I can provide more info/do more debugging, but at this point I do not know what would be most useful and request guidance.

Dynamically change mweb-default-major-mode

Hi... is there a way to dynamically change the mweb-default-major-mode... once a file has been opened. I've started a new role developing coldfusion. Here files can be written using either based or script(){} based code. I find I open up a script based file with html-mode set as the mweb-default-major-mode and can't easily quickly switch the file to JavaScript-mode. Any ideas appreciated. Thanks

Plan to Support major-mode callback?

(setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>")
                  (js-mode "<script +\\(type=\"text/javascript\"\\|language=\"javascript\"\\)[^>]*>" "</script>")
                  (css-mode "<style +type=\"text/css\"[^>]*>" "</style>")))

Above is how we initialize major mode selector (how I can call it?).
I think, it is useful when mweb permits to add hook function into each tags. So when we change from one mode to another, the hook called. It'll be more fun I thing..

(setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>" my-php-mode-hook-function)
                  (js-mode "<script +\\(type=\"text/javascript\"\\|language=\"javascript\"\\)[^>]*>" "</script>" my-js-mode-mode-hook-function)
                  (css-mode "<style +type=\"text/css\"[^>]*>" "</style>")))

package.el

Is there any interest in getting this uploaded to a public package repository such as ELPA or marmalade?

Alternatively, are you assuming that users have installed el-get? (After I noticed you have a fork of that project)

Problems with evil

Hi, thanks for a plug-in with a lot of potential.

It seems like the evil-mode modes are lost when the plug-in changes major mode. Like if I am in Visual mode i HTML and move my marker inside a PHP area I'm back to normal mode.

PHP indentation not work properly

Thanks for your emacs extension.

I'm using the latest multi-web-mode for PHP/HTML editing, it can recognise html and php very accurately. However, PHP indentation is incorrect, please see the image:
http://i.imgur.com/o5KHL.png

php-mode itself will work correctly with multi-web-mode turned off.

(Emacs 24.2.50.1 on Debian 6)

Switch mode only when caret is between the start and end tag, not on them

multi-web-mode is excellent and I think this is the best mode for webdev on emacs, but just a little thing is bothering me, namely right now if you place your caret inside either the <script> or </script>, the major mode switches to js-mode, it would be nice if there was a way to tell multi-web-mode to only change mode when the caret is between the tags, excluding the tags themselves.

Spam

edit:
Unfortunately I opened this issue for the wrong project. I'm really sorry!

Please mark it as spam.

Improvement to example config

Hi there,

I just downloaded and installed this mode and used the example configuration. On the first html file I loaded, it failed to do any mode switching. After investigation, it turned out that my html file used single quotes rather than double quotes for most of the attributes (e.g. <style type='text/css'>).

It might help new users if you make the example mweb-tags match either type of quote, e.g.

(setq mweb-tags '((php-mode "<?php|<? |<?=" "?>")
(js-mode "<script +\(type=['"]text/javascript['"]\|language=['"]javascript['"]\)[^>]>" "</script>")
(css-mode "<style +type=['"]text/css['"][^>]
>" "</style>")))

Cheers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.