From a44df170f4cf8bab4ef568385390a5005434b4a7 Mon Sep 17 00:00:00 2001 From: Tony Zorman Date: Mon, 19 Sep 2022 09:40:06 +0200 Subject: [PATCH] X.U.Run: Add findFile --- CHANGES.md | 2 ++ XMonad/Util/Run.hs | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index f5b01092..3784c991 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,8 @@ - It is now ensured that all arguments of `execute` and `eval` are quoted. + - Added `findFile` as a shorthand to call `find-file`. + ### Other changes ## 0.17.1 (September 3, 2022) diff --git a/XMonad/Util/Run.hs b/XMonad/Util/Run.hs index 735d2cc3..75983c6f 100644 --- a/XMonad/Util/Run.hs +++ b/XMonad/Util/Run.hs @@ -75,6 +75,7 @@ module XMonad.Util.Run ( require, progn, quote, + findFile, -- * Re-exports hPutStr, @@ -454,6 +455,13 @@ require = inParens . ("require " <>) . quote quote :: String -> String quote = inParens . ("quote " <>) +-- | Call @find-file@. +-- +-- >>> findFile "/path/to/file" +-- "(find-file \"/path/to/file\" )" +findFile :: String -> String +findFile = inParens . ("find-file" <>) . asString + ----------------------------------------------------------------------- -- Batch mode