spacemacs/funcs.el

63 lines
1.9 KiB
EmacsLisp
Raw Normal View History

2012-12-19 22:46:19 +00:00
(defun syl-python-compile ()
"Use compile to run python programs"
2012-12-18 22:24:55 +00:00
(interactive)
2012-12-19 22:46:19 +00:00
(compile (concat "python " (buffer-name))))
(setq compilation-scroll-output t)
2012-12-18 05:48:12 +00:00
;; from https://gist.github.com/3402786
(defun toggle-maximize-buffer () "Maximize buffer"
(interactive)
(if (= 1 (length (window-list)))
(jump-to-register '_)
(progn
(set-register '_ (list (current-window-configuration)))
(delete-other-windows))))
;; from http://github.com/technomancy/emacs-starter-kit
(defun esk-paredit-nonlisp ()
"Turn on paredit mode for non-lisps."
(interactive)
(set (make-local-variable 'paredit-space-for-delimiter-predicates)
'((lambda (endp delimiter) nil)))
(paredit-mode 1))
2012-12-18 05:48:12 +00:00
(defun z:set-transparency (value)
"Sets the transparency of the frame window. 0=transparent/100=opaque"
(interactive "nTransparency Value 0 - 100 opaque:")
(set-frame-parameter (selected-frame) 'alpha value))
(defun z:switch-to-next-frame ()
"Select the next frame on current display, and raise it."
(interactive)
(other-frame 1))
(defun z:switch-to-previous-frame ()
"Select the previous frame on current display, and raise it."
(interactive)
(other-frame -1))
;; http://emacswiki.org/emacs/TransposeWindows
(defun z:rotate-windows ()
"Rotate your windows"
(interactive)
(cond
((not (> (count-windows) 1))
(message "You can't rotate a single window!"))
(t
(let ((i 1)
(num-windows (count-windows)))
(while (< i num-windows)
(let* ((w1 (elt (window-list) i))
(w2 (elt (window-list) (+ (% i num-windows) 1)))
(b1 (window-buffer w1))
(b2 (window-buffer w2))
(s1 (window-start w1))
(s2 (window-start w2)))
(set-window-buffer w1 b2)
(set-window-buffer w2 b1)
(set-window-start w1 s2)
(set-window-start w2 s1)
(setq i (1+ i))))))))
(provide 'funcs)