From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#72735: 31.0.50; [PATCH] Make more bug-reference variables customizeable Date: Tue, 20 Aug 2024 18:34:38 +0300 Message-ID: <16727.7714981296$1724168157@news.gmane.org> Reply-To: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28378"; mail-complaints-to="usenet@ciao.gmane.io" To: 72735@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 20 17:35:49 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sgQtg-0007FQ-20 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Aug 2024 17:35:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgQtH-0000B5-IY; Tue, 20 Aug 2024 11:35:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgQtF-0000AO-96 for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 11:35:21 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sgQtD-0003sY-Vy for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 11:35:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=gJYSXI5imA22C8fkKic9CYpuvoR9Eu304Dd3s5TyfF8=; b=EEuvYt4UnaY9YQ+gBnvJBkN2eZEhmwOx8IiKZ8lB2pCV14P5mRBFmT6RCpYBn/NyQXyGe/zpob6mzUHFJEmzouBv3+5S5NXowoXqBn6b/sHNcCVie560qoFqDmQWY0sk1/6/J+7vEQVeON0bQhux2MZjedZjLv2jgT5DxnjJYAgoKtTSV1Qr87uNvQfCB9V5fLdj9rpUT1oLB35SORMx/SLfkj0nhPJVenG4as0c1rkLQZ5HWMPrExwy1PAYsMQvWeXuySIug7teEeS8TGwTssRz5kKRf43fSK9gOgay2WPBbtsQmmikujFidZG0VnpIcYRrLEAdQmgUuOUhJYimOQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sgQtu-00065M-K7 for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 11:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Aug 2024 15:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72735 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.172416813423347 (code B ref -1); Tue, 20 Aug 2024 15:36:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Aug 2024 15:35:34 +0000 Original-Received: from localhost ([127.0.0.1]:33579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgQtR-00064S-ED for submit@debbugs.gnu.org; Tue, 20 Aug 2024 11:35:34 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:56752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgQtN-00064I-S2 for submit@debbugs.gnu.org; Tue, 20 Aug 2024 11:35:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgQsg-0008DN-A6 for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 11:34:46 -0400 Original-Received: from thaodan.de ([185.216.177.71]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgQsd-0003er-M5 for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2024 11:34:46 -0400 Original-Received: from odin (dsl-trebng12-50dc75-154.dhcp.inet.fi [80.220.117.154]) by thaodan.de (Postfix) with ESMTPSA id E03ABD00077 for ; Tue, 20 Aug 2024 18:34:40 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1724168081; bh=l6PpT3bGrpZ+BdvDuue2NiqYfKD+3cIXX5VS8GTEi+8=; h=From:To:Subject:Date; b=Ne8It9C0eRrtDhYeh99Kv29abj+fxFsvZssOu3C5vOY3uhoV++iU9bfgGfU+Az8ab JHXZO85CaJjD5hz8w1hnX5Mlb61GdAe+k7k0zh45HurM7Ogfih0P3ABPBJrJHoRfma oNc1l/+J8eJ47sVnQdHbCfnwXwhkput3Tc6YK+1sfY8e3M8Tq5qbT5qqU2r+9Xvu7J yYlFEk74PcFHaKS7VLagtR5CdwR2UnNCIjtDdmdSj8e5pyWtUDDcry7CppzkbtLhY7 Ohniqq1GtCp/uSG1kswqeWePBaMEhunZT3koES4M1f5qCO46YNKdYAVFjp83UQuV0A IUaGJhGp3f7bE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SAP4hZ7cSp0YN XYpcjHdsySh2MuBhhoPeLGXs+2kSiqBiOwD/TP8AgPEg/R+SI9GI9on7fBJJ0mp2IT8kZ2rhDOjg gA6IkwQTFgoAOxYhBFHxdut1RzAepymoq1wbdKFlH Received-SPF: pass client-ip=185.216.177.71; envelope-from=bjorn.bidar@thaodan.de; helo=thaodan.de X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, INVALID_MSGID=0.568, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290455 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, I noticed that some of the variables that can be modified by the user or as mentioned as such were not defined as custom variable. These patches to so and correct the group of one of the existing defcustom. The patches don't change any of the existing functionality but only document these variables better and make them easier to modify. Because of that I set version to Emacs 30.1. Please tell if that's ok. Good day, Bj=C3=B6rn --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Define-bug-reference-url-format-as-custom-type.patch >From 0a0f4062c41de25225df6b216470141d3537308c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= Date: Tue, 20 Aug 2024 16:05:31 +0300 Subject: [PATCH 1/3] Define bug-reference-url-format as custom type * lisp/progmodes/bug-reference.el (bug-reference-url-format): Define as custom type. The manual and the documentation string talk like the variable like is a custom variable. It does make sense to define it as a custom type to check the type and group it under the other bug-reference-mode settings --- lisp/progmodes/bug-reference.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index 3bcfc213fc6..815e51aef73 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el @@ -48,7 +48,7 @@ bug-reference-map "C-c RET" #'bug-reference-push-button) ;; E.g., "https://gcc.gnu.org/PR%s" -(defvar bug-reference-url-format nil +(defcustom bug-reference-url-format nil "Format used to turn a bug number into a URL. The bug number is supplied as a string, so this should have a single %s. This can also be a function designator; it is called without arguments @@ -62,7 +62,11 @@ bug-reference-url-format If you set it to a symbol in the file Local Variables section, you need to add a `bug-reference-url-format' property to it: \(put \\='my-bug-reference-url-format \\='bug-reference-url-format t) -so that it is considered safe, see `enable-local-variables'.") +so that it is considered safe, see `enable-local-variables'." + :type '(choice (function) + (string)) + :version "30.1" + :group 'bug-reference) ;;;###autoload (put 'bug-reference-url-format 'safe-local-variable -- 2.45.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-Define-bug-reference-forge-alist-as-custom-type.patch >From 5cad0f9d1cb982f03a60c494f0a363056feab688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= Date: Tue, 20 Aug 2024 17:09:14 +0300 Subject: [PATCH 2/3] Define bug-reference-forge-alist as custom type * lisp/progmodes/bug-reference.el (bug-reference-forge-alist): Define as custom type. The manual and the documentation string refere to it like it is a custom variable. Further defcustom will also ensure that the variable is the right type when the user modifies it. --- lisp/progmodes/bug-reference.el | 49 +++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index 815e51aef73..9f293754c78 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el @@ -104,6 +104,37 @@ bug-reference-bug-regexp ;;;###autoload (put 'bug-reference-bug-regexp 'safe-local-variable 'stringp) + +(defcustom bug-reference-forge-alist + '(("github.com" github "https") + ("gitea.com" gitea "https") + ("codeberg.org" gitea "https") + ("gitlab.com" gitlab "https") + ("framagit.org" gitlab "https") + ("salsa.debian.org" gitlab "https") + ("sr.ht" sourcehut "https")) + "An alist of forge instances. +Each entry has the form (HOST-DOMAIN FORGE-TYPE PROTOCOL). +HOST-DOMAIN is the host- and domain name, e.g., gitlab.com, +salsa.debian.org, or sr.ht. +FORGE-TYPE is the type of the forge, e.g., gitlab, gitea, +sourcehut, or github. +PROTOCOL is the protocol for accessing the forge's issue tracker, +usually \"https\" but for self-hosted forge instances not +accessible via the internet it might also be \"http\"." + :type '(alist :key-type (string :tag "Host-Domain") + :value-type (group (choice :tag "Forge-Type" + (const :tag "Github" github) + (const :tag "Gitea" gitea) + (const :tag "Gitlab" gitlab) + (const :tag "Sourcehut" sourcehut) + (symbol)) + (choice :tag "Protocol" + (const "https") (string)))) + :group 'bug-reference + :version "30.1") + + (defun bug-reference-set-overlay-properties () "Set properties of bug reference overlays." (put 'bug-reference 'evaporate t) @@ -240,24 +271,6 @@ bug-reference--setup-from-vc-alist from a few default entries, and the value of `bug-reference-forge-alist'.") -(defvar bug-reference-forge-alist - '(("github.com" github "https") - ("gitea.com" gitea "https") - ("codeberg.org" gitea "https") - ("gitlab.com" gitlab "https") - ("framagit.org" gitlab "https") - ("salsa.debian.org" gitlab "https") - ("sr.ht" sourcehut "https")) - "An alist of forge instances. -Each entry has the form (HOST-DOMAIN FORGE-TYPE PROTOCOL). -HOST-DOMAIN is the host- and domain name, e.g., gitlab.com, -salsa.debian.org, or sr.ht. -FORGE-TYPE is the type of the forge, e.g., gitlab, gitea, -sourcehut, or github. -PROTOCOL is the protocol for accessing the forge's issue tracker, -usually \"https\" but for self-hosted forge instances not -accessible via the internet it might also be \"http\".") - (cl-defgeneric bug-reference--build-forge-setup-entry (host-domain forge-type protocol) "Build an entry for `bug-reference--setup-from-vc-alist'. -- 2.45.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0003-Set-custom-group-of-bug-reference-bug-regexp.patch >From 5498829ad845ad7763d25f417be52233cc707753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= Date: Tue, 20 Aug 2024 17:41:20 +0300 Subject: [PATCH 3/3] ; Set custom group of bug-reference-bug-regexp --- lisp/progmodes/bug-reference.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index 9f293754c78..00d8f5d506c 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el @@ -97,6 +97,7 @@ bug-reference-bug-regexp outside the bounds of subexpressions 1 and then don't contribute to the highlighted and clickable region." :type 'regexp + :group 'bug-reference ; 24.3: defconst -> defcustom ; 28.1: contract about subexpression 1 defines the overlay region. :version "28.1") -- 2.45.2 --=-=-=--