summaryrefslogtreecommitdiff
path: root/lisp/log-edit.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2003-05-18 03:01:22 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2003-05-18 03:01:22 +0000
commit0916e95698dba93dbb7e0578f0184873c20fcc3c (patch)
tree9cdd6c71ca80b60e1c78e9022172714542ef8dac /lisp/log-edit.el
parent11cdd167097ab58d387ff8deeb793c8a17c49ae3 (diff)
downloademacs-0916e95698dba93dbb7e0578f0184873c20fcc3c.tar.gz
Don't require vc.el anymore.
(log-edit-mode-map): Fold vc-log-mode-map into it. (vc-log-mode-map): Redefine as an alias. (vc-previous-comment): Don't widen. (vc-comment-to-change-log): Don't redundantly set paragraph-separate. Don't require `add-log' since it's already required at toplevel.
Diffstat (limited to 'lisp/log-edit.el')
-rw-r--r--lisp/log-edit.el39
1 files changed, 15 insertions, 24 deletions
diff --git a/lisp/log-edit.el b/lisp/log-edit.el
index 3d01de49738..28da8d8217c 100644
--- a/lisp/log-edit.el
+++ b/lisp/log-edit.el
@@ -35,7 +35,6 @@
(require 'add-log) ; for all the ChangeLog goodies
(require 'pcvs-util)
(require 'ring)
-(require 'vc)
;;;;
;;;; Global Variables
@@ -54,28 +53,21 @@
;; The main keymap
-;; Initialization code, to be done just once at load-time
-(defvar vc-log-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map text-mode-map)
- (define-key map "\M-n" 'vc-next-comment)
- (define-key map "\M-p" 'vc-previous-comment)
- (define-key map "\M-r" 'vc-comment-search-reverse)
- (define-key map "\M-s" 'vc-comment-search-forward)
- (define-key map "\C-c\C-c" 'vc-finish-logentry)
- map))
-;; Compatibility with old name. Should we bother ?
-(defvar vc-log-entry-mode vc-log-mode-map)
-
(easy-mmode-defmap log-edit-mode-map
`(("\C-c\C-c" . log-edit-done)
("\C-c\C-a" . log-edit-insert-changelog)
("\C-c\C-f" . log-edit-show-files)
- ("\C-c?" . log-edit-mode-help))
+ ("\M-n" . vc-next-comment)
+ ("\M-p" . vc-previous-comment)
+ ("\M-r" . vc-comment-search-reverse)
+ ("\M-s" . vc-comment-search-forward)
+ ("\C-c?" . log-edit-mode-help))
"Keymap for the `log-edit-mode' (to edit version control log messages)."
- :group 'log-edit
- :inherit (if (boundp 'vc-log-entry-mode) vc-log-entry-mode
- (if (boundp 'vc-log-mode-map) vc-log-mode-map)))
+ :group 'log-edit)
+
+;; Compatibility with old names. Should we bother ?
+(defvar vc-log-mode-map log-edit-mode-map)
+(defvar vc-log-entry-mode vc-log-mode-map)
(easy-menu-define log-edit-menu log-edit-mode-map
"Menu used for `log-edit-mode'."
@@ -205,7 +197,8 @@ With a numeric prefix ARG, go back ARG comments."
(let ((len (ring-length vc-comment-ring)))
(if (<= len 0)
(progn (message "Empty comment ring") (ding))
- (erase-buffer)
+ ;; Don't use `erase-buffer' because we don't want to `widen'.
+ (delete-region (point-min) (point-max))
(setq vc-comment-ring-index (vc-new-comment-index arg len))
(message "Comment %d" (1+ vc-comment-ring-index))
(insert (ring-ref vc-comment-ring vc-comment-ring-index)))))
@@ -242,6 +235,8 @@ when going through the comment ring."
(list (read-string "Comment substring: " nil nil vc-last-comment-match)))
(vc-comment-search-reverse str -1))
+
+
(defun vc-comment-to-change-log (&optional whoami file-name)
"Enter last VC comment into the change log for the current file.
WHOAMI (interactive prefix) non-nil means prompt for user name
@@ -253,9 +248,6 @@ automatically."
(interactive (if current-prefix-arg
(list current-prefix-arg
(prompt-for-change-log-name))))
- ;; Make sure the defvar for add-log-current-defun-function has been executed
- ;; before binding it.
- (require 'add-log)
(let (;; Extract the comment first so we get any error before doing anything.
(comment (ring-ref vc-comment-ring 0))
;; Don't let add-change-log-entry insert a defun name.
@@ -279,8 +271,7 @@ automatically."
(indent-to indentation))
(setq end (point))))
;; Fill the inserted text, preserving open-parens at bol.
- (let ((paragraph-separate (concat paragraph-separate "\\|\\s *\\s("))
- (paragraph-start (concat paragraph-start "\\|\\s *\\s(")))
+ (let ((paragraph-start (concat paragraph-start "\\|\\s *\\s(")))
(beginning-of-line)
(fill-region (point) end))
;; Canonicalize the white space at the end of the entry so it is