From 092702b95eafb95fd4d8d16bf3879bdb809f9ca9 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 16 Jun 2020 21:55:34 -0700 Subject: [PATCH] =?UTF-8?q?Prevent=20=E2=80=98auto-fill=E2=80=99=20from=20?= =?UTF-8?q?filling=20the=20Package-Requires=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oni-elisp/oni-elisp.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/oni-elisp/oni-elisp.el b/oni-elisp/oni-elisp.el index 3d79b80..18c6426 100644 --- a/oni-elisp/oni-elisp.el +++ b/oni-elisp/oni-elisp.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0616.214723 +;; Version: 2020.0616.215511 ;; Package-Requires: (oni-company oni-flycheck oni-paredit oni-fci oni-yasnippet oni-hydra rainbow-delimiters nameless erefactor flycheck-relint handle elisp-format) ;; This program is free software; you can redistribute it and/or modify @@ -52,9 +52,10 @@ (add-to-list 'yas-snippet-dirs oni-elisp-snippets-dir t)) (yas-load-directory oni-elisp-snippets-dir)) -(defun oni-elisp--auto-fill-mode () - "Enable ‘auto-fill-mode’ only for comments." +(defun oni-elisp-auto-fill-mode () + "Enable ‘auto-fill-mode’ only for comments and inhibit for Package-Requires." (setq-local comment-auto-fill-only-comments t) + (setq-local auto-fill-inhibit-regexp (rx line-start ";; Package-Requires: ")) (auto-fill-mode)) (defhydra oni-elisp-hydra (:color teal :hint nil) @@ -65,6 +66,7 @@ _eb_: Buffer " ("eb" eval-buffer)) +(add-hook 'emacs-lisp-mode-hook #'oni-elisp-auto-fill-mode) (add-hook 'emacs-lisp-mode-hook 'company-mode) (add-hook 'emacs-lisp-mode-hook 'electric-quote-local-mode) (add-hook 'emacs-lisp-mode-hook 'erefactor-lazy-highlight-turn-on) @@ -73,7 +75,6 @@ _eb_: Buffer (add-hook 'emacs-lisp-mode-hook 'nameless-mode) (add-hook 'emacs-lisp-mode-hook 'paredit-mode) (add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode) -(add-hook 'emacs-lisp-mode-hook 'oni-elisp--auto-fill-mode) (add-hook 'ielm-mode-hook 'company-mode) (add-hook 'ielm-mode-hook 'paredit-mode)