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 Till Schneidereit
On Wed, Jan 8, 2014 at 9:25 AM, ishikawa ishik...@yk.rim.or.jp 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

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

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 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

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 the job.

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 ;

Re: JavaScript Style Guide. Emacs mode line.

2014-01-07 Thread Nicholas Nethercote
On Tue, Jan 7, 2014 at 5:38 PM, Mike Hommey m...@glandium.org 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

Re: JavaScript Style Guide. Emacs mode line.

2014-01-07 Thread Martin Thomson
On 2014-01-07, at 17:38, Mike Hommey m...@glandium.org 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

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 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 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,

Re: JavaScript Style Guide. Emacs mode line.

2013-09-15 Thread Gavin Sharp
On Mon, Sep 9, 2013 at 10:08 PM, Scott Johnson sjohn...@mozilla.com 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

Re: JavaScript Style Guide. Emacs mode line.

2013-09-14 Thread ISHIKAWA,chiaki
(2013/09/14 13:37), Reuben Morais wrote: On Sep 11, 2013, at 12:04 PM, Scott Johnson sjohn...@mozilla.com 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

Re: JavaScript Style Guide. Emacs mode line.

2013-09-13 Thread Reuben Morais
On Sep 11, 2013, at 12:04 PM, Scott Johnson sjohn...@mozilla.com 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

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 request for

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 the rest

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 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 editor trying to

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

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:

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:

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 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

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 http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-136091.html? Google's

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

Re: JavaScript Style Guide. Emacs mode line.

2013-09-08 Thread Gavin Sharp
On Mon, Sep 9, 2013 at 10:15 AM, ishikawa ishik...@yk.rim.or.jp 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 ishik...@yk.rim.or.jp 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

Re: JavaScript Style Guide. Emacs mode line.

2013-09-08 Thread ishikawa
On (2013年09月09日 12:45), Karl Tomlinson wrote: ishikawa ishik...@yk.rim.or.jp 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

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 ishik...@yk.rim.or.jp 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