0

How can I chance an Emacs config setting (let's say "highlighting of current line") that I set in .emacs as (global-hl-line-mode +1), to work for all modes except one.

For example, I want highlighting of current line to be on for all modes except org-mode.

A great solution would be one that would also be applicable to customizing theme to be different by major mode (though file type could work fine for this too).

  • 1
    I answered the first part but of the question but the second one probably has a very different one. Probably you should split this question in two, – matteol Jun 1 '18 at 5:53
  • @matteol think you're right, I'll edit to remove that and add a separate question – NeuronQ Jun 1 '18 at 6:07
0

Usually you customize a mode adding functions to the mode hook. To disable the hl-line-mode use the following code

(add-hook 'org-mode-hook
          (lambda ()
            (set (make-local-variable 'global-hl-line-mode) nil)))

For more complex cases it's better to define a new function and add it to the hook.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.