diff options
| author | Stefan Monnier | 2005-10-15 12:04:34 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-10-15 12:04:34 +0000 |
| commit | bad3da7a5f21b36e9cb5c2c1f907e5e3d6f9ecbf (patch) | |
| tree | 426e85d0298ae5e9d9066f367a5046f4c1635397 | |
| parent | aa2361eb581092f5aec2f93c92e011ef681294eb (diff) | |
| download | emacs-bad3da7a5f21b36e9cb5c2c1f907e5e3d6f9ecbf.tar.gz emacs-bad3da7a5f21b36e9cb5c2c1f907e5e3d6f9ecbf.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/pcvs.el | 29 |
2 files changed, 33 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ae3c3ed4fe4..b2d06f5090e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2005-10-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * pcvs.el (cvs-edit-log-files): New var. | ||
| 4 | (cvs-mode-edit-log): New arg `file'. | ||
| 5 | (cvs-edit-log-minor-wrap): Don't set the ignore-marks property. | ||
| 6 | Instead force the use of the original file and nothing else. | ||
| 7 | (cvs-edit-log-filelist): Don't use the cvs-mode-* function unless | ||
| 8 | the cvs-minor-wrap-function is set. | ||
| 9 | (cvs-do-edit-log): Obey the vars set in cvs-edit-log-minor-wrap. | ||
| 10 | |||
| 1 | 2005-10-14 Bill Wohler <wohler@newt.com> | 11 | 2005-10-14 Bill Wohler <wohler@newt.com> |
| 2 | 12 | ||
| 3 | * toolbar/gud-break.*: Moved to etc/images/gud/break.*. | 13 | * toolbar/gud-break.*: Moved to etc/images/gud/break.*. |
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, | |||
| 1482 | (point)))))) | 1482 | (point)))))) |
| 1483 | 1483 | ||
| 1484 | (defvar cvs-edit-log-revision) | 1484 | (defvar cvs-edit-log-revision) |
| 1485 | (defun cvs-mode-edit-log (rev &optional text) | 1485 | (defvar cvs-edit-log-files) (put 'cvs-edit-log-files 'permanent-local t) |
| 1486 | (defun cvs-mode-edit-log (file rev &optional text) | ||
| 1486 | "Edit the log message at point. | 1487 | "Edit the log message at point. |
| 1487 | This is best called from a `log-view-mode' buffer." | 1488 | This is best called from a `log-view-mode' buffer." |
| 1488 | (interactive | 1489 | (interactive |
| 1489 | (list | 1490 | (list |
| 1491 | (or (cvs-mode! (lambda () | ||
| 1492 | (car (cvs-mode-files nil nil | ||
| 1493 | :read-only t :file t :noquery t)))) | ||
| 1494 | (read-string "File name: ")) | ||
| 1490 | (or (cvs-mode! (lambda () (cvs-prefix-get 'cvs-branch-prefix))) | 1495 | (or (cvs-mode! (lambda () (cvs-prefix-get 'cvs-branch-prefix))) |
| 1491 | (read-string "Revision to edit: ")) | 1496 | (read-string "Revision to edit: ")) |
| 1492 | (cvs-edit-log-text-at-point))) | 1497 | (cvs-edit-log-text-at-point))) |
| @@ -1498,26 +1503,38 @@ This is best called from a `log-view-mode' buffer." | |||
| 1498 | (let ((buf (cvs-temp-buffer "message" 'normal 'nosetup)) | 1503 | (let ((buf (cvs-temp-buffer "message" 'normal 'nosetup)) |
| 1499 | (setupfun (or (nth 2 (cdr (assoc "message" cvs-buffer-name-alist))) | 1504 | (setupfun (or (nth 2 (cdr (assoc "message" cvs-buffer-name-alist))) |
| 1500 | 'log-edit))) | 1505 | 'log-edit))) |
| 1506 | (with-current-buffer buf | ||
| 1507 | ;; Set the filename before, so log-edit can correctly setup its | ||
| 1508 | ;; log-edit-initial-files variable. | ||
| 1509 | (set (make-local-variable 'cvs-edit-log-files) (list file))) | ||
| 1501 | (funcall setupfun 'cvs-do-edit-log nil 'cvs-edit-log-filelist buf) | 1510 | (funcall setupfun 'cvs-do-edit-log nil 'cvs-edit-log-filelist buf) |
| 1502 | (when text (erase-buffer) (insert text)) | 1511 | (when text (erase-buffer) (insert text)) |
| 1503 | (set (make-local-variable 'cvs-edit-log-revision) rev) | 1512 | (set (make-local-variable 'cvs-edit-log-revision) rev) |
| 1504 | (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-edit-log-minor-wrap) | 1513 | (set (make-local-variable 'cvs-minor-wrap-function) |
| 1514 | 'cvs-edit-log-minor-wrap) | ||
| 1505 | ;; (run-hooks 'cvs-mode-commit-hook) | 1515 | ;; (run-hooks 'cvs-mode-commit-hook) |
| 1506 | )) | 1516 | )) |
| 1507 | 1517 | ||
| 1508 | (defun cvs-edit-log-minor-wrap (buf f) | 1518 | (defun cvs-edit-log-minor-wrap (buf f) |
| 1509 | (let ((cvs-ignore-marks-modif (cvs-mode-mark-get-modif "commit"))) | 1519 | (let ((cvs-branch-prefix (with-current-buffer buf cvs-edit-log-revision)) |
| 1520 | (cvs-minor-current-files | ||
| 1521 | (with-current-buffer buf cvs-edit-log-files)) | ||
| 1522 | ;; FIXME: I need to force because the fileinfos are UNKNOWN | ||
| 1523 | (cvs-force-command "/F")) | ||
| 1510 | (funcall f))) | 1524 | (funcall f))) |
| 1511 | 1525 | ||
| 1512 | (defun cvs-edit-log-filelist () | 1526 | (defun cvs-edit-log-filelist () |
| 1513 | (cvs-mode-files nil nil :read-only t :file t :noquery t)) | 1527 | (if cvs-minor-wrap-function |
| 1528 | (cvs-mode-files nil nil :read-only t :file t :noquery t) | ||
| 1529 | cvs-edit-log-files)) | ||
| 1514 | 1530 | ||
| 1515 | (defun cvs-do-edit-log (rev) | 1531 | (defun cvs-do-edit-log (rev) |
| 1516 | "Do the actual commit, using the current buffer as the log message." | 1532 | "Do the actual commit, using the current buffer as the log message." |
| 1517 | (interactive (list cvs-edit-log-revision)) | 1533 | (interactive (list cvs-edit-log-revision)) |
| 1518 | (let ((msg (buffer-substring-no-properties (point-min) (point-max)))) | 1534 | (let ((msg (buffer-substring-no-properties (point-min) (point-max)))) |
| 1519 | (cvs-mode!) | 1535 | (cvs-mode! |
| 1520 | (cvs-mode-do "admin" (list (concat "-m" rev ":" msg)) nil))) | 1536 | (lambda () |
| 1537 | (cvs-mode-do "admin" (list (concat "-m" rev ":" msg)) nil))))) | ||
| 1521 | 1538 | ||
| 1522 | 1539 | ||
| 1523 | ;;;; | 1540 | ;;;; |