From: Chris Mann Date: Thu, 12 Mar 2009 12:07:56 +0000 (+1030) Subject: * wesnoth-mode.el (wesnoth-mark-block): Ensure point remains. Skip to the X-Git-Url: https://repo.or.cz/w/wesnoth-mode.git/commitdiff_plain/996c02248fb4ca817d811c8de5999d4baf676264 * wesnoth-mode.el (wesnoth-mark-block): Ensure point remains. Skip to the start of the next non-blank line where necessary. * wesnoth-mode.texi (Indentation): Minor clean-up. (Editing Extras): Document prefix argument to `C-M-k'. --- diff --git a/wesnoth-mode.el b/wesnoth-mode.el index 8d2fe05..0154eaf 100644 --- a/wesnoth-mode.el +++ b/wesnoth-mode.el @@ -1412,12 +1412,16 @@ the end of the region to place the overlay." (defun wesnoth-mark-block () "Mark the block at point." (interactive) - (when (looking-at "[\t ]*\\(\\[\\+?\\(\\w\\|_\\)+\\]\\|#define\\|\ + (save-excursion + (while (and (save-excursion (beginning-of-line) + (looking-at "[\t ]*$")) + (= (forward-line 1) 0))) + (when (looking-at "[\t ]*\\(\\[\\+?\\(\\w\\|_\\)+\\]\\|#define\\|\ #ifn?def\\)") - (push-mark (save-excursion - (wesnoth-jump-to-matching) - (end-of-line) - (point))))) + (push-mark (save-excursion + (wesnoth-jump-to-matching) + (end-of-line) + (point)))))) (defun wesnoth-down-list (&optional arg) "Move forward down ARG levels of elements. diff --git a/wesnoth-mode.texi b/wesnoth-mode.texi index 54f2045..631fe4a 100644 --- a/wesnoth-mode.texi +++ b/wesnoth-mode.texi @@ -168,10 +168,10 @@ checkout the latest changes, the following command can be used: By default, Wesnoth Mode provides a style of indentation equivalent to that provided by @code{wmlindent} tool distributed with Wesnoth. @kbd{TAB} can be used to automatically indent the current line to the -correct depth. @kbd{TAB} can perform two actions depending on the -context of point. When there is an incomplete element immediately -preceding point, completion will be attempted, otherwise @kbd{TAB} will -perform indentation. See @ref{Tab Completion}. +correct depth. Two actions can be performed depending on the context of +point. When there is an incomplete element immediately preceding point, +completion will be attempted, otherwise indentation will be performed. +See @ref{Tab Completion}. Wesnoth Mode will, by default, indent the current line appropriately before inserting a newline when @kbd{RET} or @kbd{C-j} is @@ -209,9 +209,10 @@ at point and @kbd{C-M-u} moving to the corresponding parent element. Additional commands have been added to assist editing regions of WML. @kbd{C-M-k} can be used to kill the element at point up to the -corresponding closing element, including all contents. Also, when point -is at an opening element, the mark can be placed at the end of the -corresponding closing element using @kbd{C-M-SPC}. +corresponding closing element, including all contents. A prefix +argument can be provided to kill the next @i{n} blocks of elements. +Also, when point is at an opening element, the mark can be placed at the +end of the corresponding closing element using @kbd{C-M-SPC}. @node Inserting Elements, Validating WML, Basic Usage, Top @chapter Inserting Elements