Fork me on GitHub
#emacs
<
2018-03-05
>
borkdude17:03:54

How do I enable auto-highlight-symbol-mode globally?

dpsutton17:03:39

(global-auto-highlight-symbol-mode t)

borkdude17:03:28

Tried that yeah. Do I have to restart emacs for this to work?

dpsutton17:03:38

i've run into issues with it not working in some buffers

dpsutton17:03:59

i think it may have to do with prog mode. i saw someone say CIDER or clojure mode don't descend from prog mode but form generic mode

dpsutton17:03:18

i'm guessing it knows you don't want that in a text buffer and so it does a check like that

dpsutton17:03:50

ah it checks (memq major-mode ahs-modes)

dpsutton17:03:01

(defcustom ahs-modes
  '( actionscript-mode
     apache-mode
     bat-generic-mode
     c++-mode
     c-mode
     csharp-mode
     css-mode
     dos-mode
     emacs-lisp-mode
     html-mode
     ini-generic-mode
     java-mode
     javascript-mode
     js-mode
     lisp-interaction-mode
     lua-mode
     latex-mode
     makefile-mode
     makefile-gmake-mode
     markdown-mode
     moccur-edit-mode
     nxml-mode
     nxhtml-mode
     outline-mode
     perl-mode cperl-mode
     php-mode
     python-mode
     rc-generic-mode
     reg-generic-mode
     ruby-mode
     sgml-mode
     sh-mode
     squirrel-mode
     text-mode
     tcl-mode
     visual-basic-mode )
  "Major modes `auto-highlight-symbol-mode' can run on."
  :group 'auto-highlight-symbol
  :type '(repeat symbol))

dpsutton17:03:14

add to list on that the clojure buffer types

borkdude17:03:11

can I do this using some fancy customize menu in emacs? I haven’t used that part of emacs much

dpsutton17:03:12

(mapc (lambda (mode)
        (add-to-list 'ahs-modes mode))
      '(clojure-mode clojurescript-mode cider-repl-mode))

richiardiandrea17:03:15

Oh this is a great mode! I was I living without it!

gganley20:03:10

@dpsutton For the record I mentioned that cider-repl-mode does not derive from prog-mode and that was causing some issues where some of my settings that hooked into prog-mode were not being hooked.

dpsutton20:03:29

yeah that's what made me suspect that as the initial cause

richiardiandrea20:03:18

I think I open an issue for clojure-mode as well against prog-mode

richiardiandrea20:03:36

no clear which one should derive though (both?)