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-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. >>> >>> I have not tested vim part. >>> We can probably omit js-curly-inent-offset here, but >>> for now, I am keeping it as a reminder. >>> It seems that js mode in Emacs worked with c-basic-offset a couple of years >>> ago, but today's js-mode (Javascript mode is an alias) >>> needs its own variables, I think. >>> >>> >> >> I have been tinkering with javascript mode line for Emacs. >> >> /* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; >> c-basic-offset: 2 ; js-indent-level : 2 -*- */ > > 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 anyways (at least, it doesn't on > Debian). And emacs can take local variables in a .dir-locals.el file. > Why not put one at the root directory in mozilla-central? (and others if > necessary in subdirectories for overrides) > > Mike >
Hi, a good point. However, I do not have much preference over the placement of the config information of editor help. If we go the way of .dir-locals.el file, that is fine with me. 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.) All I want to know is what should be put in there in order to make Emacs behave the way many mozilla programmers wish it to do. [I am afraid that some differences between the Mozilla coding style and GNU coding style may have left a few difficult situations that is not obvious how to handle it in Emacs's js-mode customization: the placement of operators in a multi-line logical expressions comes to my mind, first. GNU prefers the placement of operator at the FRONT of each line while mozilla wants it at the END of the line. On other place is the placement of parenthesis. It is subtly different if I am not mistaken. The last thing I can recall is GNU does not have much preference on the placement of period in an expression involving a.b.c.d.e where a, b, c, d and e can be very lengthy IDs and thus needs to be wrapped somewhere, and naturally one wonders where the period should go. Mozilla has a preference here if I am not mistaken. GNU does not. So we may need to add a few lines of Emacs-Lisp programming to handle this placement of "." within an expression. The use of C preprocessor for some JavaScript files, as is done within mozilla source tree, is a definite No-No for Emacs JavaScript mode, but I digress.] Oh well, anyway, I wonder if someone has an Emacs setting (not necessarily a mode line, a series of defuns, etc. that need to be put into .dir-local.el file, or .emacs, etc. is just fine) that can do the job of mozilla style indentation and such 99 % of the time. Using emacs, for many patches of linux kernel drivers (mostly BSD-like coding style), GNU Project source files, I can set the style preference once for all, and that is it. I don't have to worry about the style much after the initial setup. Unfortunately, with mozilla source tree, I often found myself checking each line of modified region one by one for easy to spot style violation after I create a patch for TB. And I don't catch all of them :-( Computers are here for automation. So helpful tips will be appreciated. (Emacs users among mozilla hackers ought to throw in their particular setting so that newcomers who use Emacs can be productive from day one.) 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? TIA _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform