From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ignacio Casso Newsgroups: gmane.emacs.bugs Subject: bug#54399: 27.2; Problems with (let ((custom-variable ...)) (autoload-function ...)) Date: Thu, 12 May 2022 08:58:09 +0200 Message-ID: References: <83sfqi498s.fsf@gnu.org> <87ilrdg837.fsf@web.de> <87ilqb1nwf.fsf@gnus.org> 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="26379"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.10; emacs 29.0.50 Cc: Michael Heerdegen , Eli Zaretskii , 54399@debbugs.gnu.org, monnier@iro.umontreal.ca To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 12 09:11:45 2022 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 1np2z9-0006ic-NK for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 May 2022 09:11:43 +0200 Original-Received: from localhost ([::1]:35528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1np2z8-0005WB-6u for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 May 2022 03:11:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1np2yU-0005Km-5D for bug-gnu-emacs@gnu.org; Thu, 12 May 2022 03:11:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1np2yT-0002UG-Rc for bug-gnu-emacs@gnu.org; Thu, 12 May 2022 03:11:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1np2yT-0001Nf-NH for bug-gnu-emacs@gnu.org; Thu, 12 May 2022 03:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ignacio Casso Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 May 2022 07:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54399 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 54399-submit@debbugs.gnu.org id=B54399.16523394595297 (code B ref 54399); Thu, 12 May 2022 07:11:01 +0000 Original-Received: (at 54399) by debbugs.gnu.org; 12 May 2022 07:10:59 +0000 Original-Received: from localhost ([127.0.0.1]:39353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1np2yQ-0001NK-Gl for submit@debbugs.gnu.org; Thu, 12 May 2022 03:10:59 -0400 Original-Received: from mail-oln040092068023.outbound.protection.outlook.com ([40.92.68.23]:29838 helo=EUR02-HE1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1np2yO-0001N8-JR for 54399@debbugs.gnu.org; Thu, 12 May 2022 03:10:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i+IdaSDfAPgWsF3xvmF4jVN6KCOOLgIApO7pDkU64ig0b3K/9K7HQKFUaFiyMZMapAoiY6C4LD+nk05KElyELP/LPl3x9qXT3L6zEg5ji6uy7t5r4aw18BY5sqwK4VsmGRgjR9wT8SMbVd6yMGrgs3R+bzP6AyvjiKP77Zp0Sqsmm069g3Ex19dQcmommANmOtLf+tY5ykPDiEdFjJiCCOKfDgJpky9sB27eAtM9YnekueKiuwnbxUFdG8vsgYEnR+GFyJJ4ooFVpx2ApCQN5h4KJO+/DYrt5ne/2x8aBOobnVFyuKg9wl9z8wjwZXJowkkcxoK2SqpW42djStVqZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nxkxyY6gZszZmGrLI4aFCfLhBOMlxdL/eSmNBJjFeLA=; b=iilwwBej61S2MZremkMtHhNMy/xfrtbalsCswXsEaxVxsTdbW3hnvwZUDd6bu2ZXwqhQ137qxyj7WjAfO3UCvAEnlyJLQv3rTzz1Ll8GtPhZy2PtHYsejs8a5cpOYzGzD7Tj+FY/c4EcrfatmF9eqvbdt4tBlk7YvoPvGj9UtnzolKWqUnnR3dS8yha+n5JMLRCQw/V/QyeWpgze4kKk74LemQZV8vhq3OoDePQsmLjMWhhp+Ug13bJXYFX8XwSguk/iH8Mu3Y0tXV0S2qPSLsMrYE05cxGUw9XKyy5xxDNjgPi7wuzRGJX7Yza8p7KuloeI2/EWjrGB24h4+mP1Bw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nxkxyY6gZszZmGrLI4aFCfLhBOMlxdL/eSmNBJjFeLA=; b=uZDv47TRkO7pzjZL4MYYucAR1Jn+PY0Tb6crqxNZJP6fSTDC0KqTn+qUu2zd+BYVp/JjPnZtw2NcSTK2WKTJu95GPXTeuVg5S/3eKyemnJxazGY2jmYYyyDihp7wzkBUU4wsnwp45fqv8eqMd+a7V1TuWsLLkRBSBGEhJs5B1e79W1coaGaC/F9XFY8UU+C9vxMgUM43JK5bJ30+eyXlO8avPiEb3I2Rih+b7y9JKQu6dN47HsyvAHMvFLkQxmk31BbJ3PmZ3lY7UogLlam7lOfqPU0eMUpfsqAIuYtBoiHRFqLT6818ceX0OXI91VnUZPNRlNwg0631u1TzKCA/2Q== Original-Received: from DB6PR0601MB2087.eurprd06.prod.outlook.com (2603:10a6:4:4f::26) by VI1PR0601MB2718.eurprd06.prod.outlook.com (2603:10a6:800:83::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23; Thu, 12 May 2022 07:10:49 +0000 Original-Received: from DB6PR0601MB2087.eurprd06.prod.outlook.com ([fe80::cdbe:e542:a1b6:1a2]) by DB6PR0601MB2087.eurprd06.prod.outlook.com ([fe80::cdbe:e542:a1b6:1a2%2]) with mapi id 15.20.5250.013; Thu, 12 May 2022 07:10:49 +0000 In-reply-to: <87ilqb1nwf.fsf@gnus.org> X-TMN: [qP+P4OFB9uTcQSshT9VTqC3ypNzVE6s7] X-ClientProxiedBy: PAZP264CA0122.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1ef::18) To DB6PR0601MB2087.eurprd06.prod.outlook.com (2603:10a6:4:4f::26) X-Microsoft-Original-Message-ID: <87czgjfcp9.fsf@hotmail.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 81eb91dc-d6e5-46de-87a1-08da33e68a9c X-MS-TrafficTypeDiagnostic: VI1PR0601MB2718:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SMkX2LCJb5VJ5A9fkf7SN2gwTBsVN2oBRs9myEPXSjFemY2IMC1p84/ftB+VO35U9GwRL5tBvkY/aaqIzsXhWOloRgO/HMfla6zfo/O0ul0/zey6C6rDg3SIQY46q1SA7NCJgQuP77abV2JX8BcSQCq+1FNd0wvEUewsjN5j4M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XQwJO8P4+iANEuB0rZ+lg1HwKg+MnQKC6u5Vqs9BmdnkDgPFEYRo8BEgwooCCSMVDpy2dhBO86hxHdthL4WXkd4pUkk3WRs8ovwiomyAJe1mZ0Uc51f1+QR4YLUJ+Iso0BhXjr4kF6VKnry/7T5Q6xSv0BS8E0vECkPWaHHiDcWCiFAhJP6VxL/ AcNHXIKbU+Nw65k2nK7UCtR4UbAUBhD01gXdWQ9fY1EQpbw0VelCTqCYMhYKyP4J3bdOF4H1ZUNzT2y8lHPXKoJ5NwiUVOAGXN X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6e454.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 81eb91dc-d6e5-46de-87a1-08da33e68a9c X-MS-Exchange-CrossTenant-AuthSource: DB6PR0601MB2087.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2022 07:10:49.1729 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0601MB2718 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" Xref: news.gmane.io gmane.emacs.bugs:232019 Archived-At: --=-=-= Content-Type: text/plain >> I've also made some new changes in customize.texi after I sent this >> patch. They are equivalent to those in the docstring of >> `defcustom'. > > I didn't see any new version of the proposed patch in this bug report? Sorry, I was waiting for more feedback in other parts of the patch before sending it. I send a new version now with the typos you pointed out fixed, and the changes in customize.texi that I said. I've also dropped some of the changes in the previous path that I don't think that were actually necessary, to keep the patch and review simpler. --Ignacio --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-updated-some-documentation-regarding-customize-and-d.patch Content-Description: Patch 54399 >From 9ebf1065c2970f688fdcafd6278ae5e239265065 Mon Sep 17 00:00:00 2001 From: Ignacio Casso Date: Thu, 12 May 2022 08:41:44 +0200 Subject: [PATCH] updated some documentation regarding customize and default values --- doc/lispref/customize.texi | 8 ++++---- lisp/custom.el | 18 +++++++++--------- src/data.c | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 54059d7b6e..06a2f5365d 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -376,7 +376,7 @@ Variable Definitions the value properly for this option (which may not mean simply setting the option as a Lisp variable); preferably, though, it should not modify its value argument destructively. The default for -@var{setfunction} is @code{set-default}. +@var{setfunction} is @code{set-default-toplevel-value}. If you specify this keyword, the variable's documentation string should describe how to do the same job in hand-written Lisp code. @@ -387,7 +387,7 @@ Variable Definitions option. The function @var{getfunction} should take one argument, a symbol, and should return whatever customize should use as the current value for that symbol (which need not be the symbol's Lisp -value). The default is @code{default-value}. +value). The default is @code{default-toplevel-value}. You have to really understand the workings of Custom to use @code{:get} correctly. It is meant for values that are treated in @@ -409,7 +409,7 @@ Variable Definitions @item custom-initialize-default Like @code{custom-initialize-set}, but use the function -@code{set-default} to set the variable, instead of the variable's +@code{set-default-toplevel-value} to set the variable, instead of the variable's @code{:set} function. This is the usual choice for a variable whose @code{:set} function enables or disables a minor mode; with this choice, defining the variable will not call the minor mode function, but @@ -424,7 +424,7 @@ Variable Definitions @item custom-initialize-changed Use the @code{:set} function to initialize the variable, if it is already set or has been customized; otherwise, just use -@code{set-default}. +@code{set-default-toplevel-value}. @item custom-initialize-delay This function behaves like @code{custom-initialize-set}, but it diff --git a/lisp/custom.el b/lisp/custom.el index 76c14831ca..2ab7c69d00 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -68,7 +68,7 @@ custom-initialize-default (defun custom-initialize-set (symbol exp) "Initialize SYMBOL based on EXP. If the symbol doesn't have a default binding already, -then set it using its `:set' function (or `set-default' if it has none). +then set it using its `:set' function (or `set-default-toplevel-value' if it has none). The value is either the value in the symbol's `saved-value' property, if any, or the value of EXP." (condition-case nil @@ -81,7 +81,7 @@ custom-initialize-set (defun custom-initialize-reset (symbol exp) "Initialize SYMBOL based on EXP. -Set the symbol, using its `:set' function (or `set-default' if it has none). +Set the symbol, using its `:set' function (or `set-default-toplevel-value' if it has none). The value is either the symbol's current value (as obtained using the `:get' function), if any, or the value in the symbol's `saved-value' property if any, @@ -100,7 +100,7 @@ custom-initialize-changed "Initialize SYMBOL with EXP. Like `custom-initialize-reset', but only use the `:set' function if not using the standard setting. -For the standard setting, use `set-default'." +For the standard setting, use `set-default-toplevel-value'." (condition-case nil (let ((def (default-toplevel-value symbol))) (funcall (or (get symbol 'custom-set) #'set-default-toplevel-value) @@ -114,7 +114,7 @@ custom-initialize-changed symbol (eval (car (get symbol 'saved-value))))) (t - (set-default symbol (eval exp))))))) + (set-default-toplevel-value symbol (eval exp))))))) (defvar custom-delayed-init-variables nil "List of variables whose initialization is pending until startup. @@ -262,11 +262,11 @@ defcustom when using the Customize user interface. It takes two arguments, the symbol to set and the value to give it. The function should not modify its value argument destructively. The default choice - of function is `set-default'. + of function is `set-default-toplevel-value'. :get VALUE should be a function to extract the value of symbol. The function takes one argument, a symbol, and should return the current value for that symbol. The default choice of function - is `default-value'. + is `default-toplevel-value'. :require VALUE should be a feature symbol. If you save a value for this option, then when your init file loads the value, @@ -717,7 +717,7 @@ custom-set-default (if custom-local-buffer (with-current-buffer custom-local-buffer (set variable value)) - (set-default variable value))) + (set-default-toplevel-value variable value))) (defun custom-set-minor-mode (variable value) ":set function for minor mode variables. @@ -752,7 +752,7 @@ customize-mark-to-save Return non-nil if the `saved-value' property actually changed." (custom-load-symbol symbol) - (let* ((get (or (get symbol 'custom-get) #'default-value)) + (let* ((get (or (get symbol 'custom-get) #'default-toplevel-value)) (value (funcall get symbol)) (saved (get symbol 'saved-value)) (standard (get symbol 'standard-value)) @@ -779,7 +779,7 @@ customize-mark-as-set Return non-nil if the `customized-value' property actually changed." (custom-load-symbol symbol) - (let* ((get (or (get symbol 'custom-get) #'default-value)) + (let* ((get (or (get symbol 'custom-get) #'default-toplevel-value)) (value (funcall get symbol)) (customized (get symbol 'customized-value)) (old (or (get symbol 'saved-value) (get symbol 'standard-value)))) diff --git a/src/data.c b/src/data.c index 72dcf6f878..9b36ecc1b2 100644 --- a/src/data.c +++ b/src/data.c @@ -1939,9 +1939,9 @@ default_value (Lisp_Object symbol) DEFUN ("default-boundp", Fdefault_boundp, Sdefault_boundp, 1, 1, 0, doc: /* Return t if SYMBOL has a non-void default value. -A variable may have a buffer-local or a `let'-bound local value. This +A variable may have a buffer-local value. This function says whether the variable has a non-void value outside of the -current context. Also see `default-value'. */) +current buffer context. Also see `default-value'. */) (Lisp_Object symbol) { register Lisp_Object value; -- 2.25.1 --=-=-=--