Emacsg: Silence byte-compiler

Before this commit when running "touch init.el; emacs", then the
compilation triggered by `auto-compile-on-load-mode' resulted in:

  Warning (bytecomp): the following functions might not be defined at runtime:
      server-running-p, magit-add-section-hook
  Warning (bytecomp): the following functions are not known to be defined:
      indent-spaces-mode, indicate-buffer-boundaries-left

While "make build-init" only resulted in:

  init.el:193:1: Warning: the function ‘magit-add-section-hook’ might not be
      defined at runtime.

This commit addresses all of these warnings:

- Don't sharp quote functions, because they resulted in invalid
  warnings.

- Use the `use-package' keyword `:commands' to suppress the other
  warnings, because `:functions' fails to its job even though
  theoretically it is more suitable in these cases.
This commit is contained in:
Jonas Bernoulli 2021-01-27 12:22:40 +01:00
parent 70c1e2f11f
commit 0f9e8e769e

View File

@ -57,6 +57,7 @@
(load custom-file)))
(use-package server
:commands (server-running-p)
:config (or (server-running-p) (server-mode)))
(progn ; startup
@ -104,10 +105,11 @@
(add-hook 'emacs-lisp-mode-hook 'reveal-mode)
(defun indent-spaces-mode ()
(setq indent-tabs-mode nil))
(add-hook 'lisp-interaction-mode-hook #'indent-spaces-mode))
(add-hook 'lisp-interaction-mode-hook 'indent-spaces-mode))
(use-package magit
:defer t
:commands (magit-add-section-hook)
:config
(magit-add-section-hook 'magit-status-sections-hook
'magit-insert-modules
@ -125,7 +127,7 @@
:config (global-prettify-symbols-mode)
(defun indicate-buffer-boundaries-left ()
(setq indicate-buffer-boundaries 'left))
(add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left))
(add-hook 'prog-mode-hook 'indicate-buffer-boundaries-left))
(use-package recentf
:demand t
@ -149,7 +151,7 @@
(set-face-attribute 'smerge-refined-added nil :extend t)))
(progn ; `text-mode'
(add-hook 'text-mode-hook #'indicate-buffer-boundaries-left))
(add-hook 'text-mode-hook 'indicate-buffer-boundaries-left))
(use-package tramp
:defer t