diff --git a/app-editors/vim/patches/vim-7.3.patch b/app-editors/vim/patches/vim-7.3.patch index eafb54f1f..2b2c266e9 100644 --- a/app-editors/vim/patches/vim-7.3.patch +++ b/app-editors/vim/patches/vim-7.3.patch @@ -62,6 +62,466 @@ diff -Naur vim73/Makefile vim73.haiku/Makefile + echo "URL: http://www.vim.org/" >> dist/boot/.OptionalPackageDescription + cd dist/boot && zip -9 -r -z -y ../vim-$(VDOT)$(GCCVER_SUFFIX)-`date +%F`.zip * .OptionalPackageDescription* < ../$(COMMENT_HAIKU) + +diff -Naur vim73/runtime/doc/eval.txt vim73.haiku/runtime/doc/eval.txt +--- vim73/runtime/doc/eval.txt 2010-08-15 14:23:20.045088768 +0200 ++++ vim73.haiku/runtime/doc/eval.txt 2012-09-15 21:37:50.934019072 +0200 +@@ -6081,7 +6081,7 @@ + autocmd Compiled with autocommand support. |autocommand| + balloon_eval Compiled with |balloon-eval| support. + balloon_multiline GUI supports multiline balloons. +-beos BeOS version of Vim. ++beos BeOS/Haiku version of Vim. + browse Compiled with |:browse| support, and browse() will + work. + builtin_terms Compiled with some builtin terminals. +@@ -6133,6 +6133,7 @@ + gui_motif Compiled with Motif GUI. + gui_photon Compiled with Photon GUI. + gui_win32 Compiled with MS Windows Win32 GUI. ++gui_beos Compiled with BeOS/Haiku GUI. + gui_win32s idem, and Win32s system being used (Windows 3.1) + gui_running Vim is running in the GUI, or it will start soon. + hangul_input Compiled with Hangul input support. |hangul| +diff -Naur vim73/runtime/doc/gui.txt vim73.haiku/runtime/doc/gui.txt +--- vim73/runtime/doc/gui.txt 2010-08-15 14:23:20.046661632 +0200 ++++ vim73.haiku/runtime/doc/gui.txt 2012-09-16 21:58:25.748158976 +0200 +@@ -97,6 +97,7 @@ + OS/2 $HOME/.gvimrc or $VIM/.gvimrc + MS-DOS and Win32 $HOME/_gvimrc or $VIM/_gvimrc + Amiga s:.gvimrc or $VIM/.gvimrc ++ Haiku $HOME/config/settings/vim/gvimrc + + There are a number of options which only have meaning in the GUI version of + Vim. These are 'guicursor', 'guifont', 'guipty' and 'guioptions'. They are +diff -Naur vim73/runtime/doc/help.txt vim73.haiku/runtime/doc/help.txt +--- vim73/runtime/doc/help.txt 2010-08-15 14:23:20.047448064 +0200 ++++ vim73.haiku/runtime/doc/help.txt 2012-09-16 22:03:00.902823936 +0200 +@@ -155,6 +155,7 @@ + |gui_w16.txt| Windows 3.1 GUI + |gui_w32.txt| Win32 GUI + |gui_x11.txt| X11 GUI ++|gui_beos.txt| BeOS/Haiku GUI + + Interfaces ~ + |if_cscop.txt| using Cscope with Vim +@@ -181,7 +182,7 @@ + Remarks about specific systems ~ + |os_390.txt| OS/390 Unix + |os_amiga.txt| Amiga +-|os_beos.txt| BeOS and BeBox ++|os_beos.txt| BeOS/Haiku and BeBox + |os_dos.txt| MS-DOS and MS-Windows NT/95 common items + |os_mac.txt| Macintosh + |os_mint.txt| Atari MiNT +diff -Naur vim73/runtime/doc/options.txt vim73.haiku/runtime/doc/options.txt +--- vim73/runtime/doc/options.txt 2010-08-15 14:23:21.051642368 +0200 ++++ vim73.haiku/runtime/doc/options.txt 2012-05-28 12:06:04.016777216 +0200 +@@ -3528,7 +3528,8 @@ + 'guitablabel' can be used to change the text in the labels. + When 'e' is missing a non-GUI tab pages line may be used. + The GUI tabs are only supported on some systems, currently +- GTK, Motif, Mac OS/X and MS-Windows. ++ GTK, Motif, Mac OS/X, Haiku and MS-Windows. ++ + *'go-f'* + 'f' Foreground: Don't use fork() to detach the GUI from the shell + where it was started. Use this for programs that wait for the +@@ -5567,7 +5568,12 @@ + $VIM/vimfiles, + $VIMRUNTIME, + $VIM/vimfiles/after, +- sys$login:vimfiles/after") ++ sys$login:vimfiles/after" ++ Haiku: "$BE_USER_SETTINGS/vim, ++ $VIM/vimfiles, ++ $VIMRUNTIME, ++ $VIM/vimfiles/after, ++ $BE_USER_SETTINGS/vim/after") + global + {not in Vi} + This is a list of directories which will be searched for runtime +@@ -6920,6 +6926,7 @@ + in the GUI: "builtin_gui" + on Amiga: "amiga" + on BeOS: "beos-ansi" ++ on Haiku: "xterm" + on Mac: "mac-ansi" + on MiNT: "vt52" + on MS-DOS: "pcterm" +diff -Naur vim73/runtime/doc/os_haiku.txt vim73.haiku/runtime/doc/os_haiku.txt +--- vim73/runtime/doc/os_haiku.txt 1970-01-01 01:00:00.000000000 +0100 ++++ vim73.haiku/runtime/doc/os_haiku.txt 2012-09-17 20:45:04.675807232 +0200 +@@ -0,0 +1,323 @@ ++*os_haiku.txt* For Vim version 7.4. Last change: 2012 May 28 ++ ++ ++ VIM REFERENCE MANUAL by Bram Moolenaar ++ ++// TODO - bring to correspondence with Haiku circumstances! ++ ++ *Haiku* ++This is a port of Vim 7.4 to the Haiku A4 or later. ++ ++This file contains the particularities for the Haiku version of Vim. For ++matters not discussed in this file, Vim behaves very much like the Unix ++|os_unix.txt| version. ++ ++ 1. General |beos-general| ++ 2. Compiling Vim |beos-compiling| ++ 3. Timeout in the Terminal |beos-timeout| ++ 4. Unicode vs. Latin1 |beos-unicode| ++ 5. The BeOS GUI |beos-gui| ++ 6. The $VIM directory |beos-vimdir| ++ 6+. The $BE_USER_SETTINGS directory |haiku-user-settings-dir| ++ 7. Drag & Drop |beos-dragndrop| ++ 8. Single Launch vs. Multiple ++ Launch |beos-launch| ++ 9. Fonts |beos-fonts| ++10. The meta key modifier |beos-meta| ++11. Mouse key mappings |beos-mouse| ++12. Color names |beos-colors| ++13. Compiling with Perl |beos-perl| ++ ++ ++1. General *beos-general* ++ ++The default syntax highlighting mostly works with different foreground colors ++to highlight items. This works best if you set your Terminal window to a ++darkish background and light letters. Some middle-grey background (for ++instance (r,g,b)=(168,168,168)) with black letters also works nicely. If you ++use the default light background and dark letters, it may look better to ++simply reverse the notion of foreground and background color settings. To do ++this, add this to your .vimrc file (where may need to be replaced with ++the escape character): > ++ ++ :if &term == "beos-ansi" ++ : set t_AB=[3%dm ++ : set t_AF=[4%dm ++ :endif ++ ++ ++2. Compiling Vim *beos-compiling* ++ ++From the Advanced Access Preview Release (AAPR) on, Vim can be configured with ++the standard configure script. To get the compiler and its flags right, use ++the following command-line in the shell (you can cut and paste it in one go): ++ ++CC=$BE_C_COMPILER CFLAGS="$BE_DEFAULT_C_FLAGS -O7" \ ++ ./configure --prefix=/boot/home/config ++ ++$BE_C_COMPILER is usually "mwcc", $BE_DEFAULT_C_FLAGS is usually "-I- -I." ++ ++When configure has run, and you wish to enable GUI support, you must edit the ++config.mk file so that the lines with GUI_xxx refer to $(BEOSGUI_xxx) instead ++of $(NONE_xxx). ++Alternatively you can make this change in the Makefile; it will have a ++more permanent effect. Search for "NONE_". ++ ++After compilation you need to add the resources to the binary. Add the ++following few lines near the end (before the line with "exit $exit_value") of ++the link.sh script to do this automatically. ++ ++ rmattr BEOS:TYPE vim ++ copyres os_beos.rsrc vim ++ mimeset vim ++ ++Also, create a dummy file "strip": ++ ++ #!/bin/sh ++ mimeset $1 ++ exit 0 ++ ++You will need it when using "make install" to install Vim. ++ ++Now type "make" to compile Vim, then "make install" to install it. ++ ++If you want to install Vim by hand, you must copy Vim to $HOME/config/bin, and ++create a bunch of symlinks to it ({g,r,rg}{vim,ex,view}). Furthermore you must ++copy Vim's configuration files to $HOME/config/share/vim: ++vim-5.0s/{*.vim,doc,syntax}. For completeness, you should also copy the nroff ++manual pages to $HOME/config/man/man1. Don't forget ctags/ctags and xxd/xxd! ++ ++Obviously, you need the unlimited linker to actually link Vim. See ++http://www.metrowerks.com for purchasing the CodeWarrior compiler for BeOS. ++There are currently no other linkers that can do the job. ++ ++This won't be able to include the Perl or Python interfaces even if ++you have the appropriate files installed. |beos-perl| ++ ++ ++3. Timeout in the Terminal *beos-timeout* ++ ++Because some POSIX/UNIX features are still missing[1], there is no direct OS ++support for read-with-timeout in the Terminal. This would mean that you cannot ++use :mappings of more than one character, unless you also :set notimeout. ++|'timeout'| ++ ++To circumvent this problem, I added a workaround to provide the necessary ++input with timeout by using an extra thread which reads ahead one character. ++As a side effect, it also makes Vim recognize when the Terminal window ++resizes. ++ ++Function keys are not supported in the Terminal since they produce very ++indistinctive character sequences. ++ ++These problems do not exist in the GUI. ++ ++[1]: there is no select() on file descriptors; also the termios VMIN and VTIME ++settings do not seem to work properly. This has been the case since DR7 at ++least and still has not been fixed as of PR2. ++ ++ *beos-unicode* ++4. Unicode vs. Latin1 *beos-utf8* ++ ++BeOS uses Unicode and UTF-8 for text strings (16-bit characters encoded to ++8-bit characters). Vim assumes ISO-Latin1 or other 8-bit character codes. ++This does not produce the desired results for non-ASCII characters. Try the ++command :digraphs to see. If they look messed up, use :set isprint=@ to ++(slightly) improve the display of ISO-Latin1 characters 128-255. This works ++better in the GUI, depending on which font you use (below). ++ ++You may also use the /boot/bin/xtou command to convert UTF-8 files from (xtou ++-f iso1 filename) or to (xtou -t iso1 filename) ISO-Latin1 characters. ++ ++ ++5. The BeOS GUI *beos-gui* ++ ++The BeOS GUI is no longer included. It was not maintained for a while and ++most likely didn't work. If you want to work on this: get the Vim 6.x version ++and merge it back in. ++ ++ ++6. The $VIM directory *beos-vimdir* ++ ++$VIM is the symbolic name for the place where Vims support files are stored. ++The default value for $VIM is set at compile time and can be determined with > ++ ++ :version ++ ++The normal value is /boot/home/config/share/vim. If you don't like it you can ++set the VIM environment variable to override this, or set 'helpfile' in your ++.vimrc: > ++ ++ :if version >= 500 ++ : set helpfile=~/vim/vim54/doc/help.txt ++ : syntax on ++ :endif ++ ++ ++6a. The $USER_SETTINGS_DIR directory *haiku-user-settings-dir* ++ ++ ++7. Drag & Drop *beos-dragndrop* ++ ++You can drop files and directories on either the Vim icon (starts a new Vim ++session, unless you use the File Types application to set Vim to be "Single ++Launch") or on the Vim window (starts editing the files). Dropping a folder ++sets Vim's current working directory. |:cd| |:pwd| If you drop files or ++folders with either SHIFT key pressed, Vim changes directory to the folder ++that contains the first item dropped. When starting Vim, there is no need to ++press shift: Vim behaves as if you do. ++ ++Files dropped set the current argument list. |argument-list| ++ ++ ++8. Single Launch vs. Multiple Launch *beos-launch* ++ ++As distributed Vim's Application Flags (as seen in the FileTypes preference) ++are set to Multiple Launch. If you prefer, you can set them to Single Launch ++instead. Attempts to start a second copy of Vim will cause the first Vim to ++open the files instead. This works from the Tracker but also from the command ++line. In the latter case, non-file (option) arguments are not supported. ++ ++NB: Only the GUI version has a BApplication (and hence Application Flags). ++This section does not apply to the GUI-less version, should you compile one. ++ ++ ++9. Fonts *beos-fonts* ++ ++Set fonts with > ++ ++ :set guifont=Courier10_BT/Roman/10 ++ ++where the first part is the font family, the second part the style, and the ++third part the size. You can use underscores instead of spaces in family and ++style. ++ ++Best results are obtained with monospaced fonts (such as Courier). Vim ++attempts to use all fonts in B_FIXED_SPACING mode but apparently this does not ++work for proportional fonts (despite what the BeBook says). ++ ++Vim also tries to use the B_ISO8859_1 encoding, also known as ISO Latin 1. ++This also does not work for all fonts. It does work for Courier, but not for ++ProFontISOLatin1/Regular (strangely enough). You can verify this by giving the > ++ ++ :digraphs ++ ++command, which lists a bunch of characters with their ISO Latin 1 encoding. ++If, for instance, there are "box" characters among them, or the last character ++isn't a dotted-y, then for this font the encoding does not work. ++ ++If the font you specify is unavailable, you get the system fixed font. ++ ++Standard fixed-width system fonts are: ++ ++ ProFontISOLatin1/Regular ++ Courier10_BT/Roman ++ Courier10_BT/Italic ++ Courier10_BT/Bold ++ Courier10_BT/Bold_Italic ++ ++Standard proportional system fonts are: ++ ++ Swis721_BT/Roman ++ Swis721_BT/Italic ++ Swis721_BT/Bold ++ Swis721_BT/Bold_Italic ++ Dutch801_Rm_BT/Roman ++ Dutch801_Rm_BT/Italic ++ Dutch801_Rm_BT/Bold ++ Dutch801_Rm_BT/Bold_Italic ++ Baskerville/Roman ++ Baskerville/Italic ++ Baskerville/Bold ++ Baskerville/Bold_Italic ++ SymbolProp_BT/Regular ++ ++Try some of them, just for fun. ++ ++ ++10. The meta key modifier *beos-meta* ++ ++The META key modifier is obtained by the left or right OPTION keys. This is ++because the ALT (aka COMMAND) keys are not passed to applications. ++ ++ ++11. Mouse key mappings *beos-mouse* ++ ++Vim calls the various mouse buttons LeftMouse, MiddleMouse and RightMouse. If ++you use the default Mouse preference settings these names indeed correspond to ++reality. Vim uses this mapping: ++ ++ Button 1 -> LeftMouse, ++ Button 2 -> RightMouse, ++ Button 3 -> MiddleMouse. ++ ++If your mouse has fewer than 3 buttons you can provide your own mapping from ++mouse clicks with modifier(s) to other mouse buttons. See the file ++vim-5.x/macros/swapmous.vim for an example. |gui-mouse-mapping| ++ ++ ++12. Color names *beos-colors* ++ ++Vim has a number of color names built-in. Additional names are read from the ++file $VIMRUNTIME/rgb.txt, if present. This file is basically the color ++database from X. Names used from this file are cached for efficiency. ++ ++ ++13. Compiling with Perl *beos-perl* ++ ++Compiling with Perl support enabled is slightly tricky. The Metrowerks ++compiler has some strange ideas where to search for include files. Since ++several include files with Perl have the same names as some Vim header ++files, the wrong ones get included. To fix this, run the following Perl ++script while in the vim-5.0/src directory: > ++ ++ preproc.pl > perl.h ++ ++ #!/bin/env perl ++ # Simple #include expander, just good enough for the Perl header files. ++ ++ use strict; ++ use IO::File; ++ use Config; ++ ++ sub doinclude ++ { ++ my $filename = $_[0]; ++ my $fh = new IO::File($filename, "r"); ++ if (defined $fh) { ++ print "/* Start of $filename */\n"; ++ ++ while (<$fh>) { ++ if (/^#include "(.*)"/) { ++ doinclude($1); ++ print "/* Back in $filename */\n"; ++ } else { ++ print $_; ++ } ++ } ++ print "/* End of $filename */\n"; ++ ++ undef $fh; ++ } else { ++ print "/* Cannot open $filename */\n"; ++ print "#include \"$filename\"\n"; ++ } ++ } ++ ++ chdir $Config{installarchlib}."/CORE"; ++ doinclude "perl.h"; ++ ++It expands the "perl.h" header file, using only other Perl header files. ++ ++Now you can configure & make Vim with the --enable-perlinterp option. ++Be warned though that this adds about 616 kilobytes to the size of Vim! ++Without Perl, Vim with default features and GUI is about 575K, with Perl ++it is about 1191K. ++ ++-Olaf Seibert ++ ++[Note: these addresses no longer work:] ++ ++http://polder.ubc.kun.nl/~rhialto/be ++ ++ vim:tw=78:ts=8:ft=help:norl: +diff -Naur vim73/runtime/doc/starting.txt vim73.haiku/runtime/doc/starting.txt +--- vim73/runtime/doc/starting.txt 2010-08-15 14:23:22.056360960 +0200 ++++ vim73.haiku/runtime/doc/starting.txt 2012-09-16 22:03:00.965476352 +0200 +@@ -756,6 +756,7 @@ + OS/2 $HOME/.vimrc or $VIM/.vimrc (or _vimrc) + MS-DOS and Win32 $HOME/_vimrc or $VIM/_vimrc + Amiga s:.vimrc or $VIM/.vimrc ++ Haiku $HOME/config/settings/vim/vimrc + + If Vim was started with "-u filename", the file "filename" is used. + All following initializations until 4. are skipped. +@@ -791,6 +792,7 @@ + "$VIM/.vimrc" (for OS/2 and Amiga) (*) + "$HOME/_vimrc" (for MS-DOS and Win32) (*) + "$VIM/_vimrc" (for MS-DOS and Win32) (*) ++ "$HOME/.vimrc" (for BeOS/Haiku) (*) + Note: For Unix, OS/2 and Amiga, when ".vimrc" does not exist, + "_vimrc" is also tried, in case an MS-DOS compatible file + system is used. For MS-DOS and Win32 ".vimrc" is checked +@@ -880,6 +882,7 @@ + ~/.vimrc (Unix and OS/2) + s:.vimrc (Amiga) + $VIM\_vimrc (MS-DOS and Win32) ++ ~/.vimrc (BeOS/Haiku) + Note that creating a vimrc file will cause the 'compatible' option to be off + by default. See |compatible-default|. + +diff -Naur vim73/runtime/doc/vi_diff.txt vim73.haiku/runtime/doc/vi_diff.txt +--- vim73/runtime/doc/vi_diff.txt 2010-08-15 14:23:23.066322432 +0200 ++++ vim73.haiku/runtime/doc/vi_diff.txt 2012-05-13 20:55:51.593494016 +0200 +@@ -139,6 +139,7 @@ + - Atari MiNT + - VMS + - BeOS ++ - Haiku + - Macintosh + - Risc OS + - IBM OS/390 +@@ -163,7 +164,7 @@ + define your own menus. Better support for CTRL/SHIFT/ALT keys in + combination with special keys and mouse. Supported for various + platforms, such as X11 (with Motif and Athena interfaces), GTK, Win32 +- (Windows 95 and later), BeOS, Amiga and Macintosh. ++ (Windows 95 and later), Haiku, Amiga and Macintosh. + + Multiple windows and buffers. |windows.txt| + Vim can split the screen into several windows, each editing a diff -Naur vim73/runtime/gvimrc_example.vim vim73.haiku/runtime/gvimrc_example.vim --- vim73/runtime/gvimrc_example.vim 2010-05-15 11:03:31.008650752 +0000 +++ vim73.haiku/runtime/gvimrc_example.vim 2010-08-20 23:25:03.942407680 +0000 @@ -179,7 +639,7 @@ diff -Naur vim73/src/Makefile vim73.haiku/src/Makefile + chmod $(BINMOD) $$i ; \ + addattr -f ~icon.attr -t \'VICN\' BEOS:ICON $$i ; \ + done -+ addattr -f ~icon.attr -t \'ICON\' BEOS:ICON $(DEST_BIN)/$(VIMNAME)tutor ++ addattr -f ~icon.attr -t \'VICN\' BEOS:ICON $(DEST_BIN)/$(VIMNAME)tutor + @rm ~icon.attr + +###############################################################################