From 071722e41120f8894b5482d9eccc663a28f81058 Mon Sep 17 00:00:00 2001 From: Ignacio Casso Date: Fri, 10 Jun 2022 11:13:20 +0200 Subject: Fix issues with loading autoloaded defcustoms while bound * doc/lispref/customize.texi (Variable Definitions) (Variable Definitions): Update documentation. * lisp/custom.el (custom-initialize-set) (custom-initialize-reset): Update doc string. (custom-initialize-changed): Use set-default-toplevel-value. This fixes issues with (let ((custom-variable ...)) (autoload-function ...)). (custom-set-default): Ditto. * src/data.c (Fdefault_boundp): Update doc string. --- src/data.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/data.c') diff --git a/src/data.c b/src/data.c index 72dcf6f878d..46c0c5b6aee 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 -function says whether the variable has a non-void value outside of the -current context. Also see `default-value'. */) +A variable may have a buffer-local value. This function says whether +the variable has a non-void value outside of the current buffer +context. Also see `default-value'. */) (Lisp_Object symbol) { register Lisp_Object value; -- cgit v1.2.1 From bab1d412801eead715f1465131aa3734558f35ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Sun, 12 Jun 2022 12:05:03 +0200 Subject: Use BASE_EQ when comparing with Qunbound Qunbound is uninterned and can therefore never be EQ to any symbol with position. * src/buffer.c (Fbuffer_local_value, buffer_lisp_local_variables) (buffer_local_variables_1): * src/bytecode.c (exec_byte_code): * src/comp.c (compile_function, Fcomp__compile_ctxt_to_file): * src/composite.c (composition_gstring_cache_clear_font): * src/data.c (Fboundp, Fsymbol_value, set_internal) (Fdefault_boundp, Fdefault_value, Fmake_variable_buffer_local): * src/emacs-module.c (module_global_reference_p): * src/eval.c (Fdefault_toplevel_value, defvar) (run_hook_with_args): * src/fns.c (hash_put, Fmaphash): * src/font.c (font_put_extra): * src/frame.c (gui_set_frame_parameters) (gui_frame_get_and_record_arg, gui_default_parameter) (gui_figure_window_size): * src/haikufns.c (get_geometry_from_preferences) (haiku_create_frame, haiku_create_tip_frame): * src/haikuterm.c (haiku_draw_text_decoration) (haiku_default_font_parameter): * src/json.c (lisp_to_json_nonscalar_1): * src/keymap.c (access_keymap_1, access_keymap, current_minor_maps): * src/lread.c (readevalloop, define_symbol): * src/minibuf.c (read_minibuf, Ftry_completion): (Fall_completions, Ftest_completion): * src/pgtkfns.c (pgtk_default_font_parameter, Fx_create_frame) (x_create_tip_frame): * src/pgtkselect.c (Fpgtk_own_selection_internal): * src/print.c (print): * src/profiler.c (evict_lower_half, record_backtrace): * src/terminal.c (create_terminal): * src/textprop.c (set_properties): * src/w32fns.c (my_create_window, w32_icon) (w32_default_font_parameter, Fx_create_frame) (w32_create_tip_frame): * src/w32term.c (w32_draw_glyph_string): * src/xdisp.c (handle_single_display_spec) (cursor_row_fully_visible_p, calc_pixel_width_or_height): * src/xfns.c (x_default_scroll_bar_color_parameter, x_icon_verify) (x_icon, x_default_font_parameter, Fx_create_frame) (x_create_tip_frame): * src/xselect.c (x_handle_selection_request): * src/xterm.c (x_draw_glyph_string, x_term_init): Use BASE_EQ instead of EQ when comparing with Qunbound. --- src/data.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/data.c') diff --git a/src/data.c b/src/data.c index 46c0c5b6aee..cf180b16fb2 100644 --- a/src/data.c +++ b/src/data.c @@ -699,7 +699,7 @@ global value outside of any lexical scope. */) default: emacs_abort (); } - return (EQ (valcontents, Qunbound) ? Qnil : Qt); + return (BASE_EQ (valcontents, Qunbound) ? Qnil : Qt); } /* It has been previously suggested to make this function an alias for @@ -1585,7 +1585,7 @@ global value outside of any lexical scope. */) Lisp_Object val; val = find_symbol_value (symbol); - if (!EQ (val, Qunbound)) + if (!BASE_EQ (val, Qunbound)) return val; xsignal1 (Qvoid_variable, symbol); @@ -1612,7 +1612,7 @@ void set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, enum Set_Internal_Bind bindflag) { - bool voide = EQ (newval, Qunbound); + bool voide = BASE_EQ (newval, Qunbound); /* If restoring in a dead buffer, do nothing. */ /* if (BUFFERP (where) && NILP (XBUFFER (where)->name)) @@ -1947,7 +1947,7 @@ context. Also see `default-value'. */) register Lisp_Object value; value = default_value (symbol); - return (EQ (value, Qunbound) ? Qnil : Qt); + return (BASE_EQ (value, Qunbound) ? Qnil : Qt); } DEFUN ("default-value", Fdefault_value, Sdefault_value, 1, 1, 0, @@ -1958,7 +1958,7 @@ local bindings in certain buffers. */) (Lisp_Object symbol) { Lisp_Object value = default_value (symbol); - if (!EQ (value, Qunbound)) + if (!BASE_EQ (value, Qunbound)) return value; xsignal1 (Qvoid_variable, symbol); @@ -2138,7 +2138,7 @@ See also `defvar-local'. */) case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start; case SYMBOL_PLAINVAL: forwarded = 0; valcontents.value = SYMBOL_VAL (sym); - if (EQ (valcontents.value, Qunbound)) + if (BASE_EQ (valcontents.value, Qunbound)) valcontents.value = Qnil; break; case SYMBOL_LOCALIZED: -- cgit v1.2.1