[Libreoffice] [SCRIPT, EASYHACK] "add-modelines", a script to add modelines to source files

someone at boldandbusted.com someone at boldandbusted.com
Sat Oct 9 13:15:51 PDT 2010


On Sat, 09 Oct 2010 20:44 +0100, "Caolán McNamara" <caolanm at redhat.com>
wrote:
> On Sat, 2010-10-09 at 12:34 -0700, someone at boldandbusted.com wrote:
> > I think this feature calls for a script getopts-style option where one
> >  can select to either not clobber exsiting modelines (the default) or
> >  remove and replace existing modelines.
> 
> A quick opengrok (http://opengrok.go-oo.org/) on "vi:set", "ex:set" and
> "vim:set" suggest that I'm nearly the only one who ever added them
> before now to .cxx files and all of those could be clobbered. There's
> one in regexp which isn't mine, but it could be clobbered too. There are
> some perl scripts which have modelines which are nothing to do with me
> but they're not affected by this script anyway.
> 
> As a minor aside, SourceFiles='*.cxx *.cpp' can be extended to .hxx, .h
> and .hpp to I guess. Hmm, maybe also .idl.
> 
> C.
> 
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice
> 

OK, but FYI I'm not the person who will be running this script against a
committable tree, so whoever does can change $SourceFiles. I can also
still add an option to explicitly allow an overwrite, which will be
needed once this is run for the first time. It may be a bit tough to
*really* catch all custom modelines (especially since they will be in
the "black box" known as the LO codebase, from my perspective), but I'll
try. That said, once they are added in an automated fashion, they
*should* be easier to later edit properly.

You can pretty easily start adding garbage to a lot of files with this
script, so I need to craft it a bit. :) Thanks again for helping me to
tune this script.

Cheers,

Jesse Adelman
Bold and Busted LLC
San Francisco, CA
http://www.boldandbusted.com/


More information about the LibreOffice mailing list