-`log-edit-done' which will end up calling CALLBACK to do the actual commit."
- (when (and log-edit-setup-invert (not (eq setup 'force)))
- (setq setup (not setup)))
- (when setup (erase-buffer))
- (log-edit-mode)
- (set (make-local-variable 'log-edit-callback) callback)
- (set (make-local-variable 'log-edit-listfun) listfun)
- (when setup (run-hooks 'log-edit-hook))
- (goto-char (point-min)) (push-mark (point-max))
- (set (make-local-variable 'log-edit-initial-files) (log-edit-files))
- (message (substitute-command-keys
- "Press \\[log-edit-done] when you are done editing.")))
+`log-edit-done' which will end up calling CALLBACK to do the actual commit.
+LISTFUN if non-nil is a function of no arguments returning the list of files
+ that are concerned by the current operation (using relative names).
+If BUFFER is non-nil `log-edit' will jump to that buffer, use it to edit the
+ log message and go back to the current buffer when done. Otherwise, it
+ uses the current buffer."
+ (let ((parent (current-buffer)))
+ (if buffer (pop-to-buffer buffer))
+ (when (and log-edit-setup-invert (not (eq setup 'force)))
+ (setq setup (not setup)))
+ (when setup (erase-buffer))
+ (log-edit-mode)
+ (set (make-local-variable 'log-edit-callback) callback)
+ (set (make-local-variable 'log-edit-listfun) listfun)
+ (if buffer (set (make-local-variable 'log-edit-parent-buffer) parent))
+ (when setup (run-hooks 'log-edit-hook))
+ (goto-char (point-min)) (push-mark (point-max))
+ (set (make-local-variable 'log-edit-initial-files) (log-edit-files))
+ (message (substitute-command-keys
+ "Press \\[log-edit-done] when you are done editing."))))