From 1b6e61678c585e4cab602481e1804af244d09e39 Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Sun, 13 Aug 2017 10:16:52 +0200 Subject: [PATCH] regen: add emacs modeline to vim ft=c I'd really like to have C formatting for perly.tab and .act --- charclass_invlists.h | 2 +- ebcdic_tables.h | 2 +- embed.h | 2 +- embedvar.h | 2 +- ext/Config/Config_xs.out | 6 ++++-- feature.h | 2 +- keywords.c | 2 +- keywords.h | 2 +- l1_char_class_tab.h | 2 +- lib/.gitignore | 2 +- lib/B/Op_private.pm | 2 +- lib/feature.pm | 2 +- lib/overload/numbers.pm | 2 +- lib/warnings.pm | 2 +- mg_names.inc | 2 +- mg_raw.h | 2 +- mg_vtable.h | 2 +- miniperlmain.c | 2 +- opcode.h | 2 +- opnames.h | 2 +- overload.h | 2 +- overload.inc | 2 +- packsizetables.inc | 2 +- perlapi.c | 2 +- perlapi.h | 2 +- perly.act | 2 +- perly.h | 2 +- perly.tab | 2 +- pp_proto.h | 2 +- proto.h | 2 +- reentr.c | 2 +- reentr.h | 2 +- regcharclass.h | 2 +- regen/regen_lib.pl | 7 +++---- regnodes.h | 2 +- unicode_constants.h | 2 +- warnings.h | 2 +- 37 files changed, 42 insertions(+), 41 deletions(-) diff --git a/charclass_invlists.h b/charclass_invlists.h index e136de19128..32df98fdfc3 100644 --- a/charclass_invlists.h +++ b/charclass_invlists.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! * This file is built by regen/mk_invlists.pl from Unicode::UCD. * Any changes made here will be lost! diff --git a/ebcdic_tables.h b/ebcdic_tables.h index cd98bcf28d2..e4fcc72dafb 100644 --- a/ebcdic_tables.h +++ b/ebcdic_tables.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! * This file is built by regen/ebcdic.pl. * Any changes made here will be lost! diff --git a/embed.h b/embed.h index ef58de39125..e6c733c88a3 100644 --- a/embed.h +++ b/embed.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * embed.h * diff --git a/embedvar.h b/embedvar.h index ff34f1436cf..bd8d3286781 100644 --- a/embedvar.h +++ b/embedvar.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * embedvar.h * diff --git a/ext/Config/Config_xs.out b/ext/Config/Config_xs.out index 374de7c29e2..1aa270ea524 100644 --- a/ext/Config/Config_xs.out +++ b/ext/Config/Config_xs.out @@ -7187,10 +7187,12 @@ PROTOTYPES: DISABLE BOOT: { STATIC_ASSERT_STMT(sizeof (stringpool_contents) <= 1 << 15); -#if PTRSIZE == 8 +#ifndef _MSC_VER /* MSVC packing? Fails on my MSVC110FREE WIN64 box */ +# if PTRSIZE == 8 STATIC_ASSERT_STMT(sizeof (struct Perl_Config) == 16); -#else +# else STATIC_ASSERT_STMT(sizeof (struct Perl_Config) == 8); +# endif #endif #if BYTEORDER == 0x4321 || BYTEORDER == 0x87654321 /* big-endian */ /* an inline string better be negative on BE */ diff --git a/feature.h b/feature.h index f0f2de815bb..5a1c782f10f 100644 --- a/feature.h +++ b/feature.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- !!!!!!! DO NOT EDIT THIS FILE !!!!!!! This file is built by regen/feature.pl. Any changes made here will be lost! diff --git a/keywords.c b/keywords.c index d0ca75c56f6..648d5142e71 100644 --- a/keywords.c +++ b/keywords.c @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! * This file is built by regen/keywords.pl from its data. * Any changes made here will be lost! diff --git a/keywords.h b/keywords.h index 1b634974f02..9348ab049ae 100644 --- a/keywords.h +++ b/keywords.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * keywords.h * diff --git a/l1_char_class_tab.h b/l1_char_class_tab.h index 53afe586300..e54b5a0c0f4 100644 --- a/l1_char_class_tab.h +++ b/l1_char_class_tab.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! * This file is built by regen/mk_PL_charclass.pl from property * definitions. diff --git a/lib/.gitignore b/lib/.gitignore index 34aa90f4f20..44a02411709 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -1,4 +1,4 @@ -# ex: set ro ft=c: -*- buffer-read-only: t -*- +# ex: set ro ft=perl: -*- mode: perl; buffer-read-only: t -*- # !!!!!!! DO NOT EDIT THIS FILE !!!!!!! # This file is built by regen/lib_cleanup.pl from MANIFEST and parsing files # in cpan/ dist/ and ext/. diff --git a/lib/B/Op_private.pm b/lib/B/Op_private.pm index 3f6b08fd8ef..0d3f60a0f70 100644 --- a/lib/B/Op_private.pm +++ b/lib/B/Op_private.pm @@ -1,4 +1,4 @@ -# ex: set ro ft=c: -*- buffer-read-only: t -*- +# ex: set ro ft=perl: -*- mode: perl; buffer-read-only: t -*- # # lib/B/Op_private.pm # diff --git a/lib/feature.pm b/lib/feature.pm index 7865e92f4be..936f09b9e51 100644 --- a/lib/feature.pm +++ b/lib/feature.pm @@ -1,4 +1,4 @@ -# ex: set ro ft=c: -*- buffer-read-only: t -*- +# ex: set ro ft=perl: -*- mode: perl; buffer-read-only: t -*- # !!!!!!! DO NOT EDIT THIS FILE !!!!!!! # This file is built by regen/feature.pl. # Any changes made here will be lost! diff --git a/lib/overload/numbers.pm b/lib/overload/numbers.pm index aea9785d2df..e4055226131 100644 --- a/lib/overload/numbers.pm +++ b/lib/overload/numbers.pm @@ -1,4 +1,4 @@ -# ex: set ro ft=c: -*- buffer-read-only: t -*- +# ex: set ro ft=perl: -*- mode: perl; buffer-read-only: t -*- # # lib/overload/numbers.pm # diff --git a/lib/warnings.pm b/lib/warnings.pm index 106f30ce1d5..d3ce5113c60 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -1,4 +1,4 @@ -# ex: set ro ft=c: -*- buffer-read-only: t -*- +# ex: set ro ft=perl: -*- mode: perl; buffer-read-only: t -*- # !!!!!!! DO NOT EDIT THIS FILE !!!!!!! # This file is built by regen/warnings.pl. # Any changes made here will be lost! diff --git a/mg_names.inc b/mg_names.inc index 41b24eba422..b41d1efd12a 100644 --- a/mg_names.inc +++ b/mg_names.inc @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * mg_names.inc * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! diff --git a/mg_raw.h b/mg_raw.h index 7085575fe14..48c1c924186 100644 --- a/mg_raw.h +++ b/mg_raw.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * mg_raw.h * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! diff --git a/mg_vtable.h b/mg_vtable.h index 3a66c55eb87..6f4b8b9cd41 100644 --- a/mg_vtable.h +++ b/mg_vtable.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * mg_vtable.h * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! diff --git a/miniperlmain.c b/miniperlmain.c index 24d65f96bae..bfc0d2c3952 100644 --- a/miniperlmain.c +++ b/miniperlmain.c @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- !!!!!!! DO NOT EDIT THIS FILE !!!!!!! This file is built by regen/miniperlmain.pl and ExtUtils::Miniperl. Any changes made here will be lost! diff --git a/opcode.h b/opcode.h index 2862176afb7..00ee4749ff4 100644 --- a/opcode.h +++ b/opcode.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * opcode.h * diff --git a/opnames.h b/opnames.h index 2895e32ff13..b56a2000ad9 100644 --- a/opnames.h +++ b/opnames.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * opnames.h * diff --git a/overload.h b/overload.h index 169a14cc6f4..4ff3fd99528 100644 --- a/overload.h +++ b/overload.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * overload.h * diff --git a/overload.inc b/overload.inc index 45d52cb8d1c..f70c5a64fe5 100644 --- a/overload.inc +++ b/overload.inc @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * overload.inc * diff --git a/packsizetables.inc b/packsizetables.inc index bc4063a1b37..3e3b9b26166 100644 --- a/packsizetables.inc +++ b/packsizetables.inc @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- !!!!!!! DO NOT EDIT THIS FILE !!!!!!! This file is built by regen/genpacksizetables.pl from its data. Any changes made here will be lost! diff --git a/perlapi.c b/perlapi.c index 6385aeb0f72..8792ae0c51b 100644 --- a/perlapi.c +++ b/perlapi.c @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * perlapi.c * diff --git a/perlapi.h b/perlapi.h index 04857557a6b..3f31311a98e 100644 --- a/perlapi.h +++ b/perlapi.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * perlapi.h * diff --git a/perly.act b/perly.act index e7f4d3979c7..25710b53307 100644 --- a/perly.act +++ b/perly.act @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- !!!!!!! DO NOT EDIT THIS FILE !!!!!!! This file is built by regen_perly.pl from perly.y. Any changes made here will be lost! diff --git a/perly.h b/perly.h index e1ad46fc56c..8ff228f0179 100644 --- a/perly.h +++ b/perly.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- !!!!!!! DO NOT EDIT THIS FILE !!!!!!! This file is built by regen_perly.pl from perly.y. Any changes made here will be lost! diff --git a/perly.tab b/perly.tab index e7d0ddca266..629238084b3 100644 --- a/perly.tab +++ b/perly.tab @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- !!!!!!! DO NOT EDIT THIS FILE !!!!!!! This file is built by regen_perly.pl from perly.y. Any changes made here will be lost! diff --git a/pp_proto.h b/pp_proto.h index 710d5057a6a..6305bafcb51 100644 --- a/pp_proto.h +++ b/pp_proto.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- !!!!!!! DO NOT EDIT THIS FILE !!!!!!! This file is built by opcode.pl from its data. Any changes made here will be lost! diff --git a/proto.h b/proto.h index be501527b94..aff9965bd9e 100644 --- a/proto.h +++ b/proto.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * proto.h * diff --git a/reentr.c b/reentr.c index a6693a680d4..7c95159ac00 100644 --- a/reentr.c +++ b/reentr.c @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * reentr.c * diff --git a/reentr.h b/reentr.h index 58f3a13059f..eca809d495a 100644 --- a/reentr.h +++ b/reentr.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * reentr.h * diff --git a/regcharclass.h b/regcharclass.h index 7319b035696..429a2cb6d70 100644 --- a/regcharclass.h +++ b/regcharclass.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * * regcharclass.h * diff --git a/regen/regen_lib.pl b/regen/regen_lib.pl index 2fa2eee8154..1b584f1ba51 100644 --- a/regen/regen_lib.pl +++ b/regen/regen_lib.pl @@ -128,11 +128,10 @@ sub read_only_top { unless exists $lang_opener{$lang}; my $style = $args{style} ? " $args{style} " : ' '; - my $raw = "ex: set ro ft=c: -*- buffer-read-only: t -*-\n"; + my $lc = lc $lang; # C, Pod or Perl + my $raw = "ex: set ro ft=$lc: -*- mode: $lc; buffer-read-only: t -*-\n"; + $raw .= "\n $args{file}\n" if $args{file}; - if ($args{file}) { - $raw .= "\n $args{file}\n"; - } if ($args{copyright}) { local $" = ', '; $raw .= wrap(75, ' ', ' ', <<"EOM") . "\n"; diff --git a/regnodes.h b/regnodes.h index 92efdf94b3d..c98962a942d 100644 --- a/regnodes.h +++ b/regnodes.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- !!!!!!! DO NOT EDIT THIS FILE !!!!!!! This file is built by regen/regcomp.pl from regcomp.sym. Any changes made here will be lost! diff --git a/unicode_constants.h b/unicode_constants.h index 60f0b1e6791..ecc460f9be3 100644 --- a/unicode_constants.h +++ b/unicode_constants.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! * This file is built by regen/unicode_constants.pl from Unicode data. * Any changes made here will be lost! diff --git a/warnings.h b/warnings.h index 8f915c71414..66076714dd4 100644 --- a/warnings.h +++ b/warnings.h @@ -1,4 +1,4 @@ -/* ex: set ro ft=c: -*- buffer-read-only: t -*- +/* ex: set ro ft=c: -*- mode: c; buffer-read-only: t -*- !!!!!!! DO NOT EDIT THIS FILE !!!!!!! This file is built by regen/warnings.pl. Any changes made here will be lost!