Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define-minor-mode A-mode
- :global t
- :lighter " A"
- (if A-mode
- (B-mode 1)
- (B-mode 0))) ; hooks here are added/removed...
- (add-hook 'A-mode-hook 'B-mode)
- (progn
- (setq foo 10)
- (print foo) ; 10
- (let ((foo 42))
- (print foo)) ; 42
- (print foo)) ; 10
- (put 'A-mode 'B-mode-enabled (bound-and-true-p B-mode))
- (unless (get 'A-mode 'B-mode-enabled)
- (B-mode 0))
Add Comment
Please, Sign In to add comment