Re: JavaScript Style Guide. Emacs mode line.

2014-01-08 Thread Anthony Jones
On 08/01/14 15:04, Chris Peterson wrote: > 1. Finish bikeshedding coding style > 2. Update official style guide (owner=bsmedberg?) > 3. Add style config files for vim/emacs/clang-format in mozilla-central > 4. Reformat mozilla-central code (piecemeal or big bang) > 5. Remove modelines from mozilla-

Re: JavaScript Style Guide. Emacs mode line.

2014-01-08 Thread Boris Zbarsky
On 1/8/14 1:08 PM, Garrett Robinson wrote: > Can an emacs modeline execute arbitrary elisp? It can if it uses certain modeline features. The default behavior of emacs is to silently apply the modelines that don't use those features and for the ones to do not apply them unless the user explicitly

Re: JavaScript Style Guide. Emacs mode line.

2014-01-08 Thread Garrett Robinson
On 01/08/2014 12:25 AM, ishikawa wrote: > That vim mode line is useless for a large percentage of user > community is a news to me. (But I don't use vim myself.) It's disabled by default because it's a security concern (modelines can execute arbitrary vimscript, IIRC). Can an emacs modeline exec

Re: JavaScript Style Guide. Emacs mode line.

2014-01-08 Thread Nick Alexander
> BTW, do java or javascript programmers use Eclipse with its built-in editor > with suitable editor configuration, > and that is the end of the story for such Eclipse users when they tinker > with Mozilla source code? Android Background Services are developed in a separate git repo that we then m

Re: JavaScript Style Guide. Emacs mode line.

2014-01-08 Thread Till Schneidereit
On Wed, Jan 8, 2014 at 9:25 AM, ishikawa wrote: > BTW, do java or javascript programmers use Eclipse with its built-in editor > with suitable editor configuration, > and that is the end of the story for such Eclipse users when they tinker > with Mozilla source code? > I use Eclipse for working o

Re: JavaScript Style Guide. Emacs mode line.

2014-01-08 Thread Mike de Boer
Awesome idea! It also supports per-directory settings, so a style difference for any module can be recorded as well. Filed as https://bugzilla.mozilla.org/show_bug.cgi?id=957564 Whatever comes out of these discussions, they can be recorded & enforced with this in-tree and not just in a wiki. C

Re: JavaScript Style Guide. Emacs mode line.

2014-01-08 Thread Neil
Blair McBride wrote: I'd like to see the removal of the modelines also. A root config file is much cleaner. For the widest possible support of editors, I'd love to see a root .editorconfig file. See http://editorconfig.org/ - it's an editor-neutral config, with plugins for many editors/IDEs

Re: JavaScript Style Guide. Emacs mode line.

2014-01-08 Thread ishikawa
On (2014年01月08日 10:38), Mike Hommey wrote: > On Wed, Jan 08, 2014 at 10:23:28AM +0900, ISHIKAWA,chiaki wrote: >> (2013/09/10 19:17), ishikawa wrote: >> >> [ omissions ] >>> >>> I am getting the hang of emacs mode line. >>> >>> /* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; >>> c-ba

Re: JavaScript Style Guide. Emacs mode line.

2014-01-07 Thread Blair McBride
I'd like to see the removal of the modelines also. A root config file is much cleaner. For the widest possible support of editors, I'd love to see a root .editorconfig file. See http://editorconfig.org/ - it's an editor-neutral config, with plugins for many editors/IDEs (including Emacs, Vim,

Re: JavaScript Style Guide. Emacs mode line.

2014-01-07 Thread Karl Tomlinson
Chris Peterson writes: > If mozilla-central is reformatted, that would be a good time to > also remove the modelines. > 5. Remove modelines from mozilla-central files I'm happy with removal of modelines provided .dir-locals.el files are added to provide the same functionality. There is imported

Re: JavaScript Style Guide. Emacs mode line.

2014-01-07 Thread Chris Peterson
On 1/7/14, 5:42 PM, Martin Thomson wrote: Yeah, I thought that was the whole point of having a .emacs file. I’ve never found those mode line things to be properly useful short of the point that it includes the entire c-offsets-alist for the buffer. I’d rather the mode line stuff be removed.

Re: JavaScript Style Guide. Emacs mode line.

2014-01-07 Thread Martin Thomson
On 2014-01-07, at 17:38, Mike Hommey wrote: > Do we need so much boilerplate in all our files? With this and > vim-modeline, we now have editor boilerplate that takes as much space as > the MPL boilerplate. Also, afaik, vim modelines are mostly useless, since > vim doesn't use them by default any

Re: JavaScript Style Guide. Emacs mode line.

2014-01-07 Thread Nicholas Nethercote
On Tue, Jan 7, 2014 at 5:38 PM, Mike Hommey wrote: > Also, afaik, vim modelines are mostly useless, since > vim doesn't use them by default anyways I enable them, and as long as we have some files with 2-space indents and some with 4-space indents I will continue to find them useful... Nick

Re: JavaScript Style Guide. Emacs mode line.

2014-01-07 Thread Mike Hommey
On Wed, Jan 08, 2014 at 10:23:28AM +0900, ISHIKAWA,chiaki wrote: > (2013/09/10 19:17), ishikawa wrote: > > [ omissions ] > > > > I am getting the hang of emacs mode line. > > > > /* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; > > c-basic-offset: 2 ; js-indent-level : 2 ; js-curl

Re: JavaScript Style Guide. Emacs mode line.

2014-01-07 Thread ISHIKAWA,chiaki
(2013/09/10 19:17), ishikawa wrote: [ omissions ] > > I am getting the hang of emacs mode line. > > /* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; > c-basic-offset: 2 ; js-indent-level : 2 ; js-curly-indent-offset: 0 -*- */ > /* vim: set ts=2 et sw=2 tw=80: */ > > seem to do th

Re: JavaScript Style Guide. Emacs mode line.

2013-09-15 Thread Cameron McCormack
Gavin Sharp wrote: On Mon, Sep 9, 2013 at 10:08 PM, Scott Johnson wrote: I'd recommend we not do this, as it will likely break hg blame. I think the idea that white space-only changes "break hg blame" needs to die :) White space-only changes are a change like any other, and at worst add one s

Re: JavaScript Style Guide. Emacs mode line.

2013-09-15 Thread Gavin Sharp
On Mon, Sep 9, 2013 at 10:08 PM, Scott Johnson wrote: > I'd recommend we not do this, as it will likely break hg blame. I think the idea that white space-only changes "break hg blame" needs to die :) White space-only changes are a change like any other, and at worst add one step to what is usuall

Re: JavaScript Style Guide. Emacs mode line.

2013-09-13 Thread ISHIKAWA,chiaki
(2013/09/14 13:37), Reuben Morais wrote: On Sep 11, 2013, at 12:04 PM, Scott Johnson wrote: I understand the merit of leaving the code as is since hg blame won't work nicely with such file-wide format change as in step-1. (Or maybe we can teach hg blame to ignore such change, etc. but maybe too

Re: JavaScript Style Guide. Emacs mode line.

2013-09-13 Thread Reuben Morais
On Sep 11, 2013, at 12:04 PM, Scott Johnson wrote: >>> I understand the merit of leaving the code as is since hg blame won't work >>> nicely with such file-wide format change as in step-1. >>> (Or maybe we can teach hg blame to ignore such change, etc. but maybe too >>> much work: the idea would b

Re: JavaScript Style Guide. Emacs mode line.

2013-09-11 Thread Scott Johnson
Thus Spoke ishikawa: > On (2013年09月10日 00:08), Scott Johnson wrote: >> Thus Spoke ishikawa: >> >> So you are suggesting something like >> step 1 - request for formatting a file indented in an arcane format, i.e., >> reformat it according to the currently adopted code. Exactly what I meant, if by "

Re: JavaScript Style Guide. Emacs mode line.

2013-09-10 Thread Justin Dolske
On 9/10/13 3:09 AM, ishikawa wrote: > OTOH, code in a strange indentation is hard to touch: during linux > development around 2.1.1xx, Alan Cox got tired of the spaghetti code of SCSI > driver subsystem and introduced a revision: that revision consisted only of > sweeping reformatting of scsi su

Re: JavaScript Style Guide. Emacs mode line.

2013-09-10 Thread Ehsan Akhgari
On 2013-09-10 12:09 PM, ishikawa wrote: > On (2013年09月10日 00:08), Scott Johnson wrote: >> >> Thus Spoke ishikawa: >>> >>> I wonder if trying to re-indent legacy code according to the current style >>> is a good idea or not. (It is a little irritating to modify a part of legacy >>> code and find my

Re: JavaScript Style Guide. Emacs mode line.

2013-09-10 Thread ishikawa
On (2013年09月10日 01:42), Chris Peterson wrote: > On 9/9/13 6:58 AM, Dao wrote: >> Probably historic reasons (e.g. somebody started adding lots of Java >> files with 4-space indents and changing those wasn't considered >> worthwhile) or consistency with >>

Re: JavaScript Style Guide. Emacs mode line.

2013-09-10 Thread ishikawa
On (2013年09月10日 00:08), Scott Johnson wrote: > > Thus Spoke ishikawa: >> >> I wonder if trying to re-indent legacy code according to the current style >> is a good idea or not. (It is a little irritating to modify a part of legacy >> code and find my editor trying to follow the current style while

Re: JavaScript Style Guide. Emacs mode line.

2013-09-09 Thread Chris Peterson
On 9/9/13 6:58 AM, Dao wrote: Probably historic reasons (e.g. somebody started adding lots of Java files with 4-space indents and changing those wasn't considered worthwhile) or consistency with ? Google's

Re: JavaScript Style Guide. Emacs mode line.

2013-09-09 Thread Scott Johnson
Thus Spoke ishikawa: > > I wonder if trying to re-indent legacy code according to the current style > is a good idea or not. (It is a little irritating to modify a part of legacy > code and find my editor trying to follow the current style while the rest of > the file is in different style.) I'd r

Re: JavaScript Style Guide. Emacs mode line.

2013-09-09 Thread Dao
On 09.09.2013 14:48, ISHIKAWA,chiaki wrote: But to be honest, I wonder why 2 for JS and 4 for Java. As far as the indentation requirement is concerned, there does not seem to be much difference between the two languages. But there must be a reason. But for a casual programmer, it is not clear.

Re: JavaScript Style Guide. Emacs mode line.

2013-09-09 Thread ISHIKAWA,chiaki
(2013/09/09 21:18), Dao wrote: On 09.09.2013 05:15, ishikawa wrote: I have been recently editing javascript files to reduce warnings but found an issue of adopted styls in comm-central thunderbird codes. I checked for the preferred style: [1] I found one reference here: http://autonome.wordpre

Re: JavaScript Style Guide. Emacs mode line.

2013-09-09 Thread Dao
On 09.09.2013 05:15, ishikawa wrote: > I have been recently editing javascript files to > reduce warnings but found an issue of adopted styls in comm-central > thunderbird codes. > > I checked for the preferred style: > > [1] I found one reference here: > http://autonome.wordpress.com/2006/03/24/

Re: JavaScript Style Guide. Emacs mode line.

2013-09-08 Thread ishikawa
On (2013年09月09日 12:45), Karl Tomlinson wrote: > ishikawa writes: > >> - Has anyone have mode-line (or .emacs) setting to make the indentation in >> Emacs to follow the prefered style? > > I've got by so-far with M-x set-variable js-indent-level 2 when > necessary, but this doesn't automaticall

Re: JavaScript Style Guide. Emacs mode line.

2013-09-08 Thread ishikawa
On (2013年09月09日 12:44), Gavin Sharp wrote: > On Mon, Sep 9, 2013 at 10:15 AM, ishikawa wrote: >> So my question boils down to >> - what is the preferred style for JavaScript now for mozilla source code? > > There isn't one that applies across all of Mozilla, and I think that's > not a problem.

Re: JavaScript Style Guide. Emacs mode line.

2013-09-08 Thread Karl Tomlinson
ishikawa writes: > - Has anyone have mode-line (or .emacs) setting to make the indentation in > Emacs to follow the prefered style? I've got by so-far with M-x set-variable js-indent-level 2 when necessary, but this doesn't automatically become buffer-local, so I find myself manually changing b

Re: JavaScript Style Guide. Emacs mode line.

2013-09-08 Thread Gavin Sharp
On Mon, Sep 9, 2013 at 10:15 AM, ishikawa wrote: > So my question boils down to > - what is the preferred style for JavaScript now for mozilla source code? There isn't one that applies across all of Mozilla, and I think that's not a problem. (https://developer.mozilla.org/en-US/docs/User:GavinS

JavaScript Style Guide. Emacs mode line.

2013-09-08 Thread ishikawa
I have been recently editing javascript files to reduce warnings but found an issue of adopted styls in comm-central thunderbird codes. I checked for the preferred style: [1] I found one reference here: http://autonome.wordpress.com/2006/03/24/javascript-style-guide-for-mozilla-projects/ [2] I f