diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 21ccf2b..f09e2ef 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*      For Vim version 7.0aa.  Last change: 2005 Dec 11
+*eval.txt*      For Vim version 7.0aa.  Last change: 2005 Dec 12
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1278,7 +1278,7 @@
 			'diffexpr'	original file
 			'patchexpr'	original file
 			'printexpr'	file to be printed
-		And set to the swap file name for |SwapExits|.
+		And set to the swap file name for |SwapExists|.
 
 					*v:fname_out* *fname_out-variable*
 v:fname_out	The name of the output file.  Only valid while
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index ba8e423..dd95b6c 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -1,4 +1,4 @@
-*motion.txt*    For Vim version 7.0aa.  Last change: 2005 Dec 09
+*motion.txt*    For Vim version 7.0aa.  Last change: 2005 Dec 12
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -57,6 +57,7 @@
 	|>|	>	shift right
 	|<|	<	shift left
 	|zf|	zf	define a fold
+	|g@|    g@      call function set with the 'operatorfunc' option
 
 If the motion includes a count and the operator also had a count before it,
 the two counts are multiplied.  For example: "2d3w" deletes six words.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index f49e3ab..cea3588 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 7.0aa.  Last change: 2005 Dec 11
+*options.txt*	For Vim version 7.0aa.  Last change: 2005 Dec 12
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -4646,6 +4646,17 @@
 	For the use of the function see 'completefunc'.
 
 
+						*'operatorfunc'* *'opfunc'*
+'operatorfunc' 'opfunc'	string	(default: empty)
+			global
+			{not in Vi}
+	This option specifies a function to be called by the |g@| operator.
+	See |:map-operator| for more info and an example.
+
+	This option cannot be set from a |modeline| or in the |sandbox|, for
+	security reasons.
+
+
 					*'osfiletype'* *'oft'* *E366*
 'osfiletype' 'oft'	string (RISC-OS default: "Text",
 				others default: "")
@@ -5873,7 +5884,7 @@
 			{not in Vi}
 			{not available when compiled without the |+syntax|
 			feature}
-	Methods used for spelling suggestions.  Both for the |z?| command and
+	Methods used for spelling suggestions.  Both for the |z=| command and
 	the |spellsuggest()| function.  This is a comma-separated list of
 	items:
 
@@ -5892,7 +5903,7 @@
 			character inserts/deletes/swaps.  Works well for
 			simple typing mistakes.
 
-	{number}	The maximum number of suggestions listed for |z?|.
+	{number}	The maximum number of suggestions listed for |z=|.
 			Not used for |spellsuggest()|.  The number of
 			suggestions is never more than the value of 'lines'
 			minus two.
@@ -5914,7 +5925,7 @@
 			Lists, each with a suggestion and a score.
 			Example:
 				[['the', 33], ['that', 44]]
-			Set 'verbose' and use |z?| to see the scores that the
+			Set 'verbose' and use |z=| to see the scores that the
 			internal methods use.  A lower score is better.
 			This may invoke |spellsuggest()| if you temporarily
 			set 'spellsuggest' to exclude the "expr:" part.
diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt
index ffd1509..d6efe64 100644
--- a/runtime/doc/recover.txt
+++ b/runtime/doc/recover.txt
@@ -1,4 +1,4 @@
-*recover.txt*   For Vim version 7.0aa.  Last change: 2005 Feb 10
+*recover.txt*   For Vim version 7.0aa.  Last change: 2005 Dec 12
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -126,6 +126,28 @@
 A Vim swap file can be recognized by the first six characters: "b0VIM ".
 After that comes the version number, e.g., "3.0".
 
+
+Links and symbolic links ~
+
+On Unix it is possible to have two names for the same file.  This can be done
+with hard links and with symbolic links (symlinks).
+
+For hard links Vim does not know the other name of the file.  Therefore, the
+name of the swapfile will be based on the name you used to edit the file.
+There is no check for editing the same file by the other name too, because Vim
+cannot find the other swapfile (except for searching all of your harddisk,
+which would be very slow).
+
+For symbolic links Vim resolves the links to find the name of the actual file.
+The swap file name is based on that name.  Thus it doesn't matter by what name
+you edit the file, the swap file name will normally be the same.  However,
+there are exceptions:
+- When the directory of the actual file is not writable the swapfile is put
+  elsewhere.
+- When the symbolic links somehow create a loop you get an *E773* error
+  message and the unmodified file name will be used.  You won't be able to
+  save your file normally.
+
 ==============================================================================
 2. Recovery					*recovery* *E308* *E311*
 
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 31949c2..157e164 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -614,6 +614,8 @@
 'omnifunc'	options.txt	/*'omnifunc'*
 'op'	vi_diff.txt	/*'op'*
 'open'	vi_diff.txt	/*'open'*
+'operatorfunc'	options.txt	/*'operatorfunc'*
+'opfunc'	options.txt	/*'opfunc'*
 'optimize'	vi_diff.txt	/*'optimize'*
 'option'	intro.txt	/*'option'*
 'osfiletype'	options.txt	/*'osfiletype'*
@@ -2144,9 +2146,14 @@
 :map-<silent>	map.txt	/*:map-<silent>*
 :map-<unique>	map.txt	/*:map-<unique>*
 :map-alt-keys	map.txt	/*:map-alt-keys*
+:map-arguments	map.txt	/*:map-arguments*
+:map-commands	map.txt	/*:map-commands*
 :map-local	map.txt	/*:map-local*
+:map-modes	map.txt	/*:map-modes*
+:map-operator	map.txt	/*:map-operator*
 :map-script	map.txt	/*:map-script*
 :map-silent	map.txt	/*:map-silent*
+:map-special-chars	map.txt	/*:map-special-chars*
 :map-special-keys	map.txt	/*:map-special-keys*
 :map-undo	map.txt	/*:map-undo*
 :map-verbose	map.txt	/*:map-verbose*
@@ -3777,6 +3784,7 @@
 E770	spell.txt	/*E770*
 E771	spell.txt	/*E771*
 E772	spell.txt	/*E772*
+E773	recover.txt	/*E773*
 E78	motion.txt	/*E78*
 E79	message.txt	/*E79*
 E80	message.txt	/*E80*
@@ -5158,6 +5166,7 @@
 g?	change.txt	/*g?*
 g??	change.txt	/*g??*
 g?g?	change.txt	/*g?g?*
+g@	map.txt	/*g@*
 gD	pattern.txt	/*gD*
 gE	motion.txt	/*gE*
 gH	visual.txt	/*gH*
@@ -5991,6 +6000,7 @@
 new-debug-itf	version6.txt	/*new-debug-itf*
 new-debug-mode	version6.txt	/*new-debug-mode*
 new-debug-support	version7.txt	/*new-debug-support*
+new-define-operator	version7.txt	/*new-define-operator*
 new-diff-mode	version6.txt	/*new-diff-mode*
 new-encryption	version5.txt	/*new-encryption*
 new-evim	version6.txt	/*new-evim*
diff --git a/src/gui_mac.c b/src/gui_mac.c
index 52a24d7..8f8358c 100644
--- a/src/gui_mac.c
+++ b/src/gui_mac.c
@@ -13,14 +13,9 @@
  */
 
 /*
- * NOTE: Comment mentionning FAQ refer to the book:
- *       "Macworld Mac Programming FAQs" from "IDG Books"
- */
-
-/*
- * WARNING: Vim must be able to compile without Carbon
- *	    As the desired minimum requirement are circa System 7
- *	    (I want to run it on my Mac Classic) (Dany)
+ * NOTES: - Vim 7+ does not support classic MacOS. Please use Vim 6.x
+ *        - Comments mentioning FAQ refer to the book:
+ *          "Macworld Mac Programming FAQs" from "IDG Books"
  */
 
 /*
@@ -33,143 +28,61 @@
  *
  */
 
-/* TODO: find the best place for this (Dany) */
-#if 0
-#  if ! TARGET_API_MAC_CARBON
-/* Enable the new API functions even when not compiling for Carbon */
-/* Apple recomends Universal Interface 3.3.2 or later */
-#  define OPAQUE_TOOLBOX_STRUCTS		1
-#  define ACCESSOR_CALLS_ARE_FUNCTIONS	1
-/* Help Menu not supported by Carbon */
-#  define USE_HELPMENU
-# endif
-#endif
+ /* TODO (Jussi)
+  *   * Clipboard does not work (at least some cases)
+  *   * ATSU font rendering has some problems
+  *   * Investigate and remove dead code (there is still lots of that)
+  */
 
 #include <Devices.h> /* included first to avoid CR problems */
 #include "vim.h"
 
-/* Enable Contextual Menu Support */
-#if UNIVERSAL_INTERFACES_VERSION >= 0x0320
-# define USE_CTRLCLICKMENU
-#endif
-
-/* Put Vim Help in MacOS Help */
-#define USE_HELPMENU
-
-/* Enable AEVENT */
-#define USE_AEVENT
+#define USE_CARBONIZED
+#define USE_AEVENT		/* Enable AEVENT */
+#undef USE_OFFSETED_WINDOW	/* Debugging feature: start Vim window OFFSETed */
 
 /* Compile as CodeWarior External Editor */
 #if defined(FEAT_CW_EDITOR) && !defined(USE_AEVENT)
 # define USE_AEVENT /* Need Apple Event Support */
 #endif
 
-/* The VIM creator is CodeWarior specific */
-#if !(defined(__MRC__) || defined(__SC__) || defined(__APPLE_CC__))
-# define USE_VIM_CREATOR_ID
-#else
-# if 0 /* Was this usefull for some compiler? (Dany) */
-static    OSType	_fcreator = 'VIM!';
-static    OSType	_ftype = 'TEXT';
-# endif
-#endif
-
 /* Vim's Scrap flavor. */
 #define VIMSCRAPFLAVOR 'VIM!'
 
-/* CARBON version only tested with Project Builder under MacOS X */
-#undef USE_CARBONIZED
-#if (defined(__APPLE_CC__) || defined(__MRC__)) && defined(TARGET_API_MAC_CARBON)
-# if TARGET_API_MAC_CARBON
-#  define USE_CARBONIZED
-# endif
-#endif
-
-#undef USE_MOUSEWHEEL
-#if defined(MACOS_X) && defined(USE_CARBONIZED)
-# define USE_MOUSEWHEEL
 static EventHandlerUPP mouseWheelHandlerUPP = NULL;
-#endif
+SInt32 gMacSystemVersion;
 
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
-# define USE_CARBONKEYHANDLER
+#if defined(FEAT_MBYTE)
+#define USE_CARBONKEYHANDLER
 static EventHandlerUPP keyEventHandlerUPP = NULL;
 #endif
 
-#ifdef MACOS_X
-SInt32 gMacSystemVersion;
-#endif
-
-/* Debugging feature: start Vim window OFFSETed */
-#undef USE_OFFSETED_WINDOW
-
-/* Debugging feature: use CodeWarior SIOUX */
-#undef USE_SIOUX
-
 
 /* Include some file. TODO: move into os_mac.h */
 #include <Menus.h>
 #include <Resources.h>
-#if !TARGET_API_MAC_CARBON
-#include <StandardFile.h>
-#include <Traps.h>
-#endif
-#include <Balloons.h>
 #include <Processes.h>
 #ifdef USE_AEVENT
 # include <AppleEvents.h>
 # include <AERegistry.h>
 #endif
-#ifdef USE_CTRLCLICKMENU
 # include <Gestalt.h>
-#endif
-#ifdef USE_SIOUX
-# include <stdio.h>
-# include <sioux.h>
-# include <console.h>
-#endif
 #if UNIVERSAL_INTERFACES_VERSION >= 0x0330
 # include <ControlDefinitions.h>
 # include <Navigation.h>  /* Navigation only part of ?? */
 #endif
 
-#if TARGET_API_MAC_CARBON && 0
+/* Help Manager (balloon.h, HM prefixed functions) are not supported
+ * under Carbon (Jussi) */
+#  if 0
 /* New Help Interface for Mac, not implemented yet.*/
-# include <MacHelp.h>
-#endif
+#    include <MacHelp.h>
+#  endif
 
 /*
- * Translate new name to old ones
- * New function only available in MacOS 8.5,
- * So use old one to be compatible back to System 7
+ * These seem to be rectangle options. Why are they not found in
+ * headers? (Jussi)
  */
-#ifndef USE_CARBONIZED
-# undef  EnableMenuItem
-# define EnableMenuItem EnableItem
-# undef  DisableMenuItem
-# define DisableMenuItem DisableItem
-#endif
-
-/* Carbon does not support the Get/SetControll functions,
- * use Get/SetControl32Bit instead and rename for non-carbon
- * systems.
- */
-
-#ifndef USE_CARBONIZED
-# undef    SetControl32BitMaximum
-# define   SetControl32BitMaximum SetControlMaximum
-# undef    SetControl32BitMinimum
-# define   SetControl32BitMinimum SetControlMinimum
-# undef    SetControl32BitValue
-# define   SetControl32BitValue SetControlValue
-# undef    GetControl32BitValue
-# define   GetControl32BitValue GetControlValue
-#endif
-
-/*
- * ???
- */
-
 #define kNothing 0
 #define kCreateEmpty 2 /*1*/
 #define kCreateRect 2
@@ -178,7 +91,6 @@
 /*
  * Dany: Don't like those...
  */
-
 #define topLeft(r)	(((Point*)&(r))[0])
 #define botRight(r)	(((Point*)&(r))[1])
 
@@ -201,9 +113,7 @@
 static int allow_scrollbar = FALSE;
 
 /* Last mouse click caused contextual menu, (to provide proper release) */
-#ifdef USE_CTRLCLICKMENU
 static short clickIsPopup;
-#endif
 
 /* Feedback Action for Scrollbar */
 ControlActionUPP gScrollAction;
@@ -212,7 +122,6 @@
 /* Keeping track of which scrollbar is being dragged */
 static ControlHandle dragged_sb = NULL;
 
