From 0564bde343c0b45b61ccdaa6ed1c2e503e62beb0 Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Sat, 15 Jan 2022 10:28:59 +0530 Subject: [PATCH] Use when-let instead of awhen --- init.org | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/init.org b/init.org index 5621aec..205f02d 100644 --- a/init.org +++ b/init.org @@ -2920,17 +2920,16 @@ _u_: next word ^_l_: edit lines^ _s_: next whole symbol ("a" ag "ag") ("h" find-grep "find-grep")) #+END_SRC + ** General #+BEGIN_SRC emacs-lisp -(require 'anaphora) - (defun my-compile-project (file &optional prefix cmd) "Enter ancestor directory containing FILE and run compile command CMD. If CMD is not supplied, use `compile-command'. With PREFIX argument and omitted CMD, prompt for command." (interactive "fDominating File: \nP") - (awhen (locate-dominating-file default-directory file) - (cd it)) + (when-let ((dir (locate-dominating-file default-directory file))) + (cd dir)) (compile (cond (prefix (compilation-read-command