[Xastir-dev] Editor header in source files

Tom Russo russo at bogodyn.org
Tue Apr 30 10:06:56 PDT 2019


On Tue, Apr 30, 2019 at 09:06:29AM -0700, we recorded a bogon-computron collision of the <curt.we7u at gmail.com> flavor, containing:
> 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.

Emacs.  Tells it that when it is in C editing mode, to indent by four chars
and not use tabs, no matter what other settings the user might have in his
or her defaults.

Since I NEVER code to that standard (ick) except when working on Xastir, my
editor is set up to indent by two chars, not four.  If I don't have this line
in the file, my defaults wind up corrupting the file while I'm editing it.  And
God forbid I try to reformat the whole file (like I had to do on interface.c
and some others that had egregious indentation violations) without that line
in place.

> 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.

I have no idea what header Vim uses to override default settings.  You're
on your own there.

I only add this line to files when I actually edit one, I don't add them
willy-nilly.  No harm would come from putting it in all of them.

-- 
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