Last Comment Bug 669936 - emacs mode lines for websockets 2 space indents
: emacs mode lines for websockets 2 space indents
Status: RESOLVED FIXED
[inbound]
:
Product: Core
Classification: Components
Component: Networking: WebSockets (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: mozilla8
Assigned To: Patrick McManus [:mcmanus]
:
Mentors:
Depends on: 664860
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-07 10:19 PDT by Patrick McManus [:mcmanus]
Modified: 2011-07-08 05:55 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch 1 (3.15 KB, patch)
2011-07-07 10:21 PDT, Patrick McManus [:mcmanus]
jduell.mcbugs: review+
Details | Diff | Splinter Review

Description Patrick McManus [:mcmanus] 2011-07-07 10:19:05 PDT
bug 664860 changed netwerk/websockets to 2 space indents but did not update the emacs mode lines.
Comment 1 Patrick McManus [:mcmanus] 2011-07-07 10:21:03 PDT
Created attachment 544533 [details] [diff] [review]
patch 1
Comment 2 Jason Duell [:jduell] (needinfo me) 2011-07-07 10:52:43 PDT
Comment on attachment 544533 [details] [diff] [review]
patch 1

>diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp
>-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
>+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
> /* vim: set sw=2 ts=8 et tw=80 : */

The "canonical" example in the Mozilla Style guide (and what I've used elsewhere in necko) is

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */

I.e. tab-width is 8.  Doesn't make any difference when indent-tabs-mode is nil, correct?  Except when there are tabs already in file?  I don't know--might as well follow the style guide.


>diff --git a/netwerk/protocol/websocket/nsIWebSocketChannel.idl 
>diff --git a/netwerk/protocol/websocket/nsIWebSocketListener.idl 
>-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
>+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */

I deliberately kept the indenting of the IDL files at 4 spaces.  Maybe that was stupid/arbitrary (logic: IDLs are old-school with the ns-prefix, etc.), but let's not change it now (unless you really want to, but I think I know the answer to that :)   You can change tab-width to 8 for extra-credit.
Comment 3 Marco Bonardo [::mak] (Away 6-20 Aug) 2011-07-08 05:55:01 PDT
http://hg.mozilla.org/mozilla-central/rev/8edd1224feed

Note You need to log in before you can comment on or make changes to this bug.