fixed a couple of oversights

This commit is contained in:
Bozhidar Batsov 2011-10-10 17:50:23 +03:00
parent 6351407b07
commit 313056af7a
2 changed files with 15 additions and 16 deletions

View file

@ -97,7 +97,7 @@ to markdown blockquote rules (useful to copy snippets to StackOverflow, Assembla
"Copy the selected code region to the clipboard, indented according
to markdown blockquote rules. Useful to add snippets under bullet points."
(interactive "r")
(indent-rigidly-and-copy-to-clipboard begin end 6))
(prelude-indent-rigidly-and-copy-to-clipboard begin end 6))
(defun prelude-insert-empty-line ()
"Insert an empty line after the current line and positon
@ -158,7 +158,7 @@ the curson at its beginning, according to the current mode."
(indent-region (region-beginning) (region-end))
(message "Indented selected region."))
(progn
(indent-buffer)
(prelude-indent-buffer)
(message "Indented buffer.")))))
(defun prelude-annotate-todo ()
@ -401,19 +401,18 @@ there's a region, all lines that region covers will be duplicated."
(defun prelude-swap-windows ()
"If you have 2 windows, it swaps them."
(interactive)
(cond ((/= (count-windows) 2)
(message "You need exactly 2 windows to do this."))
(t
(let* ((w1 (first (window-list)))
(w2 (second (window-list)))
(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))))
(if (/= (count-windows) 2)
(message "You need exactly 2 windows to do this.")
(let* ((w1 (first (window-list)))
(w2 (second (window-list)))
(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)))
(other-window 1))
(provide 'prelude-core)

View file

@ -62,7 +62,7 @@
;; Indentation help
(global-set-key (kbd "C-x ^") 'join-line)
(global-set-key (kbd "C-M-\\") 'indent-region-or-buffer)
(global-set-key (kbd "C-M-\\") 'prelude-indent-region-or-buffer)
;; Start proced in a similar manner to dired
(global-set-key (kbd "C-x p") 'proced)