/[emacs]/emacs/man/custom.texi
ViewVC logotype

Diff of /emacs/man/custom.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.48.2.9 by miles, Sat Sep 4 09:26:23 2004 UTC revision 1.48.2.10 by miles, Wed Oct 6 05:21:53 2004 UTC
# Line 785  as soon as one hook function returns a n Line 785  as soon as one hook function returns a n
785  are not called at all.  The documentation of each abnormal hook variable  are not called at all.  The documentation of each abnormal hook variable
786  explains in detail what is peculiar about it.  explains in detail what is peculiar about it.
787    
788    The recommended way to add a hook function to a hook (either normal or    You can set a hook variable with @code{setq} like any other Lisp
789  abnormal) is by calling @code{add-hook}.  You can use any valid Lisp  variable, but the recommended way to add a hook function to a hook
790  function as the hook function, provided it can handle the proper number  (either normal or abnormal) is by calling @code{add-hook}.  You can
791  of arguments (zero arguments, in the case of a normal hook).  Of course,  specify any valid Lisp function as the hook function, provided it can
792  not every Lisp function is @emph{useful} in any particular hook.  handle the proper number of arguments (zero arguments, in the case of
793    a normal hook).  Of course, not every Lisp function is @emph{useful}
794    in any particular hook.
795    
796    For example, here's how to set up a hook to turn on Auto Fill mode    For example, here's how to set up a hook to turn on Auto Fill mode
797  when entering Text mode and other modes based on Text mode:  when entering Text mode and other modes based on Text mode:
# Line 830  they are executed does not matter.  Any Line 832  they are executed does not matter.  Any
832  ``asking for trouble.''  However, the order is predictable: the most  ``asking for trouble.''  However, the order is predictable: the most
833  recently added hook functions are executed first.  recently added hook functions are executed first.
834    
835      If you play with adding various different versions of a hook
836    function by calling @code{add-hook} over and over, remember that all
837    the versions you added will remain in the hook variable together.
838    To clear them out, you can do @code{(setq @var{hook-variable} nil)}.
839    
840  @node Locals  @node Locals
841  @subsection Local Variables  @subsection Local Variables
842    
# Line 998  local variables list in a comment, so it Line 1005  local variables list in a comment, so it
1005  that the file is intended as input for.  The example above is for a  that the file is intended as input for.  The example above is for a
1006  language where comment lines start with @samp{;;; } and end with  language where comment lines start with @samp{;;; } and end with
1007  @samp{***}; the local values for @code{comment-start} and  @samp{***}; the local values for @code{comment-start} and
1008  @code{comment-end} customize the rest of Emacs for this unusual syntax.  @code{comment-end} customize the rest of Emacs for this unusual
1009  Don't use a prefix (or a suffix) if you don't need one.  syntax.  Don't use a prefix (or a suffix) if you don't need one.
1010    
1011      If you write a multi-line string value, you should put the prefix
1012    and suffix on each line, even lines that start or end within the
1013    string.  They will be stripped off for processing the list.  If you
1014    want to split a long string across multiple lines of the file, you can
1015    use backslash-newline, which is ignored in Lisp string constants.
1016    Here's an example of doing this:
1017    
1018    @example
1019    # Local Variables:
1020    # compile-command: "cc foo.c -Dfoo=bar -Dhack=whatever \
1021    #   -Dmumble=blaah"
1022    # End:
1023    @end example
1024    
1025    Two ``variable names'' have special meanings in a local variables    Two ``variable names'' have special meanings in a local variables
1026  list: a value for the variable @code{mode} really sets the major mode,  list: a value for the variable @code{mode} really sets the major mode,
# Line 1635  The Emacs Lisp Reference Manual}.}: Line 1656  The Emacs Lisp Reference Manual}.}:
1656  Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}.  Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}.
1657    
1658  Since this puts a non-@acronym{ASCII} character in the @file{.emacs},  Since this puts a non-@acronym{ASCII} character in the @file{.emacs},
1659  you should specify for that file a coding system that supports  you should specify a coding system for that file that supports the
1660  that character.  @xref{Init Syntax}.  character in question.  @xref{Init Syntax}.
   
 @strong{Warning:} if you change the keyboard encoding, such that the code that  
 @kbd{C-q} inserts becomes different, you'll need to edit the  
 Lisp expression accordingly.  
1661    
1662  @strong{Warning:} @kbd{C-q} will insert the wrong code if you visit  @strong{Warning:} if you change the keyboard encoding, or change
1663  the file @file{.emacs} in a unibyte buffer, so don't do that.  between multibyte and unibyte mode, or anything that would alter which
1664    code @kbd{C-q} would insert for that character, you'll need to edit
1665    the Lisp expression accordingly, to use the character code generated
1666    by @kbd{C-q} in the new mode.
1667    
1668  @node Mouse Buttons  @node Mouse Buttons
1669  @subsection Rebinding Mouse Buttons  @subsection Rebinding Mouse Buttons

Legend:
Removed from v.1.48.2.9  
changed lines
  Added in v.1.48.2.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26