diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2005-10-15 12:04:34 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2005-10-15 12:04:34 +0000 |
commit | bad3da7a5f21b36e9cb5c2c1f907e5e3d6f9ecbf (patch) | |
tree | 426e85d0298ae5e9d9066f367a5046f4c1635397 /lisp/pcvs.el | |
parent | aa2361eb581092f5aec2f93c92e011ef681294eb (diff) | |
download | emacs-bad3da7a5f21b36e9cb5c2c1f907e5e3d6f9ecbf.tar.gz |
(cvs-edit-log-files): New var.
(cvs-mode-edit-log): New arg `file'.
(cvs-edit-log-minor-wrap): Don't set the ignore-marks property.
Instead force the use of the original file and nothing else.
(cvs-edit-log-filelist): Don't use the cvs-mode-* function unless
the cvs-minor-wrap-function is set.
(cvs-do-edit-log): Obey the vars set in cvs-edit-log-minor-wrap.
Diffstat (limited to 'lisp/pcvs.el')
-rw-r--r-- | lisp/pcvs.el | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/lisp/pcvs.el b/lisp/pcvs.el index f86e4c95625..1e9f1bce7ce 100644 --- a/lisp/pcvs.el +++ b/lisp/pcvs.el @@ -1482,11 +1482,16 @@ The POSTPROC specified there (typically `log-edit') is then called, (point)))))) (defvar cvs-edit-log-revision) -(defun cvs-mode-edit-log (rev &optional text) +(defvar cvs-edit-log-files) (put 'cvs-edit-log-files 'permanent-local t) +(defun cvs-mode-edit-log (file rev &optional text) "Edit the log message at point. This is best called from a `log-view-mode' buffer." (interactive (list + (or (cvs-mode! (lambda () + (car (cvs-mode-files nil nil + :read-only t :file t :noquery t)))) + (read-string "File name: ")) (or (cvs-mode! (lambda () (cvs-prefix-get 'cvs-branch-prefix))) (read-string "Revision to edit: ")) (cvs-edit-log-text-at-point))) @@ -1498,26 +1503,38 @@ This is best called from a `log-view-mode' buffer." (let ((buf (cvs-temp-buffer "message" 'normal 'nosetup)) (setupfun (or (nth 2 (cdr (assoc "message" cvs-buffer-name-alist))) 'log-edit))) + (with-current-buffer buf + ;; Set the filename before, so log-edit can correctly setup its + ;; log-edit-initial-files variable. + (set (make-local-variable 'cvs-edit-log-files) (list file))) (funcall setupfun 'cvs-do-edit-log nil 'cvs-edit-log-filelist buf) (when text (erase-buffer) (insert text)) (set (make-local-variable 'cvs-edit-log-revision) rev) - (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-edit-log-minor-wrap) + (set (make-local-variable 'cvs-minor-wrap-function) + 'cvs-edit-log-minor-wrap) ;; (run-hooks 'cvs-mode-commit-hook) )) (defun cvs-edit-log-minor-wrap (buf f) - (let ((cvs-ignore-marks-modif (cvs-mode-mark-get-modif "commit"))) + (let ((cvs-branch-prefix (with-current-buffer buf cvs-edit-log-revision)) + (cvs-minor-current-files + (with-current-buffer buf cvs-edit-log-files)) + ;; FIXME: I need to force because the fileinfos are UNKNOWN + (cvs-force-command "/F")) (funcall f))) (defun cvs-edit-log-filelist () - (cvs-mode-files nil nil :read-only t :file t :noquery t)) + (if cvs-minor-wrap-function + (cvs-mode-files nil nil :read-only t :file t :noquery t) + cvs-edit-log-files)) (defun cvs-do-edit-log (rev) "Do the actual commit, using the current buffer as the log message." (interactive (list cvs-edit-log-revision)) (let ((msg (buffer-substring-no-properties (point-min) (point-max)))) - (cvs-mode!) - (cvs-mode-do "admin" (list (concat "-m" rev ":" msg)) nil))) + (cvs-mode! + (lambda () + (cvs-mode-do "admin" (list (concat "-m" rev ":" msg)) nil))))) ;;;; |