]>
Commit | Line | Data |
---|---|---|
9b411fd1 ER |
1 | To: vim-dev@vim.org |
2 | Subject: patch 7.0.187 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.0.187 | |
11 | Problem: Can't source a remote script properly. | |
12 | Solution: Add the SourceCmd event. (Charles Campbell) | |
13 | Files: runtime/doc/autocmd.txt, src/ex_cmds2.c, src/fileio.c, src/vim.h | |
14 | ||
15 | ||
16 | *** ../vim-7.0.186/runtime/doc/autocmd.txt Sun May 7 17:07:33 2006 | |
17 | --- runtime/doc/autocmd.txt Tue Jan 16 21:29:14 2007 | |
18 | *************** | |
19 | *** 1,4 **** | |
20 | ! *autocmd.txt* For Vim version 7.0. Last change: 2006 May 06 | |
21 | ||
22 | ||
23 | VIM REFERENCE MANUAL by Bram Moolenaar | |
24 | --- 1,4 ---- | |
25 | ! *autocmd.txt* For Vim version 7.0. Last change: 2007 Jan 16 | |
26 | ||
27 | ||
28 | VIM REFERENCE MANUAL by Bram Moolenaar | |
29 | *************** | |
30 | *** 279,284 **** | |
31 | --- 279,285 ---- | |
32 | |FuncUndefined| a user function is used but it isn't defined | |
33 | |SpellFileMissing| a spell file is used but it can't be found | |
34 | |SourcePre| before sourcing a Vim script | |
35 | + |SourceCmd| before sourcing a Vim script |Cmd-event| | |
36 | ||
37 | |VimResized| after the Vim window size changed | |
38 | |FocusGained| Vim got input focus | |
39 | *************** | |
40 | *** 690,699 **** | |
41 | Can be used to check for any changed files. | |
42 | *SourcePre* | |
43 | SourcePre Before sourcing a Vim script. |:source| | |
44 | *SpellFileMissing* | |
45 | SpellFileMissing When trying to load a spell checking file and | |
46 | ! it can't be found. <amatch> is the language, | |
47 | ! 'encoding' also matters. See | |
48 | |spell-SpellFileMissing|. | |
49 | *StdinReadPost* | |
50 | StdinReadPost After reading from the stdin into the buffer, | |
51 | --- 701,717 ---- | |
52 | Can be used to check for any changed files. | |
53 | *SourcePre* | |
54 | SourcePre Before sourcing a Vim script. |:source| | |
55 | + <afile> is the name of the file being sourced. | |
56 | + *SourceCmd* | |
57 | + SourceCmd When sourcing a Vim script. |:source| | |
58 | + <afile> is the name of the file being sourced. | |
59 | + The autocommand must source this file. | |
60 | + |Cmd-event| | |
61 | *SpellFileMissing* | |
62 | SpellFileMissing When trying to load a spell checking file and | |
63 | ! it can't be found. The pattern is matched | |
64 | ! against the language. <amatch> is the | |
65 | ! language, 'encoding' also matters. See | |
66 | |spell-SpellFileMissing|. | |
67 | *StdinReadPost* | |
68 | StdinReadPost After reading from the stdin into the buffer, | |
69 | *************** | |
70 | *** 1219,1226 **** | |
71 | ||
72 | *Cmd-event* | |
73 | When using one of the "*Cmd" events, the matching autocommands are expected to | |
74 | ! do the file reading or writing. This can be used when working with a special | |
75 | ! kind of file, for example on a remote system. | |
76 | CAREFUL: If you use these events in a wrong way, it may have the effect of | |
77 | making it impossible to read or write the matching files! Make sure you test | |
78 | your autocommands properly. Best is to use a pattern that will never match a | |
79 | --- 1238,1245 ---- | |
80 | ||
81 | *Cmd-event* | |
82 | When using one of the "*Cmd" events, the matching autocommands are expected to | |
83 | ! do the file reading, writing or sourcing. This can be used when working with | |
84 | ! a special kind of file, for example on a remote system. | |
85 | CAREFUL: If you use these events in a wrong way, it may have the effect of | |
86 | making it impossible to read or write the matching files! Make sure you test | |
87 | your autocommands properly. Best is to use a pattern that will never match a | |
88 | *************** | |
89 | *** 1233,1241 **** | |
90 | original file isn't needed for recovery. You might want to do this only when | |
91 | you expect the file to be modified. | |
92 | ||
93 | ! The |v:cmdarg| variable holds the "++enc=" and "++ff=" argument that are | |
94 | ! effective. These should be used for the command that reads/writes the file. | |
95 | ! The |v:cmdbang| variable is one when "!" was used, zero otherwise. | |
96 | ||
97 | See the $VIMRUNTIME/plugin/netrw.vim for examples. | |
98 | ||
99 | --- 1252,1261 ---- | |
100 | original file isn't needed for recovery. You might want to do this only when | |
101 | you expect the file to be modified. | |
102 | ||
103 | ! For file read and write commands the |v:cmdarg| variable holds the "++enc=" | |
104 | ! and "++ff=" argument that are effective. These should be used for the command | |
105 | ! that reads/writes the file. The |v:cmdbang| variable is one when "!" was | |
106 | ! used, zero otherwise. | |
107 | ||
108 | See the $VIMRUNTIME/plugin/netrw.vim for examples. | |
109 | ||
110 | *** ../vim-7.0.186/src/ex_cmds2.c Tue Aug 29 17:28:56 2006 | |
111 | --- src/ex_cmds2.c Tue Jan 16 18:30:40 2007 | |
112 | *************** | |
113 | *** 2811,2816 **** | |
114 | --- 2811,2827 ---- | |
115 | } | |
116 | ||
117 | #ifdef FEAT_AUTOCMD | |
118 | + /* Apply SourceCmd autocommands, they should get the file and source it. */ | |
119 | + if (has_autocmd(EVENT_SOURCECMD, fname_exp, NULL) | |
120 | + && apply_autocmds(EVENT_SOURCECMD, fname_exp, fname_exp, | |
121 | + FALSE, curbuf)) | |
122 | + # ifdef FEAT_EVAL | |
123 | + return aborting() ? FAIL : OK; | |
124 | + # else | |
125 | + return OK; | |
126 | + # endif | |
127 | + | |
128 | + /* Apply SourcePre autocommands, they may get the file. */ | |
129 | apply_autocmds(EVENT_SOURCEPRE, fname_exp, fname_exp, FALSE, curbuf); | |
130 | #endif | |
131 | ||
132 | *** ../vim-7.0.186/src/fileio.c Tue Jan 9 15:43:39 2007 | |
133 | --- src/fileio.c Tue Jan 16 18:23:35 2007 | |
134 | *************** | |
135 | *** 7019,7024 **** | |
136 | --- 7020,7026 ---- | |
137 | {"ShellCmdPost", EVENT_SHELLCMDPOST}, | |
138 | {"ShellFilterPost", EVENT_SHELLFILTERPOST}, | |
139 | {"SourcePre", EVENT_SOURCEPRE}, | |
140 | + {"SourceCmd", EVENT_SOURCECMD}, | |
141 | {"SpellFileMissing",EVENT_SPELLFILEMISSING}, | |
142 | {"StdinReadPost", EVENT_STDINREADPOST}, | |
143 | {"StdinReadPre", EVENT_STDINREADPRE}, | |
144 | *** ../vim-7.0.186/src/vim.h Wed Nov 1 15:31:02 2006 | |
145 | --- src/vim.h Tue Jan 16 18:22:28 2007 | |
146 | *************** | |
147 | *** 1102,1108 **** | |
148 | EVENT_COLORSCHEME, /* after loading a colorscheme */ | |
149 | EVENT_FILEAPPENDPOST, /* after appending to a file */ | |
150 | EVENT_FILEAPPENDPRE, /* before appending to a file */ | |
151 | ! EVENT_FILEAPPENDCMD, /* appende to a file using command */ | |
152 | EVENT_FILECHANGEDSHELL, /* after shell command that changed file */ | |
153 | EVENT_FILECHANGEDSHELLPOST, /* after (not) reloading changed file */ | |
154 | EVENT_FILECHANGEDRO, /* before first change to read-only file */ | |
155 | --- 1102,1108 ---- | |
156 | EVENT_COLORSCHEME, /* after loading a colorscheme */ | |
157 | EVENT_FILEAPPENDPOST, /* after appending to a file */ | |
158 | EVENT_FILEAPPENDPRE, /* before appending to a file */ | |
159 | ! EVENT_FILEAPPENDCMD, /* append to a file using command */ | |
160 | EVENT_FILECHANGEDSHELL, /* after shell command that changed file */ | |
161 | EVENT_FILECHANGEDSHELLPOST, /* after (not) reloading changed file */ | |
162 | EVENT_FILECHANGEDRO, /* before first change to read-only file */ | |
163 | *************** | |
164 | *** 1147,1152 **** | |
165 | --- 1147,1153 ---- | |
166 | EVENT_REMOTEREPLY, /* upon string reception from a remote vim */ | |
167 | EVENT_SWAPEXISTS, /* found existing swap file */ | |
168 | EVENT_SOURCEPRE, /* before sourcing a Vim script */ | |
169 | + EVENT_SOURCECMD, /* sourcing a Vim script using command */ | |
170 | EVENT_SPELLFILEMISSING, /* spell file missing */ | |
171 | EVENT_CURSORMOVED, /* cursor was moved */ | |
172 | EVENT_CURSORMOVEDI, /* cursor was moved in Insert mode */ | |
173 | *** ../vim-7.0.186/src/version.c Tue Jan 16 16:00:38 2007 | |
174 | --- src/version.c Tue Jan 16 20:37:23 2007 | |
175 | *************** | |
176 | *** 668,669 **** | |
177 | --- 668,671 ---- | |
178 | { /* Add new patch number below this line */ | |
179 | + /**/ | |
180 | + 187, | |
181 | /**/ | |
182 | ||
183 | -- | |
184 | hundred-and-one symptoms of being an internet addict: | |
185 | 29. Your phone bill comes to your doorstep in a box. | |
186 | ||
187 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
188 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
189 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
190 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |