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))
(setq end (line-end-position))
(let ((region (buffer-substring-no-properties beg end)))
(dotimes (i arg)
(goto-char end)
(newline)
(insert region)
(setq end (point)))
(-dotimes arg
(lambda ()
(goto-char end)
(newline)
(insert region)
(setq end (point))))
(goto-char (+ origin (* (length region) arg) arg)))))
;; 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 ()
"Kill all buffers but the current one. Doesn't mess with special buffers."
(interactive)
(dolist (buffer (buffer-list))
(unless (or (eql buffer (current-buffer)) (not (buffer-file-name buffer)))
(kill-buffer buffer))))
(-each
(->> (buffer-list)
(-filter #'buffer-file-name)
(--remove (eql (current-buffer) it)))
#'kill-buffer))
(require 'repeat)

View file

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