diff options
| author | Stefan Monnier | 2017-10-25 12:37:09 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2017-10-25 12:37:09 -0400 |
| commit | bc9300ac5ed3bdf52a2f8b9e217236e1ee76cd02 (patch) | |
| tree | ea85e4e07e146922956a1d84d3268506d7ba442a /src | |
| parent | 090f4f157eea6f0d0d13963520f5e05706de142f (diff) | |
| download | emacs-bc9300ac5ed3bdf52a2f8b9e217236e1ee76cd02.tar.gz emacs-bc9300ac5ed3bdf52a2f8b9e217236e1ee76cd02.zip | |
Fix misleading error during autoload (bug#28994)
* src/eval.c (Fautoload_do_load): Don't silence `load` errors when
autoloading a macro. If silencing load errors, also silence the
subsequent check.
Diffstat (limited to 'src')
| -rw-r--r-- | src/eval.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/eval.c b/src/eval.c index 52e4c96d4b2..063deb4ba03 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -1986,12 +1986,10 @@ it defines a macro. */) | |||
| 1986 | if (!CONSP (fundef) || !EQ (Qautoload, XCAR (fundef))) | 1986 | if (!CONSP (fundef) || !EQ (Qautoload, XCAR (fundef))) |
| 1987 | return fundef; | 1987 | return fundef; |
| 1988 | 1988 | ||
| 1989 | if (EQ (macro_only, Qmacro)) | 1989 | Lisp_Object kind = Fnth (make_number (4), fundef); |
| 1990 | { | 1990 | if (EQ (macro_only, Qmacro) |
| 1991 | Lisp_Object kind = Fnth (make_number (4), fundef); | 1991 | && !(EQ (kind, Qt) || EQ (kind, Qmacro))) |
| 1992 | if (! (EQ (kind, Qt) || EQ (kind, Qmacro))) | 1992 | return fundef; |
| 1993 | return fundef; | ||
| 1994 | } | ||
| 1995 | 1993 | ||
| 1996 | /* This is to make sure that loadup.el gives a clear picture | 1994 | /* This is to make sure that loadup.el gives a clear picture |
| 1997 | of what files are preloaded and when. */ | 1995 | of what files are preloaded and when. */ |
| @@ -2014,15 +2012,18 @@ it defines a macro. */) | |||
| 2014 | The value saved here is to be restored into Vautoload_queue. */ | 2012 | The value saved here is to be restored into Vautoload_queue. */ |
| 2015 | record_unwind_protect (un_autoload, Vautoload_queue); | 2013 | record_unwind_protect (un_autoload, Vautoload_queue); |
| 2016 | Vautoload_queue = Qt; | 2014 | Vautoload_queue = Qt; |
| 2017 | /* If `macro_only', assume this autoload to be a "best-effort", | 2015 | /* If `macro_only' is set and fundef isn't a macro, assume this autoload to |
| 2016 | be a "best-effort" (e.g. to try and find a compiler macro), | ||
| 2018 | so don't signal an error if autoloading fails. */ | 2017 | so don't signal an error if autoloading fails. */ |
| 2019 | Fload (Fcar (Fcdr (fundef)), macro_only, Qt, Qnil, Qt); | 2018 | Lisp_Object ignore_errors |
| 2019 | = (EQ (kind, Qt) || EQ (kind, Qmacro)) ? Qnil : macro_only; | ||
| 2020 | Fload (Fcar (Fcdr (fundef)), ignore_errors, Qt, Qnil, Qt); | ||
| 2020 | 2021 | ||
| 2021 | /* Once loading finishes, don't undo it. */ | 2022 | /* Once loading finishes, don't undo it. */ |
| 2022 | Vautoload_queue = Qt; | 2023 | Vautoload_queue = Qt; |
| 2023 | unbind_to (count, Qnil); | 2024 | unbind_to (count, Qnil); |
| 2024 | 2025 | ||
| 2025 | if (NILP (funname)) | 2026 | if (NILP (funname) || !NILP (ignore_errors)) |
| 2026 | return Qnil; | 2027 | return Qnil; |
| 2027 | else | 2028 | else |
| 2028 | { | 2029 | { |