Index: CKEditor/trunk/_source/core/command.js
===================================================================
--- CKEditor/trunk/_source/core/command.js	(revision 6008)
+++ CKEditor/trunk/_source/core/command.js	(revision 6009)
@@ -199,6 +199,7 @@
 /**
  * Fired when the command state changes.
- * @name CKEDITOR.command.prototype#state
+ * @name CKEDITOR.command#state
  * @event
+ * @example
  * command.on( <b>'state'</b> , function( e )
  *     {
Index: CKEditor/trunk/_source/core/commanddefinition.js
===================================================================
--- CKEditor/trunk/_source/core/commanddefinition.js	(revision 6008)
+++ CKEditor/trunk/_source/core/commanddefinition.js	(revision 6009)
@@ -12,13 +12,13 @@
 /**
  * (Virtual Class) Do not call this constructor. This class is not really part
- *		of the API. It just illustrates the features of command objects to be
+ *		of the API. 
+ * @name CKEDITOR.commandDefinition
+ * @class Virtual class that illustrates the features of command objects to be
  *		passed to the {@link CKEDITOR.editor.prototype.addCommand} function.
- * @name CKEDITOR.commandDefinition
- * @constructor
  * @example
  */
 
  /**
- * Executes the command.
+ * The function to be fired when the commend is executed.
  * @name CKEDITOR.commandDefinition.prototype.exec
  * @function
@@ -39,7 +39,7 @@
 /**
  * Whether the command need to be hooked into the redo/undo system.
- * @name  CKEDITOR.commandDefinition.canUndo
- * @type {Boolean} If not defined or 'true' both hook into undo system, set it
- *		to 'false' explicitly  keep it out.
+ * @name  CKEDITOR.commandDefinition.prototype.canUndo
+ * @type {Boolean}
+ * @default true
  * @field
  * @example
@@ -55,16 +55,21 @@
 
 /**
- * Whether the command is asynchronous, which means the 'afterCommandExec' event
- * will be fired by the command itself manually, and the 'exec' function return value
- * of this command is not to be returned.
- * @name  CKEDITOR.commandDefinition.async
- * @type {Boolean} If defined as 'true', the command is asynchronous.
+ * Whether the command is asynchronous, which means that the
+ * {@link CKEDITOR.editor#event:afterCommandExec} event will be fired by the
+ * command itself manually, and that the return value of this command is not to
+ * be returned by the {@link CKEDITOR.command#exec} function.
+ * @name  CKEDITOR.commandDefinition.prototype.async
+ * @default false
+ * @type {Boolean}
  * @example
- * editorInstance.addCommand( 'alertName',
+ * editorInstance.addCommand( 'loadOptions',
  * {
  *     exec : function( editor )
  *     {
  *         // Asynchronous operation below.
- *         CKEDITOR.ajax.loadXml( 'data.xml' );
+ *         CKEDITOR.ajax.loadXml( 'data.xml', function()
+ *             {
+ *                 editor.fire( 'afterCommandExec' );
+ *             ));
  *     },
  *     async : true    // The command need some time to complete after exec function returns.
@@ -74,6 +79,8 @@
 /**
  * Whether the command should give focus to the editor before execution.
- * @name  CKEDITOR.commandDefinition.editorFocus
+ * @name  CKEDITOR.commandDefinition.prototype.editorFocus
  * @type {Boolean}
+ * @default true
+ * @see CKEDITOR.command#editorFocus
  * @example
  * editorInstance.addCommand( 'maximize',
@@ -81,4 +88,5 @@
  *     exec : function( editor )
  *     {
+ *         // ...
  *     },
  *     editorFocus : false    // The command doesn't require focusing the editing document.
@@ -89,5 +97,5 @@
 /**
  * Whether the command state should be set to {@link CKEDITOR.TRISTATE_DISABLED} on startup.
- * @name  CKEDITOR.commandDefinition.startDisabled
+ * @name  CKEDITOR.commandDefinition.prototype.startDisabled
  * @type {Boolean}
  * @default false
@@ -97,6 +105,25 @@
  *     exec : function( editor )
  *     {
+ *         // ...
  *     },
  *     startDisabled : true    // Command is unavailable until selection is inside a link.
  * });
  */
+
+/**
+ * The editor modes within which the command can be executed. The execution
+ * will have no action if the current mode is not listed in this property.
+ * @name  CKEDITOR.commandDefinition.prototype.modes
+ * @type Object
+ * @default { wysiwyg : 1 }
+ * @see CKEDITOR.command#modes
+ * @example
+ * editorInstance.addCommand( 'link',
+ * {
+ *     exec : function( editor )
+ *     {
+ *         // ...
+ *     },
+ *     modes : { wysiwyg : 1 }    // Command is available in wysiwyg mode only.
+ * });
+ */
Index: CKEditor/trunk/_source/core/editor.js
===================================================================
--- CKEditor/trunk/_source/core/editor.js	(revision 6008)
+++ CKEditor/trunk/_source/core/editor.js	(revision 6009)
@@ -764,3 +764,26 @@
  * @name CKEDITOR#pluginsLoaded
  * @event
+ * @param {CKEDITOR.editor} editor The editor instance that has been destroyed.
  */
+
+/**
+ * Fired before the command execution when {@link #execCommand} is called.
+ * @name CKEDITOR.editor#beforeCommandExec
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ * @param {String} data.name The command name.
+ * @param {Object} data.commandData The data to be sent to the command. This
+ *		can be manipulated by the event listener.
+ * @param {CKEDITOR.command} data.command The command itself.
+ */
+
+/**
+ * Fired after the command execution when {@link #execCommand} is called.
+ * @name CKEDITOR.editor#afterCommandExec
+ * @event
+ * @param {CKEDITOR.editor} editor This editor instance.
+ * @param {String} data.name The command name.
+ * @param {Object} data.commandData The data sent to the command.
+ * @param {CKEDITOR.command} data.command The command itself.
+ * @param {Object} data.returnValue The value returned by the command execution.
+ */
