From 851de4f6b3e973bdd62463c18050c40d8303a9b0 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 22 Oct 2014 21:09:22 -0400 Subject: Go crazy with anaphoric forms --- lisp/init-ace.el | 4 ++-- lisp/init-bib.el | 4 ++-- lisp/init-external.el | 14 +++++++------- lisp/init-git.el | 4 ++-- lisp/init-org.el | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) (limited to 'lisp') diff --git a/lisp/init-ace.el b/lisp/init-ace.el index 78d0d72..80380ea 100644 --- a/lisp/init-ace.el +++ b/lisp/init-ace.el @@ -28,8 +28,8 @@ (save-excursion (goto-char (window-start)) (while (< (point) end) - (-when-let (pos (dired-next-line 1)) - (push pos points))) + (--when-let (dired-next-line 1) + (push it points))) (nreverse points)))) (after 'dired diff --git a/lisp/init-bib.el b/lisp/init-bib.el index 4ae4ffe..ae15305 100644 --- a/lisp/init-bib.el +++ b/lisp/init-bib.el @@ -71,8 +71,8 @@ way." (when (equal (thing-at-point 'word) "doi") (backward-word) (re-search-forward "doi:[ \t\n]*")) - (-if-let (http-doi (thing-at-point 'url)) - (replace-regexp-in-string "http://" "" http-doi) + (--if-let (thing-at-point 'url) + (replace-regexp-in-string "http://" "" it) (user-error "No DOI found at point")))) (provide 'init-bib) diff --git a/lisp/init-external.el b/lisp/init-external.el index 0831a48..676bb0a 100644 --- a/lisp/init-external.el +++ b/lisp/init-external.el @@ -24,9 +24,9 @@ of the same name already exists, switch to it unless NEW-BUFFER is non-nil." (interactive "P") (let ((name (concat "zsh:" (abbreviate-file-name default-directory)))) - (-if-let (buffer-name (and (not new-buffer) - (get-buffer (concat "*" name "*")))) - (switch-to-buffer buffer-name) + (--if-let (and (not new-buffer) + (get-buffer (concat "*" name "*"))) + (switch-to-buffer it) (ansi-term "/bin/zsh" name)))) (defun km/zsh-ansi-term-other-window (&optional new-buffer) @@ -66,14 +66,14 @@ monitor setup)." (defun km/display-compilation-other-window () (interactive) - (-if-let (comp-buffer (get-buffer "*compilation*")) - (display-buffer comp-buffer) + (--if-let (get-buffer "*compilation*") + (display-buffer it) (user-error "No compilation buffer"))) (defun km/recompile-current-compilation () (interactive) - (-if-let (comp-buffer (get-buffer "*compilation*")) - (with-current-buffer comp-buffer + (--if-let (get-buffer "*compilation*") + (with-current-buffer it (recompile)) (user-error "No compilation buffer"))) diff --git a/lisp/init-git.el b/lisp/init-git.el index 5cfe9c0..c084c69 100644 --- a/lisp/init-git.el +++ b/lisp/init-git.el @@ -110,8 +110,8 @@ START-POINT set to the current branch. "Create a backup branch for the current branch. \n(git branch b/)" (interactive) - (-if-let (current-branch (magit-get-current-branch)) - (magit-run-git "branch" (concat "b/" current-branch)) + (--if-let (magit-get-current-branch) + (magit-run-git "branch" (concat "b/" it)) (user-error "No current branch"))) ;; http://whattheemacsd.com/setup-magit.el-01.html diff --git a/lisp/init-org.el b/lisp/init-org.el index b24f32e..ab25cf2 100644 --- a/lisp/init-org.el +++ b/lisp/init-org.el @@ -61,8 +61,8 @@ PDF files are not ignored." (defun km/org-open-annex-file () "Open a git annex file with `org-open-file'." (interactive) - (-if-let (files (magit-annex-present-files)) - (org-open-file (magit-completing-read "Open annex file" files nil t)) + (--if-let (magit-annex-present-files) + (org-open-file (magit-completing-read "Open annex file" it nil t)) (message "No annex files found"))) (defun km/org-open-recent-file () -- cgit v1.2.3