4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: The user manual section on exceptions contains small mistakes.
12 Solution: Give a good example of an error that could be missed and other
13 improvements. (Servatius Brandt)
14 Files: runtime/doc/usr_41.txt
17 *** ../vim-6.2.020/runtime/doc/usr_41.txt Sun Jun 1 15:11:52 2003
18 --- runtime/doc/usr_41.txt Tue Jun 3 13:02:15 2003
21 ! *usr_41.txt* For Vim version 6.2. Last change: 2003 Jun 01
23 VIM USER MANUAL - by Bram Moolenaar
26 ! *usr_41.txt* For Vim version 6.2. Last change: 2003 Jun 03
28 VIM USER MANUAL - by Bram Moolenaar
34 < function Show(start, ...) ~
35 ! function GetVimIndent()~
36 function SetSyn(name) ~
38 To see what a function does, use its name as an argument for ":function": >
42 < function Show(start, ...) ~
43 ! function GetVimIndent() ~
44 function SetSyn(name) ~
46 To see what a function does, use its name as an argument for ":function": >
51 For the commands in between ":try" and ":endtry" errors are turned into
52 ! exceptions. An exception is a string. In the case of an error the string is
53 ! the error message. And every error message has a number. In this case, the
54 ! error we catch contains "E484:". This number is guaranteed to stay the same
55 ! (the text may change, e.g., it may be translated).
57 When the ":read" command causes another error, the pattern "E484:" will not
58 match in it. Thus this exception will not be caught and result in the usual
62 For the commands in between ":try" and ":endtry" errors are turned into
63 ! exceptions. An exception is a string. In the case of an error the string
64 ! contains the error message. And every error message has a number. In this
65 ! case, the error we catch contains "E484:". This number is guaranteed to stay
66 ! the same (the text may change, e.g., it may be translated).
68 When the ":read" command causes another error, the pattern "E484:" will not
69 match in it. Thus this exception will not be caught and result in the usual
74 This means all errors are caught. But then you will not see errors that are
75 ! useful, such as an invalid modeline.
77 Another useful mechanism is the ":finally" command: >
82 This means all errors are caught. But then you will not see errors that are
83 ! useful, such as "E21: Cannot make changes, 'modifiable' is off".
85 Another useful mechanism is the ":finally" command: >
90 This filters the lines from the cursor until the end of the file through the
91 "filter" command, which takes a file name argument. No matter if the
92 ! filtering works or something goes wrong in between ":try" and ":finally", the
93 ! "call delete(tmp)" is always executed. This makes sure you don't leave the
94 ! temporary file behind.
96 More information about exception handling can be found in the reference
97 manual: |exception-handling|.
100 This filters the lines from the cursor until the end of the file through the
101 "filter" command, which takes a file name argument. No matter if the
102 ! filtering works, something goes wrong in between ":try" and ":finally" or the
103 ! user cancels the filtering by pressing CTRL-C, the "call delete(tmp)" is
104 ! always executed. This makes sure you don't leave the temporary file behind.
106 More information about exception handling can be found in the reference
107 manual: |exception-handling|.
108 *** ../vim-6.2.020/src/version.c Sat Jul 5 19:14:04 2003
109 --- src/version.c Sat Jul 5 19:18:00 2003
113 { /* Add new patch number below this line */
119 ARTHUR: I am your king!
120 WOMAN: Well, I didn't vote for you.
121 ARTHUR: You don't vote for kings.
122 WOMAN: Well, 'ow did you become king then?
123 The Quest for the Holy Grail (Monty Python)
125 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
126 /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
127 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
128 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///