<html lang="en">
<head>
<title>Motion - PHP Mode Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="PHP Mode Manual">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="Electricity.html#Electricity" title="Electricity">
<link rel="next" href="Indentation.html#Indentation" title="Indentation">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This manual documents PHP mode version 1.5.0 for
use with GNU Emacs.
Copyright (C) 2008 Aaron S. Hawley
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.2 or any later version published by the Free Software
Foundation; with no Invariant Sections, and no Cover Texts. A
copy of the license is included in the section entitled ``Copying
This Manual.''
A copy of the license is also available from the Free Software
Foundation Web site at `http://www.gnu.org/licenses/fdl.html'.
The document was typeset with
GNU Texinfo (http://www.texinfo.org/).
$Date: 2008-11-04 11:51:51 -0500 (Tue, 04 Nov 2008) $
$Revision: 90 $
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Motion"></a>
Next: <a rel="next" accesskey="n" href="Indentation.html#Indentation">Indentation</a>,
Previous: <a rel="previous" accesskey="p" href="Electricity.html#Electricity">Electricity</a>,
Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>
<h2 class="chapter">4 Motion</h2>
<!-- It's important to explain when a feature is really a -->
<!-- subset of a feature of Emacs or C Mode, and take the -->
<!-- opportunity to create a cross-reference to those free -->
<!-- manuals. -->
<p><a name="index-motion-54"></a><a name="index-movement-55"></a><a name="index-C-mode_002c-movement-56"></a><a name="index-point-57"></a>
The traditional point movement commands for
Emacs<a rel="footnote" href="#fn-1" name="fnd-1"><sup>1</sup></a> and Emacs's C mode<a rel="footnote" href="#fn-2" name="fnd-2"><sup>2</sup></a> are supported in PHP mode. The following are
noteworthy commands for working on PHP code or are
extensions expressly provided by PHP mode.
<dl>
<!-- The forward-sexp command isn't optimally named nor -->
<!-- behaved for a language like PHP, but it comes for free -->
<!-- (gratis) from Emacs, and may prove useful. It would be -->
<!-- better to have a php-forward-syntax command that follows -->
<!-- the parsing rules of PHP and not a lisp language. For -->
<!-- instance, if at the beginning or end of a statement, move -->
<!-- to the next statement. The syntaxes that would be useful -->
<!-- to move across would need to be researched. -->
<a name="index-block-58"></a><a name="index-braces-59"></a><a name="index-parentheses-60"></a><a name="index-string-61"></a><a name="index-statements-62"></a><a name="index-syntax_002c-forward-63"></a><a name="index-forward_002dsexp-64"></a><a name="index-C_002dM_002df-65"></a><dt><kbd>C-M-f</kbd><dd>Move forward past the current syntax (<code>forward-sexp</code>).
If point is in a string literal, move to the end of the
string. If point is at the beginning of a parenthetical
expression, move to the end of it. If at the beginning of
statement block that is surrounded by braces, move to the
end of the block. If point is at an identifier, skip to the
end of it.
<a name="index-syntax_002c-backward-66"></a><a name="index-backward_002dsexp-67"></a><a name="index-C_002dM_002db-68"></a><br><dt><kbd>C-M-b</kbd><dd>Same as <kbd>C-M-f</kbd>, except a syntactic element move to its
beginning (<code>backward-sexp</code>).
<a name="index-beginning-of-function-69"></a><a name="index-function_002c-beginning-of-70"></a><a name="index-c_002dbeginning_002dof_002ddefun-71"></a><a name="index-C_002dM_002da-72"></a><br><dt><kbd>C-M-a</kbd><dd>Move point to the beginning of the top-level function
definition (<code>c-beginning-of-defun</code>).
<a name="index-end-of-function-73"></a><a name="index-function_002c-end-of-74"></a><a name="index-c_002dend_002dof_002ddefun-75"></a><a name="index-C_002dM_002de-76"></a><br><dt><kbd>C-M-e</kbd><dd>Move point to the end of the top-level function definition
(<code>c-end-of-defun</code>).
<a name="index-end-of-function-77"></a><a name="index-function_002c-end-of-78"></a><a name="index-beginning_002dof_002ddefun-79"></a><a name="index-C_002dM_002d_003cHOME_003e-80"></a><br><dt><kbd>C-M-<HOME></kbd><dd>Move point to the beginning of the current function
(<code>beginning-of-defun</code>).
<a name="index-end-of-function-81"></a><a name="index-function_002c-end-of-82"></a><a name="index-end_002dof_002ddefun-83"></a><a name="index-C_002dM_002d_003cEND_003e-84"></a><br><dt><kbd>C-M-<END></kbd><dd>Move point to the end of the current function
(<code>end-of-defun</code>).
<a name="index-indentation_002c-move-to-85"></a><a name="index-back_002dto_002dindentation-86"></a><a name="index-M_002dm-87"></a><br><dt><kbd>M-m</kbd><dd>Move to the indentation at the beginning of the line
(<code>back-to-indentation</code>).
<a name="index-bumpy-case-88"></a><a name="index-camel-case-89"></a><a name="index-mixed-case-90"></a><a name="index-case_002c-mixed-91"></a><a name="index-function_002c-end-of-92"></a><a name="index-backward_002dword-93"></a><a name="index-forward_002dword-94"></a><a name="index-c_002dsubword_002dmode-95"></a><a name="index-C_002dc-C_002dw-96"></a><br><dt><kbd>C-c C-w</kbd><dd>Enable word motion across mixed case identifiers with
<code>forward-word</code> and <code>backward-word</code> commands
(<code>c-subword-mode</code>).
</dl>
<a name="index-universal-argument-97"></a><a name="index-numeric-argument-98"></a><a name="index-universal_002dargument-99"></a><a name="index-C_002du-100"></a>Most movement commands support prefixing the command with a
<dfn>numeric argument</dfn> by using Emacs's <dfn>universal
argument</dfn> command. Type <kbd>C-u </kbd><var>n</var>, where <var>n</var> is
the number of times to repeat a command. If no number
<var>n</var> is provided, Emacs will repeat the command 4 times
by default. See <a href="http://emacswiki.org/cgi-bin/info-ref?find=Arguments.html#Arguments">Numeric Arguments</a>.
<div class="footnote">
<hr>
<h4>Footnotes</h4><p class="footnote"><small>[<a name="fn-1" href="#fnd-1">1</a>]</small> See <a href="http://emacswiki.org/cgi-bin/info-ref?find=Moving-Point.html#Moving-Point">Changing the Location of Point</a>.</p>
<p class="footnote"><small>[<a name="fn-2" href="#fnd-2">2</a>]</small> See <a href="http://cc-mode.sourceforge.net/html-manual/Movement-Commands.html#Movement-Commands">Movement Commands</a>.</p>
<hr></div>
</body></html>