(require-package 'sql-indent)
(eval-after-load 'sql
  '(load-library "sql-indent"))

(eval-after-load 'sql
  '(when (featurep 'dash-at-point)
     (defun sanityinc/maybe-set-dash-db-docset ()
       (when (eq sql-product 'postgres)
         (setq dash-at-point-docset "psql")))

     (add-hook 'sql-mode-hook 'sanityinc/maybe-set-dash-db-docset)
     (add-hook 'sql-interactive-mode-hook 'sanityinc/maybe-set-dash-db-docset)
     (defadvice sql-set-product (after set-dash-docset activate)
       (sanityinc/maybe-set-dash-db-docset))))


(provide 'init-sql)

(require-package 'sql-indent)
(eval-after-load 'sql
  '(load-library "sql-indent"))

(eval-after-load 'sql
  '(when (package-installed-p 'dash-at-point)
     (defun sanityinc/maybe-set-dash-db-docset ()
        (when (eq sql-product 'postgres)
          (setq dash-at-point-docset "psql")))

     (add-hook 'sql-mode-hook 'sanityinc/maybe-set-dash-db-docset)
     (add-hook 'sql-interactive-mode-hook 'sanityinc/maybe-set-dash-db-docset)
     (defadvice sql-set-product (after set-dash-docset activate)
       (sanityinc/maybe-set-dash-db-docset))))


(provide 'init-sql)

Use package-installed-p to detect dash-at-point
Use package-installed-p to detect dash-at-point

Enzo-Liu/emacs.d,ruiyang/emacs.d,zhaotai/.emacs.d,cjqw/emacs.d,modkzs/emcs.d,LittleLmp/emacs.d,mpwang/emacs.d,ruiyang/emacs.d,farzadbekran/emacs.d,Togal/emacs.d,pairyo/emacs.d,mmqmzk/emacs.d,ernest-dzf/emacs.d,zenith-john/emacs.d,boblannon/emacs.d,carlosliu/emacs.d,purcell/emacs.d,wenpincui/emacs.d,me020523/emacs.d,Guoozz/emacs.d,jachinpy/emacs.d,lujianmei/emacs.d,46do14/emacs.d,hkcqr/emacs.d,Shanicky/emacs.d,danfengcao/emacs.d,baohaojun/emacs.d,zhuoyikang/emacs.d,jkaessens/emacs.d,renatoriccio/emacs.d,shafayetkhan/emacs.d,caoyuanqi/emacs.d,sgarciac/emacs.d,lust4life/emacs.d,DarkThrone/emacs.d,haodaivshen/emacs.d,exclamaforte/emacs.d,dcorking/emacs.d,gsmlg/emacs.d,dhanunjaya/emacs.d,braveoyster/emacs.d,krzysz00/emacs.d,farzadbekran/emacs.d,hophacker/emacs.d,roxolan/emacs.d,qinshulei/emacs.d,cyjia/emacs.d,farzadbekran/emacs.d,emuio/emacs.d,kindoblue/emacs.d,farzadbekran/emacs.d,farzadbekran/emacs.d,whizzzkid/emacs.d,scorpionis/emacs.d,alant/emacs.d,wegatron/emacs.d,blueseason/emacs.d,svenyurgensson/emacs.d,Jadecity/PurcellEmacs.d,atreeyang/emacs.d,dongdonghu/.emacs.d,ilove0518/emacs.d,jachinpy/emacs.d,bibaijin/emacs.d,LKI/emacs.d,jhpx/emacs.d,arthurl/emacs.d,benkha/emacs.d,fengxl/emacs.d,blueabysm/emacs.d,Werewolflsp/emacs.d,kongfy/emacs.d,qianwan/emacs.d,jthetzel/emacs.d,lromang/emacs.d