Re: [commit: ghc] master: rts: add Emacs 'Local Variables' to every .c file (39b5c1c)

On 28/07/14 15:37, git@git.haskell.org wrote:
Repository : ssh://git@git.haskell.org/ghc
On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/39b5c1cbd8950755de400933cecca7b8de...
---------------------------------------------------------------
commit 39b5c1cbd8950755de400933cecca7b8deb4ffcd Author: Austin Seipp
Date: Mon Jul 21 23:08:31 2014 -0500 rts: add Emacs 'Local Variables' to every .c file
This will hopefully help ensure some basic consistency in the forward by overriding buffer variables. In particular, it sets the wrap length, the offset to 4, and turns off tabs.
I'm not a huge fan of this. Is there a way to do this without adding the spam to the end of every source file? Also it only works for emacs, what if the vim folks want to add their own spam? Cheers, Simon
Signed-off-by: Austin Seipp
---------------------------------------------------------------
39b5c1cbd8950755de400933cecca7b8deb4ffcd rts/Adjustor.c | 8 ++++++++ rts/Apply.h | 8 ++++++++ rts/Arena.c | 8 ++++++++ rts/Arena.h | 8 ++++++++ rts/AutoApply.h | 8 ++++++++ rts/AwaitEvent.h | 8 ++++++++ rts/BeginPrivate.h | 8 ++++++++ rts/Capability.c | 8 ++++++++ rts/Capability.h | 8 ++++++++ rts/CheckUnload.c | 8 ++++++++ rts/CheckUnload.h | 8 ++++++++ rts/ClosureFlags.c | 8 ++++++++ rts/Disassembler.c | 8 ++++++++ rts/Disassembler.h | 8 ++++++++ rts/EndPrivate.h | 8 ++++++++ rts/FileLock.c | 8 ++++++++ rts/FileLock.h | 8 ++++++++ rts/GetEnv.h | 8 ++++++++ rts/GetTime.h | 8 ++++++++ rts/Globals.c | 8 ++++++++ rts/Globals.h | 8 ++++++++ rts/Hash.c | 8 ++++++++ rts/Hash.h | 8 ++++++++ rts/Hpc.c | 8 ++++++++ rts/HsFFI.c | 8 ++++++++ rts/Inlines.c | 8 ++++++++ rts/Interpreter.c | 8 ++++++++ rts/Interpreter.h | 8 ++++++++ rts/LdvProfile.c | 8 ++++++++ rts/LdvProfile.h | 8 ++++++++ rts/Linker.c | 8 ++++++++ rts/LinkerInternals.h | 8 ++++++++ rts/Messages.c | 8 ++++++++ rts/Messages.h | 8 ++++++++ rts/OldARMAtomic.c | 8 ++++++++ rts/Papi.c | 8 ++++++++ rts/Papi.h | 8 ++++++++ rts/PosixSource.h | 8 ++++++++ rts/Prelude.h | 8 ++++++++ rts/Printer.c | 8 ++++++++ rts/Printer.h | 8 ++++++++ rts/ProfHeap.c | 8 ++++++++ rts/ProfHeap.h | 8 ++++++++ rts/Profiling.c | 8 ++++++++ rts/Profiling.h | 8 ++++++++ rts/Proftimer.c | 8 ++++++++ rts/Proftimer.h | 8 ++++++++ rts/RaiseAsync.c | 8 ++++++++ rts/RaiseAsync.h | 8 ++++++++ rts/RetainerProfile.c | 8 ++++++++ rts/RetainerProfile.h | 8 ++++++++ rts/RetainerSet.c | 8 ++++++++ rts/RetainerSet.h | 8 ++++++++ rts/RtsAPI.c | 8 ++++++++ rts/RtsDllMain.c | 8 ++++++++ rts/RtsDllMain.h | 8 ++++++++ rts/RtsFlags.c | 8 ++++++++ rts/RtsFlags.h | 8 ++++++++ rts/RtsMain.c | 8 ++++++++ rts/RtsMessages.c | 8 ++++++++ rts/RtsSignals.h | 8 ++++++++ rts/RtsStartup.c | 8 ++++++++ rts/RtsUtils.c | 8 ++++++++ rts/RtsUtils.h | 8 ++++++++ rts/STM.c | 8 ++++++++ rts/STM.h | 8 ++++++++ rts/Schedule.c | 8 ++++++++ rts/Schedule.h | 8 ++++++++ rts/Sparks.c | 8 ++++++++ rts/Sparks.h | 8 ++++++++ rts/Stable.c | 8 ++++++++ rts/Stable.h | 8 ++++++++ rts/Stats.c | 8 ++++++++ rts/Stats.h | 8 ++++++++ rts/StgCRun.c | 8 ++++++++ rts/StgPrimFloat.c | 8 ++++++++ rts/StgPrimFloat.h | 8 ++++++++ rts/StgRun.h | 8 ++++++++ rts/Task.c | 8 ++++++++ rts/Task.h | 8 ++++++++ rts/ThreadLabels.c | 8 ++++++++ rts/ThreadLabels.h | 8 ++++++++ rts/ThreadPaused.c | 8 ++++++++ rts/ThreadPaused.h | 8 ++++++++ rts/Threads.c | 8 ++++++++ rts/Threads.h | 8 ++++++++ rts/Ticker.h | 8 ++++++++ rts/Ticky.c | 8 ++++++++ rts/Ticky.h | 8 ++++++++ rts/Timer.c | 8 ++++++++ rts/Timer.h | 8 ++++++++ rts/Trace.c | 8 ++++++++ rts/Trace.h | 8 ++++++++ rts/Updates.h | 8 ++++++++ rts/WSDeque.c | 8 ++++++++ rts/WSDeque.h | 8 ++++++++ rts/Weak.c | 8 ++++++++ rts/Weak.h | 8 ++++++++ rts/eventlog/EventLog.c | 8 ++++++++ rts/eventlog/EventLog.h | 8 ++++++++ rts/hooks/FlagDefaults.c | 8 ++++++++ rts/hooks/MallocFail.c | 8 ++++++++ rts/hooks/OnExit.c | 8 ++++++++ rts/hooks/OutOfHeap.c | 8 ++++++++ rts/hooks/StackOverflow.c | 8 ++++++++ rts/posix/Clock.h | 8 ++++++++ rts/posix/GetEnv.c | 8 ++++++++ rts/posix/GetTime.c | 8 ++++++++ rts/posix/Itimer.c | 8 ++++++++ rts/posix/Itimer.h | 8 ++++++++ rts/posix/OSMem.c | 8 ++++++++ rts/posix/OSThreads.c | 8 ++++++++ rts/posix/Select.c | 8 ++++++++ rts/posix/Select.h | 8 ++++++++ rts/posix/Signals.c | 8 ++++++++ rts/posix/Signals.h | 8 ++++++++ rts/posix/TTY.c | 8 ++++++++ rts/posix/TTY.h | 8 ++++++++ rts/sm/BlockAlloc.c | 8 ++++++++ rts/sm/BlockAlloc.h | 8 ++++++++ rts/sm/Compact.c | 8 ++++++++ rts/sm/Compact.h | 8 ++++++++ rts/sm/Evac.c | 8 ++++++++ rts/sm/Evac.h | 8 ++++++++ rts/sm/GC.c | 8 ++++++++ rts/sm/GC.h | 8 ++++++++ rts/sm/GCAux.c | 8 ++++++++ rts/sm/GCTDecl.h | 8 ++++++++ rts/sm/GCThread.h | 8 ++++++++ rts/sm/GCUtils.c | 8 ++++++++ rts/sm/GCUtils.h | 8 ++++++++ rts/sm/MBlock.c | 8 ++++++++ rts/sm/MarkStack.h | 8 ++++++++ rts/sm/MarkWeak.c | 8 ++++++++ rts/sm/MarkWeak.h | 8 ++++++++ rts/sm/OSMem.h | 8 ++++++++ rts/sm/Sanity.c | 8 ++++++++ rts/sm/Sanity.h | 8 ++++++++ rts/sm/Scav.c | 8 ++++++++ rts/sm/Scav.h | 8 ++++++++ rts/sm/Storage.c | 8 ++++++++ rts/sm/Storage.h | 8 ++++++++ rts/sm/Sweep.c | 8 ++++++++ rts/sm/Sweep.h | 8 ++++++++ rts/win32/AsyncIO.c | 8 ++++++++ rts/win32/AsyncIO.h | 8 ++++++++ rts/win32/AwaitEvent.c | 8 ++++++++ rts/win32/ConsoleHandler.c | 8 ++++++++ rts/win32/ConsoleHandler.h | 8 ++++++++ rts/win32/GetEnv.c | 8 ++++++++ rts/win32/GetTime.c | 8 ++++++++ rts/win32/IOManager.c | 8 ++++++++ rts/win32/IOManager.h | 8 ++++++++ rts/win32/OSMem.c | 8 ++++++++ rts/win32/OSThreads.c | 8 ++++++++ rts/win32/ThrIOManager.c | 8 ++++++++ rts/win32/Ticker.c | 8 ++++++++ rts/win32/WorkQueue.c | 8 ++++++++ rts/win32/WorkQueue.h | 8 ++++++++ rts/win32/seh_excn.c | 8 ++++++++ rts/win32/seh_excn.h | 8 ++++++++ 161 files changed, 1288 insertions(+)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 39b5c1cbd8950755de400933cecca7b8deb4ffcd _______________________________________________ ghc-commits mailing list ghc-commits@haskell.org http://www.haskell.org/mailman/listinfo/ghc-commits

