I'm trying to activate highlight-indent-guides-mode by default but it is not working. If i do M-x highlight-indent-guides-mode it works fine but adding (highlight-indent-guides-mode 1) to my .emacs file does not activates the mode. Any suggestions?

Here is the part of my .emacs file:

(add-to-list 'load-path "~/.emacs.d/manualinstalled/")
(load "guides")
(highlight-indent-guides-mode 1)
  • I'm assuming that highlight-indent-guides-mode is a minor mode. The package might also provide a global version of it, and if it doesn't, you'll probably want to enable it in a hook. – DoMiNeLa10 Jan 8 at 23:18

highlight-indent-guides-mode is buffer-local, not global. The comments at the beginning of the library https://github.com/DarthFennec/highlight-indent-guides/blob/master/highlight-indent-guides.el state in relevant part:

;; ... To enable it automatically in
;; most programming modes, use the following:
;;   (add-hook 'prog-mode-hook 'highlight-indent-guides-mode)

In your .emacs file, remove (highlight-indent-guides-mode 1) and replace it with:

(add-hook 'prog-mode-hook 'highlight-indent-guides-mode)

The original poster has apparently broken from tradition in that Emacs users normally keep the existing name of the file highlight-indent-guides.el the same, and do not alter the provide statement at the bottom of the file. To the extent the original file name and provide statement remain unchanged, we would change (load "guides") to (require 'highlight-indent-guides).

For more information regarding this library, have a look at the READE.md file of the repository:


Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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