]> code.delx.au - gnu-emacs/blobdiff - lisp/log-edit.el
* paths.el: Remove gnus-startup-file.
[gnu-emacs] / lisp / log-edit.el
index fdb0c3d7400f3e5be65c3268bb2681e113a4ec61..54cf34c7be950e7fb4bd5247c89954ee39de9cea 100644 (file)
@@ -4,8 +4,7 @@
 
 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
 ;; Keywords: pcl-cvs cvs commit log
-;; Version: $Name:  $
-;; Revision: $Id: log-edit.el,v 1.12 2000/12/06 19:36:44 fx Exp $
+;; Revision: $Id: log-edit.el,v 1.16 2001/05/11 20:42:58 monnier Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -127,7 +126,7 @@ conventions, or to allow recording the message in some other database,
 such as a bug-tracking system.  The list of files about to be committed
 can be obtained from `log-edit-files'."
   :group 'log-edit
-  :type '(hook :options (log-edit-delete-common-indentation
+  :type '(hook :options (log-edit-set-common-indentation
                         log-edit-add-to-changelog)))
 
 (defvar cvs-changelog-full-paragraphs t
@@ -189,9 +188,9 @@ If BUFFER is non-nil `log-edit' will jump to that buffer, use it to edit the
     (set (make-local-variable 'log-edit-callback) callback)
     (set (make-local-variable 'log-edit-listfun) listfun)
     (if buffer (set (make-local-variable 'log-edit-parent-buffer) parent))
+    (set (make-local-variable 'log-edit-initial-files) (log-edit-files))
     (when setup (run-hooks 'log-edit-hook))
     (goto-char (point-min)) (push-mark (point-max))
-    (set (make-local-variable 'log-edit-initial-files) (log-edit-files))
     (message (substitute-command-keys
              "Press \\[log-edit-done] when you are done editing."))))
 
@@ -270,7 +269,7 @@ To select default log text, we:
 - use those paragraphs as the log text."
   (interactive)
   (log-edit-insert-changelog-entries (log-edit-files))
-  (log-edit-delete-common-indentation)
+  (log-edit-set-common-indentation)
   (goto-char (point-min))
   (when (looking-at "\\*\\s-+")
     (forward-line 1)
@@ -289,8 +288,13 @@ To select default log text, we:
      (substitute-command-keys
       "Type `\\[log-edit-done]' to finish commit.  Try `\\[describe-function] log-edit-done' for more help."))))
 
-(defun log-edit-delete-common-indentation ()
-  "Unindent the current buffer rigidly until at least one line is flush left."
+(defcustom log-edit-common-indent 0
+  "Minimum indentation to use in `log-edit-set-common-indentation'."
+  :group 'log-edit
+  :type 'integer)
+
+(defun log-edit-set-common-indentation ()
+  "(Un)Indent the current buffer rigidly to `log-edit-common-indent'."
   (save-excursion
     (let ((common (point-max)))
       (goto-char (point-min))
@@ -298,7 +302,8 @@ To select default log text, we:
         (if (not (looking-at "^[ \t]*$"))
             (setq common (min common (current-indentation))))
         (forward-line 1))
-      (indent-rigidly (point-min) (point-max) (- common)))))
+      (indent-rigidly (point-min) (point-max)
+                     (- log-edit-common-indent common)))))
 
 (defun log-edit-show-files ()
   "Show the list of files to be committed."
@@ -492,7 +497,4 @@ Sort REGIONS front-to-back first."
 
 (provide 'log-edit)
 
-;;; Change Log:
-;; $log$
-
 ;;; log-edit.el ends here