www.delorie.com/gnu/docs/emacs-lisp-intro/emacs-lisp-intro_123.html   search  
 
Buy the book!


Programming in Emacs Lisp

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.1 zap-to-char

The zap-to-char function barely changed between GNU Emacs version 19 and GNU Emacs version 21. However, zap-to-char calls another function, kill-region, which enjoyed a major rewrite on the way to version 21.

The kill-region function in Emacs 19 is complex, but does not use code that is important at this time. We will skip it.

The kill-region function in Emacs 21 is easier to read than the same function in Emacs 19 and introduces a very important concept, that of error handling. We will walk through the function.

But first, let us look at the interactive zap-to-char function.

The Complete zap-to-char Implementation  The complete implementation.
8.1.1 The interactive Expression  A three part interactive expression.
8.1.2 The Body of zap-to-char  A short overview.
8.1.3 The search-forward Function  How to search for a string.
8.1.4 The progn Special Form  The progn special form.
8.1.5 Summing up zap-to-char  Using point and search-forward.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003