<html lang="en">
<head>
<title>Electricity - 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.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="Introduction.html#Introduction" title="Introduction">
<link rel="next" href="Motion.html#Motion" title="Motion">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This manual documents PHP mode version 1.4.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-01-03 20:50:20 -0500 (Thu, 03 Jan 2008) $
$Revision: 30 $-->
<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="Electricity"></a>
Next: <a rel="next" accesskey="n" href="Motion.html#Motion">Motion</a>,
Previous: <a rel="previous" accesskey="p" href="Introduction.html#Introduction">Introduction</a>,
Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>
<h2 class="chapter">2 Electricity</h2>
<p><a name="index-electricity-9"></a><a name="index-self_002dinsert_002dcommand-10"></a>Certain characters when inserted in Emacs have
<dfn>electricity</dfn>. Emacs recognizes them as “electric”
and automatically reacts in some way to their insertion.
This is unlike the <code>self-insert-command</code> – the
conventional manner most characters are inserted into the
buffer with no side-effect.
<p><a name="index-indentation_002c-electric-11"></a><a name="index-electric-indentation-12"></a><a name="index-declaration-blocks-13"></a><a name="index-conditional-statements-14"></a><a name="index-braces-15"></a><a name="index-comments-16"></a><a name="index-TAB-17"></a>For example, the indent commands for programming language
modes – including PHP mode – are electric. Hitting
<kbd>TAB</kbd> (or <kbd>C-i</kbd>) typically indents the line to the
correct column based on the nested declaration blocks or
conditional (control) syntax statements. Other examples of
electric characters include braces ({ and }), characters
that are recognized as comments (#, / and *), and
semicolons. Inserting “electric” characters causes the
line to be automatically be indented appropriately by PHP
mode.
<p><a name="index-quoted_002dinsert-18"></a><a name="index-C_002dq-19"></a><a name="index-c_002dtoggle_002delectric_002dstate-20"></a><a name="index-C_002dc-C_002dl-21"></a>Should PHP mode ever do something you wish it didn't, like
indenting incorrectly after inserting a character when you
wish it didn't, then you've been <dfn>electrocuted</dfn>. To
avoid this, use <code>quoted-insert</code> by prefixing the
character with <kbd>C-q</kbd>. For example, <kbd>C-q TAB</kbd> for a
tab. Alternatively, disable the electric effect of PHP mode
with <kbd>C-c C-l</kbd>. Issue <kbd>C-c C-l</kbd> again to activate
the electric effect again.
<!-- Is there a setting to use in ones .emacs to permanently -->
<!-- shut off electricity? -->
</body></html>