migrated a bit more code to dash.el

This commit is contained in:
Bozhidar Batsov 2012-12-15 20:42:19 +02:00
parent 07e822f95e
commit 207d21b5cd
2 changed files with 18 additions and 14 deletions

View file

@ -160,11 +160,12 @@ there's a region, all lines that region covers will be duplicated."
(exchange-point-and-mark)) (exchange-point-and-mark))
(setq end (line-end-position)) (setq end (line-end-position))
(let ((region (buffer-substring-no-properties beg end))) (let ((region (buffer-substring-no-properties beg end)))
(dotimes (i arg) (-dotimes arg
(lambda ()
(goto-char end) (goto-char end)
(newline) (newline)
(insert region) (insert region)
(setq end (point))) (setq end (point))))
(goto-char (+ origin (* (length region) arg) arg))))) (goto-char (+ origin (* (length region) arg) arg)))))
;; TODO doesn't work with uniquify ;; TODO doesn't work with uniquify
@ -283,9 +284,11 @@ there's a region, all lines that region covers will be duplicated."
(defun prelude-kill-other-buffers () (defun prelude-kill-other-buffers ()
"Kill all buffers but the current one. Doesn't mess with special buffers." "Kill all buffers but the current one. Doesn't mess with special buffers."
(interactive) (interactive)
(dolist (buffer (buffer-list)) (-each
(unless (or (eql buffer (current-buffer)) (not (buffer-file-name buffer))) (->> (buffer-list)
(kill-buffer buffer)))) (-filter #'buffer-file-name)
(--remove (eql (current-buffer) it)))
#'kill-buffer))
(require 'repeat) (require 'repeat)

View file

@ -104,12 +104,13 @@
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode)) (add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))) (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)))
(dolist (entry prelude-auto-install-alist) (-each prelude-auto-install-alist
(lambda (entry)
(let ((extension (first entry)) (let ((extension (first entry))
(package (second entry)) (package (second entry))
(mode (third entry))) (mode (third entry)))
(unless (package-installed-p package) (unless (package-installed-p package)
(prelude-auto-install extension package mode)))) (prelude-auto-install extension package mode)))))
(provide 'prelude-packages) (provide 'prelude-packages)
;;; prelude-packages.el ends here ;;; prelude-packages.el ends here