Hello Simon, On 2014-07-31 at 10:53:20 +0200, Simon Marlow wrote: [...]
rts: add Emacs 'Local Variables' to every .c file
This will hopefully help ensure some basic consistency in the forward by overriding buffer variables. In particular, it sets the wrap length, the offset to 4, and turns off tabs.
I'm not a huge fan of this. Is there a way to do this without adding the spam to the end of every source file? Also it only works for emacs, what if the vim folks want to add their own spam?
I recently stumbled over http://cgit.freedesktop.org/mesa/mesa/commit/?id=8d0a1a6bc05af7edd25b15ce915... which lead me to read up on its effect which is explained in more detail in https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variable... | The usual way to define directory-local variables is to put a file | named .dir-locals.el1 in a directory. Whenever Emacs visits any file | in that directory or any of its subdirectories, it will apply the | directory-local variables specified in .dir-locals.el, as though they | had been defined as file-local variables for that file (see File | Variables). So maybe that's a better option? Cheers, hvr

On 31/07/14 10:37, Herbert Valerio Riedel wrote:
Hello Simon,
On 2014-07-31 at 10:53:20 +0200, Simon Marlow wrote:
[...]
rts: add Emacs 'Local Variables' to every .c file
This will hopefully help ensure some basic consistency in the forward by overriding buffer variables. In particular, it sets the wrap length, the offset to 4, and turns off tabs.
I'm not a huge fan of this. Is there a way to do this without adding the spam to the end of every source file? Also it only works for emacs, what if the vim folks want to add their own spam?
I recently stumbled over
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8d0a1a6bc05af7edd25b15ce915...
which lead me to read up on its effect which is explained in more detail in
https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variable...
| The usual way to define directory-local variables is to put a file | named .dir-locals.el1 in a directory. Whenever Emacs visits any file | in that directory or any of its subdirectories, it will apply the | directory-local variables specified in .dir-locals.el, as though they | had been defined as file-local variables for that file (see File | Variables).
So maybe that's a better option?
Great. Austin, want to change over to using .dir-locals.el? Cheers, Simon

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 31/07/14 11:37, Herbert Valerio Riedel wrote:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variable... And
for those of us who use the improved editor of the beast: http://andrew.stwrt.ca/posts/project-specific-vimrc - -- Alexander alexander@plaimi.net https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlPaIpMACgkQRtClrXBQc7UkSAEAmXTKImKH0KeOghqK3/UFHRD9 3AfCQRtwrsrwE9XkQWYA/0l/WEX+ebeWLCVh9IQ773guO0vEo11AdkVZUbPZdvUC =1on2 -----END PGP SIGNATURE-----

On Thu, Jul 31, 2014 at 01:03:47PM +0200, Alexander Berntsen wrote:
for those of us who use the improved editor of the beast: http://andrew.stwrt.ca/posts/project-specific-vimrc
This only seems to work if you're starting a new vim instance inside of the directory, the vimrc in the directory isn't considered if you just open a file inside of the directory with an already running vim instance. But this plugin seems to do the desired thing: http://www.vim.org/scripts/script.php?script_id=3393 Greetings, Daniel
participants (4)
-
Alexander Berntsen
-
Daniel Trstenjak
-
Herbert Valerio Riedel
-
Simon Marlow