emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106815: * doc/emacs/files.texi (Diff


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106815: * doc/emacs/files.texi (Diff Mode): Discuss diff-auto-refine-mode.
Date: Sat, 07 Jan 2012 16:12:27 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106815
fixes bug(s): http://debbugs.gnu.org/10309
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2012-01-07 16:12:27 +0800
message:
  * doc/emacs/files.texi (Diff Mode): Discuss diff-auto-refine-mode.
  
  * doc/emacs/custom.texi (Hooks): Discuss how to disable minor modes.
modified:
  doc/emacs/ChangeLog
  doc/emacs/custom.texi
  doc/emacs/files.texi
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog       2012-01-07 03:15:48 +0000
+++ b/doc/emacs/ChangeLog       2012-01-07 08:12:27 +0000
@@ -1,5 +1,10 @@
 2012-01-07  Chong Yidong  <address@hidden>
 
+       * custom.texi (Hooks): Discuss how to disable minor modes.
+
+       * files.texi (Diff Mode): Discuss diff-auto-refine-mode
+       (Bug#10309).
+
        * trouble.texi (Lossage): Refer to Bugs node for problems.
        (DEL Does Not Delete): Don't use "usual erasure key" teminology.
        (Screen Garbled): Don't refer to terminal "manufacturers".

=== modified file 'doc/emacs/custom.texi'
--- a/doc/emacs/custom.texi     2012-01-06 10:53:41 +0000
+++ b/doc/emacs/custom.texi     2012-01-07 08:12:27 +0000
@@ -857,17 +857,34 @@
   Most major modes run one or more @dfn{mode hooks} as the last step
 of initialization.  Mode hooks are a convenient way to customize the
 behavior of individual modes; they are always normal.  For example,
-here's how to set up a hook to turn on Auto Fill mode when entering
-Text mode and other modes based on Text mode:
+here's how to set up a hook to turn on Auto Fill mode in Text mode and
+other modes based on Text mode:
 
 @example
 (add-hook 'text-mode-hook 'auto-fill-mode)
 @end example
 
-  Here is another example, showing how to use a hook to customize the
-indentation of C code.  The hook function uses an anonymous lambda
-expression (@pxref{Lambda Expressions,,, elisp, The Emacs Lisp
-Reference Manual}).
address@hidden
+This works by calling @code{auto-fill-mode}, which enables the minor
+mode when no argument is supplied (@pxref{Minor Modes}).  Next,
+suppose you don't want Auto Fill mode turned on in address@hidden mode,
+which is one of the modes based on Text mode.  You can do this with
+the following additional line:
+
address@hidden
+(add-hook 'latex-mode-hook (lambda () (auto-fill-mode -1)))
address@hidden example
+
address@hidden
+Here we have used the special macro @code{lambda} to construct an
+anonymous function (@pxref{Lambda Expressions,,, elisp, The Emacs Lisp
+Reference Manual}), which calls @code{auto-fill-mode} with an argument
+of @code{-1} to disable the minor mode.  Because address@hidden mode runs
address@hidden after running @code{text-mode-hook}, the result
+leaves Auto Fill mode disabled.
+
+  Here is a more complex example, showing how to use a hook to
+customize the indentation of C code:
 
 @example
 @group

=== modified file 'doc/emacs/files.texi'
--- a/doc/emacs/files.texi      2012-01-05 09:46:05 +0000
+++ b/doc/emacs/files.texi      2012-01-07 08:12:27 +0000
@@ -1352,9 +1352,25 @@
 @findex diff-hunk-next
 Move to the next hunk-start (@code{diff-hunk-next}).
 
address@hidden diff-auto-refine-mode
address@hidden mode, Diff Auto-Refine
address@hidden Diff Auto-Refine mode
+This command has a side effect: it @dfn{refines} the hunk you move to,
+highlighting its changes with better granularity.  To disable this
+feature, type @kbd{M-x diff-auto-refine-mode} to toggle off the minor
+mode Diff Auto-Refine mode.  To disable Diff Auto Refine mode by
+default, add this to your init file (@pxref{Hooks}):
+
address@hidden
+(add-hook 'diff-mode-hook
+          (lambda () (diff-auto-refine-hook -1)))
address@hidden example
+
 @item M-p
 @findex diff-hunk-prev
-Move to the previous hunk-start (@code{diff-hunk-prev}).
+Move to the previous hunk-start (@code{diff-hunk-prev}).  Like
address@hidden, this has the side-effect of refining the hunk you move to,
+unless you disable Diff Auto-Refine mode.
 
 @item address@hidden
 @findex diff-file-next
@@ -1454,7 +1470,6 @@
 patch syntax (@pxref{Useless Whitespace}).
 @end table
 
-
 @node Misc File Ops
 @section Miscellaneous File Operations
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]