177 |
for more information about Transient Mark mode and activation and |
for more information about Transient Mark mode and activation and |
178 |
deactivation of the mark. |
deactivation of the mark. |
179 |
|
|
180 |
One easy way to use faces is to turn on Font Lock mode. This minor |
One easy way to use faces is to turn on Font Lock mode. @xref{Font |
181 |
mode, which is always local to a particular buffer, arranges to |
Lock}, for more information about Font Lock mode and syntactic |
182 |
choose faces according to the syntax of the text you are editing. It |
highlighting. |
|
can recognize comments and strings in most languages; in several |
|
|
languages, it can also recognize and properly highlight various other |
|
|
important constructs. @xref{Font Lock}, for more information about |
|
|
Font Lock mode and syntactic highlighting. |
|
183 |
|
|
184 |
You can print out the buffer with the highlighting that appears |
You can print out the buffer with the highlighting that appears |
185 |
on your screen using the command @code{ps-print-buffer-with-faces}. |
on your screen using the command @code{ps-print-buffer-with-faces}. |
202 |
|
|
203 |
@findex font-lock-mode |
@findex font-lock-mode |
204 |
@findex turn-on-font-lock |
@findex turn-on-font-lock |
205 |
The command @kbd{M-x font-lock-mode} turns Font Lock mode on or off |
The command @kbd{M-x font-lock-mode} turns Font Lock mode on with |
206 |
according to the argument, and toggles the mode when it has no argument. |
positive argument, off with negative or zero argument, and toggles the |
207 |
The function @code{turn-on-font-lock} unconditionally enables Font Lock |
mode when it has no argument. The function @code{turn-on-font-lock} |
208 |
mode. This is useful in mode-hook functions. For example, to enable |
unconditionally enables Font Lock mode. This is useful in mode-hook |
209 |
Font Lock mode whenever you edit a C file, you can do this: |
functions. For example, to enable Font Lock mode whenever you edit a |
210 |
|
C file, you can do this: |
211 |
|
|
212 |
@example |
@example |
213 |
(add-hook 'c-mode-hook 'turn-on-font-lock) |
(add-hook 'c-mode-hook 'turn-on-font-lock) |
216 |
@findex global-font-lock-mode |
@findex global-font-lock-mode |
217 |
@vindex global-font-lock-mode |
@vindex global-font-lock-mode |
218 |
To turn on Font Lock mode automatically in all modes which support |
To turn on Font Lock mode automatically in all modes which support |
219 |
it, customize the variable @code{global-font-lock-mode} or use the |
it, customize the variable @code{global-font-lock-mode} using the |
220 |
function @code{global-font-lock-mode} in your @file{.emacs} file, like |
Customize interface (@pxref{Easy Customization}) or use the function |
221 |
this: |
@code{global-font-lock-mode} in your @file{.emacs} file, like this: |
222 |
|
|
223 |
@example |
@example |
224 |
(global-font-lock-mode 1) |
(global-font-lock-mode 1) |
638 |
meaning ``there's more text on this line which is scrolled |
meaning ``there's more text on this line which is scrolled |
639 |
horizontally out of view;'' clicking the mouse on one of the arrows |
horizontally out of view;'' clicking the mouse on one of the arrows |
640 |
scrolls the display horizontally in the direction of the arrow. The |
scrolls the display horizontally in the direction of the arrow. The |
641 |
fringes also indicate other things such as empty lines, or where a |
fringes can also indicate other things, such as empty lines, or where a |
642 |
program you are debugging is executing (@pxref{Debuggers}). |
program you are debugging is executing (@pxref{Debuggers}). |
643 |
|
|
644 |
@findex set-fringe-style |
@findex set-fringe-style |
725 |
of columns (you specify how many columns). You can use this to get an |
of columns (you specify how many columns). You can use this to get an |
726 |
overview of a part of a program. |
overview of a part of a program. |
727 |
|
|
728 |
To hide lines, type @kbd{C-x $} (@code{set-selective-display}) with a |
To hide lines in the current buffer, type @kbd{C-x $} |
729 |
numeric argument @var{n}. Then lines with at least @var{n} columns of |
(@code{set-selective-display}) with a numeric argument @var{n}. Then |
730 |
indentation disappear from the screen. The only indication of their |
lines with at least @var{n} columns of indentation disappear from the |
731 |
presence is that three dots (@samp{@dots{}}) appear at the end of each |
screen. The only indication of their presence is that three dots |
732 |
visible line that is followed by one or more hidden ones. |
(@samp{@dots{}}) appear at the end of each visible line that is |
733 |
|
followed by one or more hidden ones. |
734 |
|
|
735 |
The commands @kbd{C-n} and @kbd{C-p} move across the hidden lines as |
The commands @kbd{C-n} and @kbd{C-p} move across the hidden lines as |
736 |
if they were not there. |
if they were not there. |