# $buffer-fhook(5)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

$buffer-fhook - Buffer macro hook command name (buffer creation)
$buffer-dhook - Buffer macro hook command name (buffer deletion)
$buffer-bhook - Buffer macro hook command name (buffer current)
$buffer-ehook - Buffer macro hook command name (buffer swapped)

## SYNOPSIS

$buffer-fhook FunctionName
$buffer-dhook FunctionName
$buffer-bhook FunctionName
$buffer-ehook FunctionName

## DESCRIPTION

Sets the buffer create, delete, begin and end hook command which are executed:

buffer-fhook

When the buffer is created.

buffer-dhook

When the buffer is deleted.

buffer-bhook

When the buffer becomes the current buffer.

buffer-ehook

When the buffer is swapped out from being the current buffer.

The variable $buffer-fhook is largely redundant as the file hook is executed only once and before it can be sent. Its main use is within macros which wish to ascertain what type of buffer it is executing on, i.e. if a command was to be executed only on c file then the follow ensures that this is the case:

    !if &not &seq $buffer-fhook "fhook-cmode"
        !abort
    !endif

Where the command fhook-cmode is the c file hook.

dhooks are executed when a buffer is deleted, but before the contents of the buffer are lost. Note that dhooks will not be called if the buffer never becomes active, or if MicroEmacs 2009 quits due to the receipt of a panic signal.

bhooks and ehooks are usually used to set and restore global variables which require different setting in the current buffer.

The order of The default settings of these variable are determined by the command add-file-hook(2).

## SEE ALSO

add-file-hook(2).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>