From 8f5d822363503c9340e6ed2c74ea955e12b50ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Sun, 9 Sep 2018 21:11:45 +0100 Subject: [PATCH] make compile-core: fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is easier to spot real problems if the code is warning-free. Replacing `gensym` with `make-symbol` is an idea taken from here: https://github.com/abo-abo/org-mode/commit/b44c08dd455236a63ae1da07cb30639d2679ba92 In defer-until!: core-lib.el:150:19:Warning: function ‘gensym’ from cl package called at runtime In add-transient-hook!: core-lib.el:216:16:Warning: function ‘gensym’ from cl package called at runtime In toplevel form: autoload/message.el:35:1:Warning: Unused lexical variable ‘spec’ In toplevel form: autoload/line-numbers.el:31:1:Warning: defcustom for ‘display-line-numbers-type’ fails to specify containing group autoload/line-numbers.el:31:1:Warning: defcustom for ‘display-line-numbers-type’ fails to specify containing group autoload/line-numbers.el:39:1:Warning: defcustom for ‘display-line-numbers-grow-only’ fails to specify containing group autoload/line-numbers.el:39:1:Warning: defcustom for ‘display-line-numbers-grow-only’ fails to specify containing group autoload/line-numbers.el:44:1:Warning: defcustom for ‘display-line-numbers-width-start’ fails to specify containing group autoload/line-numbers.el:44:1:Warning: defcustom for ‘display-line-numbers-width-start’ fails to specify containing group In toplevel form: cli/autoloads.el:137:1:Warning: Unused lexical variable ‘type’ Preserve name of unused lexical var _type Makes it obvious what is stored there. --- core/autoload/line-numbers.el | 3 +++ core/autoload/message.el | 2 +- core/cli/autoloads.el | 2 +- core/core-lib.el | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/autoload/line-numbers.el b/core/autoload/line-numbers.el index 6ea35584d..a02a7b899 100644 --- a/core/autoload/line-numbers.el +++ b/core/autoload/line-numbers.el @@ -27,6 +27,9 @@ Lisp programs can disable display of a line number of a particular buffer line by putting the display-line-numbers-disable text property or overlay property on the first visible character of that line.") +(defgroup display-line-numbers nil "Display line number preferences" + :group 'emacs) + ;;;###autoload (defcustom display-line-numbers-type t "The default type of line numbers to use in `display-line-numbers-mode'. diff --git a/core/autoload/message.el b/core/autoload/message.el index 6421c839f..e7645d352 100644 --- a/core/autoload/message.el +++ b/core/autoload/message.el @@ -47,7 +47,7 @@ Otherwise, it maps colors to a term-color-* face." (propertize text 'face (append (get-text-property 0 'face text) - (let (spec) + (let (_) (cond ((>= code 40) `(:background ,(caddr (assq style doom-ansi-alist)))) ((>= code 30) diff --git a/core/cli/autoloads.el b/core/cli/autoloads.el index 4d427be58..e964bc5ae 100644 --- a/core/cli/autoloads.el +++ b/core/cli/autoloads.el @@ -192,7 +192,7 @@ even if it doesn't need reloading!" (push `(put ',name 'doom-module ',origin) forms)))) ((eq type 'defalias) - (cl-destructuring-bind (type name target &optional docstring) sexp + (cl-destructuring-bind (_type name target &optional docstring) sexp (let ((name (doom-unquote name)) (target (doom-unquote target))) (unless (and member-p diff --git a/core/core-lib.el b/core/core-lib.el index 0e764aede..e9275d53c 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -130,7 +130,7 @@ serve as a predicated alternative to `after!'." (declare (indent defun) (debug t)) `(if ,condition (progn ,@body) - ,(let ((fun (gensym "doom|delay-form-"))) + ,(let ((fun (make-symbol "doom|delay-form-"))) `(progn (fset ',fun (lambda (&rest args) (when ,(or condition t) @@ -196,7 +196,7 @@ advised)." (let ((append (if (eq (car forms) :after) (pop forms))) (fn (if (symbolp (car forms)) (intern (format "doom|transient-hook-%s" (pop forms))) - (gensym "doom|transient-hook-")))) + (make-symbol "doom|transient-hook-")))) `(progn (fset ',fn (lambda (&rest _)