From 4d0a1c884d4b43b7378bae77f8a468b246fd2367 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 7 Sep 2020 14:45:10 -0700 Subject: [PATCH] =?UTF-8?q?Use=20=E2=80=98display-fill-column-indicator-mo?= =?UTF-8?q?de=E2=80=99=20if=20possible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fall back to ‘fci-mode’ if the function ‘display-fill-column-indicator-mode’ doesn’t exist. --- oni-c.el | 8 ++++++-- oni-cmake.el | 8 ++++++-- oni-cpp.el | 8 ++++++-- oni-csharp/oni-csharp.el | 8 ++++++-- oni-css/oni-css.el | 8 ++++++-- oni-elisp/oni-elisp.el | 8 ++++++-- oni-java.el | 8 ++++++-- oni-js.el | 8 ++++++-- oni-makefile.el | 8 ++++++-- oni-php/oni-php.el | 8 ++++++-- oni-python/oni-python.el | 8 ++++++-- oni-ruby/oni-ruby.el | 8 ++++++-- oni-scheme.el | 8 ++++++-- oni-sh.el | 11 ++++++++--- oni-yaml.el | 8 ++++++-- 15 files changed, 92 insertions(+), 31 deletions(-) diff --git a/oni-c.el b/oni-c.el index 843287a..cfa360d 100644 --- a/oni-c.el +++ b/oni-c.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2019.1210.230144 +;; Version: 2020.0907.143822 ;; Package-Requires: (oni-flycheck oni-fci) ;; This program is free software; you can redistribute it and/or modify @@ -34,9 +34,13 @@ (add-hook 'c-mode-hook 'electric-pair-local-mode) (add-hook 'c-mode-hook 'electric-indent-local-mode) (add-hook 'c-mode-hook 'flycheck-mode) -(add-hook 'c-mode-hook 'fci-mode) (add-hook 'c-mode-hook 'oni-c--auto-fill-mode) +(add-hook 'c-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + ;;;###autoload(with-eval-after-load 'cc-mode (require 'oni-c)) (provide 'oni-c) diff --git a/oni-cmake.el b/oni-cmake.el index 3f26444..836f27c 100644 --- a/oni-cmake.el +++ b/oni-cmake.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0229.130404 +;; Version: 2020.0907.143950 ;; Package-Requires: (cmake-mode oni-company oni-fci oni-flycheck cmake-font-lock eldoc-cmake) ;; This program is free software; you can redistribute it and/or modify @@ -38,9 +38,13 @@ (add-hook 'cmake-mode-hook 'company-mode) (add-hook 'cmake-mode-hook 'eldoc-cmake-enable) (add-hook 'cmake-mode-hook 'electric-pair-local-mode) -(add-hook 'cmake-mode-hook 'fci-mode) (add-hook 'cmake-mode-hook 'oni-cmake--auto-fill-mode) +(add-hook 'cmake-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + (add-to-list 'compilation-error-regexp-alist `(,(rx bol "CMake Warning (dev) at " diff --git a/oni-cpp.el b/oni-cpp.el index 388f360..eadbbc3 100644 --- a/oni-cpp.el +++ b/oni-cpp.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0113.213122 +;; Version: 2020.0907.144055 ;; Package-Requires: (oni-company oni-flycheck oni-fci) ;; This program is free software; you can redistribute it and/or modify @@ -34,10 +34,14 @@ (add-hook 'c++-mode-hook 'company-mode) (add-hook 'c++-mode-hook 'electric-indent-local-mode) (add-hook 'c++-mode-hook 'electric-pair-local-mode) -(add-hook 'c++-mode-hook 'fci-mode) (add-hook 'c++-mode-hook 'flycheck-mode) (add-hook 'c++-mode-hook 'oni-cpp--auto-fill-mode) +(add-hook 'c++-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + ;;;###autoload(with-eval-after-load 'cc-mode (require 'oni-cpp)) (provide 'oni-cpp) diff --git a/oni-csharp/oni-csharp.el b/oni-csharp/oni-csharp.el index b15e163..07ab27e 100644 --- a/oni-csharp/oni-csharp.el +++ b/oni-csharp/oni-csharp.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0825.163721 +;; Version: 2020.0907.144202 ;; Package-Requires: (csharp-mode oni-company oni-flycheck oni-yasnippet oni-hydra oni-fci oni-lsp smartparens) ;; This program is free software; you can redistribute it and/or modify @@ -144,7 +144,6 @@ _cs_: Solution (add-hook 'csharp-mode-hook 'company-mode) (add-hook 'csharp-mode-hook 'electric-indent-local-mode) -(add-hook 'csharp-mode-hook 'fci-mode) (add-hook 'csharp-mode-hook 'flycheck-mode) (add-hook 'csharp-mode-hook 'lsp) (add-hook 'csharp-mode-hook 'oni-csharp--auto-fill-mode) @@ -152,6 +151,11 @@ _cs_: Solution (add-hook 'csharp-mode-hook 'rainbow-delimiters-mode) (add-hook 'csharp-mode-hook 'smartparens-mode) +(add-hook 'csharp-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + (define-key csharp-mode-map (kbd "C-c SPC") 'oni-csharp-hydra/body) ;;;###autoload diff --git a/oni-css/oni-css.el b/oni-css/oni-css.el index f886d6a..3c89c0b 100644 --- a/oni-css/oni-css.el +++ b/oni-css/oni-css.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0305.222317 +;; Version: 2020.0907.143210 ;; Package-Requires: (oni-company oni-fci oni-hydra rainbow-mode yasnippet) ;; This program is free software; you can redistribute it and/or modify @@ -96,10 +96,14 @@ (add-hook 'css-mode-hook 'company-mode) (add-hook 'css-mode-hook 'electric-indent-local-mode) (add-hook 'css-mode-hook 'electric-pair-local-mode) -(add-hook 'css-mode-hook 'fci-mode) (add-hook 'css-mode-hook 'rainbow-mode) (add-hook 'css-mode-hook 'oni-css--auto-fill-mode) +(add-hook 'css-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + (with-eval-after-load 'compile (let ((scss-error-regexp (rx (and bol diff --git a/oni-elisp/oni-elisp.el b/oni-elisp/oni-elisp.el index f5211b4..1ac4708 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.221949 +;; Version: 2020.0907.143103 ;; 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 @@ -80,12 +80,16 @@ _eb_: Buffer (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) -(add-hook 'emacs-lisp-mode-hook 'fci-mode) (add-hook 'emacs-lisp-mode-hook 'flycheck-mode) (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 + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + (add-hook 'ielm-mode-hook 'company-mode) (add-hook 'ielm-mode-hook 'paredit-mode) diff --git a/oni-java.el b/oni-java.el index b46ebbc..72ca8b8 100644 --- a/oni-java.el +++ b/oni-java.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0305.222356 +;; Version: 2020.0907.143141 ;; Package-Requires: (oni-fci oni-data-dir oni-lsp oni-hydra lsp-java company-lsp) ;; This program is free software; you can redistribute it and/or modify @@ -72,9 +72,13 @@ (add-hook 'java-mode-hook 'auto-fill-mode) (add-hook 'java-mode-hook 'electric-indent-local-mode) (add-hook 'java-mode-hook 'electric-pair-local-mode) -(add-hook 'java-mode-hook 'fci-mode) (add-hook 'java-mode-hook 'lsp) +(add-hook 'java-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + (add-to-list 'company-backends 'company-lsp) (define-key java-mode-map (kbd "C-c r") 'java-refactor-hydra/body) diff --git a/oni-js.el b/oni-js.el index 534b0c8..5222db2 100644 --- a/oni-js.el +++ b/oni-js.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2019.1210.230928 +;; Version: 2020.0907.143324 ;; Package-Requires: (oni-company js2-mode js2-refactor oni-fci oni-flycheck tern company-tern fic-mode rjsx-mode) ;; This program is free software; you can redistribute it and/or modify @@ -58,7 +58,6 @@ (add-hook 'js2-mode-hook 'company-mode) (add-hook 'js2-mode-hook 'electric-pair-local-mode) -(add-hook 'js2-mode-hook 'fci-mode) (add-hook 'js2-mode-hook 'fic-mode) (add-hook 'js2-mode-hook 'flycheck-mode) (add-hook 'js2-mode-hook 'js2-refactor-mode) @@ -67,6 +66,11 @@ (add-hook 'js2-mode-hook 'tern-mode) (add-hook 'js2-mode-hook 'oni-js--auto-fill-mode) +(add-hook 'js2-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + (js2r-add-keybindings-with-prefix "C-c r") (add-to-list 'company-backends 'company-tern) diff --git a/oni-makefile.el b/oni-makefile.el index 74815ed..053240d 100644 --- a/oni-makefile.el +++ b/oni-makefile.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2019.1210.231019 +;; Version: 2020.0907.141543 ;; Package-Requires: (oni-fci) ;; This program is free software; you can redistribute it and/or modify @@ -40,9 +40,13 @@ (add-hook 'makefile-mode-hook #'oni-makefile--whitespace-mode) (add-hook 'makefile-mode-hook 'electric-pair-local-mode) -(add-hook 'makefile-mode-hook 'fci-mode) (add-hook 'makefile-mode-hook 'oni-makefile--auto-fill-mode) +(add-hook 'makefile-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + ;;;###autoload(with-eval-after-load 'make-mode (require 'oni-makefile)) (provide 'oni-makefile) diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el index e302890..a38dcea 100644 --- a/oni-php/oni-php.el +++ b/oni-php/oni-php.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0305.222253 +;; Version: 2020.0907.142339 ;; Package-Requires: (php-mode oni-yasnippet oni-flycheck oni-company oni-fci oni-hydra ggtags fic-mode company-php phpcbf) ;; This program is free software; you can redistribute it and/or modify @@ -74,13 +74,17 @@ nil for some reason." (add-hook 'php-mode-hook 'company-mode) (add-hook 'php-mode-hook 'electric-indent-local-mode) (add-hook 'php-mode-hook 'electric-pair-local-mode) -(add-hook 'php-mode-hook 'fci-mode) (add-hook 'php-mode-hook 'fic-mode) (add-hook 'php-mode-hook 'flycheck-mode) (add-hook 'php-mode-hook 'ggtags-mode) (add-hook 'php-mode-hook 'phpcbf-enable-on-save) (add-hook 'php-mode-hook 'oni-php--auto-fill-mode) +(add-hook 'php-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + (with-eval-after-load 'company (add-to-list 'company-backends 'company-ac-php-backend)) diff --git a/oni-python/oni-python.el b/oni-python/oni-python.el index d18fc9b..c4bea82 100644 --- a/oni-python/oni-python.el +++ b/oni-python/oni-python.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0706.231614 +;; Version: 2020.0907.143301 ;; Package-Requires: (oni-yasnippet oni-company oni-fci oni-flycheck oni-hydra oni-lsp rainbow-delimiters reformatter traad) ;; This program is free software; you can redistribute it and/or modify @@ -90,7 +90,6 @@ for indentation." (add-hook 'python-mode-hook 'company-mode) (add-hook 'python-mode-hook 'electric-indent-local-mode) (add-hook 'python-mode-hook 'electric-pair-local-mode) -(add-hook 'python-mode-hook 'fci-mode) (add-hook 'python-mode-hook 'flycheck-mode) (add-hook 'python-mode-hook 'lsp) (add-hook 'python-mode-hook 'oni-python-set-fill-column) @@ -98,6 +97,11 @@ for indentation." (add-hook 'python-mode-hook 'python-black-on-save-mode) (add-hook 'python-mode-hook 'rainbow-delimiters-mode) +(add-hook 'python-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + ;;;###autoload (with-eval-after-load 'python (with-eval-after-load 'yasnippet diff --git a/oni-ruby/oni-ruby.el b/oni-ruby/oni-ruby.el index 8e7b694..16ceec0 100644 --- a/oni-ruby/oni-ruby.el +++ b/oni-ruby/oni-ruby.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2019.1210.225801 +;; Version: 2020.0907.142903 ;; Package-Requires: (ruby-mode oni-fci oni-yasnippet) ;; This program is free software; you can redistribute it and/or modify @@ -52,9 +52,13 @@ (add-hook 'ruby-mode-hook 'electric-indent-local-mode) (add-hook 'ruby-mode-hook 'electric-pair-local-mode) -(add-hook 'ruby-mode-hook 'fci-mode) (add-hook 'ruby-mode-hook 'oni-ruby--auto-fill-mode) +(add-hook 'ruby-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + ;;;###autoload (with-eval-after-load 'ruby-mode (with-eval-after-load 'yasnippet diff --git a/oni-scheme.el b/oni-scheme.el index f18fc98..c577c34 100644 --- a/oni-scheme.el +++ b/oni-scheme.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0719.203126 +;; Version: 2020.0907.143238 ;; Package-Requires: (oni-company oni-paredit oni-fci rainbow-delimiters geiser) ;; This program is free software; you can redistribute it and/or modify @@ -34,11 +34,15 @@ (auto-fill-mode)) (add-hook 'scheme-mode-hook 'company-mode) -(add-hook 'scheme-mode-hook 'fci-mode) (add-hook 'scheme-mode-hook 'paredit-mode) (add-hook 'scheme-mode-hook 'rainbow-delimiters-mode) (add-hook 'scheme-mode-hook 'oni-scheme--auto-fill-mode) +(add-hook 'scheme-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + (add-hook 'geiser-repl-mode-hook 'paredit-mode) (setq geiser-default-implementation 'guile) diff --git a/oni-sh.el b/oni-sh.el index ee22755..eee240a 100644 --- a/oni-sh.el +++ b/oni-sh.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0427.091422 +;; Version: 2020.0907.143035 ;; Package-Requires: (reformatter oni-flycheck oni-fci oni-smartparens) ;; This program is free software; you can redistribute it and/or modify @@ -27,7 +27,8 @@ ;; This sets the following minor modes for ‘sh-mode’: ;; - ‘electric-indent-local-mode’ ;; - ‘electric-pair-local-mode’ -;; - ‘fci-mode’ +;; - ‘display-fill-column-indicator-mode’ (falls back to ‘fci-mode’ if this mode +;; doesn’t exist. ;; - ‘flycheck-mode’ ;; It also defines a formatter using ‘reformatter’ which runs the shfmt utility. @@ -44,11 +45,15 @@ :group 'shfmt) (add-hook 'sh-mode-hook 'electric-indent-local-mode) -(add-hook 'sh-mode-hook 'fci-mode) (add-hook 'sh-mode-hook 'flycheck-mode) (add-hook 'sh-mode-hook 'shfmt-on-save-mode) (add-hook 'sh-mode-hook 'smartparens-mode) +(add-hook 'sh-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + ;;;###autoload (add-to-list 'auto-mode-alist '("PKGBUILD\\'" . sh-mode)) diff --git a/oni-yaml.el b/oni-yaml.el index 5ed5ca0..ba65d4c 100644 --- a/oni-yaml.el +++ b/oni-yaml.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0719.212242 +;; Version: 2020.0907.144306 ;; Package-Requires: (yaml-mode oni-flycheck oni-fci oni-highlight-indent-guides flycheck-yamllint indent-tools yaml-imenu) ;; This program is free software; you can redistribute it and/or modify @@ -39,11 +39,15 @@ (add-hook 'yaml-mode-hook 'electric-indent-local-mode) (add-hook 'yaml-mode-hook 'electric-pair-local-mode) -(add-hook 'yaml-mode-hook 'fci-mode) (add-hook 'yaml-mode-hook 'highlight-indent-guides-mode) (add-hook 'yaml-mode-hook 'oni-yaml--auto-fill-mode) (add-hook 'yaml-mode-hook 'yaml-imenu-enable) +(add-hook 'yaml-mode-hook + (if (fboundp 'display-fill-column-indicator-mode) + 'display-fill-column-indicator-mode + 'fci-mode)) + (flycheck-yamllint-setup) ;;;###autoload(with-eval-after-load 'yaml-mode (require 'oni-yaml))