Mercurial > vim
comparison src/fileio.c @ 676:9cdb8018cdf1
updated for version 7.0202
author | vimboss |
---|---|
date | Mon, 20 Feb 2006 21:28:49 +0000 |
parents | 4b8583e82cb8 |
children | e629de7618da |
comparison
equal
deleted
inserted
replaced
675:51794dc170f7 | 676:9cdb8018cdf1 |
---|---|
64 static void msg_add_eol __ARGS((void)); | 64 static void msg_add_eol __ARGS((void)); |
65 static int check_mtime __ARGS((buf_T *buf, struct stat *s)); | 65 static int check_mtime __ARGS((buf_T *buf, struct stat *s)); |
66 static int time_differs __ARGS((long t1, long t2)); | 66 static int time_differs __ARGS((long t1, long t2)); |
67 #ifdef FEAT_AUTOCMD | 67 #ifdef FEAT_AUTOCMD |
68 static int apply_autocmds_exarg __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap)); | 68 static int apply_autocmds_exarg __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap)); |
69 static int au_find_group __ARGS((char_u *name)); | |
70 | |
71 # define AUGROUP_DEFAULT -1 /* default autocmd group */ | |
72 # define AUGROUP_ERROR -2 /* errornouse autocmd group */ | |
73 # define AUGROUP_ALL -3 /* all autocmd groups */ | |
69 #endif | 74 #endif |
70 | 75 |
71 #if defined(FEAT_CRYPT) || defined(FEAT_MBYTE) | 76 #if defined(FEAT_CRYPT) || defined(FEAT_MBYTE) |
72 # define HAS_BW_FLAGS | 77 # define HAS_BW_FLAGS |
73 # define FIO_LATIN1 0x01 /* convert Latin1 */ | 78 # define FIO_LATIN1 0x01 /* convert Latin1 */ |
4626 # endif | 4631 # endif |
4627 | 4632 |
4628 /* Do filetype detection now if 'filetype' is empty. */ | 4633 /* Do filetype detection now if 'filetype' is empty. */ |
4629 if (*curbuf->b_p_ft == NUL) | 4634 if (*curbuf->b_p_ft == NUL) |
4630 { | 4635 { |
4631 (void)do_doautocmd((char_u *)"filetypedetect BufRead", TRUE); | 4636 if (au_find_group((char_u *)"filetypedetect") != AUGROUP_ERROR) |
4637 (void)do_doautocmd((char_u *)"filetypedetect BufRead", FALSE); | |
4632 do_modelines(FALSE); | 4638 do_modelines(FALSE); |
4633 } | 4639 } |
4634 #endif | 4640 #endif |
4635 | 4641 |
4636 return OK; | 4642 return OK; |
6960 {"SpellFileMissing",EVENT_SPELLFILEMISSING}, | 6966 {"SpellFileMissing",EVENT_SPELLFILEMISSING}, |
6961 {"StdinReadPost", EVENT_STDINREADPOST}, | 6967 {"StdinReadPost", EVENT_STDINREADPOST}, |
6962 {"StdinReadPre", EVENT_STDINREADPRE}, | 6968 {"StdinReadPre", EVENT_STDINREADPRE}, |
6963 {"SwapExists", EVENT_SWAPEXISTS}, | 6969 {"SwapExists", EVENT_SWAPEXISTS}, |
6964 {"Syntax", EVENT_SYNTAX}, | 6970 {"Syntax", EVENT_SYNTAX}, |
6965 {"TabEnterPost", EVENT_TABENTERPOST}, | 6971 {"TabEnter", EVENT_TABENTER}, |
6966 {"TabLeavePre", EVENT_TABLEAVEPRE}, | 6972 {"TabLeave", EVENT_TABLEAVE}, |
6967 {"TermChanged", EVENT_TERMCHANGED}, | 6973 {"TermChanged", EVENT_TERMCHANGED}, |
6968 {"TermResponse", EVENT_TERMRESPONSE}, | 6974 {"TermResponse", EVENT_TERMRESPONSE}, |
6969 {"User", EVENT_USER}, | 6975 {"User", EVENT_USER}, |
6970 {"VimEnter", EVENT_VIMENTER}, | 6976 {"VimEnter", EVENT_VIMENTER}, |
6971 {"VimLeave", EVENT_VIMLEAVE}, | 6977 {"VimLeave", EVENT_VIMLEAVE}, |
7011 #define AUGROUP_NAME(i) (((char_u **)augroups.ga_data)[i]) | 7017 #define AUGROUP_NAME(i) (((char_u **)augroups.ga_data)[i]) |
7012 | 7018 |
7013 /* | 7019 /* |
7014 * The ID of the current group. Group 0 is the default one. | 7020 * The ID of the current group. Group 0 is the default one. |
7015 */ | 7021 */ |
7016 #define AUGROUP_DEFAULT -1 /* default autocmd group */ | |
7017 #define AUGROUP_ERROR -2 /* errornouse autocmd group */ | |
7018 #define AUGROUP_ALL -3 /* all autocmd groups */ | |
7019 static int current_augroup = AUGROUP_DEFAULT; | 7022 static int current_augroup = AUGROUP_DEFAULT; |
7020 | 7023 |
7021 static int au_need_clean = FALSE; /* need to delete marked patterns */ | 7024 static int au_need_clean = FALSE; /* need to delete marked patterns */ |
7022 | 7025 |
7023 static void show_autocmd __ARGS((AutoPat *ap, event_T event)); | 7026 static void show_autocmd __ARGS((AutoPat *ap, event_T event)); |
7024 static void au_remove_pat __ARGS((AutoPat *ap)); | 7027 static void au_remove_pat __ARGS((AutoPat *ap)); |
7025 static void au_remove_cmds __ARGS((AutoPat *ap)); | 7028 static void au_remove_cmds __ARGS((AutoPat *ap)); |
7026 static void au_cleanup __ARGS((void)); | 7029 static void au_cleanup __ARGS((void)); |
7027 static int au_new_group __ARGS((char_u *name)); | 7030 static int au_new_group __ARGS((char_u *name)); |
7028 static void au_del_group __ARGS((char_u *name)); | 7031 static void au_del_group __ARGS((char_u *name)); |
7029 static int au_find_group __ARGS((char_u *name)); | |
7030 static event_T event_name2nr __ARGS((char_u *start, char_u **end)); | 7032 static event_T event_name2nr __ARGS((char_u *start, char_u **end)); |
7031 static char_u *event_nr2name __ARGS((event_T event)); | 7033 static char_u *event_nr2name __ARGS((event_T event)); |
7032 static char_u *find_end_event __ARGS((char_u *arg, int have_group)); | 7034 static char_u *find_end_event __ARGS((char_u *arg, int have_group)); |
7033 static int event_ignored __ARGS((event_T event)); | 7035 static int event_ignored __ARGS((event_T event)); |
7034 static int au_get_grouparg __ARGS((char_u **argp)); | 7036 static int au_get_grouparg __ARGS((char_u **argp)); |