aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2003-05-18 03:01:22 +0000
committerStefan Monnier2003-05-18 03:01:22 +0000
commit0916e95698dba93dbb7e0578f0184873c20fcc3c (patch)
tree9cdd6c71ca80b60e1c78e9022172714542ef8dac
parent11cdd167097ab58d387ff8deeb793c8a17c49ae3 (diff)
downloademacs-0916e95698dba93dbb7e0578f0184873c20fcc3c.tar.gz
emacs-0916e95698dba93dbb7e0578f0184873c20fcc3c.zip
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.
-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 @@
35(require 'add-log) ; for all the ChangeLog goodies 35(require 'add-log) ; for all the ChangeLog goodies
36(require 'pcvs-util) 36(require 'pcvs-util)
37(require 'ring) 37(require 'ring)
38(require 'vc)
39 38
40;;;; 39;;;;
41;;;; Global Variables 40;;;; Global Variables
@@ -54,28 +53,21 @@
54 53
55;; The main keymap 54;; The main keymap
56 55
57;; Initialization code, to be done just once at load-time
58(defvar vc-log-mode-map
59 (let ((map (make-sparse-keymap)))
60 (set-keymap-parent map text-mode-map)
61 (define-key map "\M-n" 'vc-next-comment)
62 (define-key map "\M-p" 'vc-previous-comment)
63 (define-key map "\M-r" 'vc-comment-search-reverse)
64 (define-key map "\M-s" 'vc-comment-search-forward)
65 (define-key map "\C-c\C-c" 'vc-finish-logentry)
66 map))
67;; Compatibility with old name. Should we bother ?
68(defvar vc-log-entry-mode vc-log-mode-map)
69
70(easy-mmode-defmap log-edit-mode-map 56(easy-mmode-defmap log-edit-mode-map
71 `(("\C-c\C-c" . log-edit-done) 57 `(("\C-c\C-c" . log-edit-done)
72 ("\C-c\C-a" . log-edit-insert-changelog) 58 ("\C-c\C-a" . log-edit-insert-changelog)
73 ("\C-c\C-f" . log-edit-show-files) 59 ("\C-c\C-f" . log-edit-show-files)
74 ("\C-c?" . log-edit-mode-help)) 60 ("\M-n" . vc-next-comment)
61 ("\M-p" . vc-previous-comment)
62 ("\M-r" . vc-comment-search-reverse)
63 ("\M-s" . vc-comment-search-forward)
64 ("\C-c?" . log-edit-mode-help))
75 "Keymap for the `log-edit-mode' (to edit version control log messages)." 65 "Keymap for the `log-edit-mode' (to edit version control log messages)."
76 :group 'log-edit 66 :group 'log-edit)
77 :inherit (if (boundp 'vc-log-entry-mode) vc-log-entry-mode 67
78 (if (boundp 'vc-log-mode-map) vc-log-mode-map))) 68;; Compatibility with old names. Should we bother ?
69(defvar vc-log-mode-map log-edit-mode-map)
70(defvar vc-log-entry-mode vc-log-mode-map)
79 71
80(easy-menu-define log-edit-menu log-edit-mode-map 72(easy-menu-define log-edit-menu log-edit-mode-map
81 "Menu used for `log-edit-mode'." 73 "Menu used for `log-edit-mode'."
@@ -205,7 +197,8 @@ With a numeric prefix ARG, go back ARG comments."
205 (let ((len (ring-length vc-comment-ring))) 197 (let ((len (ring-length vc-comment-ring)))
206 (if (<= len 0) 198 (if (<= len 0)
207 (progn (message "Empty comment ring") (ding)) 199 (progn (message "Empty comment ring") (ding))
208 (erase-buffer) 200 ;; Don't use `erase-buffer' because we don't want to `widen'.
201 (delete-region (point-min) (point-max))
209 (setq vc-comment-ring-index (vc-new-comment-index arg len)) 202 (setq vc-comment-ring-index (vc-new-comment-index arg len))
210 (message "Comment %d" (1+ vc-comment-ring-index)) 203 (message "Comment %d" (1+ vc-comment-ring-index))
211 (insert (ring-ref vc-comment-ring vc-comment-ring-index))))) 204 (insert (ring-ref vc-comment-ring vc-comment-ring-index)))))
@@ -242,6 +235,8 @@ when going through the comment ring."
242 (list (read-string "Comment substring: " nil nil vc-last-comment-match))) 235 (list (read-string "Comment substring: " nil nil vc-last-comment-match)))
243 (vc-comment-search-reverse str -1)) 236 (vc-comment-search-reverse str -1))
244 237
238
239
245(defun vc-comment-to-change-log (&optional whoami file-name) 240(defun vc-comment-to-change-log (&optional whoami file-name)
246 "Enter last VC comment into the change log for the current file. 241 "Enter last VC comment into the change log for the current file.
247WHOAMI (interactive prefix) non-nil means prompt for user name 242WHOAMI (interactive prefix) non-nil means prompt for user name
@@ -253,9 +248,6 @@ automatically."
253 (interactive (if current-prefix-arg 248 (interactive (if current-prefix-arg
254 (list current-prefix-arg 249 (list current-prefix-arg
255 (prompt-for-change-log-name)))) 250 (prompt-for-change-log-name))))
256 ;; Make sure the defvar for add-log-current-defun-function has been executed
257 ;; before binding it.
258 (require 'add-log)
259 (let (;; Extract the comment first so we get any error before doing anything. 251 (let (;; Extract the comment first so we get any error before doing anything.
260 (comment (ring-ref vc-comment-ring 0)) 252 (comment (ring-ref vc-comment-ring 0))
261 ;; Don't let add-change-log-entry insert a defun name. 253 ;; Don't let add-change-log-entry insert a defun name.
@@ -279,8 +271,7 @@ automatically."
279 (indent-to indentation)) 271 (indent-to indentation))
280 (setq end (point)))) 272 (setq end (point))))
281 ;; Fill the inserted text, preserving open-parens at bol. 273 ;; Fill the inserted text, preserving open-parens at bol.
282 (let ((paragraph-separate (concat paragraph-separate "\\|\\s *\\s(")) 274 (let ((paragraph-start (concat paragraph-start "\\|\\s *\\s(")))
283 (paragraph-start (concat paragraph-start "\\|\\s *\\s(")))
284 (beginning-of-line) 275 (beginning-of-line)
285 (fill-region (point) end)) 276 (fill-region (point) end))
286 ;; Canonicalize the white space at the end of the entry so it is 277 ;; Canonicalize the white space at the end of the entry so it is