sql: move function to funcs.el

This commit is contained in:
syl20bnr 2018-01-18 01:08:46 -05:00
parent 04910be2e2
commit 93913ebce1
2 changed files with 18 additions and 7 deletions

18
layers/+lang/sql/funcs.el Normal file
View File

@ -0,0 +1,18 @@
;;; funcs.el --- SQL Layer functions File for Spacemacs
;;
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defun spacemacs/sql-populate-products-list (&rest args)
"Update Spacemacs list of sql products"
(setq
spacemacs-sql-highlightable sql-product-alist
spacemacs-sql-startable (remove-if-not
(lambda (product) (sql-get-product-feature (car product) :sqli-program))
sql-product-alist)))

View File

@ -27,13 +27,6 @@
;; should not set this to anything else than nil
;; the focus of SQLi is handled by spacemacs conventions
sql-pop-to-buffer-after-send-region nil)
(defun spacemacs/sql-populate-products-list (&rest args)
"Update Spacemacs list of sql products"
(setq
spacemacs-sql-highlightable sql-product-alist
spacemacs-sql-startable (remove-if-not
(lambda (product) (sql-get-product-feature (car product) :sqli-program))
sql-product-alist)))
(advice-add 'sql-add-product :after #'spacemacs/sql-populate-products-list)
(advice-add 'sql-del-product :after #'spacemacs/sql-populate-products-list)
(spacemacs/sql-populate-products-list)