Trevoke / sqlup-mode.el

An emacs minor mode to upcase SQL keyword and functions
GNU General Public License v3.0
88 stars 15 forks source link

Can't use postgres commands (`\c`) -- they can get capitalized #38

Closed Trevoke closed 8 years ago

Trevoke commented 8 years ago

Turns out c counts as something to upcase, so I can't do \c db_name which is kind of a shame.

Idea - if the word is preceded by a \, do not upcase.

davidshepherd7 commented 8 years ago

This happens because of the ("^\\s-*\\\\.*$" . font-lock-doc-face) rule in sql-mode-font-lock-keywords. We can probably just filter out any rules with font-lock-doc-face because they aren't really keywords.

davidshepherd7 commented 8 years ago

I forgot to click post on a comment I wrote here yesterday so I'll try again!

It turns out that the font-lock-doc-face isn't a problem (probably because we concat the regex with an extra $ and ^ now, and ^^ can't match anything). However there was another separate problem that caused the same issue: C alone is a postgres keyword, no idea what it's for. A fix is to include any leading \ in words when we check if they are keywords.