From unknown Thu Aug 14 18:32:17 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#16170 <16170@debbugs.gnu.org> To: bug#16170 <16170@debbugs.gnu.org> Subject: Status: Customizable log-edit commit messages Reply-To: bug#16170 <16170@debbugs.gnu.org> Date: Fri, 15 Aug 2025 01:32:17 +0000 retitle 16170 Customizable log-edit commit messages reassign 16170 emacs submitter 16170 Juri Linkov severity 16170 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 16 20:35:20 2013 Received: (at submit) by debbugs.gnu.org; 17 Dec 2013 01:35:20 +0000 Received: from localhost ([127.0.0.1]:54681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VsjZ9-0003V6-Gw for submit@debbugs.gnu.org; Mon, 16 Dec 2013 20:35:19 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34820) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VsjZ7-0003Uy-H0 for submit@debbugs.gnu.org; Mon, 16 Dec 2013 20:35:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsjYy-00077R-MR for submit@debbugs.gnu.org; Mon, 16 Dec 2013 20:35:17 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsjYy-00077N-KL for submit@debbugs.gnu.org; Mon, 16 Dec 2013 20:35:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsjYs-0000pX-IR for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2013 20:35:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsjYm-0006oo-C7 for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2013 20:35:02 -0500 Received: from [69.163.184.122] (port=47634 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsjYm-0006oc-3O for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2013 20:34:56 -0500 Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.184.122]) by ps18281.dreamhostps.com (Postfix) with ESMTP id DE268303236A33 for ; Mon, 16 Dec 2013 17:12:33 -0800 (PST) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: Customizable log-edit commit messages Organization: JURTA Date: Tue, 17 Dec 2013 02:38:02 +0200 Message-ID: <87fvpsgvmd.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Currently the commit message is hard-coded that might be unsuitable to other projects with different conventions. This patch leaves the current default unchanged, and moves it to a separate function, so a set of messages could by easily configured in `log-edit-hook'. Adding `save-excursion' to `log-edit-insert-cvs-template' was necessary to not move point set by `message-position-point' in `log-edit-insert-message-template'. === modified file 'lisp/vc/log-edit.el' --- lisp/vc/log-edit.el 2013-12-04 00:37:33 +0000 +++ lisp/vc/log-edit.el 2013-12-17 00:34:35 +0000 @@ -126,12 +126,14 @@ (defcustom log-edit-setup-add-author nil :type 'boolean :safe 'booleanp) -(defcustom log-edit-hook '(log-edit-insert-cvs-template +(defcustom log-edit-hook '(log-edit-insert-message-template + log-edit-insert-cvs-template log-edit-show-files log-edit-insert-changelog) "Hook run at the end of `log-edit'." :group 'log-edit - :type '(hook :options (log-edit-insert-changelog + :type '(hook :options (log-edit-insert-message-template + log-edit-insert-changelog log-edit-insert-cvs-rcstemplate log-edit-insert-cvs-template log-edit-insert-filenames))) @@ -440,12 +442,6 @@ (defun log-edit (callback &optional setu (if mode (funcall mode) (log-edit-mode)) - (when setup - (erase-buffer) - (insert "Summary: ") - (when log-edit-setup-add-author - (insert "\nAuthor: ")) - (insert "\n\n")) (set (make-local-variable 'log-edit-callback) callback) (if (listp params) (dolist (crt params) @@ -456,10 +452,9 @@ (defun log-edit (callback &optional setu (if buffer (set (make-local-variable 'log-edit-parent-buffer) parent)) (set (make-local-variable 'log-edit-initial-files) (log-edit-files)) - (when setup (run-hooks 'log-edit-hook)) - (if setup - (message-position-point) - (goto-char (point-min))) + (when setup + (erase-buffer) + (run-hooks 'log-edit-hook)) (push-mark (point-max)) (message "%s" (substitute-command-keys "Press \\[log-edit-done] when you are done editing.")))) @@ -626,6 +621,17 @@ (defun log-edit-empty-buffer-p () (zerop (forward-line 1)))) (eobp)))) +(defun log-edit-insert-message-template () + "Insert the default template with Summary and Author." + (interactive) + (when (or (called-interactively-p 'interactive) + (log-edit-empty-buffer-p)) + (insert "Summary: ") + (when log-edit-setup-add-author + (insert "\nAuthor: ")) + (insert "\n\n") + (message-position-point))) + (defun log-edit-insert-cvs-template () "Insert the template specified by the CVS administrator, if any. This simply uses the local CVS/Template file." @@ -701,6 +707,7 @@ (defun log-edit-insert-changelog (&optio or if the command is repeated a second time in a row, use the first log entry regardless of user name or time." (interactive "P") + (save-excursion (let ((eoh (save-excursion (rfc822-goto-eoh) (point)))) (when (<= (point) eoh) (goto-char eoh) @@ -732,8 +739,7 @@ (defun log-edit-insert-changelog (&optio (goto-char start) (skip-chars-forward "^():") (skip-chars-forward ": ") - (delete-region start (point))))) - (goto-char (point-min)))) + (delete-region start (point)))))))) From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 18 18:53:27 2013 Received: (at 16170-done) by debbugs.gnu.org; 18 Dec 2013 23:53:27 +0000 Received: from localhost ([127.0.0.1]:57868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VtQvf-0004NR-8H for submit@debbugs.gnu.org; Wed, 18 Dec 2013 18:53:27 -0500 Received: from [69.163.184.122] (port=54175 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VtQvd-0004NG-9y for 16170-done@debbugs.gnu.org; Wed, 18 Dec 2013 18:53:25 -0500 Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.184.122]) by ps18281.dreamhostps.com (Postfix) with ESMTP id B4CBC30366ACFA for <16170-done@debbugs.gnu.org>; Wed, 18 Dec 2013 15:53:23 -0800 (PST) From: Juri Linkov To: 16170-done@debbugs.gnu.org Subject: Re: bug#16170: Customizable log-edit commit messages Organization: JURTA References: <87fvpsgvmd.fsf@mail.jurta.org> Date: Thu, 19 Dec 2013 01:52:45 +0200 In-Reply-To: <87fvpsgvmd.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 17 Dec 2013 02:38:02 +0200") Message-ID: <87sitrutqs.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Currently the commit message is hard-coded that might be unsuitable > to other projects with different conventions. This patch leaves the > current default unchanged, and moves it to a separate function, > so a set of messages could by easily configured in `log-edit-hook'. > Adding `save-excursion' to `log-edit-insert-cvs-template' was > necessary to not move point set by `message-position-point' in > `log-edit-insert-message-template'. [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 16170-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Currently the commit message is hard-coded that might be unsuitable > to other projects with different conventions. This patch leaves the > current default unchanged, and moves it to a separate function, > so a set of messages could by easily configured in `log-edit-hook'. > Adding `save-excursion' to `log-edit-insert-cvs-template' was > necessary to not move point set by `message-position-point' in > `log-edit-insert-message-template'. [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS > Currently the commit message is hard-coded that might be unsuitable > to other projects with different conventions. This patch leaves the > current default unchanged, and moves it to a separate function, > so a set of messages could by easily configured in `log-edit-hook'. > Adding `save-excursion' to `log-edit-insert-cvs-template' was > necessary to not move point set by `message-position-point' in > `log-edit-insert-message-template'. This is a useful addition to accompany log-edit-insert-filenames to insert the names of files that don't require ChangeLog entry, but should be mentioned in the commit message: === modified file 'lisp/vc/log-edit.el' --- lisp/vc/log-edit.el 2013-12-04 00:37:33 +0000 +++ lisp/vc/log-edit.el 2013-12-18 23:52:35 +0000 @@ -137,6 +137,7 @@ log-edit-insert-cvs-template log-edit-insert-changelog log-edit-insert-filenames + log-edit-insert-filenames-without-changelog log-edit-show-files))) (defcustom log-edit-mode-hook (if (boundp 'vc-log-mode-hook) vc-log-mode-hook) @@ -664,6 +666,21 @@ (insert "Affected files: \n" (mapconcat 'identity (log-edit-files) " \n"))) +(defun log-edit-insert-filenames-without-changelog () + "Insert the list of files that have no ChangeLog message." + (interactive) + (let ((files + (delq nil + (mapcar + (lambda (file) + (unless (or (cdr-safe (log-edit-changelog-entries file)) + (equal (file-name-nondirectory file) "ChangeLog")) + file)) + (log-edit-files))))) + (when files + (goto-char (point-max)) + (insert (mapconcat 'identity files ", ") ": ")))) + (defun log-edit-add-to-changelog () "Insert this log message into the appropriate ChangeLog file." (interactive) From unknown Thu Aug 14 18:32:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 16 Jan 2014 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator