emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: log-edit-insert-changelog even when run git/hg from the


From: Dmitry Gutov
Subject: Re: log-edit-insert-changelog even when run git/hg from the
Date: Sat, 1 Oct 2022 03:10:20 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 30.09.2022 18:48, Uwe Brauer wrote:
I did this, first let me remark that the docstring states:

   "Insert a VC commit log message by looking at the ChangeLog.
The idea is to write your ChangeLog entries first, and then use this
command to commit your changes with that log."

So that seems to suggest that only vc-commands are covered but not the ones in 
which you start the VCS command from the command line and change then 
emacsclient into vc-hg-log-edit-mode

In any case edebug resulted in
   (interactive "P")
   (save-excursion
     (let ((eoh (save-excursion (rfc822-goto-eoh) (point))))
       (when (<= (point) eoh)
        (goto-char eoh)
        (if (looking-at "\n") (forward-char 1))))
     (let ((author
           (let ((log-edit-changelog-use-first
                  (or use-first (eq last-command 'log-edit-insert-changelog))))
             (log-edit-insert-changelog-entries (log-edit-files)))))
                                                      ^nil

So  log-edit-files return nil!
I tried to debug this as well,
(defun log-edit-files ()
   "Return the list of files that are about to be committed."
   (ignore-errors (funcall log-edit-listfun)))

but again (funcall log-edit-listfun)))  returned nil.

In a «normal vc-next-action that funcall returns a non nil value


Any suggestions?

I suppose there are two directions to go from here.

First, you could set log-edit-listfun to a function that retrieves the list of files you are currently committing. Not sure how that could be implemented, but some reading of files on disk might be involved.

Or maybe Hg passes those files in a comment to the commit edit program, I'm not sure.

Alternatively, we could modify log-edit-insert-changelog-entries to honor the USE-FIRST argument as well. Perhaps it would see that its FILES argument is nil, and when so, if the (newly added) argument USE-FIRST is non-nil, it would copy the first entry from the change log.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]