1
0
Fork 0

Prevent ‘auto-fill’ from filling the Package-Requires line

This commit is contained in:
Tom Willemse 2020-06-16 21:55:34 -07:00
parent b9370a75b6
commit 092702b95e

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; 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) ;; 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 ;; 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)) (add-to-list 'yas-snippet-dirs oni-elisp-snippets-dir t))
(yas-load-directory oni-elisp-snippets-dir)) (yas-load-directory oni-elisp-snippets-dir))
(defun oni-elisp--auto-fill-mode () (defun oni-elisp-auto-fill-mode ()
"Enable auto-fill-mode only for comments." "Enable auto-fill-mode only for comments and inhibit for Package-Requires."
(setq-local comment-auto-fill-only-comments t) (setq-local comment-auto-fill-only-comments t)
(setq-local auto-fill-inhibit-regexp (rx line-start ";; Package-Requires: "))
(auto-fill-mode)) (auto-fill-mode))
(defhydra oni-elisp-hydra (:color teal :hint nil) (defhydra oni-elisp-hydra (:color teal :hint nil)
@ -65,6 +66,7 @@ _eb_: Buffer
" "
("eb" eval-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 'company-mode)
(add-hook 'emacs-lisp-mode-hook 'electric-quote-local-mode) (add-hook 'emacs-lisp-mode-hook 'electric-quote-local-mode)
(add-hook 'emacs-lisp-mode-hook 'erefactor-lazy-highlight-turn-on) (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 'nameless-mode)
(add-hook 'emacs-lisp-mode-hook 'paredit-mode) (add-hook 'emacs-lisp-mode-hook 'paredit-mode)
(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-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 'company-mode)
(add-hook 'ielm-mode-hook 'paredit-mode) (add-hook 'ielm-mode-hook 'paredit-mode)