]> code.delx.au - gnu-emacs/blobdiff - lisp/ediff-help.el
Add 2008 to copyright years.
[gnu-emacs] / lisp / ediff-help.el
index 64bb3e5a09d5ec5bd7bf048b1914ae5aaebb9a08..9da6732d399e9f7beb81f03c39f02754d28c8a05 100644 (file)
@@ -1,14 +1,15 @@
 ;;; ediff-help.el --- Code related to the contents of Ediff help buffers
 
-;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+;;   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
-;; Author: Michael Kifer <kifer@cs.sunysb.edu>
+;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
 
 ;;; Code:
-        
-(provide 'ediff-help)
+
 
 ;; Compiler pacifier start
 (defvar ediff-multiframe)
@@ -45,9 +47,9 @@
   "The head of the full help message.")
 (defconst ediff-long-help-message-tail
   "=====================|===========================|=============================
-    R -show registry |     = -compare regions    |  M   -show session group    
-    D -diff output   |     E -browse Ediff manual|  G   -send bug report       
-    i -status info   |     ? -help off           |  z/q -suspend/quit          
+    R -show registry |     = -compare regions    |  M   -show session group
+    D -diff output   |     E -browse Ediff manual|  G   -send bug report
+    i -status info   |     ? -help off           |  z/q -suspend/quit
 -------------------------------------------------------------------------------
 For help on a specific command:  Click Button 2 over it; or
                                 Put the cursor over it and type RET."
@@ -57,102 +59,105 @@ For help on a specific command:  Click Button 2 over it; or
   "
 p,DEL -previous diff |     | -vert/horiz split   | xy -copy buf X's region to Y
 n,SPC -next diff     |     h -hilighting         | rx -restore buf X's old diff
-    j -jump to diff  |     @ -auto-refinement    |  * -refine current region   
-   gx -goto X's point|                           |  ! -update diff regions     
-  C-l -recenter      |    ## -ignore whitespace  |
-  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X              
-  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output        
+    j -jump to diff  |     @ -auto-refinement    |  * -refine current region
+   gx -goto X's point|    ## -ignore whitespace  |  ! -update diff regions
+  C-l -recenter      |    #c -ignore case        |
+  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
+  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output
     ~ -rotate buffers|     m -wide display       |
 "
   "Help message usually used for 3-way comparison.
-Normally, not a user option. See `ediff-help-message' for details.")
-  
+Normally, not a user option.  See `ediff-help-message' for details.")
+
 (defconst ediff-long-help-message-compare2
   "
 p,DEL -previous diff |     | -vert/horiz split   |a/b -copy A/B's region to B/A
 n,SPC -next diff     |     h -hilighting         | rx -restore buf X's old diff
-    j -jump to diff  |     @ -auto-refinement    |  * -refine current region   
-   gx -goto X's point|                           |  ! -update diff regions     
-  C-l -recenter      |    ## -ignore whitespace  |
-  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X              
-  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output        
-    ~ -swap variants |     m -wide display       |  
+    j -jump to diff  |     @ -auto-refinement    |  * -refine current region
+   gx -goto X's point|    ## -ignore whitespace  |  ! -update diff regions
+  C-l -recenter      |    #c -ignore case        |
+  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
+  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output
+    ~ -swap variants |     m -wide display       |
 "
   "Help message usually used for 2-way comparison.
-Normally, not a user option. See `ediff-help-message' for details.")
-  
+Normally, not a user option.  See `ediff-help-message' for details.")
+
 (defconst ediff-long-help-message-narrow2
   "
 p,DEL -previous diff |     | -vert/horiz split   |a/b -copy A/B's region to B/A
 n,SPC -next diff     |     h -hilighting         | rx -restore buf X's old diff
-    j -jump to diff  |     @ -auto-refinement    |  * -refine current region   
-   gx -goto X's point|     % -narrow/widen buffs |  ! -update diff regions     
-  C-l -recenter      |    ## -ignore whitespace  |
-  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X              
-  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output        
-    ~ -swap variants |     m -wide display       |  
+    j -jump to diff  |     @ -auto-refinement    |  * -refine current region
+   gx -goto X's point|    ## -ignore whitespace  |  ! -update diff regions
+  C-l -recenter      |    #c -ignore case        |  % -narrow/widen buffs 
+  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
+  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output
+    ~ -swap variants |     m -wide display       |
 "
   "Help message when comparing windows or regions line-by-line.
-Normally, not a user option. See `ediff-help-message' for details.")
-  
+Normally, not a user option.  See `ediff-help-message' for details.")
+
 (defconst ediff-long-help-message-word-mode
   "
 p,DEL -previous diff |     | -vert/horiz split   | xy -copy buf X's region to Y
 n,SPC -next diff     |     h -hilighting         | rx -restore buf X's old diff
-    j -jump to diff  |                           |                   
-   gx -goto X's point|     % -narrow/widen buffs |  ! -recompute diffs         
-  C-l -recenter      |                           |
-  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X              
-  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output        
-    ~ -swap variants |     m -wide display       |  
+    j -jump to diff  |                           |
+   gx -goto X's point|    % -narrow/widen buffs  |  ! -recompute diffs
+  C-l -recenter      |    #c -ignore case        |
+  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
+  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output
+    ~ -swap variants |     m -wide display       |
 "
   "Help message when comparing windows or regions word-by-word.
-Normally, not a user option. See `ediff-help-message' for details.")
-  
+Normally, not a user option.  See `ediff-help-message' for details.")
+
 (defconst ediff-long-help-message-merge
   "
 p,DEL -previous diff |     | -vert/horiz split   |  x -copy buf X's region to C
 n,SPC -next diff     |     h -hilighting         |  r -restore buf C's old diff
-    j -jump to diff  |     @ -auto-refinement    |  * -refine current region   
-   gx -goto X's point|    ## -ignore whitespace  |  ! -update diff regions     
-  C-l -recenter      | #f/#h -focus/hide regions |  + -combine diff regions    
-  v/V -scroll up/dn  |     X -read-only in buf X | wx -save buf X              
-  </> -scroll lt/rt  |     m -wide display       | wd -save diff output        
-    ~ -swap variants |     s -shrink window C    |  / -show ancestor buff      
-                     |     $ -show clashes only  |  & -merge w/new default     
+    j -jump to diff  |     @ -auto-refinement    |  * -refine current region
+   gx -goto X's point|    ## -ignore whitespace  |  ! -update diff regions
+  C-l -recenter      | #f/#h -focus/hide regions |  + -combine diff regions
+  v/V -scroll up/dn  |     X -read-only in buf X | wx -save buf X
+  </> -scroll lt/rt  |     m -wide display       | wd -save diff output
+    ~ -swap variants |     s -shrink window C    |  / -show ancestor buff
+                     |  $$ -show clashes only    |  & -merge w/new default
+                     |  $* -skip changed regions |
 "
-  "Help message during merging.
-Normally, not a user option. See `ediff-help-message' for details.")
+  "Help message for merge sessions.
+Normally, not a user option.  See `ediff-help-message' for details.")
 
 ;; The actual long help message.
 (ediff-defvar-local ediff-long-help-message ""
-  "Normally, not a user option. See `ediff-help-message' for details.")
-  
+  "Normally, not a user option.  See `ediff-help-message' for details.")
+
 (defconst ediff-brief-message-string
-  "? -quick help "
+  " Type ? for help"
   "Contents of the brief help message.")
 ;; The actual brief help message
 (ediff-defvar-local ediff-brief-help-message ""
-  "Normally, not a user option. See `ediff-help-message' for details.")
-  
+  "Normally, not a user option.  See `ediff-help-message' for details.")
+
 (ediff-defvar-local ediff-brief-help-message-function nil
   "The brief help message that the user can customize.
 If the user sets this to a parameter-less function, Ediff will use it to
-produce the brief help message. This function must return a string.")
+produce the brief help message.  This function must return a string.")
 (ediff-defvar-local ediff-long-help-message-function nil
   "The long help message that the user can customize.
 See `ediff-brief-help-message-function' for more.")
 
-(defvar ediff-use-long-help-message nil
-  "*If t, Ediff displays a long help message. Short help message otherwise.")
+(defcustom ediff-use-long-help-message nil
+  "*If t, Ediff displays a long help message.  Short help message otherwise."
+  :type 'boolean
+  :group 'ediff-window)
 
 ;; The actual help message.
 (ediff-defvar-local ediff-help-message ""
   "The actual help message.
-Normally, the user shouldn't touch this. However, if you want Ediff to
+Normally, the user shouldn't touch this.  However, if you want Ediff to
 start up with different help messages for different jobs, you can change
 the value of this variable and the variables `ediff-help-message-*' in
-`ediff-startup-hook'.") 
+`ediff-startup-hook'.")
 
 
 ;; the keymap that defines clicks over the quick help regions
@@ -185,18 +190,21 @@ the value of this variable and the variables `ediff-help-message-*' in
   (let ((pos (ediff-event-point last-command-event))
        overl cmd)
 
-    (if ediff-xemacs-p
-       (setq overl (extent-at pos (current-buffer) 'ediff-help-info)
-             cmd   (ediff-overlay-get overl 'ediff-help-info))
-      (setq cmd (car (mapcar (function (lambda (elt)
-                                        (overlay-get elt 'ediff-help-info)))
-                            (overlays-at pos)))))
-    
+    (ediff-cond-compile-for-xemacs-or-emacs
+     ;; xemacs
+     (setq overl (extent-at pos (current-buffer) 'ediff-help-info)
+          cmd   (ediff-overlay-get overl 'ediff-help-info))
+     ;; emacs
+     (setq cmd (car (mapcar (lambda (elt)
+                             (overlay-get elt 'ediff-help-info))
+                           (overlays-at pos))))
+     )
+
     (if (not (stringp cmd))
-       (error "Hmm... I don't see an Ediff command around here..."))
-    
+       (error "Hmm...  I don't see an Ediff command around here..."))
+
     (ediff-documentation "Quick Help Commands")
-    
+
     (let (case-fold-search)
       (cond ((string= cmd "?") (re-search-forward "^`\\?'"))
            ((string= cmd "G") (re-search-forward "^`G'"))
@@ -219,6 +227,7 @@ the value of this variable and the variables `ediff-help-message-*' in
            ((string= cmd "r") (re-search-forward "^`r'"))
            ((string= cmd "rx") (re-search-forward "^`ra'"))
            ((string= cmd "##") (re-search-forward "^`##'"))
+           ((string= cmd "#c") (re-search-forward "^`#c'"))
            ((string= cmd "#f/#h") (re-search-forward "^`#f'"))
            ((string= cmd "X") (re-search-forward "^`A'"))
            ((string= cmd "v/V") (re-search-forward "^`v'"))
@@ -231,7 +240,8 @@ the value of this variable and the variables `ediff-help-message-*' in
            ((string= cmd "z/q") (re-search-forward "^`z'"))
            ((string= cmd "%") (re-search-forward "^`%'"))
            ((string= cmd "C-l") (re-search-forward "^`C-l'"))
-           ((string= cmd "$") (re-search-forward "^`\\$'"))
+           ((string= cmd "$$") (re-search-forward "^`\\$\\$'"))
+           ((string= cmd "$*") (re-search-forward "^`\\$\\*'"))
            ((string= cmd "/") (re-search-forward "^`/'"))
            ((string= cmd "&") (re-search-forward "^`&'"))
            ((string= cmd "s") (re-search-forward "^`s'"))
@@ -251,7 +261,7 @@ the value of this variable and the variables `ediff-help-message-*' in
        (next-line 1))
     (end-of-line)
     (current-column)))
-    
+
 
 (defun ediff-indent-help-message ()
   (let* ((shift (/ (max 0 (- (window-width (selected-window))
@@ -264,7 +274,7 @@ the value of this variable and the variables `ediff-help-message-*' in
        (insert str)
        (beginning-of-line)
        (forward-line 1)))))
-      
+
 
 ;; compose the help message as a string
 (defun ediff-set-help-message ()
@@ -273,7 +283,7 @@ the value of this variable and the variables `ediff-help-message-*' in
                    (or (symbolp ediff-long-help-message-function)
                        (consp ediff-long-help-message-function)))
               (funcall ediff-long-help-message-function))
-             (ediff-word-mode 
+             (ediff-word-mode
               (concat ediff-long-help-message-head
                       ediff-long-help-message-word-mode
                       ediff-long-help-message-tail))
@@ -281,7 +291,7 @@ the value of this variable and the variables `ediff-help-message-*' in
               (concat ediff-long-help-message-head
                       ediff-long-help-message-narrow2
                       ediff-long-help-message-tail))
-             (ediff-merge-job 
+             (ediff-merge-job
               (concat ediff-long-help-message-head
                       ediff-long-help-message-merge
                       ediff-long-help-message-tail))
@@ -289,11 +299,11 @@ the value of this variable and the variables `ediff-help-message-*' in
               (concat ediff-long-help-message-head
                       ediff-long-help-message-compare3
                       ediff-long-help-message-tail))
-             (t 
+             (t
               (concat ediff-long-help-message-head
                       ediff-long-help-message-compare2
                       ediff-long-help-message-tail))))
-  (setq ediff-brief-help-message 
+  (setq ediff-brief-help-message
        (cond ((and ediff-brief-help-message-function
                    (or (symbolp ediff-brief-help-message-function)
                        (consp ediff-brief-help-message-function)))
@@ -309,5 +319,14 @@ the value of this variable and the variables `ediff-help-message-*' in
                             ediff-brief-help-message))
   (run-hooks 'ediff-display-help-hook))
 
+;;;###autoload
+(defun ediff-customize ()
+  (interactive)
+  (customize-group "ediff"))
+
+
+(provide 'ediff-help)
+
 
+;;; arch-tag: 05659813-7fcf-4274-964f-d2f577431a9d
 ;;; ediff-help.el ends here