From 341fc75709a03c1223fb12d41413acfa5c79dd75 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 26 May 2024 11:50:13 +0800 Subject: [PATCH] Address compilation errors and warnings on x86 Solaris 10 systems * doc/misc/ede.texi (Extending EDE): * doc/misc/flymake.texi (Top, Using Flymake): Insert punctuation after xrefs. * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Print number of files being scraped. * src/dired.c (directory_files_internal): * src/eval.c (Fmake_interpreted_closure, Fdefvaralias): * src/fns.c (Fassoc): Work around optimizer failures. (cherry picked from commit 74ceb6922c621cf48a2c9f6e6622133b522252ab) --- doc/misc/ede.texi | 12 +++++------ doc/misc/flymake.texi | 11 +++++------ lisp/emacs-lisp/loaddefs-gen.el | 4 ++-- src/dired.c | 7 +++++-- src/eval.c | 35 ++++++++++++++++++++++----------- src/fns.c | 11 ++++++----- 6 files changed, 48 insertions(+), 32 deletions(-) diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi index 15f7a329803..ae179832753 100644 --- a/doc/misc/ede.texi +++ b/doc/misc/ede.texi @@ -1027,13 +1027,13 @@ superclasses, specifically the PROJECT and TARGET@. All commands in target. All specific projects in @ede{} derive subclasses of the @ede{} -superclasses. In this way, specific behaviors such as how a project -is saved, or how a target is compiled can be customized by a project -author in detail. @ede{} communicates to these project objects via an -API using methods. The commands you use in @ede{} mode are high-level +superclasses. In this way, specific behaviors such as how a project is +saved, or how a target is compiled can be customized by a project author +in detail. @ede{} communicates to these project objects via an API +using methods. The commands you use in @ede{} mode are high-level functional wrappers over these methods. @xref{Top,,, eieio, EIEIO -manual} for details on using @eieio{} to extending classes, and -writing methods. +manual}, for details on using @eieio{} to extending classes, and writing +methods. If you intend to extend @ede{}, it is most likely that a new target type is needed in one of the existing project types. The rest of this chapter diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 7019f4b2ca0..6b605a6c095 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -59,11 +59,10 @@ types of diagnostics. To learn about using Flymake, @pxref{Using Flymake}. -When the Emacs LSP support mode Eglot is enabled, Flymake will use -that as an additional back-end. @xref{Eglot Features,,, eglot, Eglot: -The Emacs LSP Client} Flymake is also designed to be easily extended -to support new backends via an Elisp interface. @xref{Extending -Flymake}. +When the Emacs LSP support mode Eglot is enabled, Flymake will use that +as an additional back-end. @xref{Eglot Features,,, eglot, Eglot: The +Emacs LSP Client}. Flymake is also designed to be easily extended to +support new backends via an Elisp interface. @xref{Extending Flymake}. @ifnottex @insertcopying @@ -94,7 +93,7 @@ write your own Flymake backend functions. @xref{Backend functions}. When the Emacs LSP support mode Eglot is enabled, Flymake will use that as an additional back-end automatically. @xref{Eglot Features,,, -eglot, Eglot: The Emacs LSP Client} +eglot, Eglot: The Emacs LSP Client}. @menu * Starting Flymake:: diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 581053f6304..50e90cdf94c 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -601,7 +601,6 @@ instead of just updating them with the new/changed autoloads." (if (consp dir) dir (list dir))))) (updating (and (file-exists-p output-file) (not generate-full))) (defs nil)) - ;; Allow the excluded files to be relative. (setq excluded-files (mapcar (lambda (file) (expand-file-name file dir)) @@ -610,7 +609,8 @@ instead of just updating them with the new/changed autoloads." ;; Collect all the autoload data. (let ((progress (make-progress-reporter (byte-compile-info - (concat "Scraping files for loaddefs")) + (format "Scraping %s files for loaddefs" + (length files))) 0 (length files) nil 10)) (output-time (file-attribute-modification-time (file-attributes output-file))) diff --git a/src/dired.c b/src/dired.c index 05233c40a84..2736b6639be 100644 --- a/src/dired.c +++ b/src/dired.c @@ -351,8 +351,11 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, specpdl_ptr = specpdl_ref_to_ptr (count); if (NILP (nosort)) - list = CALLN (Fsort, Fnreverse (list), - attrs ? Qfile_attributes_lessp : Qstring_lessp); + { + Lisp_Object ordered = Fnreverse (list); + list = CALLN (Fsort, ordered, + attrs ? Qfile_attributes_lessp : Qstring_lessp); + } (void) directory_volatile; return list; diff --git a/src/eval.c b/src/eval.c index 8cabe2d2cc7..20b9ca9a0ec 100644 --- a/src/eval.c +++ b/src/eval.c @@ -527,14 +527,22 @@ IFORM if non-nil should be of the form (interactive ...). */) (Lisp_Object args, Lisp_Object body, Lisp_Object env, Lisp_Object docstring, Lisp_Object iform) { + Lisp_Object ifcdr, value, slots[6]; + CHECK_CONS (body); /* Make sure it's not confused with byte-code! */ CHECK_LIST (args); CHECK_LIST (iform); - Lisp_Object ifcdr = Fcdr (iform); - Lisp_Object slots[] = { args, body, env, Qnil, docstring, - NILP (Fcdr (ifcdr)) - ? Fcar (ifcdr) - : CALLN (Fvector, XCAR (ifcdr), XCDR (ifcdr)) }; + ifcdr = CDR (iform); + if (NILP (CDR (ifcdr))) + value = CAR (ifcdr); + else + value = CALLN (Fvector, XCAR (ifcdr), XCDR (ifcdr)); + slots[0] = args; + slots[1] = body; + slots[2] = env; + slots[3] = Qnil; + slots[4] = docstring; + slots[5] = value; /* Adjusting the size is indispensable since, as for byte-code objects, we distinguish interactive functions by the presence or absence of the iform slot. */ @@ -675,12 +683,17 @@ signal a `cyclic-variable-indirection' error. */) else if (!NILP (Fboundp (new_alias)) && !EQ (find_symbol_value (new_alias), find_symbol_value (base_variable))) - call2 (Qdisplay_warning, - list3 (Qdefvaralias, Qlosing_value, new_alias), - CALLN (Fformat_message, - build_string - ("Overwriting value of `%s' by aliasing to `%s'"), - new_alias, base_variable)); + { + Lisp_Object message, formatted; + + message = build_string ("Overwriting value of `%s' by aliasing" + " to `%s'"); + formatted = CALLN (Fformat_message, message, + new_alias, base_variable); + call2 (Qdisplay_warning, + list3 (Qdefvaralias, Qlosing_value, new_alias), + formatted); + } { union specbinding *p; diff --git a/src/fns.c b/src/fns.c index 726fcaebcea..49db6a54178 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2006,11 +2006,12 @@ TESTFN is called with 2 arguments: a car of an alist element and KEY. */) FOR_EACH_TAIL (tail) { Lisp_Object car = XCAR (tail); - if (CONSP (car) - && (NILP (testfn) - ? (EQ (XCAR (car), key) || !NILP (Fequal - (XCAR (car), key))) - : !NILP (call2 (testfn, XCAR (car), key)))) + if (!CONSP (car)) + continue; + if ((NILP (testfn) + ? (EQ (XCAR (car), key) || !NILP (Fequal + (XCAR (car), key))) + : !NILP (call2 (testfn, XCAR (car), key)))) return car; } CHECK_LIST_END (tail, alist); -- 2.39.5