all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Good JavaScript c-style-mode?
@ 2008-09-22 20:47 jrwats
  2008-09-22 21:00 ` Joost Diepenmaat
  0 siblings, 1 reply; 2+ messages in thread
From: jrwats @ 2008-09-22 20:47 UTC (permalink / raw)
  To: help-gnu-emacs

Does anyone know a good c-style-mode or what variables I need to
change to fix the below indentation:
AClass = {}

    AClass.function1 = function(){
        alert('function1');
    }

        Aclass.function2 = function(){
            alert('function2');
        }

The desired indentation would be:
AClass = {}

AClass.function1 = function(){
    alert('function1');
}

Aclass.function2 = function(){
  alert('function2');
}


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Good JavaScript c-style-mode?
  2008-09-22 20:47 Good JavaScript c-style-mode? jrwats
@ 2008-09-22 21:00 ` Joost Diepenmaat
  0 siblings, 0 replies; 2+ messages in thread
From: Joost Diepenmaat @ 2008-09-22 21:00 UTC (permalink / raw)
  To: help-gnu-emacs

jrwats <jrwats@gmail.com> writes:

> Does anyone know a good c-style-mode or what variables I need to
> change to fix the below indentation:
> AClass = {}
>
>     AClass.function1 = function(){
>         alert('function1');
>     }
>
>         Aclass.function2 = function(){
>             alert('function2');
>         }
>
> The desired indentation would be:
> AClass = {}
>
> AClass.function1 = function(){
>     alert('function1');
> }
>
> Aclass.function2 = function(){
>   alert('function2');
> }

you want a real javascript mode. as far as indentation goes, Karl
Landstrom's mode is probably the best (link to my patched version):

http://joost.zeekat.nl/wp-content/javascript.el

outside of indentation, js2 mode is probably better:

http://code.google.com/p/js2-mode/

-- 
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-22 21:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-22 20:47 Good JavaScript c-style-mode? jrwats
2008-09-22 21:00 ` Joost Diepenmaat

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.