punassuming / ahk-mode

AutotHotkey major mode for emacs
38 stars 15 forks source link

Doesn't seem to trigger prog-mode-hook hooks #21

Open blaenk opened 7 years ago

blaenk commented 7 years ago

I have a variety of functionality attached to prog-mode-hook and for some reason I noticed that this mode, despite seemingly deriving from it, doesn't trigger those hook handlers.

blaenk commented 7 years ago

To test, I removed the run-mode-hooks call, which is called automatically anyway, and then the prog-mode-hook handlers did run.

duianto commented 5 years ago

Confirmed, there's a prog-mode-hook issue.

Spacemacs enables evil-mc-mode for prog-mode:

      (add-hook 'prog-mode-hook 'turn-on-evil-mc-mode)

source: https://github.com/syl20bnr/spacemacs/blob/4b195ddfc9228256361e0b264fe974aa86ed51a8/layers/%2Bmisc/multiple-cursors/packages.el#L35

but evil-mc-mode isn't enabled when a .ahk file is opened.

A workaround is to add the following to the dotspacemacs/user-config section in .spacemacs.

    (add-hook 'ahk-mode-hook 'spacemacs/run-prog-mode-hooks)

the spacemacs/run-prog-mode-hooks function calls: (run-hooks 'prog-mode-hook).

blaenk suggested removing: https://github.com/ralesi/ahk-mode/blob/fde5be2cd4a0a48dc876031fb25be82892f700e0/ahk-mode.el#L691

but it didn't fix this issue.

System Info :computer: