comparison lisp/log-edit.el @ 36616:61f696f7e5f9

(log-edit-common-indent): New var. (log-edit-set-common-indentation): Renamed from log-edit-delete-common-indentation. Use the new var. (log-edit-insert-changelog, log-edit-done-hook): Use the new name.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 07 Mar 2001 00:26:25 +0000
parents 45a589a4c480
children 615b5341ede0
comparison
equal deleted inserted replaced
36615:c3af189df631 36616:61f696f7e5f9
2 2
3 ;; Copyright (C) 1999, 2000 Free Software Foundation, Inc. 3 ;; Copyright (C) 1999, 2000 Free Software Foundation, Inc.
4 4
5 ;; Author: Stefan Monnier <monnier@cs.yale.edu> 5 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
6 ;; Keywords: pcl-cvs cvs commit log 6 ;; Keywords: pcl-cvs cvs commit log
7 ;; Revision: $Id: log-edit.el,v 1.13 2000/12/10 21:08:55 monnier Exp $ 7 ;; Revision: $Id: log-edit.el,v 1.14 2000/12/18 03:17:31 monnier Exp $
8 8
9 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
10 10
11 ;; GNU Emacs is free software; you can redistribute it and/or modify 11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by 12 ;; it under the terms of the GNU General Public License as published by
124 This hook can be used to cleanup the message, enforce various 124 This hook can be used to cleanup the message, enforce various
125 conventions, or to allow recording the message in some other database, 125 conventions, or to allow recording the message in some other database,
126 such as a bug-tracking system. The list of files about to be committed 126 such as a bug-tracking system. The list of files about to be committed
127 can be obtained from `log-edit-files'." 127 can be obtained from `log-edit-files'."
128 :group 'log-edit 128 :group 'log-edit
129 :type '(hook :options (log-edit-delete-common-indentation 129 :type '(hook :options (log-edit-set-common-indentation
130 log-edit-add-to-changelog))) 130 log-edit-add-to-changelog)))
131 131
132 (defvar cvs-changelog-full-paragraphs t 132 (defvar cvs-changelog-full-paragraphs t
133 "Obsolete, use `log-edit-changelog-full-paragraphs'.") 133 "Obsolete, use `log-edit-changelog-full-paragraphs'.")
134 134
267 - search the ChangeLog entry for paragraphs containing the names of 267 - search the ChangeLog entry for paragraphs containing the names of
268 the files we're checking in, and finally 268 the files we're checking in, and finally
269 - use those paragraphs as the log text." 269 - use those paragraphs as the log text."
270 (interactive) 270 (interactive)
271 (log-edit-insert-changelog-entries (log-edit-files)) 271 (log-edit-insert-changelog-entries (log-edit-files))
272 (log-edit-delete-common-indentation) 272 (log-edit-set-common-indentation)
273 (goto-char (point-min)) 273 (goto-char (point-min))
274 (when (looking-at "\\*\\s-+") 274 (when (looking-at "\\*\\s-+")
275 (forward-line 1) 275 (forward-line 1)
276 (when (not (re-search-forward "^\\*\\s-+" nil t)) 276 (when (not (re-search-forward "^\\*\\s-+" nil t))
277 (goto-char (point-min)) 277 (goto-char (point-min))
286 (describe-function major-mode) 286 (describe-function major-mode)
287 (message 287 (message
288 (substitute-command-keys 288 (substitute-command-keys
289 "Type `\\[log-edit-done]' to finish commit. Try `\\[describe-function] log-edit-done' for more help.")))) 289 "Type `\\[log-edit-done]' to finish commit. Try `\\[describe-function] log-edit-done' for more help."))))
290 290
291 (defun log-edit-delete-common-indentation () 291 (defcustom log-edit-common-indent 0
292 "Unindent the current buffer rigidly until at least one line is flush left." 292 "Minimum indentation to use in `log-edit-set-common-indentation'."
293 :group 'log-edit
294 :type 'integer)
295
296 (defun log-edit-set-common-indentation ()
297 "(Un)Indent the current buffer rigidly to `log-edit-common-indent'."
293 (save-excursion 298 (save-excursion
294 (let ((common (point-max))) 299 (let ((common (point-max)))
295 (goto-char (point-min)) 300 (goto-char (point-min))
296 (while (< (point) (point-max)) 301 (while (< (point) (point-max))
297 (if (not (looking-at "^[ \t]*$")) 302 (if (not (looking-at "^[ \t]*$"))
298 (setq common (min common (current-indentation)))) 303 (setq common (min common (current-indentation))))
299 (forward-line 1)) 304 (forward-line 1))
300 (indent-rigidly (point-min) (point-max) (- common))))) 305 (indent-rigidly (point-min) (point-max)
306 (- log-edit-common-indent common)))))
301 307
302 (defun log-edit-show-files () 308 (defun log-edit-show-files ()
303 "Show the list of files to be committed." 309 "Show the list of files to be committed."
304 (interactive) 310 (interactive)
305 (let* ((files (log-edit-files)) 311 (let* ((files (log-edit-files))