I have a buffer with name *fsharp info* which I want to change (programmatically) the mode from help-mode to my custom mode.
I created a simple major mode fsharp-info-mode to highlight fsharp documentation using markdown's font-lock.
(define-derived-mode fsharp-info-mode help-mode "fsharp-info-mode"
"major mode for fsharp info."
(setq font-lock-defaults '(markdown-mode-font-lock-keywords)))
With no success, I tried to enable it to the buffer with name *fsharp info* using
(add-to-list 'auto-mode-alist '("\\*fsharp info\\*" . fsharp-info-mode))
Looking in fsharp-mode, I discovered that the use with-help-window to create *fsharp info*. In the documentation, it says that help-mode is activate in the buffer (maybe that is why I can't change?)
EDIT:
I solved my problem temporarily advising fsharp-ac/show-info-window which is the function called by fsharp-mode to display the documentation.
(defadvice fsharp-ac/show-info-window (after fsharp-ac/show-info-window-after activate)
(save-excursion
(switch-to-buffer "*fsharp info*")
(fsharp-info-mode)))