0

Does anyone know how to set Emacs to use /* */ comments in SQL mode by default instead of --?

Clarification: I want to insert /* */ when I type M-;, but by default it inserts --. I am not concerned with font coloring or anything.

I usually write sqlite and postgresql code, if that matters, but it shouldn't.

itsjeyd
  • 5,070
  • 2
  • 30
  • 49
forkandwait
  • 5,041
  • 7
  • 23
  • 22

2 Answers2

1

Something like

(add-hook 'sql-mode-hook
          (lambda ()
            (setq comment-start "/* ")
            (setq comment-end " */")))

might do it, tho it's 100% untested.

Stefan
  • 27,908
  • 4
  • 53
  • 82
-1

I don't know much about it, but I think you can edit the syntax table to change how emacs works. The answer on this thread explains it a lot better than I could, since I've never personally gotten to work with emacs. Aside from that, I unfortunately don't have anything for you. How to make Emacs sql-mode recognize MySQL #-style comments?

Community
  • 1
  • 1