[Xastir-dev] Editor header in source files

km5vy Tom Russo russo at bogodyn.org
Tue Apr 30 12:05:06 PDT 2019


On Tue, Apr 30, 2019 at 12:41:50PM -0600, we recorded a bogon-computron collision of the <russo at bogodyn.org> flavor, containing:
> On Tue, Apr 30, 2019 at 11:14:54AM -0700, we recorded a bogon-computron collision of the <curt.we7u at gmail.com> flavor, containing:
> > What do you think of this idea instead:  https://editorconfig.org/
> > It requires a plug-in for Emacs and VIM, but we could add that to the
> > coding standards.
> 
> I'm not particularly keen on having it depend on a plugin at all.
> 
> The suggestion of a per-directory emacs file is a better one.  The syntax
> is much ickier than it is for the file-specific setting, but making it
> global for the entire project directory (and ignored by everything but emacs) 
> is a benefit.

There is now a .dir-locals.el file in the top level directory, and the per-file
settings lines are gone.  emacs users will now have project indentation
standards enforced by emacs automatically.

I'll leave it to others to deal with the Vim settings.

> > It would avoid having to have a special config in each of our source files.
> > 
> > On Tue, Apr 30, 2019 at 11:00 AM Tom Russo <russo at bogodyn.org> wrote:
> > 
> > > On Tue, Apr 30, 2019 at 10:23:20AM -0700, we recorded a bogon-computron
> > > collision of the <curt.we7u at gmail.com> flavor, containing:
> > > > Thanks. Looks like the equivalent in Vim is Modelines:
> > > >
> > > > https://vim.fandom.com/wiki/Modeline_magic
> > > >
> > > > But a lot of the major distributions turn off modelines by default.
> > > >
> > > > We should either have the Emacs and VIM Modelines in all the source
> > > files,
> > > > or none of them.
> > >
> > > Then I vote for all of them.  If we take out those Emacs local vars
> > > settings,
> > > I would have to change my Emacs defaults every time I open it to edit
> > > Xastir code.  Either that, or every time I edit Xastir code I would have
> > > to manually fix its incorrect (for project standards) indentation choices.
> > >
> > > I would still advocate leaving the variable settings in the file, to
> > > override personal defaults and enforce project defaults.
> > >
> > > > Our source guidelines specify 4-spaces per tab, no embedded tab
> > > characters.
> > > > As I edit various files I sometimes get a 4-char space tab, sometimes a
> > > > regular 8-char tab, and that is with Vim so I don't know why it is
> > > changing
> > > > from file to file 'cuz I don't see modelines in there for Vim. I might be
> > > > missing them.
> > >
> > > There are no Vim modelines as far as I can tell.  I couldn't guess why
> > > Vim would edit different files with different defaults.  Must be something
> > > about specifics of your vim settings, though.  Can't help you there, I'm
> > > not a vim user.
> > >
> > > > On Tue, Apr 30, 2019 at 9:52 AM Hal Mueller <hal at seanet.com> wrote:
> > > >
> > > > > That???s for Emacs. You can specify major mode and per-file variables.
> > > > >
> > > > >
> > > > >
> > > https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html
> > > > >
> > > > >
> > > > >
> > > https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables
> > > > >
> > > > > Hal
> > > > > N3YX
> > > > >
> > > > > > On Apr 30, 2019, at 9:20 AM, Jason KG4WSV <kg4wsv at gmail.com> wrote:
> > > > > >
> > > > > > I haven't seen this before, but it does make my emacs behave
> > > differently
> > > > > > (the file had 2 space tabs, this made it do 4) and does nothing to
> > > vi.
> > > > > >
> > > > > > RHEL 7
> > > > > >
> > > > > > -j
> > > > > >
> > > > > >
> > > > > >
> > > > > >> On Tue, Apr 30, 2019 at 11:06 AM Curt Mills <curt.we7u at gmail.com>
> > > > > wrote:
> > > > > >>
> > > > > >> I see this header in _some_ of our source files:
> > > > > >>
> > > > > >>    /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*-
> > > > > >>
> > > > > >> Is that for VI -and- Emacs, or just one of them? I use Vim.
> > > > > >>
> > > > > >> I've noticed while editing files in the last couple of weeks that my
> > > > > tab is
> > > > > >> not 4 chars sometimes. I have to manually space to indent properly.
> > > > > >>
> > > > > >> I thought at one point we needed two headers in our files, one for
> > > Emacs
> > > > > >> and one for VI. I didn't scan all the files but I saw a bunch of
> > > files
> > > > > with
> > > > > >> no header and a bunch with the header above.
> > > > > >>
> > > > > >> --
> > > > > >> Curt, WE7U        http://we7u.wetnet.net
> > > > > >> http://www.sarguydigital.com
> > > > > >> _______________________________________________
> > > > > >> Xastir-dev mailing list
> > > > > >> Xastir-dev at lists.xastir.org
> > > > > >> http://xastir.org/mailman/listinfo/xastir-dev
> > > > > >
> > > > > >
> > > > > > --
> > > > > > -Jason
> > > > > > kg4wsv
> > > > > > _______________________________________________
> > > > > > Xastir-dev mailing list
> > > > > > Xastir-dev at lists.xastir.org
> > > > > > http://xastir.org/mailman/listinfo/xastir-dev
> > > > > _______________________________________________
> > > > > Xastir-dev mailing list
> > > > > Xastir-dev at lists.xastir.org
> > > > > http://xastir.org/mailman/listinfo/xastir-dev
> > > > >
> > > >
> > > >
> > > > --
> > > > Curt, WE7U        http://we7u.wetnet.net
> > > http://www.sarguydigital.com
> > > > _______________________________________________
> > > > Xastir-dev mailing list
> > > > Xastir-dev at lists.xastir.org
> > > > http://xastir.org/mailman/listinfo/xastir-dev
> > >
> > > --
> > > Tom Russo    KM5VY
> > > Tijeras, NM
> > >
> > >  echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z]
> > > [n-z][a-m]
> > >
> > > _______________________________________________
> > > Xastir-dev mailing list
> > > Xastir-dev at lists.xastir.org
> > > http://xastir.org/mailman/listinfo/xastir-dev
> > >
> > 
> > 
> > -- 
> > Curt, WE7U        http://we7u.wetnet.net        http://www.sarguydigital.com
> 
> -- 
> Tom Russo    KM5VY
> Tijeras, NM  
> 
>  echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z] [n-z][a-m]
> 
> _______________________________________________
> Xastir-dev mailing list
> Xastir-dev at lists.xastir.org
> http://xastir.org/mailman/listinfo/xastir-dev

-- 
Tom Russo    KM5VY
Tijeras, NM  

 echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z] [n-z][a-m]



More information about the Xastir-dev mailing list