Skip to content

Commit

Permalink
provided a non-global version of guru-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Jun 22, 2012
1 parent 62058a8 commit 3221bcd
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions guru-mode.el
Expand Up @@ -69,11 +69,23 @@
(define-key guru-mode-map
(read-kbd-macro (first cell)) (guru-rebind (first cell) (rest cell))))

;; define minor mode
;;;###autoload
(define-minor-mode guru-mode
"A minor mode that teaches to help you use Emacs the way it was intended to be used."
t " guru"
'guru-mode-map :global t)
(define-globalized-minor-mode guru-global-mode guru-mode guru-on)

(defun guru-on ()
"Enable Guru."
(guru-mode +1))

(defun guru-off ()
"Disable Guru."
(guru-mode -1))

;;;###autoload
(define-minor-mode guru-mode "A minor mode that teaches to help you use Emacs the way it was intended to be used."
:lighter " guru"
:keymap guru-mode-map
:group 'guru)

(provide 'guru-mode)
;;; guru-mode.el ends here

1 comment on commit 3221bcd

@sfllaw
Copy link

@sfllaw sfllaw commented on 3221bcd Jul 10, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide a global-guru-mode minor mode, just like global-whitespace-mode that prelude-mode uses to globally enable guru-mode. Then, prelude-prog-mode-defaults can call guru-turn-on-if-enabled and we can disable guru-mode globally.

Please sign in to comment.