emacstuareg

fill-column setting in tuareg mode not working


I have following setting in ~/.emacs

(defun my-fillcol-hook ()
   (longlines-mode t)
   (setq-default fill-column 80))                                                                                                                                                                                 

(add-hook 'c-mode-hook 'my-fillcol-hook)
(add-hook 'c++-mode-hook 'my-fillcol-hook)
(add-hook 'tuareg-mode-hook 'my-fillcol-hook)

The fill-column is set as expected in C-mode and C++-mode but not in tuareg-mode. I am not able to find out why fill-column is not getting set in tuareg-mode. Thanks in advance for the help.


Solution

  • setq-default changes the global value, whereas tuareg-mode apparently sets a buffer-local value which takes precedence. IOW you want to use setq-local or just setq.