Re: [Xastir-dev] Editor header in source files
See my previous link to per-directory-tree configuration files, which seem tailored to this exact use case. Hal > On Apr 30, 2019, at 11:00 AM, Tom Russo wrote: > > would still advocate leaving the variable settings in the file, to > override personal defaults and enforce project defaults. ___ Xastir-dev mailing list Xastir-dev@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev
Re: [Xastir-dev] Editor header in source files
On Tue, Apr 30, 2019 at 10:10 AM Tom Russo wrote: > Four character indents are the Xastir coding standard. > > http://xastir.org/index.php/HowTo:Developer_Guidelines_and_Notes > > I personally hate it, but that's what this project has always required. > Right. I don't like it either. We're probably at a point now where we could vote that out. Should probably do that vote on the developer's list. FWIW: Other than the Xastir project I like to do 2-char indentation (spaces, not tabs) and bracing like this: if (true) { blah blah; } While Xastir uses: if (true) { blah blah; } I'm less concerned about changing the bracing standard than I am the indentation, but perhaps we could vote on both. -- Curt, WE7Uhttp://we7u.wetnet.nethttp://www.sarguydigital.com ___ Xastir-dev mailing list Xastir-dev@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev
Re: [Xastir-dev] Editor header in source files
There's also project-specific VIM files: https://andrew.stwrt.ca/posts/project-specific-vimrc/ Which would require tweaks to the users ~/.vimrc file to enable. On Tue, Apr 30, 2019 at 11:14 AM Curt Mills wrote: > 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. > 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 wrote: > >> On Tue, Apr 30, 2019 at 10:23:20AM -0700, we recorded a bogon-computron >> collision of the 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 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 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 >> > > 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, WE7Uhttp://we7u.wetnet.net >> > > >> http://www.sarguydigital.com >> > > >> ___ >> > > >> Xastir-dev mailing list >> > > >> Xastir-dev@lists.xastir.org >> > > >> http://xastir.org/mailman/listinfo/xastir-dev >> > > > >> > > > >> > > > -- >> > > > -Jason >> > > > kg4wsv >> > > > ___ >> > > > Xastir-dev mailing list >> > > > Xastir-dev@lists.xastir.org >> > > > http://xastir.org/mailman/listinfo/xastir-dev >> > > ___ >> > > Xastir-dev mailing list >> > > Xastir-dev@lists.xastir.org >> > > http://xastir.org/mailman/listinfo/xastir-dev >> > > >> > >> > >> > -- >> > Curt, WE7Uhttp://we7u.wetnet.net >> http://www.sarguydigital.com >> > ___ >> > Xastir-dev mailing list >> > Xastir-dev@lists.xastir.org >> > http://xastir.org/mailman/listinfo/xastir-dev >> >> -- >> Tom RussoKM5VY >> 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@lists.xastir.org >> http://xastir.org/mailman/listinfo/xastir-dev >> > > > -- > Curt, WE7Uhttp://we7u.wetnet.net > http://www.sarguydigital.com > -- Curt, WE7Uhttp://we7u.wetnet.nethttp://www.sarguydigital.com ___ Xastir-dev mailing list Xastir-dev@lists.xastir.org
Re: [Xastir-dev] Editor header in source files
On Tue, Apr 30, 2019 at 11:14:54AM -0700, we recorded a bogon-computron collision of the 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. > 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 wrote: > > > On Tue, Apr 30, 2019 at 10:23:20AM -0700, we recorded a bogon-computron > > collision of the 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 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 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 > > > > 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, WE7Uhttp://we7u.wetnet.net > > > > >> http://www.sarguydigital.com > > > > >> ___ > > > > >> Xastir-dev mailing list > > > > >> Xastir-dev@lists.xastir.org > > > > >> http://xastir.org/mailman/listinfo/xastir-dev > > > > > > > > > > > > > > > -- > > > > > -Jason > > > > > kg4wsv > > > > > ___ > > > > > Xastir-dev mailing list > > > > > Xastir-dev@lists.xastir.org > > > > > http://xastir.org/mailman/listinfo/xastir-dev > > > > ___ > > > > Xastir-dev mailing list > > > > Xastir-dev@lists.xastir.org > > > > http://xastir.org/mailman/listinfo/xastir-dev > > > > > > > > > > > > > -- > > > Curt, WE7Uhttp://we7u.wetnet.net > > http://www.sarguydigital.com > > > ___ > > > Xastir-dev mailing list > > > Xastir-dev@lists.xastir.org > > > http://xastir.org/mailman/listinfo/xastir-dev > > > > -- > > Tom RussoKM5VY > > 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@lists.xastir.org > >
Re: [Xastir-dev] Editor header in source files
On Tue, Apr 30, 2019 at 12:41:50PM -0600, we recorded a bogon-computron collision of the flavor, containing: > On Tue, Apr 30, 2019 at 11:14:54AM -0700, we recorded a bogon-computron > collision of the 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 wrote: > > > > > On Tue, Apr 30, 2019 at 10:23:20AM -0700, we recorded a bogon-computron > > > collision of the 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 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 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 > > > > > 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, WE7Uhttp://we7u.wetnet.net > > > > > >> http://www.sarguydigital.com > > > > > >> ___ > > > > > >> Xastir-dev mailing list > > > > > >> Xastir-dev@lists.xastir.org > > > > > >> http://xastir.org/mailman/listinfo/xastir-dev > > > > > > > > > > > > > > > > > > -- > > > > > > -Jason > > > > > > kg4wsv > > > > > > ___ > > > > > > Xastir-dev mailing list > > > > > > Xastir-dev@lists.xastir.org > > > > > > http://xastir.org/mailman/listinfo/xastir-dev > > > > > ___ > > > > > Xastir-dev mailing list > > > > >
Re: [Xastir-dev] Editor header in source files
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 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 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, WE7Uhttp://we7u.wetnet.net >> http://www.sarguydigital.com >> ___ >> Xastir-dev mailing list >> Xastir-dev@lists.xastir.org >> http://xastir.org/mailman/listinfo/xastir-dev > > > -- > -Jason > kg4wsv > ___ > Xastir-dev mailing list > Xastir-dev@lists.xastir.org > http://xastir.org/mailman/listinfo/xastir-dev ___ Xastir-dev mailing list Xastir-dev@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev
Re: [Xastir-dev] Editor header in source files
Seconded. I think that the people who established the current standard for Xastir are long gone, and maintaining consistency with that style for the sake of consistency has gone on long enough. I personally hate *both* the four-space indentation *and* the "egyptian brace"/K style, and prefer the 2-space indentation and the brace style you say you prefer (with the left brace lining up with the line before it, and the right brace lining up with the left). On Tue, Apr 30, 2019 at 10:40:20AM -0700, we recorded a bogon-computron collision of the flavor, containing: > On Tue, Apr 30, 2019 at 10:10 AM Tom Russo wrote: > > > Four character indents are the Xastir coding standard. > > > > http://xastir.org/index.php/HowTo:Developer_Guidelines_and_Notes > > > > I personally hate it, but that's what this project has always required. > > > > Right. I don't like it either. We're probably at a point now where we could > vote that out. Should probably do that vote on the developer's list. > > FWIW: Other than the Xastir project I like to do 2-char indentation > (spaces, not tabs) and bracing like this: > > if (true) > { > blah blah; > } > > While Xastir uses: > > if (true) { > blah blah; > } > > I'm less concerned about changing the bracing standard than I am the > indentation, but perhaps we could vote on both. > > -- > Curt, WE7Uhttp://we7u.wetnet.nethttp://www.sarguydigital.com -- Tom RussoKM5VY 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@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev
Re: [Xastir-dev] Editor header in source files
On Tue, Apr 30, 2019 at 10:23:20AM -0700, we recorded a bogon-computron collision of the 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 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 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 > > 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, WE7Uhttp://we7u.wetnet.net > > >> http://www.sarguydigital.com > > >> ___ > > >> Xastir-dev mailing list > > >> Xastir-dev@lists.xastir.org > > >> http://xastir.org/mailman/listinfo/xastir-dev > > > > > > > > > -- > > > -Jason > > > kg4wsv > > > ___ > > > Xastir-dev mailing list > > > Xastir-dev@lists.xastir.org > > > http://xastir.org/mailman/listinfo/xastir-dev > > ___ > > Xastir-dev mailing list > > Xastir-dev@lists.xastir.org > > http://xastir.org/mailman/listinfo/xastir-dev > > > > > -- > Curt, WE7Uhttp://we7u.wetnet.nethttp://www.sarguydigital.com > ___ > Xastir-dev mailing list > Xastir-dev@lists.xastir.org > http://xastir.org/mailman/listinfo/xastir-dev -- Tom RussoKM5VY 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@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev
Re: [Xastir-dev] Editor header in source files
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 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, WE7Uhttp://we7u.wetnet.net > http://www.sarguydigital.com > ___ > Xastir-dev mailing list > Xastir-dev@lists.xastir.org > http://xastir.org/mailman/listinfo/xastir-dev > -- -Jason kg4wsv ___ Xastir-dev mailing list Xastir-dev@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev
Re: [Xastir-dev] Editor header in source files
On Tue, Apr 30, 2019 at 09:06:29AM -0700, we recorded a bogon-computron collision of the 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 RussoKM5VY 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@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev
[Xastir-dev] Editor header in source files
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, WE7Uhttp://we7u.wetnet.nethttp://www.sarguydigital.com ___ Xastir-dev mailing list Xastir-dev@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev
Re: [Xastir-dev] Editor header in source files
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. 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 wrote: > On Tue, Apr 30, 2019 at 10:23:20AM -0700, we recorded a bogon-computron > collision of the 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 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 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 > > > 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, WE7Uhttp://we7u.wetnet.net > > > >> http://www.sarguydigital.com > > > >> ___ > > > >> Xastir-dev mailing list > > > >> Xastir-dev@lists.xastir.org > > > >> http://xastir.org/mailman/listinfo/xastir-dev > > > > > > > > > > > > -- > > > > -Jason > > > > kg4wsv > > > > ___ > > > > Xastir-dev mailing list > > > > Xastir-dev@lists.xastir.org > > > > http://xastir.org/mailman/listinfo/xastir-dev > > > ___ > > > Xastir-dev mailing list > > > Xastir-dev@lists.xastir.org > > > http://xastir.org/mailman/listinfo/xastir-dev > > > > > > > > > -- > > Curt, WE7Uhttp://we7u.wetnet.net > http://www.sarguydigital.com > > ___ > > Xastir-dev mailing list > > Xastir-dev@lists.xastir.org > > http://xastir.org/mailman/listinfo/xastir-dev > > -- > Tom RussoKM5VY > 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@lists.xastir.org > http://xastir.org/mailman/listinfo/xastir-dev > -- Curt, WE7Uhttp://we7u.wetnet.nethttp://www.sarguydigital.com ___ Xastir-dev mailing list Xastir-dev@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev
Re: [Xastir-dev] Editor header in source files
On Tue, Apr 30, 2019 at 11:20:59AM -0500, we recorded a bogon-computron collision of the flavor, containing: > 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. Four character indents are the Xastir coding standard. http://xastir.org/index.php/HowTo:Developer_Guidelines_and_Notes I personally hate it, but that's what this project has always required. > On Tue, Apr 30, 2019 at 11:06 AM Curt Mills 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, WE7Uhttp://we7u.wetnet.net > > http://www.sarguydigital.com > > ___ > > Xastir-dev mailing list > > Xastir-dev@lists.xastir.org > > http://xastir.org/mailman/listinfo/xastir-dev > > > > > -- > -Jason > kg4wsv > ___ > Xastir-dev mailing list > Xastir-dev@lists.xastir.org > http://xastir.org/mailman/listinfo/xastir-dev -- Tom RussoKM5VY 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@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev
Re: [Xastir-dev] Editor header in source files
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. 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. On Tue, Apr 30, 2019 at 9:52 AM Hal Mueller 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 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 > 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, WE7Uhttp://we7u.wetnet.net > >> http://www.sarguydigital.com > >> ___ > >> Xastir-dev mailing list > >> Xastir-dev@lists.xastir.org > >> http://xastir.org/mailman/listinfo/xastir-dev > > > > > > -- > > -Jason > > kg4wsv > > ___ > > Xastir-dev mailing list > > Xastir-dev@lists.xastir.org > > http://xastir.org/mailman/listinfo/xastir-dev > ___ > Xastir-dev mailing list > Xastir-dev@lists.xastir.org > http://xastir.org/mailman/listinfo/xastir-dev > -- Curt, WE7Uhttp://we7u.wetnet.nethttp://www.sarguydigital.com ___ Xastir-dev mailing list Xastir-dev@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev
Re: [Xastir-dev] Editor header in source files
I think per-directory local variables would be a cleaner solution (but I’ve never used them). Looks like one file at top of source tree would do it. https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html#Directory-Variables Embedded spaces (vs tabs) certainly make code review of PRs easier. Hal N3YX > On Apr 30, 2019, at 10:23 AM, Curt Mills wrote: > > 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. > > 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. > > >> On Tue, Apr 30, 2019 at 9:52 AM Hal Mueller 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 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 >> 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, WE7Uhttp://we7u.wetnet.net http://www.sarguydigital.com ___ Xastir-dev mailing list Xastir-dev@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev >>> >>> >>> -- >>> -Jason >>> kg4wsv >>> ___ >>> Xastir-dev mailing list >>> Xastir-dev@lists.xastir.org >>> http://xastir.org/mailman/listinfo/xastir-dev >> ___ >> Xastir-dev mailing list >> Xastir-dev@lists.xastir.org >> http://xastir.org/mailman/listinfo/xastir-dev >> > > > -- > Curt, WE7Uhttp://we7u.wetnet.nethttp://www.sarguydigital.com > ___ > Xastir-dev mailing list > Xastir-dev@lists.xastir.org > http://xastir.org/mailman/listinfo/xastir-dev ___ Xastir-dev mailing list Xastir-dev@lists.xastir.org http://xastir.org/mailman/listinfo/xastir-dev