From 8742607120fbc440821acbc351fda1e8e68a8806 Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Tue, 31 Jan 2023 22:02:07 -0500 Subject: [PATCH] stop clobbering company-backends * using add-hook to modify company-backends is bad juju * there does not appear to be a sensible way for a mode to modify company-backends either in the variable docstring or the online documentation here https://company-mode.github.io/manual/Backends.html so... we should not modify it. * document the added effort to use the company backend * the only additional fanciness to `systemd-company-backend' is that it will automatically insert an = after completing a directive, so it might be nice to work that into the capf completion somehow and trash the company-specific code --- systemd.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/systemd.el b/systemd.el index dff9005..6db0403 100644 --- a/systemd.el +++ b/systemd.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2014-2023 Mark Oteiza ;; Author: Mark Oteiza -;; Version: 1.6 +;; Version: 1.6.1 ;; Package-Requires: ((emacs "24.4")) ;; Keywords: tools, unix @@ -33,7 +33,8 @@ ;; network configuration. Both a completer for ;; `completion-at-point-functions' and a company backend are provided. ;; The latter can be enabled by adding `company-mode' to -;; `systemd-mode-hook'. +;; `systemd-mode-hook' and adding `systemd-company-backend' to +;; `company-backends'. ;;; Code: @@ -406,7 +407,6 @@ Key bindings: (set-keymap-parent systemd-mode-map nil) (conf-mode-initialize systemd-comment-start) (setq-local auto-fill-inhibit-regexp "^[ \t]*?[^;#]") - (add-hook 'company-backends #'systemd-company-backend nil 'local) (add-hook 'completion-at-point-functions #'systemd-complete-at-point nil t) (add-hook 'font-lock-extend-region-functions 'systemd-font-lock-extend-region nil t)