Guest User

Untitled

a guest
Oct 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. (define-minor-mode A-mode
  2. :global t
  3. :lighter " A"
  4. (if A-mode
  5. (B-mode 1)
  6. (B-mode 0))) ; hooks here are added/removed...
  7.  
  8. (add-hook 'A-mode-hook 'B-mode)
  9.  
  10. (progn
  11. (setq foo 10)
  12. (print foo) ; 10
  13. (let ((foo 42))
  14. (print foo)) ; 42
  15. (print foo)) ; 10
  16.  
  17. (put 'A-mode 'B-mode-enabled (bound-and-true-p B-mode))
  18.  
  19. (unless (get 'A-mode 'B-mode-enabled)
  20. (B-mode 0))
Add Comment
Please, Sign In to add comment