From: Ignacio Casso <ignaciocasso@hotmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: michael_heerdegen@web.de, Eli Zaretskii <eliz@gnu.org>,
54399@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#54399: 27.2; Problems with (let ((custom-variable ...)) (autoload-function ...))
Date: Thu, 09 Jun 2022 23:19:54 +0200 [thread overview]
Message-ID: <DB6PR0601MB20877A152D71652416BA1FBEC6A79@DB6PR0601MB2087.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <87tu8t283h.fsf@gnus.org>
[-- Attachment #1: Type: text/plain, Size: 495 bytes --]
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Ignacio Casso <ignaciocasso@hotmail.com> writes:
>
>> These two I thought that I had remove them. Ignore them, they will not
>> be there in the next version of the patch
>
> Ignacio, did you have a new version of the patch that we missed?
Not really, just the last one but without those two changes. I guess I was
waiting for all of you to agree before sending it (you and Eli did, but
Stefan did not answer) and I forgot eventually. Here it is:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch for bug#54399 --]
[-- Type: text/x-diff, Size: 5910 bytes --]
From 6f0791ce7d5189af29362e8570659881776d7748 Mon Sep 17 00:00:00 2001
From: Ignacio Casso <ignaciocasso@hotmail.com>
Date: Thu, 12 May 2022 10:37:10 +0200
Subject: [PATCH] updated some documentation regarding customize and default
values
---
doc/lispref/customize.texi | 8 ++++----
lisp/custom.el | 14 +++++++-------
src/data.c | 4 ++--
3 files changed, 13 insertions(+), 13 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 a084304ff8..84c740f73b 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.
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
next prev parent reply other threads:[~2022-06-09 21:19 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 11:50 bug#54399: 27.2; Problems with (let ((custom-variable ...)) (autoload-function ...)) Ignacio Casso
2022-03-17 11:23 ` Lars Ingebrigtsen
2022-03-18 0:22 ` Michael Heerdegen
2022-03-18 1:02 ` Michael Heerdegen
2022-03-18 9:32 ` Lars Ingebrigtsen
2022-03-18 9:38 ` Ignacio Casso
2022-04-12 13:18 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-12 13:23 ` Ignacio Casso
2022-04-12 13:55 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-12 9:13 ` Ignacio Casso
2022-04-12 11:38 ` Eli Zaretskii
2022-04-12 12:16 ` Ignacio Casso
2022-04-12 13:35 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-12 14:27 ` Ignacio Casso
2022-04-12 15:04 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-12 15:27 ` Ignacio Casso
2022-04-12 22:15 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-13 15:26 ` Ignacio Casso
2022-04-13 0:24 ` Michael Heerdegen
2022-04-13 3:26 ` Glenn Morris
2022-04-13 3:43 ` Michael Heerdegen
2022-04-12 15:24 ` Eli Zaretskii
2022-04-13 17:22 ` Ignacio Casso
2022-04-12 13:19 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-12 13:51 ` Ignacio Casso
2022-04-12 15:22 ` Eli Zaretskii
2022-04-13 0:06 ` Michael Heerdegen
2022-04-13 12:08 ` Ignacio Casso
2022-05-12 2:32 ` Lars Ingebrigtsen
2022-05-12 6:58 ` Ignacio Casso
2022-05-12 7:34 ` Eli Zaretskii
2022-05-12 8:14 ` Ignacio Casso
2022-05-12 8:36 ` Eli Zaretskii
2022-05-12 8:41 ` Ignacio Casso
2022-05-12 9:40 ` Eli Zaretskii
2022-05-12 11:49 ` Lars Ingebrigtsen
2022-06-09 15:02 ` Lars Ingebrigtsen
2022-06-09 21:19 ` Ignacio Casso [this message]
2022-06-10 9:13 ` Lars Ingebrigtsen
2022-06-10 14:01 ` dick
2022-06-11 10:51 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB6PR0601MB20877A152D71652416BA1FBEC6A79@DB6PR0601MB2087.eurprd06.prod.outlook.com \
--to=ignaciocasso@hotmail.com \
--cc=54399@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
--cc=michael_heerdegen@web.de \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.