<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Emacs on Grimoire</title>
    <link>https://shlemas.codeberg.page/</link>
    <description>Recent content in Emacs on Grimoire</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 24 May 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://shlemas.codeberg.page/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>isearch: semi-fuzzy search</title>
      <link>https://shlemas.codeberg.page/post/isearch-semi-fuzzy-search/</link>
      <pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate>
      <guid>https://shlemas.codeberg.page/post/isearch-semi-fuzzy-search/</guid>
      <description>&lt;p&gt;Let&amp;rsquo;s kick this blog off with a simple yet handy isearch hack that I&amp;rsquo;m&#xA;pretty sure I originally lifted from &lt;a href=&#34;https://github.com/protesilaos/dotfiles/blob/master/emacs/.emacs.d/prot-emacs-modules/prot-emacs-search.el#L3&#34;&gt;prot&amp;rsquo;s Emacs configuration&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-elisp&#34; data-lang=&#34;elisp&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;(defun my/isearch-fuzzy-forward (&lt;span style=&#34;color:#66d9ef&#34;&gt;&amp;amp;optional&lt;/span&gt; regexp-p)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Fuzzy version of &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;`isearch-forward&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;.&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  (interactive &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;P&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  (let ((search-whitespace-regexp &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;.*?&amp;#34;&lt;/span&gt;))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    (isearch-forward regexp-p)))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;(defun my/isearch-fuzzy-backward (&lt;span style=&#34;color:#66d9ef&#34;&gt;&amp;amp;optional&lt;/span&gt; regexp-p)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Fuzzy version of &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;`isearch-backward&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;.&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  (interactive &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;P&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  (let ((search-whitespace-regexp &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;.*?&amp;#34;&lt;/span&gt;))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    (isearch-backward regexp-p)))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The idea is simple: set &lt;code&gt;search-whitespace-regexp&lt;/code&gt; such that &lt;em&gt;any&lt;/em&gt;&#xA;sequence of characters can count as whitespace. This means as long as&#xA;the individual search terms in your query are found on the same line,&#xA;it doesn&amp;rsquo;t matter what&amp;rsquo;s between them.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
