Guest User

Untitled

a guest
May 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. (defvar *volume* 100)
  2. (defvar *mutedp* nil)
  3. (define-key paredit-mode-map [(control ?\j)] nil)
  4. (define-key paredit-mode-map (kbd "RET") 'paredit-newline)
  5. (global-set-key (kbd "<XF86AudioPlay>") (lambda () (cond (emms-player-playing-p
  6. (minibuffer-message "Pausing your playlist")
  7. (emms-start))
  8. ((not emms-player-playing-p)
  9. (minibuffer-message "Resuming your playlist")
  10. (emms-start)))))
  11. (global-set-key (kbd "<XF86Save>") 'save-buffer)
  12. (global-set-key (kbd "<SunOpen>") 'find-file)
  13. (global-set-key (kbd "<XF86New>") 'fine-file)
  14. (defun change-volume (downp)
  15. (cond (downp (if (< 0 (- *volume* 1))
  16. (setf *volume* (- *volume* 1))))
  17. ((not downp) (if (>= 100 (+ *volume* 1))
  18. (setf *volume* (+ *volume* 1)))))
  19. (shell-command-to-string
  20. (format "amixer set Master %d%% unmute" *volume*))
  21. (minibuffer-message (format "Set volume to %d%%" *volume*)))
  22.  
  23. (defun mute ()
  24. (interactive)
  25. (cond ((not *mutedp*)
  26. (shell-command-to-string "amixer set Master mute")
  27. (minibuffer-message "Muted the speakers")
  28. (setf *mutedp* t))
  29. (*mutedp*
  30. (shell-command-to-string "amixer set Master unmute")
  31. (minibuffer-message "Unmuted the speakers")
  32. (setf *mutedp* nil))))
  33.  
  34. (global-set-key (kbd "<XF86AudioMute>") 'mute)
  35. (global-set-key (kbd "<XF86AudioLowerVolume>") (lambda () (interactive) (change-volume t)))
  36. (global-set-key (kbd "<XF86AudioRaiseVolume>") (lambda () (interactive) (change-volume nil)))
  37. (global-set-key (kbd "<XF86Favorites>") (lambda () (interactive) (flet ((y-or-n-p (a) nil)) (slime))))
  38. (global-set-key (kbd "<XF86Documents>") 'magit-status)
  39. (global-set-key (kbd "<XF86Close>") (lambda () (interactive)
  40. (if (yes-or-no-p "Would you like to save this buffer?")
  41. ((lambda ()
  42. (save-buffer)
  43. (kill-this-buffer)))
  44. (kill-this-buffer))))
  45.  
  46. (global-set-key (kbd "<f31>") (lambda () (interactive)
  47. (find-file "~/programming/lisp/how/how.asd")
  48. (find-file "~/programming/lisp/how/packages.lisp")
  49. (find-file "~/programming/lisp/how/src/sprite.lisp")
  50. (find-file "~/programming/lisp/how/src/health.lisp")
  51. (find-file "~/programming/lisp/how/src/image.lisp")))
  52.  
  53. (global-set-key (kbd "<f32>") (lambda () (interactive)
  54. (find-file "~/programming/lisp/juggler/juggler.asd")
  55. (find-file "~/programming/lisp/juggler/simple-sdl-init.lisp")
  56. (find-file "~/programming/lisp/juggler/src/juggler.lisp")
  57. (find-file "~/programming/lisp/juggler/src/materials.lisp")
  58. (find-file "~/programming/lisp/juggler/src/globals.lisp")
  59. (find-file "~/programming/lisp/juggler/src/render.lisp")))
Add Comment
Please, Sign In to add comment