Sams Teach Yourself Emacs in 24 Hours |  | ContentsIndex
Appendix A: Installing Functions and Packages from the CD |  | Previous HourNext Chapter
Sections in this Hour: |  |

## folding.el

In Hour 14, "Finding Differences Between Files," package folding is described. It is an alternative to outline-mode for programming languages. You can find it in Anders Lindgren's /opt/share/emacs-lisp/users/andersl/folding.el .irectory.

To install it, copy the file folding.el to your load path, and insert one of the following into your Emacs file:

    (load "folding" 'nomessage 'noerror) (folding-mode-add-find-file-hook)

or

    (autoload 'folding-mode "folding" "Folding mode" t) </pre>

The first line will allow Emacs to investigate if a file is written for folding-mode. This requires that the package be loaded at startup, which may add time to the Emacs startup time. If, on the other hand, you seldom use folding-mode then you may use the second line of code listed. To enable folding-mode in this case, you need to start it by typing M-x folding-mode RET.

If you are used to outline-mode, you may ask folding-mode to use keybindings that are like those for outline-mode. You can do this by inserting the following into the .emacs file:

    (setq fold-default-keys-function 'fold-bind-outline-compatible-keys).span class=compcode></pre>

If you would like a prefix other than C-c @ for the folding commands, you may set the variable folding-mode-key-prefix, such as in the following example:

    (setq folding-mode-key-prefix [(control o)]) </pre>

Sams Teach Yourself Emacs in 24 Hours |  | ContentsIndex
Appendix A: Installing Functions and Packages from the CD |  | Previous HourNext Chapter
Sections in this Hour: |  |

© Copyright Macmillan USA. All rights reserved.