From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: log-edit-insert-changelog even when run git/hg from the Date: Sat, 1 Oct 2022 03:10:20 +0300 Message-ID: <078c04cf-00ad-4104-5762-6b3b7832485c@yandex.ru> References: <87fsgyuyh7.fsf@mat.ucm.es> <87fsg9crz3.fsf@mat.ucm.es> <87ill4c18c.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="691"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cc: emacs-devel@gnu.org To: Uwe Brauer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 01 02:11:50 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oeQ6f-000AbD-Ju for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Oct 2022 02:11:49 +0200 Original-Received: from localhost ([::1]:46052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oeQ6e-0004HQ-Md for ged-emacs-devel@m.gmane-mx.org; Fri, 30 Sep 2022 20:11:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeQ5W-0003V8-Si for emacs-devel@gnu.org; Fri, 30 Sep 2022 20:10:42 -0400 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:46943) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oeQ5Q-00040e-Fu for emacs-devel@gnu.org; Fri, 30 Sep 2022 20:10:38 -0400 Original-Received: by mail-wm1-x334.google.com with SMTP id n40-20020a05600c3ba800b003b49aefc35fso2938163wms.5 for ; Fri, 30 Sep 2022 17:10:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date; bh=jRewR5uaxYitchNeZ0Fztl4MEFHwQzVIODdynV/XST8=; b=k0WpmQAXv+gtNO3lompj7AiL4nMEtJFMTDoEZoabFm2DZQ1am2IdBbSlPriQZjpWbH iUrCHe3v0nl+O4IRwz/gQ+VQ389Whkow04IA9Gn4yE85TOtqtrLONAQnlP4wo1IdK8Tk YZOwYCahCug/Zqh2BelqOTGMzs8rUorNxo11JnSGi5Ypfv5c39BUFGZyZVervluvSBP8 gybrBw71yqlY/xiLenF8KdqOWylSL4+ffJYAMfwH1dt6E2Y2YV/XG/5dALVZDk9bEa7p E8IT7M/jFQgHGbsRZUkmTv3HwwTaSjOnMvTEMadkbZ44vtj/FdCCEOIhMsD8faT2sCpW 2Ivg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date; bh=jRewR5uaxYitchNeZ0Fztl4MEFHwQzVIODdynV/XST8=; b=Rv6m+cnc3bCr/n1RkbDEkLvc0+qg6kl9nRZgzql7VtiPt1XerrYOboKArSkmWNxmm/ b6e48lNLApMmYy7oq5xx/Q/I4rjj28xdoAzi28Tv+hH+dM6Qv8QSbEi+IKwYHycSmH+u ewVfFgR2165WYAWqf1j9Yj1GVwyZelm8akf2aFiyR9Rdt7k2QaOSrA8WnG/5/O5takX8 5xCBkzEjGip4tVjlI5Iy6mP90GfRhm3pNGIDRH9Kn40+cSnXHT/46s3sSDm3z8lrGZT6 zfQ6Hn8YPQefdMRD/8tHXw7Ls/MEm6x2Vdt/3zfEY4lsK534utCM0MqUSN5KJArmWhd6 b/VQ== X-Gm-Message-State: ACrzQf3f67g2KVPLk7dNGGMUvj1wqStMDUTSmuV9ivITrqotKn1Q3VsH 1SS10fej8P5vyF5JqD/iAfQ= X-Google-Smtp-Source: AMsMyM6Tktk2/ZXn+UDyBxFHNoXDuBqP/hsd/Dnt66dYj3s+e9LvVSqejVjZPF7G+VXlPaqnBNWn1A== X-Received: by 2002:a05:600c:5490:b0:3b4:8db0:5547 with SMTP id iv16-20020a05600c549000b003b48db05547mr299674wmb.77.1664583022405; Fri, 30 Sep 2022 17:10:22 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id k17-20020adfe8d1000000b00226dfac0149sm3269220wrn.114.2022.09.30.17.10.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Sep 2022 17:10:22 -0700 (PDT) Content-Language: en-US In-Reply-To: <87ill4c18c.fsf@mat.ucm.es> Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=raaahh@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.583, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:296536 Archived-At: 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.