-#if defined(USE_CARBONIZED) && defined(MACOS_X)
 static struct
 {
     FMFontFamily family;
@@ -220,24 +129,13 @@
     FMFontStyle style;
     Boolean isPanelVisible;
 } gFontPanelInfo = { 0, 0, 0, false };
-#endif
 
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
 # define USE_ATSUI_DRAWING
 ATSUStyle   gFontStyle;
 Boolean	    gIsFontFallbackSet;
 #endif
 
-/*
- * The Quickdraw global is predefined in CodeWarior
- * but is not in Apple MPW
- */
-#if (defined(__MRC__) || defined(__SC__))
-# if !(defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON)
-QDGlobals qd;
-# endif
-#endif
-
 /* Colors Macros */
 #define RGB(r,g,b)	((r) << 16) + ((g) << 8) + (b)
 #define Red(c)		((c & 0x00FF0000) >> 16)
@@ -371,7 +269,8 @@
  *
  */
 
-char_u *C2Pascal_save(char_u *Cstring)
+    char_u *
+C2Pascal_save(char_u *Cstring)
 {
     char_u  *PascalString;
     int	    len;
@@ -402,7 +301,8 @@
  *
  */
 
-char_u *C2Pascal_save_and_remove_backslash(char_u *Cstring)
+    char_u *
+C2Pascal_save_and_remove_backslash(char_u *Cstring)
 {
     char_u  *PascalString;
     int	    len;
@@ -519,15 +419,14 @@
     return pixels;
 }
 
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
 /*
  * Deletes all traces of any Windows-style mnemonic text (including any
  * parentheses) from a menu item and returns the cleaned menu item title.
  * The caller is responsible for releasing the returned string.
  */
     static CFStringRef
-menu_title_removing_mnemonic(menu)
-    vimmenu_T	*menu;
+menu_title_removing_mnemonic(vimmenu_T *menu)
 {
     CFStringRef		name;
     size_t		menuTitleLen;
@@ -581,7 +480,8 @@
  * character strings.
  */
 
-char_u **new_fnames_from_AEDesc(AEDesc *theList, long *numFiles, OSErr *error)
+    char_u **
+new_fnames_from_AEDesc(AEDesc *theList, long *numFiles, OSErr *error)
 {
     char_u	**fnames = NULL;
     OSErr	newError;
@@ -595,9 +495,6 @@
     *error = AECountItems(theList, numFiles);
     if (*error)
     {
-#ifdef USE_SIOUX
-	printf("fname_from_AEDesc: AECountItems error: %d\n", error);
-#endif
 	return(fnames);
     }
 
@@ -619,9 +516,6 @@
 	{
 	    /* Caller is able to clean up */
 	    /* TODO: Should be clean up or not? For safety. */
-#ifdef USE_SIOUX
-	    printf("aevt_odoc: AEGetNthPtr error: %ld\n", (long)newError);
-#endif
 	    return(fnames);
 	}
 
@@ -663,21 +557,18 @@
  *
  */
 
-#if defined(__MWERKS__)  /* only in Codewarrior */
-# pragma options align=mac68k
-#endif
 typedef struct WindowSearch WindowSearch;
 struct WindowSearch /* for handling class 'KAHL', event 'SRCH', keyDirectObject typeChar*/
 {
     FSSpec theFile; // identifies the file
     long *theDate; // where to put the modification date/time
 };
-#if defined(__MWERKS__)  /* only in Codewarrior */
-# pragma options align=reset
-#endif
 
     pascal OSErr
-Handle_KAHL_SRCH_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+Handle_KAHL_SRCH_AE(
+	const AppleEvent    *theAEvent,
+	AppleEvent	    *theReply,
+	long		    refCon)
 {
     OSErr	error = noErr;
     buf_T	*buf;
@@ -689,18 +580,12 @@
     error = AEGetParamPtr(theAEvent, keyDirectObject, typeChar, &typeCode, (Ptr) &SearchData, sizeof(WindowSearch), &actualSize);
     if (error)
     {
-#ifdef USE_SIOUX
-	printf("KAHL_SRCH: AEGetParamPtr error: %d\n", error);
-#endif
 	return(error);
     }
 
     error = HandleUnusedParms(theAEvent);
     if (error)
     {
-#ifdef USE_SIOUX
-	printf("KAHL_SRCH: HandleUnusedParms error: %d\n", error);
-#endif
 	return(error);
     }
 
@@ -719,13 +604,6 @@
     else
 	*SearchData.theDate = buf->b_mtime;
 
-#ifdef USE_SIOUX
-    printf("KAHL_SRCH: file \"%#s\" {%d}", SearchData.theFile.name,SearchData.theFile.parID);
-    if (foundFile == false)
-	printf(" NOT");
-    printf(" found. [date %lx, %lx]\n", *SearchData.theDate, buf->b_mtime_read);
-#endif
-
     return error;
 };
 
@@ -756,9 +634,6 @@
  *
  */
 
-#if defined(__MWERKS__)  /* only in Codewarrior */
-# pragma options align=mac68k
-#endif
 typedef struct ModificationInfo ModificationInfo;
 struct ModificationInfo /* for replying to class 'KAHL', event 'MOD ', keyDirectObject typeAEList*/
 {
@@ -766,12 +641,12 @@
     long theDate; // the date/time the file was last modified
     short saved; // set this to zero when replying, unused
 };
-#if defined(__MWERKS__)  /* only in Codewarrior */
-# pragma options align=reset
-#endif
 
     pascal OSErr
-Handle_KAHL_MOD_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+Handle_KAHL_MOD_AE(
+	const AppleEvent    *theAEvent,
+	AppleEvent	    *theReply,
+	long		    refCon)
 {
     OSErr	error = noErr;
     AEDescList	replyList;
@@ -784,9 +659,6 @@
     error = HandleUnusedParms(theAEvent);
     if (error)
     {
-#ifdef USE_SIOUX
-	printf("KAHL_MOD: HandleUnusedParms error: %d\n", error);
-#endif
 	return(error);
     }
 
@@ -798,18 +670,11 @@
     error = AECreateList(nil, 0, false, &replyList);
     if (error)
     {
-#ifdef USE_SIOUX
-	printf("KAHL_MOD: AECreateList error: %d\n", error);
-#endif
 	return(error);
     }
 
 #if 0
     error = AECountItems(&replyList, &numFiles);
-#ifdef USE_SIOUX
-    printf("KAHL_MOD ReplyList: %x %x\n", replyList.descriptorType, replyList.dataHandle);
-    printf("KAHL_MOD ItemInList: %d\n", numFiles);
-#endif
 
     /* AEPutKeyDesc(&replyList, keyAEPnject, &aDesc)
      * AEPutKeyPtr(&replyList, keyAEPosition, typeChar, (Ptr)&theType,
@@ -828,37 +693,15 @@
 	    theFile.theDate = buf->b_mtime;
 /*	    theFile.theDate = time(NULL) & (time_t) 0xFFFFFFF0; */
 	    error = AEPutPtr(&replyList, numFiles, typeChar, (Ptr) &theFile, sizeof(theFile));
-#ifdef USE_SIOUX
-	    if (numFiles == 0)
-		printf("KAHL_MOD: ");
-	    else
-		printf(", ");
-	    printf("\"%#s\" {%d} [date %lx, %lx]", theFile.theFile.name, theFile.theFile.parID, theFile.theDate, buf->b_mtime_read);
-	    if (error)
-		printf(" (%d)", error);
-	    numFiles++;
-#endif
 	};
 
-#ifdef USE_SIOUX
-    printf("\n");
-#endif
-
 #if 0
     error = AECountItems(&replyList, &numFiles);
-#ifdef USE_SIOUX
-    printf("KAHL_MOD ItemInList: %d\n", numFiles);
-#endif
 #endif
 
     /* We can add data only if something to reply */
     error = AEPutParamDesc(theReply, keyDirectObject, &replyList);
 
-#ifdef USE_SIOUX
-    if (error)
-	printf("KAHL_MOD: AEPutParamDesc error: %d\n", error);
-#endif
-
     if (replyList.dataHandle)
 	AEDisposeDesc(&replyList);
 
@@ -891,9 +734,6 @@
  *
  */
 
-#if defined(__MWERKS__)  /* only in Codewarrior */
-# pragma options align=mac68k
-#endif
 typedef struct CW_GetText CW_GetText;
 struct CW_GetText /* for handling class 'KAHL', event 'GTTX', keyDirectObject typeChar*/
 {
@@ -902,12 +742,12 @@
     long *unused;   /* 0 (not used) */
     long *theDate;  /* where to put the modification date/time */
 };
-#if defined(__MWERKS__)  /* only in Codewarrior */
-# pragma options align=reset
-#endif
 
     pascal OSErr
-Handle_KAHL_GTTX_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+Handle_KAHL_GTTX_AE(
+	const AppleEvent    *theAEvent,
+	AppleEvent	    *theReply,
+	long		    refCon)
 {
     OSErr	error = noErr;
     buf_T	*buf;
@@ -926,9 +766,6 @@
 
     if (error)
     {
-#ifdef USE_SIOUX
-	printf("KAHL_GTTX: AEGetParamPtr error: %d\n", error);
-#endif
 	return(error);
     }
 
@@ -954,10 +791,6 @@
 	    SetHandleSize(GetTextData.theText, BufferSize);
 	    if (GetHandleSize(GetTextData.theText) != BufferSize)
 	    {
-	#ifdef USE_SIOUX
-		printf("KAHL_GTTX: SetHandleSize increase: %d, size %d\n",
-			linesize, BufferSize);
-	#endif
 		break; /* Simple handling for now */
 	    }
 	    else
@@ -981,19 +814,10 @@
 /*	    *GetTextData.theDate = time(NULL) & (time_t) 0xFFFFFFF0;*/
 	    *GetTextData.theDate = buf->b_mtime;
     }
-#ifdef USE_SIOUX
-    printf("KAHL_GTTX: file \"%#s\" {%d} [date %lx, %lx]", GetTextData.theFile.name, GetTextData.theFile.parID, *GetTextData.theDate, buf->b_mtime_read);
-    if (foundFile == false)
-	printf(" NOT");
-    printf(" found. (BufferSize = %d)\n", BufferSize);
-#endif
 
     error = HandleUnusedParms(theAEvent);
     if (error)
     {
-#ifdef USE_SIOUX
-	printf("KAHL_GTTX: HandleUnusedParms error: %d\n", error);
-#endif
 	return(error);
     }
 
@@ -1005,9 +829,11 @@
  */
 
 /* Taken from MoreAppleEvents:ProcessHelpers*/
-pascal	OSErr	FindProcessBySignature(const OSType targetType,
-					const OSType targetCreator,
-					      ProcessSerialNumberPtr psnPtr)
+    pascal	OSErr
+FindProcessBySignature(
+	const OSType		targetType,
+	const OSType		targetCreator,
+	ProcessSerialNumberPtr	psnPtr)
 {
     OSErr	anErr = noErr;
     Boolean	lookingForProcess = true;
@@ -1053,12 +879,6 @@
 
 
     anErr = FindProcessBySignature('APPL', 'CWIE', &psn);
-#ifdef USE_SIOUX
-    printf("CodeWarrior is");
-    if (anErr != noErr)
-	printf(" NOT");
-    printf(" running\n");
-#endif
     if (anErr == noErr)
     {
 	anErr = AECreateDesc(typeProcessSerialNumber, &psn,
@@ -1088,9 +908,6 @@
 	    anErr = AESend(&theEvent, &theReply, sendMode, kAENormalPriority, kNoTimeOut, idleProcUPP, nil);
 	if (anErr == noErr  &&  sendMode == kAEWaitReply)
 	{
-#ifdef USE_SIOUX
-	    printf("KAHL_MOD: Send error: %d\n", anErr);
-#endif
 /*	    anErr =  AEHGetHandlerError(&theReply);*/
 	}
 	(void) AEDisposeDesc(&theReply);
@@ -1147,9 +964,6 @@
  *
  */
 
-#if defined(__MWERKS__)  /* only in Codewarrior */
-# pragma options align=mac68k
-#endif
 typedef struct SelectionRange SelectionRange;
 struct SelectionRange /* for handling kCoreClassEvent:kOpenDocuments:keyAEPosition typeChar */
 {
@@ -1160,9 +974,6 @@
     long unused2; // 0 (not used)
     long theDate; // modification date/time
 };
-#if defined(__MWERKS__)  /* only in Codewarrior */
-# pragma options align=reset
-#endif
 
 /* The IDE uses the optional keyAEPosition parameter to tell the ed-
    itor the selection range. If lineNum is zero or greater, scroll the text
@@ -1193,17 +1004,10 @@
     short	gotPosition = false;
     long	lnum;
 
-#ifdef USE_SIOUX
-    printf("aevt_odoc:\n");
-#endif
-
     /* the direct object parameter is the list of aliases to files (one or more) */
     error = AEGetParamDesc(theAEvent, keyDirectObject, typeAEList, &theList);
     if (error)
     {
-#ifdef USE_SIOUX
-	printf("aevt_odoc: AEGetParamDesc error: %ld\n", (long)error);
-#endif
 	return(error);
     }
 
@@ -1215,18 +1019,9 @@
 	error = noErr;
     if (error)
     {
-#ifdef USE_SIOUX
-	printf("aevt_odoc: AEGetParamPtr error: %ld\n", (long)error);
-#endif
 	return(error);
     }
 
-#ifdef USE_SIOUX
-    printf("aevt_odoc: lineNum: %d, startRange %ld, endRange %ld, [date %lx]\n",
-	    (int)thePosition.lineNum,
-	    (long)thePosition.startRange, (long)thePosition.endRange,
-	    (long)thePosition.theDate);
-#endif
 /*
     error = AEGetParamDesc(theAEvent, keyAEPosition, typeChar, &thePosition);
 
@@ -1330,9 +1125,6 @@
     error = HandleUnusedParms(theAEvent);
     if (error)
     {
-#ifdef USE_SIOUX
-	printf("aevt_odoc: HandleUnusedParms error: %ld\n", (long)error);
-#endif
 	return(error);
     }
     return(error);
@@ -1343,14 +1135,13 @@
  */
 
     pascal OSErr
-Handle_aevt_oapp_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+Handle_aevt_oapp_AE(
+	const AppleEvent    *theAEvent,
+	AppleEvent	    *theReply,
+	long		    refCon)
 {
     OSErr	error = noErr;
 
-#ifdef USE_SIOUX
-    printf("aevt_oapp:\n");
-#endif
-
     error = HandleUnusedParms(theAEvent);
     if (error)
     {
@@ -1365,14 +1156,13 @@
  */
 
     pascal OSErr
-Handle_aevt_quit_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+Handle_aevt_quit_AE(
+	const AppleEvent    *theAEvent,
+	AppleEvent	    *theReply,
+	long		    refCon)
 {
     OSErr	error = noErr;
 
-#ifdef USE_SIOUX
-    printf("aevt_quit\n");
-#endif
-
     error = HandleUnusedParms(theAEvent);
     if (error)
     {
@@ -1390,14 +1180,13 @@
  */
 
     pascal OSErr
-Handle_aevt_pdoc_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+Handle_aevt_pdoc_AE(
+	const AppleEvent    *theAEvent,
+	AppleEvent	    *theReply,
+	long		    refCon)
 {
     OSErr	error = noErr;
 
-#ifdef USE_SIOUX
-    printf("aevt_pdoc:\n");
-#endif
-
     error = HandleUnusedParms(theAEvent);
     if (error)
     {
@@ -1413,14 +1202,13 @@
  * (Just get rid of all the parms)
  */
     pascal OSErr
-Handle_unknown_AE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+Handle_unknown_AE(
+	const AppleEvent    *theAEvent,
+	AppleEvent	    *theReply,
+	long		    refCon)
 {
     OSErr	error = noErr;
 
-#ifdef USE_SIOUX
-    printf("Unknown Event: %x\n", theAEvent->descriptorType);
-#endif
-
     error = HandleUnusedParms(theAEvent);
     if (error)
     {
@@ -1431,11 +1219,6 @@
 }
 
 
-
-#if TARGET_API_MAC_CARBON
-# define NewAEEventHandlerProc(x) NewAEEventHandlerUPP(x)
-#endif
-
 /*
  * Install the various AppleEvent Handlers
  */
@@ -1446,7 +1229,7 @@
 
     /* install open application handler */
     error = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,
-		    NewAEEventHandlerProc(Handle_aevt_oapp_AE), 0, false);
+		    NewAEEventHandlerUPP(Handle_aevt_oapp_AE), 0, false);
     if (error)
     {
 	return error;
@@ -1454,7 +1237,7 @@
 
     /* install quit application handler */
     error = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
-		    NewAEEventHandlerProc(Handle_aevt_quit_AE), 0, false);
+		    NewAEEventHandlerUPP(Handle_aevt_quit_AE), 0, false);
     if (error)
     {
 	return error;
@@ -1462,7 +1245,7 @@
 
     /* install open document handler */
     error = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
-		    NewAEEventHandlerProc(HandleODocAE), 0, false);
+		    NewAEEventHandlerUPP(HandleODocAE), 0, false);
     if (error)
     {
 	return error;
@@ -1470,47 +1253,47 @@
 
     /* install print document handler */
     error = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments,
-		    NewAEEventHandlerProc(Handle_aevt_pdoc_AE), 0, false);
+		    NewAEEventHandlerUPP(Handle_aevt_pdoc_AE), 0, false);
 
 /* Install Core Suite */
 /*  error = AEInstallEventHandler(kAECoreSuite, kAEClone,
-		    NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
 
     error = AEInstallEventHandler(kAECoreSuite, kAEClose,
-		    NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
 
     error = AEInstallEventHandler(kAECoreSuite, kAECountElements,
-		    NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
 
     error = AEInstallEventHandler(kAECoreSuite, kAECreateElement,
-		    NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
 
     error = AEInstallEventHandler(kAECoreSuite, kAEDelete,
-		    NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
 
     error = AEInstallEventHandler(kAECoreSuite, kAEDoObjectsExist,
-		    NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
 
     error = AEInstallEventHandler(kAECoreSuite, kAEGetData,
-		    NewAEEventHandlerProc(Handle_unknown_AE), kAEGetData, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), kAEGetData, false);
 
     error = AEInstallEventHandler(kAECoreSuite, kAEGetDataSize,
-		    NewAEEventHandlerProc(Handle_unknown_AE), kAEGetDataSize, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), kAEGetDataSize, false);
 
     error = AEInstallEventHandler(kAECoreSuite, kAEGetClassInfo,
-		    NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
 
     error = AEInstallEventHandler(kAECoreSuite, kAEGetEventInfo,
-		    NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
 
     error = AEInstallEventHandler(kAECoreSuite, kAEMove,
-		    NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
 
     error = AEInstallEventHandler(kAECoreSuite, kAESave,
-		    NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
 
     error = AEInstallEventHandler(kAECoreSuite, kAESetData,
-		    NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+		    NewAEEventHandlerUPP(Handle_unknown_AE), nil, false);
 */
 
 #ifdef FEAT_CW_EDITOR
@@ -1518,19 +1301,19 @@
      * Bind codewarrior support handlers
      */
     error = AEInstallEventHandler('KAHL', 'GTTX',
-		    NewAEEventHandlerProc(Handle_KAHL_GTTX_AE), 0, false);
+		    NewAEEventHandlerUPP(Handle_KAHL_GTTX_AE), 0, false);
     if (error)
     {
 	return error;
     }
     error = AEInstallEventHandler('KAHL', 'SRCH',
-		    NewAEEventHandlerProc(Handle_KAHL_SRCH_AE), 0, false);
+		    NewAEEventHandlerUPP(Handle_KAHL_SRCH_AE), 0, false);
     if (error)
     {
 	return error;
     }
     error = AEInstallEventHandler('KAHL', 'MOD ',
-		    NewAEEventHandlerProc(Handle_KAHL_MOD_AE), 0, false);
+		    NewAEEventHandlerUPP(Handle_KAHL_MOD_AE), 0, false);
     if (error)
     {
 	return error;
@@ -1543,14 +1326,15 @@
 #endif /* USE_AEVENT */
 
 
-#if defined(USE_CARBONIZED) && defined(MACOS_X)
 /*
  * Callback function, installed by InstallFontPanelHandler(), below,
  * to handle Font Panel events.
  */
     static OSStatus
-FontPanelHandler(EventHandlerCallRef inHandlerCallRef, EventRef inEvent,
-    void *inUserData)
+FontPanelHandler(
+	EventHandlerCallRef inHandlerCallRef,
+	EventRef inEvent,
+	void *inUserData)
 {
     if (GetEventKind(inEvent) == kEventFontPanelClosed)
     {
@@ -1590,7 +1374,7 @@
 
 
     static void
-InstallFontPanelHandler()
+InstallFontPanelHandler(void)
 {
     EventTypeSpec eventTypes[2];
     EventHandlerUPP handlerUPP;
@@ -1654,7 +1438,6 @@
 	*outName = NUL;
     }
 }
-#endif
 
 
 /*
@@ -1669,8 +1452,7 @@
  *  Returns the index inside the menu wher
  */
     short /* Shoulde we return MenuItemIndex? */
-gui_mac_get_menu_item_index(pMenu)
-    vimmenu_T *pMenu;
+gui_mac_get_menu_item_index(vimmenu_T *pMenu)
 {
     short	index;
     short	itemIndex = -1;
@@ -1695,21 +1477,12 @@
 	    index++;
 	    pBrother = pBrother->next;
 	}
-#ifdef USE_HELPMENU
-	/* Adjust index in help menu (for predefined ones) */
-	if (itemIndex != -1)
-	    if (pMenu->parent->submenu_id == kHMHelpMenuID)
-		itemIndex += gui.MacOSHelpItems;
-#endif
     }
     return itemIndex;
 }
 
     static vimmenu_T *
-gui_mac_get_vim_menu(menuID, itemIndex, pMenu)
-    short	menuID;
-    short	itemIndex;
-    vimmenu_T	*pMenu;
+gui_mac_get_vim_menu(short menuID, short itemIndex, vimmenu_T *pMenu)
 {
     short	index;
     vimmenu_T	*pChildMenu;
@@ -1726,11 +1499,6 @@
 
     if ((pElder) && (pElder->submenu_id == menuID))
     {
-#ifdef USE_HELPMENU
-	if (menuID == kHMHelpMenuID)
-	    itemIndex -= gui.MacOSHelpItems;
-#endif
-
 	for (index = 1; (index != itemIndex) && (pMenu != NULL); index++)
 	    pMenu = pMenu->next;
     }
@@ -1879,9 +1647,7 @@
  * TODO: Add support for potential TOOLBAR
  */
     void
-gui_mac_doInContentClick(theEvent, whichWindow)
-    EventRecord *theEvent;
-    WindowPtr	 whichWindow;
+gui_mac_doInContentClick(EventRecord *theEvent, WindowPtr whichWindow)
 {
     Point		thePoint;
     int_u		vimModifiers;
@@ -1930,8 +1696,8 @@
 	/* Defaults to MOUSE_LEFT as there's only one mouse button */
 	vimMouseButton = MOUSE_LEFT;
 
-#ifdef USE_CTRLCLICKMENU
 	/* Convert the CTRL_MOUSE_LEFT to MOUSE_RIGHT */
+	/* TODO: NEEDED? */
 	clickIsPopup = FALSE;
 
 	if ((gui.MacOSHaveCntxMenu) && (mouse_model_popup()))
@@ -1941,26 +1707,23 @@
 		vimModifiers &= ~MOUSE_CTRL;
 		clickIsPopup = TRUE;
 	    }
-#endif
 
 	/* Is it a double click ? */
 	dblClick = ((theEvent->when - lastMouseTick) < GetDblTime());
 
-	/* Send the mouse clicj to Vim */
+	/* Send the mouse click to Vim */
 	gui_send_mouse_event(vimMouseButton, thePoint.h,
 					  thePoint.v, dblClick, vimModifiers);
 
 	/* Create the rectangle around the cursor to detect
 	 * the mouse dragging
 	 */
-#ifdef USE_CTRLCLICKMENU
 #if 0
 	/* TODO: Do we need to this even for the contextual menu?
 	 * It may be require for popup_setpos, but for popup?
 	 */
 	if (vimMouseButton == MOUSE_LEFT)
 #endif
-#endif
 	{
 	    SetRect(&dragRect, FILL_X(X_2_COL(thePoint.h)),
 				FILL_Y(Y_2_ROW(thePoint.v)),
@@ -1977,19 +1740,13 @@
  * Handle the click in the titlebar (to move the window)
  */
     void
-gui_mac_doInDragClick(where, whichWindow)
-    Point	where;
-    WindowPtr	whichWindow;
+gui_mac_doInDragClick(Point where, WindowPtr whichWindow)
 {
     Rect	movingLimits;
     Rect	*movingLimitsPtr = &movingLimits;
 
     /* TODO: may try to prevent move outside screen? */
-#ifdef USE_CARBONIZED
     movingLimitsPtr = GetRegionBounds(GetGrayRgn(), &movingLimits);
-#else
-    movingLimitsPtr = &(*GetGrayRgn())->rgnBBox;
-#endif
     DragWindow(whichWindow, where, movingLimitsPtr);
 }
 
@@ -1997,9 +1754,7 @@
  * Handle the click in the grow box
  */
     void
-gui_mac_doInGrowClick(where, whichWindow)
-    Point	where;
-    WindowPtr	whichWindow;
+gui_mac_doInGrowClick(Point where, WindowPtr whichWindow)
 {
 
     long	    newSize;
@@ -2007,71 +1762,28 @@
     unsigned short  newHeight;
     Rect	    resizeLimits;
     Rect	    *resizeLimitsPtr = &resizeLimits;
-#ifdef USE_CARBONIZED
     Rect	    NewContentRect;
 
     resizeLimitsPtr = GetRegionBounds(GetGrayRgn(), &resizeLimits);
-#else
-    resizeLimits = qd.screenBits.bounds;
-#endif
 
     /* Set the minimun size */
     /* TODO: Should this come from Vim? */
     resizeLimits.top = 100;
     resizeLimits.left = 100;
 
-#ifdef USE_CARBONIZED
     newSize = ResizeWindow(whichWindow, where, &resizeLimits, &NewContentRect);
     newWidth  = NewContentRect.right - NewContentRect.left;
     newHeight = NewContentRect.bottom - NewContentRect.top;
     gui_resize_shell(newWidth, newHeight);
     gui_mch_set_bg_color(gui.back_pixel);
     gui_set_shellsize(TRUE, FALSE);
-#else
-    newSize = GrowWindow(whichWindow, where, &resizeLimits);
-    if (newSize != 0)
-    {
-	newWidth  = newSize & 0x0000FFFF;
-	newHeight = (newSize >> 16) & 0x0000FFFF;
-
-	gui_mch_set_bg_color(gui.back_pixel);
-
-	gui_resize_shell(newWidth, newHeight);
-
-	/*
-	 * We need to call gui_set_shellsize as the size
-	 * used by Vim may be smaller than the size selected
-	 * by the user. This cause some overhead
-	 * TODO: add a check inside gui_resize_shell?
-	 */
-	gui_set_shellsize(TRUE, FALSE);
-
-	/*
-	 * Origin of the code below is unknown.
-	 * Functionality is unknown.
-	 * Time of commented out is unknown.
-	 */
-/*	SetPort(wp);
-	InvalRect(&wp->portRect);
-	if (isUserWindow(wp)) {
-	    DrawingWindowPeek	aWindow = (DrawingWindowPeek)wp;
-
-	    if (aWindow->toolRoutines.toolWindowResizedProc)
-		CallToolWindowResizedProc(aWindow->toolRoutines.toolWindowResizedProc, wp);
-	}*/
-    };
-#endif
-
 }
 
 /*
  * Handle the click in the zoom box
  */
-#ifdef USE_CARBONIZED
     static void
-gui_mac_doInZoomClick(theEvent, whichWindow)
-    EventRecord	*theEvent;
-    WindowPtr	whichWindow;
+gui_mac_doInZoomClick(EventRecord *theEvent, WindowPtr whichWindow)
 {
     Rect	r;
     Point	p;
@@ -2110,7 +1822,6 @@
     gui_mch_set_bg_color(gui.back_pixel);
     gui_set_shellsize(TRUE, FALSE);
 }
-#endif /* defined(USE_CARBONIZED) */
 
 /*
  * ------------------------------------------------------------
@@ -2123,26 +1834,21 @@
  */
 
     void
-gui_mac_doUpdateEvent(event)
-    EventRecord	*event;
+gui_mac_doUpdateEvent(EventRecord *event)
 {
     WindowPtr	whichWindow;
     GrafPtr	savePort;
     RgnHandle	updateRgn;
-#ifdef USE_CARBONIZED
     Rect	updateRect;
-#endif
     Rect	*updateRectPtr;
     Rect	rc;
     Rect	growRect;
     RgnHandle	saveRgn;
 
 
-#ifdef USE_CARBONIZED
     updateRgn = NewRgn();
     if (updateRgn == NULL)
 	return;
-#endif
 
     /* This could be done by the caller as we
      * don't require anything else out of the event
@@ -2153,18 +1859,13 @@
     GetPort(&savePort);
 
     /* Select the Window's Port */
-#ifdef USE_CARBONIZED
     SetPortWindowPort(whichWindow);
-#else
-    SetPort(whichWindow);
-#endif
 
     /* Let's update the window */
       BeginUpdate(whichWindow);
 	/* Redraw the biggest rectangle covering the area
 	 * to be updated.
 	 */
-#ifdef USE_CARBONIZED
 	GetPortVisibleRegion(GetWindowPort(whichWindow), updateRgn);
 # if 0
 	/* Would be more appropriate to use the follwing but doesn't
@@ -2172,12 +1873,10 @@
 	 */
 	GetWindowRegion(whichWindow, kWindowUpdateRgn, updateRgn);
 # endif
-#else
-	updateRgn = whichWindow->visRgn;
-#endif
+
 	/* Use the HLock useless in Carbon? Is it harmful?*/
 	HLock((Handle) updateRgn);
-#ifdef USE_CARBONIZED
+
 	  updateRectPtr = GetRegionBounds(updateRgn, &updateRect);
 # if 0
 	  /* Code from original Carbon Port (using GetWindowRegion.
@@ -2186,9 +1885,6 @@
 	  GlobalToLocal(&topLeft(updateRect)); /* preCarbon? */
 	  GlobalToLocal(&botRight(updateRect));
 # endif
-#else
-	  updateRectPtr = &(*updateRgn)->rgnBBox;
-#endif
 	  /* Update the content (i.e. the text) */
 	  gui_redraw(updateRectPtr->left, updateRectPtr->top,
 		      updateRectPtr->right - updateRectPtr->left,
@@ -2218,9 +1914,7 @@
 	    EraseRect(&rc);
 	  }
 	HUnlock((Handle) updateRgn);
-#ifdef USE_CARBONIZED
 	DisposeRgn(updateRgn);
-#endif
 
 	/* Update scrollbars */
 	DrawControls(whichWindow);
@@ -2228,13 +1922,7 @@
 	/* Update the GrowBox */
 	/* Taken from FAQ 33-27 */
 	saveRgn = NewRgn();
-#ifdef USE_CARBONIZED
 	GetWindowBounds(whichWindow, kWindowGrowRgn, &growRect);
-#else
-	growRect = whichWindow->portRect;
-	growRect.top  = growRect.bottom - 15;
-	growRect.left = growRect.right  - 15;
-#endif
 	GetClip(saveRgn);
 	ClipRect(&growRect);
 	DrawGrowIcon(whichWindow);
@@ -2251,8 +1939,7 @@
  * (apply to a window)
  */
     void
-gui_mac_doActivateEvent(event)
-    EventRecord	*event;
+gui_mac_doActivateEvent(EventRecord *event)
 {
     WindowPtr	whichWindow;
 
@@ -2283,8 +1970,7 @@
  * (apply to the application)
  */
     void
-gui_mac_doSuspendEvent(event)
-    EventRecord	*event;
+gui_mac_doSuspendEvent(EventRecord *event)
 {
     /* The frontmost application just changed */
 
@@ -2309,7 +1995,9 @@
 #ifdef USE_CARBONKEYHANDLER
 # define INLINE_KEY_BUFFER_SIZE 80
     static pascal OSStatus
-gui_mac_doKeyEventCarbon(EventHandlerCallRef nextHandler, EventRef theEvent,
+gui_mac_doKeyEventCarbon(
+	EventHandlerCallRef nextHandler,
+	EventRef theEvent,
 	void *data)
 {
     /* Multibyte-friendly key event handler */
@@ -2666,8 +2354,7 @@
  * Handle MouseClick
  */
     void
-gui_mac_doMouseDownEvent(theEvent)
-    EventRecord *theEvent;
+gui_mac_doMouseDownEvent(EventRecord *theEvent)
 {
     short		thePart;
     WindowPtr		whichWindow;
@@ -2703,9 +2390,7 @@
 
 	case (inZoomIn):
 	case (inZoomOut):
-#ifdef USE_CARBONIZED
 	    gui_mac_doInZoomClick(theEvent, whichWindow);
-#endif
 	    break;
     }
 }
@@ -2715,8 +2400,7 @@
  * [this event is a moving in and out of a region]
  */
     void
-gui_mac_doMouseMovedEvent(event)
-    EventRecord *event;
+gui_mac_doMouseMovedEvent(EventRecord *event)
 {
     Point   thePoint;
     int_u   vimModifiers;
@@ -2728,9 +2412,7 @@
     if (!Button())
 	gui_mouse_moved(thePoint.h, thePoint.v);
     else
-#ifdef USE_CTRLCLICKMENU
 	if (!clickIsPopup)
-#endif
 	    gui_send_mouse_event(MOUSE_DRAG, thePoint.h,
 					     thePoint.v, FALSE, vimModifiers);
 
@@ -2749,8 +2431,7 @@
  * Handle the mouse release
  */
     void
-gui_mac_doMouseUpEvent(theEvent)
-    EventRecord *theEvent;
+gui_mac_doMouseUpEvent(EventRecord *theEvent)
 {
     Point   thePoint;
     int_u   vimModifiers;
@@ -2764,17 +2445,14 @@
     GlobalToLocal(&thePoint);
 
     vimModifiers = EventModifiers2VimMouseModifiers(theEvent->modifiers);
-#ifdef USE_CTRLCLICKMENU
     if (clickIsPopup)
     {
 	vimModifiers &= ~MOUSE_CTRL;
 	clickIsPopup = FALSE;
     }
-#endif
     gui_send_mouse_event(MOUSE_RELEASE, thePoint.h, thePoint.v, FALSE, vimModifiers);
 }
 
-#ifdef USE_MOUSEWHEEL
     static pascal OSStatus
 gui_mac_mouse_wheel(EventHandlerCallRef nextHandler, EventRef theEvent,
 								   void *data)
@@ -2832,7 +2510,6 @@
      */
     return CallNextEventHandler(nextHandler, theEvent);
 }
-#endif /* defined(USE_MOUSEWHEEL) */
 
 #if 0
 
@@ -2876,30 +2553,16 @@
  * Handle menubar selection
  */
     void
-gui_mac_handle_menu(menuChoice)
-    long menuChoice;
+gui_mac_handle_menu(long menuChoice)
 {
     short	menu = HiWord(menuChoice);
     short	item = LoWord(menuChoice);
     vimmenu_T	*theVimMenu = root_menu;
-#ifndef USE_CARBONIZED
-    MenuHandle	appleMenu;
-    Str255	itemName;
-#endif
 
     if (menu == 256)  /* TODO: use constant or gui.xyz */
     {
 	if (item == 1)
 	    gui_mch_beep(); /* TODO: Popup dialog or do :intro */
-	else
-	{
-#ifndef USE_CARBONIZED
-	    /* Desk Accessory doesn't exist in Carbon */
-	    appleMenu = GetMenuHandle(menu);
-	    GetMenuItemText(appleMenu, item, itemName);
-	    (void) OpenDeskAcc(itemName);
-#endif
-	}
     }
     else if (item != 0)
     {
@@ -2916,13 +2579,11 @@
  */
 
     void
-gui_mac_handle_event(event)
-    EventRecord *event;
+gui_mac_handle_event(EventRecord *event)
 {
     OSErr	error;
 
     /* Handle contextual menu right now (if needed) */
-#ifdef USE_CTRLCLICKMENU
     if (gui.MacOSHaveCntxMenu)
 	if (IsShowContextualMenuClick(event))
 	{
@@ -2933,7 +2594,6 @@
 # endif
 	    return;
 	}
-#endif
 
     /* Handle normal event */
     switch (event->what)
@@ -2997,8 +2657,7 @@
 
 
     GuiFont
-gui_mac_find_font(font_name)
-    char_u *font_name;
+gui_mac_find_font(char_u *font_name)
 {
     char_u	c;
     char_u	*p;
@@ -3023,7 +2682,6 @@
     *p = c;
 
     /* Get the font name, minus the style suffix (:h, etc) */
-#if defined(MACOS_X) && defined(USE_CARBONIZED)
     char_u fontName[256];
     char_u *styleStart = vim_strchr(font_name, ':');
     size_t fontNameLen = styleStart ? styleStart - font_name : STRLEN(fontName);
@@ -3040,9 +2698,6 @@
 	if (FMGetFontFamilyInstanceFromFont(fontRef, &font_id, &fontStyle) != noErr)
 	    font_id = 0;
     }
-#else
-    GetFNum(pFontName, &font_id);
-#endif
 
     if (font_id == 0)
     {
@@ -3062,7 +2717,6 @@
 	    }
 	}
 	if (changed)
-#if defined(MACOS_X) && defined(USE_CARBONIZED)
 	    if (ATSUFindFontFromName(&pFontName[1], pFontName[0],
 			kFontFullName, kFontNoPlatformCode, kFontNoScriptCode,
 			kFontNoLanguageCode, &fontRef) == noErr)
@@ -3070,9 +2724,6 @@
 		if (FMGetFontFamilyInstanceFromFont(fontRef, &font_id, &fontStyle) != noErr)
 		    font_id = 0;
 	    }
-#else
-	    GetFNum(pFontName, &font_id);
-#endif
     }
 
 #else
@@ -3087,12 +2738,8 @@
     {
 	/* Oups, the system font was it the one the user want */
 
-#if defined(MACOS_X) && defined(USE_CARBONIZED)
 	if (FMGetFontFamilyName(systemFont, systemFontname) != noErr)
 	    return NOFONT;
-#else
-	GetFontName(0, systemFontname);
-#endif
 	if (!EqualString(pFontName, systemFontname, false, false))
 	    return NOFONT;
     }
@@ -3136,9 +2783,7 @@
  * when vim is started, whether or not the GUI has been started.
  */
     void
-gui_mch_prepare(argc, argv)
-    int		*argc;
-    char	**argv;
+gui_mch_prepare(int *argc, char **argv)
 {
     /* TODO: Move most of this stuff toward gui_mch_init */
 #ifdef USE_EXE_NAME
@@ -3153,34 +2798,18 @@
 # endif
 #endif
 
-#ifndef USE_CARBONIZED
-    MaxApplZone();	    /* What could replace thos */
-    /* In Carbon, all shared library are automatically load in
-     * there's no need to init them
-     */
-    InitGraf(&qd.thePort);
-    InitFonts();
-    InitWindows();
-    InitMenus();
-    TEInit();
-    InitDialogs(nil);
-#else
     /* Why did I put that in? (Dany) */
     MoreMasterPointers (0x40 * 3); /* we love handles */
-#endif
 
 #if 0
     InitCursor();
 
-#ifdef USE_CARBONIZED
     RegisterAppearanceClient();
-#endif
 
 #ifdef USE_AEVENT
     (void) InstallAEHandlers();
 #endif
 
-#ifdef USE_CTRLCLICKMENU
     if (Gestalt(gestaltContextualMenuAttr, &gestalt_rc) == noErr)
 	gui.MacOSHaveCntxMenu = BitTst(&gestalt_rc, 31-gestaltContextualMenuTrapAvailable);
     else
@@ -3188,28 +2817,10 @@
 
     if (gui.MacOSHaveCntxMenu)
 	gui.MacOSHaveCntxMenu = (InitContextualMenus()==noErr);
-#endif
-
-#ifdef USE_SIOUX
-    SIOUXSettings.standalone = false;
-    SIOUXSettings.initializeTB = false;
-    SIOUXSettings.setupmenus = false;
-    SIOUXSettings.asktosaveonclose = false;
-    SIOUXSettings.showstatusline = true;
-    SIOUXSettings.toppixel = 300;
-    SIOUXSettings.leftpixel = 10;
-    InstallConsole(1); /* fileno(stdout) = 1, on page 430 of MSL C */
-    printf("Debugging console enabled\n");
-    /*	SIOUXSetTitle((char_u *) "Vim Stdout"); */
-#endif
 
     pomme = NewMenu(256, "\p\024"); /* 0x14= = Apple Menu */
 
     AppendMenu(pomme, "\pAbout VIM");
-#ifndef USE_CARBONIZED
-    AppendMenu(pomme, "\p-");
-    AppendResMenu(pomme, 'DRVR');
-#endif
 
     InsertMenu(pomme, 0);
 
@@ -3223,16 +2834,10 @@
 #endif
 
 
-#ifdef USE_CARBONIZED
     CreateNewWindow(kDocumentWindowClass,
 		kWindowResizableAttribute | kWindowCollapseBoxAttribute,
 		&windRect, &gui.VimWindow);
     SetPortWindowPort(gui.VimWindow);
-#else
-    gui.VimWindow = NewCWindow(nil, &windRect, "\pgVim on Macintosh", true, documentProc,
-			(WindowPtr) -1L, false, 0);
-    SetPort(gui.VimWindow);
-#endif
 
     gui.char_width = 7;
     gui.char_height = 11;
@@ -3241,27 +2846,8 @@
     gui.num_cols = 80;
     gui.in_focus = TRUE; /* For the moment -> syn. of front application */
 
-#if TARGET_API_MAC_CARBON
     gScrollAction = NewControlActionUPP(gui_mac_scroll_action);
     gScrollDrag   = NewControlActionUPP(gui_mac_drag_thumb);
-#else
-    gScrollAction = NewControlActionProc(gui_mac_scroll_action);
-    gScrollDrag   = NewControlActionProc(gui_mac_drag_thumb);
-#endif
-
-    /* Getting a handle to the Help menu */
-#ifdef USE_HELPMENU
-# ifdef USE_CARBONIZED
-    HMGetHelpMenu(&gui.MacOSHelpMenu, NULL);
-# else
-    (void) HMGetHelpMenuHandle(&gui.MacOSHelpMenu);
-# endif
-
-    if (gui.MacOSHelpMenu != nil)
-	gui.MacOSHelpItems = CountMenuItems(gui.MacOSHelpMenu);
-    else
-	gui.MacOSHelpItems = 0;
-#endif
 
     dragRectEnbl = FALSE;
     dragRgn = NULL;
@@ -3290,11 +2876,6 @@
 # endif
     exe_name = FullPathFromFSSpec_save(applDir);
 #endif
-
-#ifdef USE_VIM_CREATOR_ID
-    _fcreator = 'VIM!';
-    _ftype = 'TEXT';
-#endif
 }
 
 #ifndef ALWAYS_USE_GUI
@@ -3377,39 +2958,31 @@
  * etc.
  */
     int
-gui_mch_init()
+gui_mch_init(void)
 {
     /* TODO: Move most of this stuff toward gui_mch_init */
     Rect	windRect;
     MenuHandle	pomme;
-#ifdef USE_CTRLCLICKMENU
     long	gestalt_rc;
-#endif
-#ifdef USE_MOUSEWHEEL
     EventTypeSpec   eventTypeSpec;
     EventHandlerRef mouseWheelHandlerRef;
-#endif
 #ifdef USE_CARBONKEYHANDLER
     EventHandlerRef keyEventHandlerRef;
 #endif
 
-#ifdef MACOS_X
     if (Gestalt(gestaltSystemVersion, &gMacSystemVersion) != noErr)
-	gMacSystemVersion = 0x1000; /* Default to minimum sensible value */
-#endif
+	gMacSystemVersion = 0x1000; /* TODO: Default to minimum sensible value */
 
 #if 1
     InitCursor();
 
-#ifdef USE_CARBONIZED
     RegisterAppearanceClient();
-#endif
 
 #ifdef USE_AEVENT
     (void) InstallAEHandlers();
 #endif
 
-#ifdef USE_CTRLCLICKMENU
+    /* Ctrl click */
     if (Gestalt(gestaltContextualMenuAttr, &gestalt_rc) == noErr)
 	gui.MacOSHaveCntxMenu = BitTst(&gestalt_rc, 31-gestaltContextualMenuTrapAvailable);
     else
@@ -3417,28 +2990,10 @@
 
     if (gui.MacOSHaveCntxMenu)
 	gui.MacOSHaveCntxMenu = (InitContextualMenus()==noErr);
-#endif
-
-#ifdef USE_SIOUX
-    SIOUXSettings.standalone = false;
-    SIOUXSettings.initializeTB = false;
-    SIOUXSettings.setupmenus = false;
-    SIOUXSettings.asktosaveonclose = false;
-    SIOUXSettings.showstatusline = true;
-    SIOUXSettings.toppixel = 300;
-    SIOUXSettings.leftpixel = 10;
-    InstallConsole(1); /* fileno(stdout) = 1, on page 430 of MSL C */
-    printf("Debugging console enabled\n");
-    /*	SIOUXSetTitle((char_u *) "Vim Stdout"); */
-#endif
 
     pomme = NewMenu(256, "\p\024"); /* 0x14= = Apple Menu */
 
     AppendMenu(pomme, "\pAbout VIM");
-#ifndef USE_CARBONIZED
-    AppendMenu(pomme, "\p-");
-    AppendResMenu(pomme, 'DRVR');
-#endif
 
     InsertMenu(pomme, 0);
 
@@ -3452,19 +3007,11 @@
 #endif
 
     gui.VimWindow = NewCWindow(nil, &windRect, "\pgVim on Macintosh", true,
-#ifdef USE_CARBONIZED
 			zoomDocProc,
-#else
-			documentProc,
-#endif
 			(WindowPtr)-1L, true, 0);
     InstallReceiveHandler((DragReceiveHandlerUPP)receiveHandler,
 	    gui.VimWindow, NULL);
-#ifdef USE_CARBONIZED
     SetPortWindowPort(gui.VimWindow);
-#else
-    SetPort(gui.VimWindow);
-#endif
 
     gui.char_width = 7;
     gui.char_height = 11;
@@ -3473,32 +3020,11 @@
     gui.num_cols = 80;
     gui.in_focus = TRUE; /* For the moment -> syn. of front application */
 
-#if TARGET_API_MAC_CARBON
     gScrollAction = NewControlActionUPP(gui_mac_scroll_action);
     gScrollDrag   = NewControlActionUPP(gui_mac_drag_thumb);
-#else
-    gScrollAction = NewControlActionProc(gui_mac_scroll_action);
-    gScrollDrag   = NewControlActionProc(gui_mac_drag_thumb);
-#endif
 
-#if defined(USE_CARBONIZED) && defined(MACOS_X)
     /* Install Carbon event callbacks. */
     (void)InstallFontPanelHandler();
-#endif
-
-    /* Getting a handle to the Help menu */
-#ifdef USE_HELPMENU
-# ifdef USE_CARBONIZED
-    HMGetHelpMenu(&gui.MacOSHelpMenu, NULL);
-# else
-    (void) HMGetHelpMenuHandle(&gui.MacOSHelpMenu);
-# endif
-
-    if (gui.MacOSHelpMenu != nil)
-	gui.MacOSHelpItems = CountMenuItems(gui.MacOSHelpMenu);
-    else
-	gui.MacOSHelpItems = 0;
-#endif
 
     dragRectEnbl = FALSE;
     dragRgn = NULL;
@@ -3538,13 +3064,10 @@
     gui.scrollbar_height = gui.scrollbar_width = 15; /* cheat 1 overlap */
     gui.border_offset = gui.border_width = 2;
 
-#if defined(FEAT_GUI) && defined(MACOS_X)
     /* If Quartz-style text antialiasing is available (see
        gui_mch_draw_string() below), enable it for all font sizes. */
     vim_setenv((char_u *)"QDTEXT_MINSIZE", (char_u *)"1");
-#endif
 
-#ifdef USE_MOUSEWHEEL
     eventTypeSpec.eventClass = kEventClassMouse;
     eventTypeSpec.eventKind = kEventMouseWheelMoved;
     mouseWheelHandlerUPP = NewEventHandlerUPP(gui_mac_mouse_wheel);
@@ -3555,7 +3078,6 @@
 	DisposeEventHandlerUPP(mouseWheelHandlerUPP);
 	mouseWheelHandlerUPP = NULL;
     }
-#endif
 
 #ifdef USE_CARBONKEYHANDLER
     eventTypeSpec.eventClass = kEventClassTextInput;
@@ -3584,7 +3106,7 @@
  * Called when the foreground or background color has been changed.
  */
     void
-gui_mch_new_colors()
+gui_mch_new_colors(void)
 {
     /* TODO:
      * This proc is called when Normal is set to a value
@@ -3596,14 +3118,13 @@
  * Open the GUI window which was created by a call to gui_mch_init().
  */
     int
-gui_mch_open()
+gui_mch_open(void)
 {
     ShowWindow(gui.VimWindow);
 
     if (gui_win_x != -1 && gui_win_y != -1)
 	gui_mch_set_winpos(gui_win_x, gui_win_y);
 
-#ifdef USE_CARBONIZED
     /*
      * Make the GUI the foreground process (in case it was launched
      * from the Terminal or via :gui).
@@ -3613,7 +3134,6 @@
 	if (GetCurrentProcess(&psn) == noErr)
 	    SetFrontProcess(&psn);
     }
-#endif
 
     return OK;
 }
@@ -3629,10 +3149,8 @@
 	DisposeEventHandlerUPP(keyEventHandlerUPP);
 #endif
 
-#ifdef USE_MOUSEWHEEL
     if (mouseWheelHandlerUPP != NULL)
 	DisposeEventHandlerUPP(mouseWheelHandlerUPP);
-#endif
 
 #ifdef USE_ATSUI_DRAWING
     if (gFontStyle)
@@ -3650,7 +3168,6 @@
 gui_mch_get_winpos(int *x, int *y)
 {
     /* TODO */
-#ifdef USE_CARBONIZED
     Rect	bounds;
     OSStatus	status;
 
@@ -3662,7 +3179,6 @@
     *x = bounds.left;
     *y = bounds.top;
     return OK;
-#endif
     return FAIL;
 }
 
@@ -3688,34 +3204,23 @@
     int		base_width,
     int		base_height)
 {
-#ifdef USE_CARBONIZED
     CGrafPtr	VimPort;
     Rect	VimBound;
-#endif
 
     if (gui.which_scrollbars[SBAR_LEFT])
     {
-#ifdef USE_CARBONIZED
 	VimPort = GetWindowPort(gui.VimWindow);
 	GetPortBounds(VimPort, &VimBound);
 	VimBound.left = -gui.scrollbar_width; /* + 1;*/
 	SetPortBounds(VimPort, &VimBound);
     /*	GetWindowBounds(gui.VimWindow, kWindowGlobalPortRgn, &winPortRect); ??*/
-#else
-	gui.VimWindow->portRect.left = -gui.scrollbar_width; /* + 1;*/
-    /*	SetWindowBounds(gui.VimWindow, kWindowGlobalPortRgn, &winPortRect); ??*/
-#endif
     }
     else
     {
-#ifdef USE_CARBONIZED
 	VimPort = GetWindowPort(gui.VimWindow);
 	GetPortBounds(VimPort, &VimBound);
 	VimBound.left = 0;
 	SetPortBounds(VimPort, &VimBound);
-#else
-	gui.VimWindow->portRect.left = 0;
-#endif;
     }
 
     SizeWindow(gui.VimWindow, width, height, TRUE);
@@ -3730,9 +3235,7 @@
  * TODO: Add live udate of those value on suspend/resume.
  */
     void
-gui_mch_get_screen_dimensions(screen_w, screen_h)
-    int		*screen_w;
-    int		*screen_h;
+gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
 {
     GDHandle	dominantDevice = GetMainDevice();
     Rect	screenRect = (**dominantDevice).gdRect;
@@ -3742,7 +3245,6 @@
 }
 
 
-#if defined(USE_CARBONIZED) && defined(MACOS_X)
 /*
  * Open the Font Panel and wait for the user to select a font and
  * close the panel.  Then fill the buffer pointed to by font_name with
@@ -3790,7 +3292,6 @@
     }
     return selected_font;
 }
-#endif
 
 
 /*
@@ -3798,9 +3299,7 @@
  * could not be loaded, OK otherwise.
  */
     int
-gui_mch_init_font(font_name, fontset)
-    char_u	*font_name;
-    int		fontset;	    /* not used */
+gui_mch_init_font(char_u *font_name, int fontset)
 {
     /* TODO: Add support for bold italic underline proportional etc... */
     Str255	suggestedFont = "\pMonaco";
@@ -3833,7 +3332,6 @@
 	    STRCPY(used_font_name, "Monaco");
 	font = (suggestedSize << 16) + ((long) font_id & 0xFFFF);
     }
-#if defined(USE_CARBONIZED) && defined(MACOS_X)
     else if (STRCMP(font_name, "*") == 0)
     {
 	char_u *new_p_guifont;
@@ -3857,7 +3355,6 @@
 	    }
 	}
     }
-#endif
     else
     {
 	font = gui_mac_find_font(font_name);
@@ -3893,12 +3390,12 @@
 	/* No antialiasing by default (do not attempt to touch antialising
 	 * options on pre-Jaguar) */
 	fontOptions =
-#ifdef MACOS_X
 	    (gMacSystemVersion >= 0x1020) ?
 	    kATSStyleNoAntiAliasing :
-#endif
 	    kATSStyleNoOptions;
 
+	printf("BLA\n");
+
 	ATSUAttributeTag attribTags[] =
 	{
 	    kATSUFontTag, kATSUSizeTag, kATSUStyleRenderingOptionsTag,
@@ -3936,7 +3433,7 @@
  * Adjust gui.char_height (after 'linespace' was changed).
  */
     int
-gui_mch_adjust_charheight()
+gui_mch_adjust_charheight(void)
 {
     FontInfo    font_info;
 
@@ -3950,9 +3447,7 @@
  * Get a font structure for highlighting.
  */
     GuiFont
-gui_mch_get_font(name, giveErrorIfMissing)
-    char_u	*name;
-    int		giveErrorIfMissing;
+gui_mch_get_font(char_u *name, int giveErrorIfMissing)
 {
     GuiFont font;
 
@@ -3977,9 +3472,7 @@
  * Don't know how to get the actual name, thus use the provided name.
  */
     char_u *
-gui_mch_get_fontname(font, name)
-    GuiFont font;
-    char_u  *name;
+gui_mch_get_fontname(GuiFont font, char_u *name)
 {
     if (name == NULL)
 	return NULL;
@@ -3991,8 +3484,7 @@
  * Set the current text font.
  */
     void
-gui_mch_set_font(font)
-    GuiFont	font;
+gui_mch_set_font(GuiFont font)
 {
 #ifdef USE_ATSUI_DRAWING
     GuiFont			currFont;
@@ -4019,13 +3511,11 @@
 	 * but it's mainly because a) latin (non-wide) aliased fonts
 	 * look bad in OS X 10.3.x and below (due to a bug in ATS), and
 	 * b) wide multibyte input does not suffer from that problem. */
-	fontOptions =
-#ifdef MACOS_X
+	/*fontOptions =
 	    (p_antialias && (font == gui.wide_font)) ?
 	    kATSStyleNoOptions : kATSStyleNoAntiAliasing;
-#else
-	    kATSStyleNoOptions;
-#endif
+	*/
+	/*fontOptions = kATSStyleAntiAliasing;*/
 
 	ATSUAttributeTag attribTags[] =
 	{
@@ -4106,8 +3596,7 @@
 }
 
     static int
-hex_digit(c)
-    int		c;
+hex_digit(int c)
 {
     if (isdigit(c))
 	return c - '0';
@@ -4124,8 +3613,7 @@
  * Return INVALCOLOR when failed.
  */
     guicolor_T
-gui_mch_get_color(name)
-    char_u *name;
+gui_mch_get_color(char_u *name)
 {
     /* TODO: Add support for the new named color of MacOS 8
      */
@@ -4204,7 +3692,6 @@
 		return table[i].color;
     }
 
-
     /*
      * Last attempt. Look in the file "$VIM/rgb.txt".
      */
@@ -4263,8 +3750,7 @@
  * Set the current text foreground color.
  */
     void
-gui_mch_set_fg_color(color)
-    guicolor_T	color;
+gui_mch_set_fg_color(guicolor_T color)
 {
     RGBColor TheColor;
 
@@ -4279,8 +3765,7 @@
  * Set the current text background color.
  */
     void
-gui_mch_set_bg_color(color)
-    guicolor_T	color;
+gui_mch_set_bg_color(guicolor_T color)
 {
     RGBColor TheColor;
 
@@ -4297,8 +3782,7 @@
  * Set the current text special color.
  */
     void
-gui_mch_set_sp_color(color)
-    guicolor_T	color;
+gui_mch_set_sp_color(guicolor_T color)
 {
     specialColor.red = Red(color) * 0x0101;
     specialColor.green = Green(color) * 0x0101;
@@ -4311,7 +3795,7 @@
     static void
 draw_undercurl(int flags, int row, int col, int cells)
 {
-    int                 i;
+    int                 x;
     int                 offset;
     const static int    val[8] = {1, 0, 0, 0, 1, 2, 2, 2 };
     int                 y = FILL_Y(row + 1) - 1;
@@ -4321,28 +3805,19 @@
     offset = val[FILL_X(col) % 8];
     MoveTo(FILL_X(col), y - offset);
 
-    for (i = FILL_X(col); i < FILL_X(col + cells); ++i)
+    for (x = FILL_X(col); x < FILL_X(col + cells); ++x)
     {
-	offset = val[i % 8];
-	LineTo(i, y - offset);
+	offset = val[x % 8];
+	LineTo(x, y - offset);
     }
 }
 
-    void
-gui_mch_draw_string(row, col, s, len, flags)
-    int		row;
-    int		col;
-    char_u	*s;
-    int		len;
-    int		flags;
+#ifndef USE_ATSUI_DRAWING
+
+    static void
+draw_string_QD(int row, int col, char_u *s, int len, int flags)
 {
 #ifdef FEAT_MBYTE
-#ifdef USE_ATSUI_DRAWING
-    /* ATSUI requires utf-16 strings */
-    UniCharCount utf16_len;
-    UniChar *tofree = mac_enc_to_utf16(s, len, (size_t *)&utf16_len);
-    utf16_len /= sizeof(UniChar);
-#else
     char_u	*tofree = NULL;
 
     if (output_conv.vc_type != CONV_NONE)
@@ -4352,11 +3827,7 @@
 	    s = tofree;
     }
 #endif
-#endif
 
-#if defined(FEAT_GUI) && defined(MACOS_X)
-    /* ATSUI automatically antialiases text */
-#ifndef USE_ATSUI_DRAWING
     /*
      * On OS X, try using Quartz-style text antialiasing.
      */
@@ -4367,7 +3838,6 @@
 			     kQDUseCGTextRendering | kQDUseCGTextMetrics : 0);
 	QDSwapTextFlags(qd_flags);
     }
-#endif
 
     /*
      * When antialiasing we're using srcOr mode, we have to clear the block
@@ -4378,12 +3848,8 @@
      * The following is like calling gui_mch_clear_block(row, col, row, col +
      * len - 1), but without setting the bg color to gui.back_pixel.
      */
-#ifdef USE_ATSUI_DRAWING
-    if ((flags & DRAW_TRANSP) == 0)
-#else
     if (((gMacSystemVersion >= 0x1020 && p_antialias) || p_linespace != 0)
 	    && !(flags & DRAW_TRANSP))
-#endif
     {
 	Rect rc;
 
@@ -4408,7 +3874,6 @@
 	EraseRect(&rc);
     }
 
-#ifndef USE_ATSUI_DRAWING
     if (gMacSystemVersion >= 0x1020 && p_antialias)
     {
 	StyleParameter face;
@@ -4427,8 +3892,6 @@
 	DrawText((char*)s, 0, len);
     }
     else
-#endif
-#endif
     {
 	/* Use old-style, non-antialiased QuickDraw text rendering. */
 	TextMode(srcCopy);
@@ -4442,7 +3905,89 @@
 	}
 
 	MoveTo(TEXT_X(col), TEXT_Y(row));
-#ifdef USE_ATSUI_DRAWING
+	DrawText((char *)s, 0, len);
+
+	if (flags & DRAW_BOLD)
+	{
+	    TextMode(srcOr);
+	    MoveTo(TEXT_X(col) + 1, TEXT_Y(row));
+	    DrawText((char *)s, 0, len);
+	}
+
+	if (flags & DRAW_UNDERL)
+	{
+	    MoveTo(FILL_X(col), FILL_Y(row + 1) - 1);
+	    LineTo(FILL_X(col + len) - 1, FILL_Y(row + 1) - 1);
+	}
+    }
+
+    if (flags & DRAW_UNDERC)
+	draw_undercurl(flags, row, col, len);
+
+#ifdef FEAT_MBYTE
+    vim_free(tofree);
+#endif
+}
+
+#else /* USE_ATSUI_DRAWING */
+
+    static void
+draw_string_ATSUI(int row, int col, char_u *s, int len, int flags)
+{
+    /* ATSUI requires utf-16 strings */
+    UniCharCount utf16_len;
+    UniChar *tofree = mac_enc_to_utf16(s, len, (size_t *)&utf16_len);
+    utf16_len /= sizeof(UniChar);
+
+    /* - ATSUI automatically antialiases text (Someone)
+     * - for some reason it does not work... (Jussi) */
+
+    /*
+     * When antialiasing we're using srcOr mode, we have to clear the block
+     * before drawing the text.
+     * Also needed when 'linespace' is non-zero to remove the cursor and
+     * underlining.
+     * But not when drawing transparently.
+     * The following is like calling gui_mch_clear_block(row, col, row, col +
+     * len - 1), but without setting the bg color to gui.back_pixel.
+     */
+    if ((flags & DRAW_TRANSP) == 0)
+    {
+	Rect rc;
+
+	rc.left = FILL_X(col);
+	rc.top = FILL_Y(row);
+	/* Multibyte computation taken from gui_w32.c */
+	if (has_mbyte)
+	{
+	    int cell_len = 0;
+	    int n;
+
+	    /* Compute the length in display cells. */
+	    for (n = 0; n < len; n += MB_BYTE2LEN(s[n]))
+		cell_len += (*mb_ptr2cells)(s + n);
+	    rc.right = FILL_X(col + cell_len);
+	}
+	else
+	    rc.right = FILL_X(col + len) + (col + len == Columns);
+
+	rc.bottom = FILL_Y(row + 1);
+	EraseRect(&rc);
+    }
+
+    {
+	/* Use old-style, non-antialiased QuickDraw text rendering. */
+	TextMode(srcCopy);
+	TextFace(normal);
+
+    /*  SelectFont(hdc, gui.currFont); */
+
+	if (flags & DRAW_TRANSP)
+	{
+	    TextMode(srcOr);
+	}
+
+	MoveTo(TEXT_X(col), TEXT_Y(row));
 	ATSUTextLayout textLayout;
 
 	if (ATSUCreateTextLayoutWithTextPtr(tofree,
@@ -4460,30 +4005,22 @@
 
 	    ATSUDisposeTextLayout(textLayout);
 	}
-#else
-	DrawText((char *)s, 0, len);
-
-
-	if (flags & DRAW_BOLD)
-	{
-	    TextMode(srcOr);
-	    MoveTo(TEXT_X(col) + 1, TEXT_Y(row));
-	    DrawText((char *)s, 0, len);
-	}
-
-	if (flags & DRAW_UNDERL)
-	{
-	    MoveTo(FILL_X(col), FILL_Y(row + 1) - 1);
-	    LineTo(FILL_X(col + len) - 1, FILL_Y(row + 1) - 1);
-	}
-#endif
     }
 
     if (flags & DRAW_UNDERC)
 	draw_undercurl(flags, row, col, len);
 
-#ifdef FEAT_MBYTE
     vim_free(tofree);
+}
+#endif
+
+    void
+gui_mch_draw_string(int row, int col, char_u *s, int len, int flags)
+{
+#if defined(USE_ATSUI_DRAWING)
+    draw_string_ATSUI(row, col, s, len, flags);
+#else
+    draw_string_QD(row, col, s, len, flags);
 #endif
 }
 
@@ -4491,8 +4028,7 @@
  * Return OK if the key with the termcap name "name" is supported.
  */
     int
-gui_mch_haskey(name)
-    char_u  *name;
+gui_mch_haskey(char_u *name)
 {
     int i;
 
@@ -4504,14 +4040,13 @@
 }
 
     void
-gui_mch_beep()
+gui_mch_beep(void)
 {
     SysBeep(1); /* Should this be 0? (????) */
 }
 
     void
-gui_mch_flash(msec)
-    int	    msec;
+gui_mch_flash(int msec)
 {
     /* Do a visual beep by reversing the foreground and background colors */
     Rect    rc;
@@ -4534,11 +4069,7 @@
  * Invert a rectangle from row r, column c, for nr rows and nc columns.
  */
     void
-gui_mch_invert_rectangle(r, c, nr, nc)
-    int		r;
-    int		c;
-    int		nr;
-    int		nc;
+gui_mch_invert_rectangle(int r, int c, int nr, int nc)
 {
     Rect	rc;
 
@@ -4550,14 +4081,13 @@
     rc.right = rc.left + nc * gui.char_width;
     rc.bottom = rc.top + nr * gui.char_height;
     InvertRect(&rc);
-
 }
 
 /*
  * Iconify the GUI window.
  */
     void
-gui_mch_iconify()
+gui_mch_iconify(void)
 {
     /* TODO: find out what could replace iconify
      *	     -window shade?
@@ -4570,7 +4100,7 @@
  * Bring the Vim window to the foreground.
  */
     void
-gui_mch_set_foreground()
+gui_mch_set_foreground(void)
 {
     /* TODO */
 }
@@ -4580,8 +4110,7 @@
  * Draw a cursor without focus.
  */
     void
-gui_mch_draw_hollow_cursor(color)
-    guicolor_T	color;
+gui_mch_draw_hollow_cursor(guicolor_T color)
 {
     Rect rc;
 
@@ -4606,10 +4135,7 @@
  * Draw part of a cursor, only w pixels wide, and h pixels high.
  */
     void
-gui_mch_draw_part_cursor(w, h, color)
-    int		w;
-    int		h;
-    guicolor_T	color;
+gui_mch_draw_part_cursor(int w, int h, guicolor_T color)
 {
     Rect rc;
 
@@ -4639,7 +4165,7 @@
  * immediately.
  */
     void
-gui_mch_update()
+gui_mch_update(void)
 {
     /* TODO: find what to do
      *	     maybe call gui_mch_wait_for_chars (0)
@@ -4661,9 +4187,6 @@
  * spent inside WaitNextEvent while profiling.
  */
 
-#if defined(__MWERKS__)  /* only in Codewarrior */
-# pragma profile reset
-#endif
     pascal
     Boolean
 WaitNextEventWrp(EventMask eventMask, EventRecord *theEvent, UInt32 sleep, RgnHandle mouseRgn)
@@ -4682,12 +4205,8 @@
  * Returns OK if a character was found to be available within the given time,
  * or FAIL otherwise.
  */
-#if defined(__MWERKS__)  /* only in Codewarrior */
-# pragma profile reset
-#endif
     int
-gui_mch_wait_for_chars(wtime)
-    int	    wtime;
+gui_mch_wait_for_chars(int wtime)
 {
     EventMask	mask  = (everyEvent);
     EventRecord event;
@@ -4733,9 +4252,6 @@
 	    sleeppyTick = 32767;
 	if (WaitNextEventWrp(mask, &event, sleeppyTick, dragRgn))
 	{
-#ifdef USE_SIOUX
-	    if (!SIOUXHandleOneEvent(&event))
-#endif
 		gui_mac_handle_event(&event);
 	    if (input_available())
 	    {
@@ -4751,17 +4267,13 @@
     return FAIL;
 }
 
-#if defined(__MWERKS__)  /* only in Codewarrior */
-# pragma profile reset
-#endif
-
 /*
  * Output routines.
  */
 
 /* Flush any output to the screen */
     void
-gui_mch_flush()
+gui_mch_flush(void)
 {
     /* TODO: Is anything needed here? */
 }
@@ -4771,11 +4283,7 @@
  * (row2, col2) inclusive.
  */
     void
-gui_mch_clear_block(row1, col1, row2, col2)
-    int		row1;
-    int		col1;
-    int		row2;
-    int		col2;
+gui_mch_clear_block(int row1, int col1, int row2, int col2)
 {
     Rect rc;
 
@@ -4796,7 +4304,7 @@
  * Clear the whole text window.
  */
     void
-gui_mch_clear_all()
+gui_mch_clear_all(void)
 {
     Rect	rc;
 
@@ -4817,9 +4325,7 @@
  * text further down within the scroll region.
  */
     void
-gui_mch_delete_lines(row, num_lines)
-    int		row;
-    int		num_lines;
+gui_mch_delete_lines(int row, int num_lines)
 {
     Rect	rc;
 
@@ -4842,9 +4348,7 @@
  * following text within the scroll region.
  */
     void
-gui_mch_insert_lines(row, num_lines)
-    int		row;
-    int		num_lines;
+gui_mch_insert_lines(int row, int num_lines)
 {
     Rect rc;
 
@@ -4878,27 +4382,20 @@
      */
 
     void
-clip_mch_request_selection(cbd)
-    VimClipboard *cbd;
+clip_mch_request_selection(VimClipboard *cbd)
 {
 
     Handle	textOfClip;
     int		flavor = 0;
-#ifdef USE_CARBONIZED
     Size	scrapSize;
     ScrapFlavorFlags	scrapFlags;
     ScrapRef    scrap = nil;
     OSStatus	error;
-#else
-    long	scrapOffset;
-    long	scrapSize;
-#endif
     int		type;
     char	*searchCR;
     char_u	*tempclip;
 
 
-#ifdef USE_CARBONIZED
     error = GetCurrentScrap(&scrap);
     if (error != noErr)
 	return;
@@ -4923,29 +4420,15 @@
     }
 
     ReserveMem(scrapSize);
-#else
-    /* Call to LoadScrap seem to avoid problem with crash on first paste */
-    scrapSize = LoadScrap();
-    scrapSize = GetScrap(nil, 'TEXT', &scrapOffset);
 
-    if (scrapSize > 0)
-#endif
     {
-#ifdef USE_CARBONIZED
 	/* In CARBON we don't need a Handle, a pointer is good */
 	textOfClip = NewHandle(scrapSize);
 	/* tempclip = lalloc(scrapSize+1, TRUE); */
-#else
-	textOfClip = NewHandle(0);
-#endif
 	HLock(textOfClip);
-#ifdef USE_CARBONIZED
 	error = GetScrapFlavorData(scrap,
 		flavor ? VIMSCRAPFLAVOR : kScrapFlavorTypeUnicode,
 		&scrapSize, *textOfClip);
-#else
-	scrapSize = GetScrap(textOfClip, 'TEXT', &scrapOffset);
-#endif
 	scrapSize -= flavor;
 
 	if (flavor)
@@ -4954,14 +4437,14 @@
 	    type = (strchr(*textOfClip, '\r') != NULL) ? MLINE : MCHAR;
 
 	tempclip = lalloc(scrapSize + 1, TRUE);
-#if defined(FEAT_MBYTE) && defined(USE_CARBONIZED)
+#if defined(FEAT_MBYTE)
 	mch_memmove(tempclip, *textOfClip + flavor, scrapSize);
 #else
 	STRNCPY(tempclip, *textOfClip + flavor, scrapSize);
 #endif
 	tempclip[scrapSize] = 0;
 
-#if defined(FEAT_MBYTE) && defined(USE_CARBONIZED)
+#if defined(FEAT_MBYTE)
 	/* Convert from utf-16 (clipboard) */
 	size_t encLen = 0;
 	char_u *to = mac_utf16_to_enc((UniChar *)tempclip, scrapSize, &encLen);
@@ -4993,8 +4476,7 @@
 }
 
     void
-clip_mch_lose_selection(cbd)
-    VimClipboard *cbd;
+clip_mch_lose_selection(VimClipboard *cbd)
 {
     /*
      * TODO: Really nothing to do?
@@ -5002,8 +4484,7 @@
 }
 
     int
-clip_mch_own_selection(cbd)
-    VimClipboard *cbd;
+clip_mch_own_selection(VimClipboard *cbd)
 {
     return OK;
 }
@@ -5012,15 +4493,12 @@
  * Send the current selection to the clipboard.
  */
     void
-clip_mch_set_selection(cbd)
-    VimClipboard *cbd;
+clip_mch_set_selection(VimClipboard *cbd)
 {
     Handle	textOfClip;
     long	scrapSize;
     int		type;
-#ifdef USE_CARBONIZED
     ScrapRef    scrap;
-#endif
 
     char_u	*str = NULL;
 
@@ -5039,7 +4517,7 @@
 
     type = clip_convert_selection(&str, (long_u *) &scrapSize, cbd);
 
-#if defined(FEAT_MBYTE) && defined(USE_CARBONIZED)
+#if defined(FEAT_MBYTE)
     size_t utf16_len = 0;
     UniChar *to = mac_enc_to_utf16(str, scrapSize, &utf16_len);
     if (to)
@@ -5052,20 +4530,11 @@
 
     if (type >= 0)
     {
-#ifdef USE_CARBONIZED
 	ClearCurrentScrap();
-#else
-	ZeroScrap();
-#endif
 
-#ifdef USE_CARBONIZED
 	textOfClip = NewHandle(scrapSize + 1);
-#else
-	textOfClip = NewHandle(scrapSize);
-#endif
 	HLock(textOfClip);
 
-#ifdef USE_CARBONIZED
 	**textOfClip = type;
 	mch_memmove(*textOfClip + 1, str, scrapSize);
 	GetCurrentScrap(&scrap);
@@ -5073,10 +4542,6 @@
 		scrapSize, *textOfClip + 1);
 	PutScrapFlavor(scrap, VIMSCRAPFLAVOR, kScrapFlavorMaskNone,
 		scrapSize + 1, *textOfClip);
-#else
-	STRNCPY(*textOfClip, str, scrapSize);
-	PutScrap(scrapSize, 'TEXT', *textOfClip);
-#endif
 	HUnlock(textOfClip);
 	DisposeHandle(textOfClip);
     }
@@ -5085,20 +4550,12 @@
 }
 
     void
-gui_mch_set_text_area_pos(x, y, w, h)
-    int		x;
-    int		y;
-    int		w;
-    int		h;
+gui_mch_set_text_area_pos(int x, int y, int w, int h)
 {
     Rect	VimBound;
 
 /*  HideWindow(gui.VimWindow); */
-#ifdef USE_CARBONIZED
     GetWindowBounds(gui.VimWindow, kWindowGlobalPortRgn, &VimBound);
-#else
-    VimBound = gui.VimWindow->portRect;
-#endif
 
     if (gui.which_scrollbars[SBAR_LEFT])
     {
@@ -5109,9 +4566,7 @@
 	VimBound.left = 0;
     }
 
-#ifdef USE_CARBONIZED
     SetWindowBounds(gui.VimWindow, kWindowGlobalPortRgn, &VimBound);
-#endif
 
     ShowWindow(gui.VimWindow);
 }
@@ -5121,8 +4576,7 @@
  */
 
     void
-gui_mch_enable_menu(flag)
-    int		flag;
+gui_mch_enable_menu(int flag)
 {
     /*
      * Menu is always active.
@@ -5130,11 +4584,7 @@
 }
 
     void
-gui_mch_set_menu_pos(x, y, w, h)
-    int		x;
-    int		y;
-    int		w;
-    int		h;
+gui_mch_set_menu_pos(int x, int y, int w, int h)
 {
     /*
      * The menu is always at the top of the screen.
@@ -5145,9 +4595,7 @@
  * Add a sub menu to the menu bar.
  */
     void
-gui_mch_add_menu(menu, idx)
-    vimmenu_T	*menu;
-    int		idx;
+gui_mch_add_menu(vimmenu_T *menu, int idx)
 {
     /*
      * TODO: Try to use only menu_id instead of both menu_id and menu_handle.
@@ -5157,7 +4605,7 @@
      */
     static long	 next_avail_id = 128;
     long	 menu_after_me = 0; /* Default to the end */
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
     CFStringRef name;
 #else
     char_u	*name;
@@ -5187,7 +4635,7 @@
 	menu_after_me = hierMenu;
 
     /* Convert the name */
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
     name = menu_title_removing_mnemonic(menu);
 #else
     name = C2Pascal_save(menu->dname);
@@ -5196,25 +4644,13 @@
 	return;
 
     /* Create the menu unless it's the help menu */
-#ifdef USE_HELPMENU
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
-    if (menu->priority == 9999)
-#else
-    if (STRNCMP(name, "\4Help", 5) == 0)
-#endif
-    {
-	menu->submenu_id = kHMHelpMenuID;
-	menu->submenu_handle = gui.MacOSHelpMenu;
-    }
-    else
-#endif
     {
 	/* Carbon suggest use of
 	 * OSStatus CreateNewMenu(MenuID, MenuAttributes, MenuRef *);
 	 * OSStatus SetMenuTitle(MenuRef, ConstStr255Param title);
 	 */
 	menu->submenu_id = next_avail_id;
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
 	if (CreateNewMenu(menu->submenu_id, 0, (MenuRef *)&menu->submenu_handle) == noErr)
 	    SetMenuTitleWithCFString((MenuRef)menu->submenu_handle, name);
 #else
@@ -5231,11 +4667,8 @@
 	 * menubar The Inserted menu are scanned or the Command-key combos
 	 */
 
-	/* Insert the menu unless it's the Help menu */
-#ifdef USE_HELPMENU
-	if (menu->submenu_id != kHMHelpMenuID)
-#endif
-	    InsertMenu(menu->submenu_handle, menu_after_me); /* insert before */
+	/* Insert the menu */
+	InsertMenu(menu->submenu_handle, menu_after_me); /* insert before */
 #if 1
 	/* Vim should normally update it. TODO: verify */
 	DrawMenuBar();
@@ -5251,7 +4684,7 @@
 	 * to avoid special character recognition by InsertMenuItem
 	 */
 	InsertMenuItem(parent->submenu_handle, "\p ", idx); /* afterItem */
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
 	SetMenuItemTextWithCFString(parent->submenu_handle, idx+1, name);
 #else
 	SetMenuItemText(parent->submenu_handle, idx+1, name);
@@ -5261,7 +4694,7 @@
 	InsertMenu(menu->submenu_handle, hierMenu);
     }
 
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
     CFRelease(name);
 #else
     vim_free(name);
@@ -5277,11 +4710,9 @@
  * Add a menu item to a menu
  */
     void
-gui_mch_add_menu_item(menu, idx)
-    vimmenu_T	*menu;
-    int		idx;
+gui_mch_add_menu_item(vimmenu_T *menu, int idx)
 {
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
     CFStringRef name;
 #else
     char_u	*name;
@@ -5297,7 +4728,7 @@
        for older OS call GetMenuItemData (menu, item, isCommandID?, data) */
 
     /* Convert the name */
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
     name = menu_title_removing_mnemonic(menu);
 #else
     name = C2Pascal_save(menu->dname);
@@ -5307,12 +4738,6 @@
     menu->submenu_id = 0;
     menu->submenu_handle = NULL;
 
-#ifdef USE_HELPMENU
-    /* The index in the help menu are offseted */
-    if (parent->submenu_id == kHMHelpMenuID)
-	idx += gui.MacOSHelpItems;
-#endif
-
     menu_inserted = 0;
     if (menu->actext)
     {
@@ -5387,7 +4812,7 @@
     if (!menu_inserted)
 	InsertMenuItem(parent->submenu_handle, "\p ", idx); /* afterItem */
     /* Set the menu item name. */
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
     SetMenuItemTextWithCFString(parent->submenu_handle, idx+1, name);
 #else
     SetMenuItemText(parent->submenu_handle, idx+1, name);
@@ -5398,7 +4823,7 @@
     DrawMenuBar();
 #endif
 
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
     CFRelease(name);
 #else
     /* TODO: Can name be freed? */
@@ -5407,8 +4832,7 @@
 }
 
     void
-gui_mch_toggle_tearoffs(enable)
-    int	    enable;
+gui_mch_toggle_tearoffs(int enable)
 {
     /* no tearoff menus */
 }
@@ -5417,8 +4841,7 @@
  * Destroy the machine specific menu widget.
  */
     void
-gui_mch_destroy_menu(menu)
-    vimmenu_T	*menu;
+gui_mch_destroy_menu(vimmenu_T *menu)
 {
     short	index = gui_mac_get_menu_item_index(menu);
 
@@ -5426,9 +4849,6 @@
     {
       if (menu->parent)
       {
-#ifdef USE_HELPMENU
-	if (menu->parent->submenu_handle != nil) /*gui.MacOSHelpMenu)*/
-#endif
 	{
 	    /* For now just don't delete help menu items. (Huh? Dany) */
 	    DeleteMenuItem(menu->parent->submenu_handle, index);
@@ -5440,14 +4860,6 @@
 		DisposeMenu(menu->submenu_handle);
 	    }
 	}
-#ifdef USE_HELPMENU
-# ifdef DEBUG_MAC_MENU
-	else
-	{
-	    printf("gmdm 1\n");
-	}
-# endif
-#endif
       }
 #ifdef DEBUG_MAC_MENU
       else
@@ -5458,10 +4870,6 @@
     }
     else
     {
-	/* Do not delete the Help Menu */
-#ifdef USE_HELPMENU
-	if (menu->submenu_id != kHMHelpMenuID)
-#endif
 	{
 	    DeleteMenu(menu->submenu_id);
 	    DisposeMenu(menu->submenu_handle);
@@ -5475,9 +4883,7 @@
  * Make a menu either grey or not grey.
  */
     void
-gui_mch_menu_grey(menu, grey)
-    vimmenu_T	*menu;
-    int		grey;
+gui_mch_menu_grey(vimmenu_T *menu, int grey)
 {
     /* TODO: Check if menu really exists */
     short index = gui_mac_get_menu_item_index(menu);
@@ -5506,9 +4912,7 @@
  * Make menu item hidden or not hidden
  */
     void
-gui_mch_menu_hidden(menu, hidden)
-    vimmenu_T	*menu;
-    int		hidden;
+gui_mch_menu_hidden(vimmenu_T *menu, int hidden)
 {
     /* There's no hidden mode on MacOS */
     gui_mch_menu_grey(menu, hidden);
@@ -5519,7 +4923,7 @@
  * This is called after setting all the menus to grey/hidden or not.
  */
     void
-gui_mch_draw_menubar()
+gui_mch_draw_menubar(void)
 {
     DrawMenuBar();
 }
@@ -5530,9 +4934,9 @@
  */
 
     void
-gui_mch_enable_scrollbar(sb, flag)
-    scrollbar_T	*sb;
-    int		flag;
+gui_mch_enable_scrollbar(
+	scrollbar_T	*sb,
+	int		flag)
 {
     if (flag)
 	ShowControl(sb->id);
@@ -5545,11 +4949,11 @@
 }
 
     void
-gui_mch_set_scrollbar_thumb(sb, val, size, max)
-    scrollbar_T *sb;
-    long	val;
-    long	size;
-    long	max;
+gui_mch_set_scrollbar_thumb(
+	scrollbar_T *sb,
+	long val,
+	long size,
+	long max)
 {
     SetControl32BitMaximum (sb->id, max);
     SetControl32BitMinimum (sb->id, 0);
@@ -5560,12 +4964,12 @@
 }
 
     void
-gui_mch_set_scrollbar_pos(sb, x, y, w, h)
-    scrollbar_T *sb;
-    int		x;
-    int		y;
-    int		w;
-    int		h;
+gui_mch_set_scrollbar_pos(
+	scrollbar_T *sb,
+	int x,
+	int y,
+	int w,
+	int h)
 {
     gui_mch_set_bg_color(gui.back_pixel);
 /*  if (gui.which_scrollbars[SBAR_LEFT])
@@ -5594,9 +4998,9 @@
 }
 
     void
-gui_mch_create_scrollbar(sb, orient)
-    scrollbar_T *sb;
-    int		orient;	/* SBAR_VERT or SBAR_HORIZ */
+gui_mch_create_scrollbar(
+	scrollbar_T *sb,
+	int orient)	/* SBAR_VERT or SBAR_HORIZ */
 {
     Rect bounds;
 
@@ -5612,11 +5016,7 @@
 			 0, /* current*/
 			 0, /* top */
 			 0, /* bottom */
-#ifdef USE_CARBONIZED
 			 kControlScrollBarLiveProc,
-#else
-			 scrollBarProc,
-#endif
 			 (long) sb->ident);
 #ifdef DEBUG_MAC_SB
     printf("create_sb (%x) %x\n",sb->id, orient);
@@ -5624,8 +5024,7 @@
 }
 
     void
-gui_mch_destroy_scrollbar(sb)
-    scrollbar_T *sb;
+gui_mch_destroy_scrollbar(scrollbar_T *sb)
 {
     gui_mch_set_bg_color(gui.back_pixel);
     DisposeControl(sb->id);
@@ -5656,7 +5055,7 @@
  * Stop the cursor blinking.  Show the cursor if it wasn't shown.
  */
     void
-gui_mch_stop_blink()
+gui_mch_stop_blink(void)
 {
     gui_update_cursor(TRUE, FALSE);
     /* TODO: TODO: TODO: TODO: */
@@ -5671,7 +5070,7 @@
  * waiting time and shows the cursor.
  */
     void
-gui_mch_start_blink()
+gui_mch_start_blink(void)
 {
     gui_update_cursor(TRUE, FALSE);
     /* TODO: TODO: TODO: TODO: */
@@ -5726,7 +5125,6 @@
     char_u *initdir,
     char_u *filter)
 {
-#if defined (USE_NAVIGATION_SERVICE) || defined (USE_CARBONIZED)
     /* TODO: Add Ammon's safety checl (Dany) */
     NavReplyRecord	reply;
     char_u		*fname = NULL;
@@ -5779,44 +5177,6 @@
 
     /* TODO: Shorten the file name if possible */
     return fname;
-#else
-    SFTypeList		fileTypes;
-    StandardFileReply	reply;
-    Str255		Prompt;
-    Str255		DefaultName;
-    Str255		Directory;
-
-    /* TODO: split dflt in path and filename */
-
-    (void) C2PascalString(title,   &Prompt);
-    (void) C2PascalString(dflt,    &DefaultName);
-    (void) C2PascalString(initdir, &Directory);
-
-    if (saving)
-    {
-	/* Use a custon filter instead of nil FAQ 9-4 */
-	StandardPutFile(Prompt, DefaultName,  &reply);
-	if (!reply.sfGood)
-	    return NULL;
-    }
-    else
-    {
-	StandardGetFile(nil, -1, fileTypes, &reply);
-	if (!reply.sfGood)
-	    return NULL;
-    }
-
-    /* Work fine but append a : for new file */
-    return (FullPathFromFSSpec_save(reply.sfFile));
-
-    /* Shorten the file name if possible */
-/*    mch_dirname(IObuff, IOSIZE);
-    p = shorten_fname(fileBuf, IObuff);
-    if (p == NULL)
-    p = fileBuf;
-    return vim_strsave(p);
-*/
-#endif
 }
 #endif /* FEAT_BROWSE */
 
@@ -5938,6 +5298,9 @@
 	SetDialogItemText(itemHandle, itemName);
 }
 
+/* TODO: There have been some crashes with dialogs, check your inbox
+ * (Jussi)
+ */
     int
 gui_mch_dialog(
     int		type,
@@ -6006,11 +5369,7 @@
     /* Change the graphical port to the dialog,
      * so we can measure the text with the proper font */
     GetPort(&oldPort);
-#ifdef USE_CARBONIZED
     SetPortDialogPort(theDialog);
-#else
-    SetPort(theDialog);
-#endif
 
     /* Get the info about the default text,
      * used to calculate the height of the message
@@ -6176,11 +5535,9 @@
     dialogHeight = box.bottom + dfltElementSpacing;
     SizeWindow(theWindow, maximumWidth, dialogHeight, TRUE);
 
-#ifdef USE_CARBONIZED
     /* Magic resize */
     AutoSizeDialog(theDialog);
     /* Need a horizontal resize anyway so not that useful */
-#endif
 
     /* Display it */
     ShowWindow(theWindow);
@@ -6190,11 +5547,7 @@
 /*  DrawDialog(theDialog); */
 #if 0
     GetPort(&oldPort);
-#ifdef USE_CARBONIZED
     SetPortDialogPort(theDialog);
-#else
-    SetPort(theDialog);
-#endif
 #endif
 
     /* Hang until one of the button is hit */
@@ -6239,33 +5592,33 @@
  */
 #ifdef USE_MCH_ERRMSG
     void
-display_errors()
+display_errors(void)
 {
     char	*p;
     char_u	pError[256];
 
-    if (error_ga.ga_data != NULL)
-    {
-	/* avoid putting up a message box with blanks only */
-	for (p = (char *)error_ga.ga_data; *p; ++p)
-	    if (!isspace(*p))
-	    {
-		if (STRLEN(p) > 255)
-		    pError[0] = 255;
-		else
-		    pError[0] = STRLEN(p);
+    if (error_ga.ga_data == NULL)
+	return;
 
-		STRNCPY(&pError[1], p, pError[0]);
-		ParamText(pError, nil, nil, nil);
-		Alert(128, nil);
-		break;
-		/* TODO: handled message longer than 256 chars
-		 *	 use auto-sizeable alert
-		 *	 or dialog with scrollbars (TextEdit zone)
-		 */
-	    }
-	ga_clear(&error_ga);
-    }
+    /* avoid putting up a message box with blanks only */
+    for (p = (char *)error_ga.ga_data; *p; ++p)
+	if (!isspace(*p))
+	{
+	    if (STRLEN(p) > 255)
+		pError[0] = 255;
+	    else
+		pError[0] = STRLEN(p);
+
+	    STRNCPY(&pError[1], p, pError[0]);
+	    ParamText(pError, nil, nil, nil);
+	    Alert(128, nil);
+	    break;
+	    /* TODO: handled message longer than 256 chars
+	     *	 use auto-sizeable alert
+	     *	 or dialog with scrollbars (TextEdit zone)
+	     */
+	}
+    ga_clear(&error_ga);
 }
 #endif
 
@@ -6284,9 +5637,7 @@
 }
 
     void
-gui_mch_setmouse(x, y)
-    int		x;
-    int		y;
+gui_mch_setmouse(int x, int y)
 {
     /* TODO */
 #if 0
@@ -6332,10 +5683,8 @@
 }
 
     void
-gui_mch_show_popupmenu(menu)
-    vimmenu_T *menu;
+gui_mch_show_popupmenu(vimmenu_T *menu)
 {
-#ifdef USE_CTRLCLICKMENU
 /*
  *  Clone PopUp to use menu
  *  Create a object descriptor for the current selection
@@ -6380,7 +5729,6 @@
 
     /* Restore original Port */
     SetPort(savePort); /*OSX*/
-#endif
 }
 
 #if defined(FEAT_CW_EDITOR) || defined(PROTO)
@@ -6388,9 +5736,6 @@
     void
 mch_post_buffer_write(buf_T *buf)
 {
-# ifdef USE_SIOUX
-    printf("Writing Buf...\n");
-# endif
     GetFSSpecFromPath(buf->b_ffname, &buf->b_FSSpec);
     Send_KAHL_MOD_AE(buf);
 }
@@ -6402,14 +5747,12 @@
  * (The icon is not taken care of).
  */
     void
-gui_mch_settitle(title, icon)
-    char_u *title;
-    char_u *icon;
+gui_mch_settitle(char_u *title, char_u *icon)
 {
     /* TODO: Get vim to make sure maxlen (from p_titlelen) is smaller
      *       that 256. Even better get it to fit nicely in the titlebar.
      */
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
     CFStringRef windowTitle;
     size_t	windowTitleLen;
 #else
@@ -6419,7 +5762,7 @@
     if (title == NULL)		/* nothing to do */
 	return;
 
-#if defined(USE_CARBONIZED) && defined(FEAT_MBYTE)
+#if defined(FEAT_MBYTE)
     windowTitleLen = STRLEN(title);
     windowTitle  = mac_enc_to_cfstring(title, windowTitleLen);
 
@@ -6444,9 +5787,7 @@
  */
 
     int
-C2PascalString(CString, PascalString)
-    char_u  *CString;
-    Str255  *PascalString;
+C2PascalString(char_u *CString, Str255 *PascalString)
 {
     char_u *PascalPtr = (char_u *) PascalString;
     int    len;
@@ -6469,9 +5810,7 @@
 }
 
     int
-GetFSSpecFromPath(file, fileFSSpec)
-    char_u *file;
-    FSSpec *fileFSSpec;
+GetFSSpecFromPath(char_u *file, FSSpec *fileFSSpec)
 {
     /* From FAQ 8-12 */
     Str255      filePascal;
@@ -6731,7 +6070,7 @@
  * Get IM status.  When IM is on, return not 0.  Else return 0.
  */
     int
-im_get_status()
+im_get_status(void)
 {
     SInt32 script = GetScriptManagerVariable(smKeyScript);
     return (script != smRoman
diff --git a/src/ops.c b/src/ops.c
index 8c239da..2f9ff00 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -159,6 +159,7 @@
     {'z', 'd', TRUE},	/* OP_FOLDDEL */
     {'z', 'D', TRUE},	/* OP_FOLDDELREC */
     {'g', 'w', TRUE},	/* OP_FORMAT2 */
+    {'g', 'y', FALSE},	/* OP_FUNCTION */
 };
 
 /*
@@ -2737,10 +2738,10 @@
     else
 	free_yank_all();	    /* free previously yanked lines */
 
-/*
- * If the cursor was in column 1 before and after the movement, and the
- * operator is not inclusive, the yank is always linewise.
- */
+    /*
+     * If the cursor was in column 1 before and after the movement, and the
+     * operator is not inclusive, the yank is always linewise.
+     */
     if (       oap->motion_type == MCHAR
 	    && oap->start.col == 0
 	    && !oap->inclusive
@@ -4786,7 +4787,7 @@
 		/* if (!is_del || oap->op_type == OP_APPEND) */
 		if (oap->op_type == OP_APPEND || virtual_op)
 		    bdp->endspaces = oap->end_vcol - bdp->end_vcol
-					+ oap->inclusive;
+							     + oap->inclusive;
 		else
 		    bdp->endspaces = 0; /* replace doesn't add characters */
 	    }
diff --git a/src/option.c b/src/option.c
index e49d932..756d918 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1624,6 +1624,9 @@
     {"open",	    NULL,   P_BOOL|P_VI_DEF,
 			    (char_u *)NULL, PV_NONE,
 			    {(char_u *)FALSE, (char_u *)0L}},
+    {"operatorfunc", "opfunc", P_STRING|P_VI_DEF|P_SECURE,
+			    (char_u *)&p_opfunc, PV_NONE,
+			    {(char_u *)"", (char_u *)0L} },
     {"optimize",    "opt",  P_BOOL|P_VI_DEF,
 			    (char_u *)NULL, PV_NONE,
 			    {(char_u *)FALSE, (char_u *)0L}},
diff --git a/src/option.h b/src/option.h
index 71ffa90..ada0c0b 100644
--- a/src/option.h
+++ b/src/option.h
@@ -613,6 +613,7 @@
 #ifdef FEAT_MZSCHEME
 EXTERN long	p_mzq;		/* 'mzquantum */
 #endif
+EXTERN char_u	*p_opfunc;	/* 'operatorfunc' */
 EXTERN char_u	*p_para;	/* 'paragraphs' */
 EXTERN int	p_paste;	/* 'paste' */
 EXTERN char_u	*p_pt;		/* 'pastetoggle' */
diff --git a/src/version.h b/src/version.h
index 3649294..267dd1d 100644
--- a/src/version.h
+++ b/src/version.h
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT	"vim70aa"
 #define VIM_VERSION_SHORT	"7.0aa"
 #define VIM_VERSION_MEDIUM	"7.0aa ALPHA"
-#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 11)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 11, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 12)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 12, compiled "
