sql: change blacklist to only accept list
This commit is contained in:
parent
7cb9c1924a
commit
6ba353a8d8
|
@ -45,10 +45,16 @@ you can set the variable =sql-capitalize-keywords-disable-interactive= to =t=.
|
||||||
[[https://github.com/Trevoke/sqlup-mode.el][sqlup-mode]] can be configured to ignore certain keywords. For example if you use
|
[[https://github.com/Trevoke/sqlup-mode.el][sqlup-mode]] can be configured to ignore certain keywords. For example if you use
|
||||||
=name= as column name it would be annoying to have it upcased. You can prevent
|
=name= as column name it would be annoying to have it upcased. You can prevent
|
||||||
this behaviour by setting the variable =sql-capitalize-keywords-blacklist= to
|
this behaviour by setting the variable =sql-capitalize-keywords-blacklist= to
|
||||||
string with one keyword (like ="name"=) or to list with multiple keywords (like
|
a list with keywords to ignore, e.g.
|
||||||
='("name" "varchar")=) to ignore.
|
|
||||||
|
|
||||||
This layer is blacklisting =name= by default as it is very common name for
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq-default dotspacemacs-configuration-layers '(
|
||||||
|
(sql :variables
|
||||||
|
sql-capitalize-keywords t
|
||||||
|
sql-capitalize-keywords-blacklist '("name" "varchar"))))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
This layer is blacklisting =name= by default as it is a very common name for
|
||||||
column and NAME is non-reserved SQL keyword.
|
column and NAME is non-reserved SQL keyword.
|
||||||
|
|
||||||
* Key bindings
|
* Key bindings
|
||||||
|
|
|
@ -15,5 +15,5 @@
|
||||||
(defvar sql-capitalize-keywords-disable-interactive nil
|
(defvar sql-capitalize-keywords-disable-interactive nil
|
||||||
"Do not capitalize keywords in interactive session (e.g. psql).")
|
"Do not capitalize keywords in interactive session (e.g. psql).")
|
||||||
|
|
||||||
(defvar sql-capitalize-keywords-blacklist "name"
|
(defvar sql-capitalize-keywords-blacklist '("name")
|
||||||
"Keyword or list of keywords to ignore during capitalization.")
|
"List of keywords to ignore during capitalization.")
|
||||||
|
|
|
@ -136,7 +136,5 @@
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(spacemacs|diminish sqlup-mode)
|
(spacemacs|diminish sqlup-mode)
|
||||||
(when sql-capitalize-keywords-blacklist
|
(setq sqlup-blacklist (append sqlup-blacklist
|
||||||
(if (listp sql-capitalize-keywords-blacklist)
|
sql-capitalize-keywords-blacklist)))))
|
||||||
(setq sqlup-blacklist (append sqlup-blacklist sql-capitalize-keywords-blacklist))
|
|
||||||
(add-to-list 'sqlup-blacklist sql-capitalize-keywords-blacklist))))))
|
|
||||||
|
|
Loading…
Reference in a new issue