<?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 Ken Huang</title>
    <link>https://blog.kenhuang.io/tags/emacs/</link>
    <description>Recent content in Emacs on Ken Huang</description>
    <generator>Hugo</generator>
    <language>en</language>
    <managingEditor>whatacold@gmail.com (Ken Huang)</managingEditor>
    <webMaster>whatacold@gmail.com (Ken Huang)</webMaster>
    <lastBuildDate>Fri, 17 Oct 2025 20:28:45 +0800</lastBuildDate>
    <atom:link href="https://blog.kenhuang.io/tags/emacs/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>🥷 Clojure Pro Tip 4: Cider ClojureDocs</title>
      <link>https://blog.kenhuang.io/blog/2025-04-29-clojure-tip-cider-clojuredocs/</link>
      <pubDate>Tue, 29 Apr 2025 12:49:27 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2025-04-29-clojure-tip-cider-clojuredocs/</guid>
      <description>&lt;p&gt;&#xA;Sometimes, we may want a few examples of a Clojure API for inspiration while developing, especially when reading other people&amp;#39;s or open source code.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;With &lt;a href=&#34;https://cider.mx/&#34;&gt;Cider&lt;/a&gt; in &lt;a href=&#34;https://www.gnu.org/software/emacs/&#34;&gt;Emacs&lt;/a&gt;, we can run &lt;code class=&#34;verbatim&#34;&gt;M-x cider-doc&lt;/code&gt; to see the docstring for the symbol. We can even use &lt;code class=&#34;verbatim&#34;&gt;M-x cider-clojuredocs&lt;/code&gt; for some examples if the symbol is from the language core.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;https://blog.kenhuang.io/img/clojure-cider-clojuredocs.jpg&#34; alt=&#34;Running M-x cider-clojuredocs&#34; title=&#34;Click to enlarge the image&#34;/&gt;&#xA;&lt;figcaption&gt;&#xA;Running M-x cider-clojuredocs&#xA;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&#xA;I happened to find this command recently. I bet I was not the only one who didn&amp;#39;t know it, thus I&amp;#39;m sharing.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Getting Started with Cider for Clojure Programming</title>
      <link>https://blog.kenhuang.io/blog/2024-12-22-getting-started-with-cider/</link>
      <pubDate>Sun, 22 Dec 2024 17:17:15 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2024-12-22-getting-started-with-cider/</guid>
      <description>&lt;p&gt;&#xA;Here is the outline for my cider tutorial on YouTube, covering basic things you need to know to get started with cider, and starting exploring the fun of clojure programming with the REPL-driven programming approach.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;&#xA;      &lt;iframe allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen&#34; loading=&#34;eager&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; src=&#34;https://www.youtube.com/embed/evmRpr_DEBQ?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; title=&#34;YouTube video&#34;&gt;&lt;/iframe&gt;&#xA;    &lt;/div&gt;&#xA;&lt;/p&gt;&#xA;&lt;div id=&#34;outline-container-headline-1&#34; class=&#34;outline-2&#34;&gt;&#xA;&lt;h2 id=&#34;headline-1&#34;&gt;&#xA;Jack In to a REPL&#xA;&lt;/h2&gt;&#xA;&lt;div id=&#34;outline-text-headline-1&#34; class=&#34;outline-text-2&#34;&gt;&#xA;&lt;dl&gt;&#xA;&lt;dt&gt;&#xA;C-c M-j (cider-jack-in-clj)&#xA;&lt;/dt&gt;&#xA;&lt;dd&gt;start a nREPL and jack in.&#xA;&#xA;It works in a project or with a &lt;strong&gt;sole .clj file&lt;/strong&gt;.&lt;/dd&gt;&#xA;&lt;dt&gt;&#xA;M-x cider-connect-clj&#xA;&lt;/dt&gt;&#xA;&lt;dd&gt;run the command and then fill in hostname and port.&#xA;&#xA;It could be useful in some cases. e.g. on Windows, I can start the nREPL manually and then connect to it separately.&lt;/dd&gt;&#xA;&lt;/dl&gt;&#xA;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;div id=&#34;outline-container-headline-2&#34; class=&#34;outline-2&#34;&gt;&#xA;&lt;h2 id=&#34;headline-2&#34;&gt;&#xA;Evaluate Things&#xA;&lt;/h2&gt;&#xA;&lt;div id=&#34;outline-text-headline-2&#34; class=&#34;outline-text-2&#34;&gt;&#xA;&lt;dl&gt;&#xA;&lt;dt&gt;&#xA;C-M-x (cider-eval-defun-at-point)&#xA;&lt;/dt&gt;&#xA;&lt;dd&gt;evaluate current top-level form.&lt;/dd&gt;&#xA;&lt;dt&gt;&#xA;C-x C-e (cider-eval-last-sexp)&#xA;&lt;/dt&gt;&#xA;&lt;dd&gt;evaluate the preceding form.&lt;/dd&gt;&#xA;&lt;dt&gt;&#xA;C-c C-k (cider-load-buffer)&#xA;&lt;/dt&gt;&#xA;&lt;dd&gt;evaluate/load the current buffer.&lt;/dd&gt;&#xA;&lt;dt&gt;&#xA;C-c C-p (cider-pprint-eval-last-sexp)&#xA;&lt;/dt&gt;&#xA;&lt;dd&gt;Pprint the result in a dedicated buffer.&#xA;&#xA;Great thing to do when the result is too large to fit in the echo area.&lt;/dd&gt;&#xA;&lt;/dl&gt;&#xA;&lt;p&gt;Note: I prefer to use the same key bindings as for Elisp, given that&#xA;cider might bind a few keys to a single command!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Join Every N Lines By A Separator in Emacs</title>
      <link>https://blog.kenhuang.io/blog/2023-11-25-emacs-join-every-n-lines/</link>
      <pubDate>Sat, 25 Nov 2023 12:24:24 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2023-11-25-emacs-join-every-n-lines/</guid>
      <description>&lt;p&gt;&#xA;It has been some time since I came along the idea of the &lt;a href=&#34;https://blog.kenhuang.io/blog/2023-06-12-emacs-join-lines/&#34;&gt;w/join-lines&lt;/a&gt; command to join lines. After that, sometimes I found that it would be even better to join every a few lines.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Let&amp;#39;s see the example below, suppose we&amp;#39;ve copies some data from somewhere, and now we want to yank it into an Emacs buffer and slightly modify it to be like an matrix.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;That is, make it from:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Restoring Emacs&#39; Window Layouts</title>
      <link>https://blog.kenhuang.io/blog/2023-11-19-emacs-winner-mode/</link>
      <pubDate>Sun, 19 Nov 2023 13:02:42 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2023-11-19-emacs-winner-mode/</guid>
      <description>&lt;p&gt;&#xA;If you&amp;#39;ve been using Emacs for a while, I bet you must have encountered the annoying problem that your Emacs window layout gets messed up after some operations, such as looking for a help (e.g. &lt;code class=&#34;verbatim&#34;&gt;C-h k&lt;/code&gt;), or checking things in the magit status buffer.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;https://blog.kenhuang.io/img/r-mo-w-_iZqdviAo-unsplash-window.jpg&#34; alt=&#34;Photo by R Mo on Unsplash&#34; title=&#34;Click to enlarge the image&#34;/&gt;&#xA;&lt;figcaption&gt;&#xA;Photo by R Mo on Unsplash&#xA;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&#xA;I&amp;#39;m happy if I can just get back to the previous layout that I had before, and guess what? Emacs happens to have that capability built in – the &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Convenience.html&#34;&gt;winner-mode&lt;/a&gt; package, what a surprise!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Emphasize Text By Dragging Mouse in Org-mode</title>
      <link>https://blog.kenhuang.io/blog/2023-08-14-org-emphasis-dragging-mouse/</link>
      <pubDate>Mon, 14 Aug 2023 22:48:20 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2023-08-14-org-emphasis-dragging-mouse/</guid>
      <description>&lt;p&gt;&#xA;Long story short, I came up with an idea to emphasize content while I was reviewing an org-mode document a few months ago after I was tired of typing tedious &lt;code class=&#34;verbatim&#34;&gt;*&lt;/code&gt; around the content repeatedly. And I&amp;#39;ve been longing for this feature since then, because I was unfamiliar with mouse-based key bindings, and neither did I have the time to investigate it.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Today I finally nailed it down while I was attending a boring meeting, and it turned out to be quite simple. The exploration journey was not much different than before. First, I managed to find out how to bind a command to a mouse event, taking advantage of the good-old &lt;code class=&#34;verbatim&#34;&gt;C-h k&lt;/code&gt; and &lt;code class=&#34;verbatim&#34;&gt;(info &amp;#34;emacs&amp;#34;)&lt;/code&gt; (or &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_node/emacs/Mouse-Buttons.html&#34;&gt;here at gnu.org&lt;/a&gt;). And then wrote a few lines of code to perform the task standing on the shoulder of &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&#34;&gt;Advice&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Join Lines By A Separator in Emacs</title>
      <link>https://blog.kenhuang.io/blog/2023-06-12-emacs-join-lines/</link>
      <pubDate>Mon, 12 Jun 2023 22:23:12 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2023-06-12-emacs-join-lines/</guid>
      <description>&lt;p&gt;&#xA;So sometimes I need to join a few lines by a separator while I&amp;#39;m coding, for example, turn the below lines,&lt;/p&gt;&#xA;&lt;div class=&#34;src src-text&#34;&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;foo&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;bar&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;baz&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&#xA;into &lt;code class=&#34;verbatim&#34;&gt;foo + bar + baz&lt;/code&gt;. (This is a silly example, I will update if I come up with a better one :-P )&lt;/p&gt;&#xA;&lt;p&gt;&#xA;When I was in a rush in the past, I usually baked a keyboard macro temporarily and then applied it to achieve this goal, thought reliable, it&amp;#39;s a little bit cumbersome to record it. So I wonder maybe it would be a good idea to have a command for it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Hugo Blogging in Emacs</title>
      <link>https://blog.kenhuang.io/blog/2022-10-10-emacs-hugo-blogging/</link>
      <pubDate>Mon, 10 Oct 2022 22:50:48 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2022-10-10-emacs-hugo-blogging/</guid>
      <description>&lt;p&gt;&#xA;When I started to use &lt;a href=&#34;https://gohugo.io/&#34;&gt;Hugo&lt;/a&gt; to write this blog last year, I noticed that there is an &lt;a href=&#34;https://github.com/masasam/emacs-easy-hugo&#34;&gt;easy-hugo&lt;/a&gt; package of Emacs many people use. So I installed it at that time, but I didn&amp;#39;t use many of its features since then. In fact, the only command I used was &lt;code class=&#34;verbatim&#34;&gt;easy-hugo-current-time&lt;/code&gt;. I used it to update the Hugo timestamps manually as in the format of &lt;code class=&#34;verbatim&#34;&gt;2022-10-15T09:45:35+08:00&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;My most desirable feature is to use it to select tags easily when I start to write a new post, but I never got it to work.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Auto-complete Accounts From Other Beancount Files in Emacs</title>
      <link>https://blog.kenhuang.io/blog/2022-09-10-emacs-beancount-account-files/</link>
      <pubDate>Sat, 10 Sep 2022 11:13:38 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2022-09-10-emacs-beancount-account-files/</guid>
      <description>&lt;figure&gt;&#xA;&lt;img src=&#34;https://blog.kenhuang.io/img/2022-09-10-beancount-mode-comple-accounts-from-files.jpg&#34; alt=&#34;Auto-complete accounts from another accounts.bean file&#34; title=&#34;Click to enlarge the image&#34;/&gt;&#xA;&lt;figcaption&gt;&#xA;Auto-complete accounts from another accounts.bean file&#xA;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&#xA;If you&amp;#39;re using Beancount with Emacs, you may be using &lt;a href=&#34;https://github.com/beancount/beancount-mode&#34;&gt;beancount-mode&lt;/a&gt;. It can auto-complete the accounts defined in the current buffer when we are typing in new transactions so that we can do it more efficiently.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;But it can &lt;strong&gt;&lt;strong&gt;only&lt;/strong&gt;&lt;/strong&gt; auto-complete the accounts from the current buffer, which makes it less useful when we have a stand-alone file or a few files of beancount accounts.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Bookmarklet for Copying a Link as an Org-mode Link</title>
      <link>https://blog.kenhuang.io/blog/2022-08-08-org-link-bookmarklet/</link>
      <pubDate>Mon, 08 Aug 2022 23:33:05 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2022-08-08-org-link-bookmarklet/</guid>
      <description>&lt;p&gt;&#xA;In this blog post, I&amp;#39;d like to share a &lt;a href=&#34;https://en.wikipedia.org/wiki/Bookmarklet&#34;&gt;bookmarklet&lt;/a&gt; for copying a web page&amp;#39;s URL as an org-mode link on Firefox, Chrome, or whatever web browsers support bookmarklets.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;It&amp;#39;s handy when the URL isn&amp;#39;t SEO-friendly, which means you can&amp;#39;t tell what its content is about at first glance of the URL. So a little description text on the link would help.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Here is the bookmarklet:&lt;/p&gt;&#xA;&lt;div class=&#34;src src-js&#34;&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;javascript&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;prompt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Copy to clipboard: Ctrl+C, Esc&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;[[&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;href&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;][&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;title&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34; - &amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;]]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// Don&amp;#39;t know why the page becomes blank after using it on Firefox, so use alert instead.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;javascript&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;alert&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;[[&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;href&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;][&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;title&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34; - &amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;]]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&#xA;Add a new bookmark on the browser, give it a name, such as &lt;code&gt;(org-link)&lt;/code&gt;, and then copy and paste the content as URL, just like below on Firefox:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Emacs Debugging Techniques</title>
      <link>https://blog.kenhuang.io/blog/2022-07-17-emacs-elisp-debug/</link>
      <pubDate>Sun, 17 Jul 2022 09:57:31 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2022-07-17-emacs-elisp-debug/</guid>
      <description>&lt;p&gt;&#xA;If you are new to Emacs, you may run into some errors, especially after you copied some elisp snippets from the Internet or elsewhere. Don&amp;#39;t panic! It happens, it&amp;#39;s just part of the learning process. Even an experienced Emacs user could run into there issues from time to time.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&lt;em&gt;BTW, I&amp;#39;m improving my English by watching YouTube videos every single day; If you&amp;#39;re also learning English, or any languages, LanguagePuppy can definitely help you. It&amp;#39;s a Chrome extension I developed using Clojure. Check it out:&lt;/em&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Duplicate the current line in Emacs</title>
      <link>https://blog.kenhuang.io/blog/2022-05-23-emacs-duplicate-line/</link>
      <pubDate>Mon, 23 May 2022 21:29:28 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2022-05-23-emacs-duplicate-line/</guid>
      <description>&lt;figure&gt;&#xA;&lt;img src=&#34;https://blog.kenhuang.io/img/2022-05-23-emacs-duplicate-current-line.jpg&#34; alt=&#34;Duplicate the current in Emacs&#34; title=&#34;Click to enlarge the image&#34;/&gt;&#xA;&lt;figcaption&gt;&#xA;Duplicate the current in Emacs&#xA;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&#xA;Duplicating the current line is frequent editing for me when I am&#xA;coding. Initially, I copied a snippet as a command in Emacs from the&#xA;Internet:&lt;/p&gt;&#xA;&lt;div class=&#34;src src-elisp&#34;&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-elisp&#34; data-lang=&#34;elisp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;w/duplicate-line&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;s&#34;&gt;&amp;#34;Duplicate the current line.&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;interactive&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;move-beginning-of-line&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;kill-line&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;yank&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;open-line&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;next-line&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;yank&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&#xA;Most of the time, I was happy with it, but it has mainly two drawbacks:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It cannot keep the column position when moving to the next line&lt;/li&gt;&#xA;&lt;li&gt;It messes up with the yank ring as it yanks the text under the hood&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;So today, I took some time to fix these two problems, and I also want&#xA;it to be capable of commenting the current line out if I prefix the&#xA;command.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Adjust the laptop&#39;s screen brightness in Emacs</title>
      <link>https://blog.kenhuang.io/blog/2022-05-21-adjust-screen-brightness-emacs/</link>
      <pubDate>Sat, 21 May 2022 11:50:25 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2022-05-21-adjust-screen-brightness-emacs/</guid>
      <description>&lt;figure&gt;&#xA;&lt;img src=&#34;https://blog.kenhuang.io/img/2022-05-21-adjust-screen-brightness-emacs.jpg&#34; alt=&#34;Adjust the screen brightness in Emacs&#34; title=&#34;Click to enlarge the image&#34;/&gt;&#xA;&lt;figcaption&gt;&#xA;Adjust the screen brightness in Emacs&#xA;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&#xA;If you&amp;#39;re using i3wm on Linux, how do you adjust the laptop&amp;#39;s screen&#xA;brightness?&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Most of the time, I use the laptop with an external monitor. But when&#xA;I am out, I have no monitors. And it seems no easy way to adjust the&#xA;brightness in i3wm. Being too bright or dim is terrible for the eyes.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Kill a &#34;Visible&#34; Buffer Quickly in Emacs</title>
      <link>https://blog.kenhuang.io/blog/2022-04-09-emacs-kill-other-buffer/</link>
      <pubDate>Sat, 09 Apr 2022 23:11:36 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2022-04-09-emacs-kill-other-buffer/</guid>
      <description>&lt;figure&gt;&#xA;&lt;img src=&#34;https://blog.kenhuang.io/img/2022-04-09-ace-window-selecting-window.jpg&#34; alt=&#34;Selecting Emacs windows using ace-window&#34; title=&#34;Click to enlarge the image&#34;/&gt;&#xA;&lt;figcaption&gt;&#xA;Selecting Emacs windows using ace-window&#xA;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&#xA;Recently I&amp;#39;ve been building a simple Emacs config for myself, along&#xA;the way I re-discovered some fantastic packages, for example, I found&#xA;that &lt;a href=&#34;https://github.com/abo-abo/ace-window&#34;&gt;ace-window&lt;/a&gt; is a simple yet powerful package to enhance&#xA;the default &lt;code class=&#34;verbatim&#34;&gt;other-window&lt;/code&gt; command to select other windows quickly&#xA;when it has more than two windows in a frame.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;I replaced the key binding of &lt;code class=&#34;verbatim&#34;&gt;other-window&lt;/code&gt; to ace-window by simply&#xA;doing &lt;code&gt;(global-set-key (kbd &amp;#34;C-x o&amp;#34;) #&amp;#39;ace-window)&lt;/code&gt;, then when there are &amp;gt;2&#xA;windows, it will show a white-in-red number at the top-left corner for&#xA;every window, hit the number (1, 2, 3, …) and then Emacs will select the&#xA;corresponding window (as demonstrated in the above screenshot).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Eglot for Better Programming Experience in Emacs</title>
      <link>https://blog.kenhuang.io/blog/2022-01-22-emacs-eglot-lsp/</link>
      <pubDate>Sat, 22 Jan 2022 11:36:18 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2022-01-22-emacs-eglot-lsp/</guid>
      <description>&lt;p&gt;&#xA;&lt;a href=&#34;https://microsoft.github.io/language-server-protocol/&#34;&gt;LSP&lt;/a&gt;, or Language Server Protocol, makes programming easier by introducing features like more precise auto-completion and definition lookup. It may have scratched your itches, and you may wonder what the experience is like in Emacs.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;&lt;em&gt;BTW, I&amp;#39;m improving my English by watching YouTube videos every single day; If you&amp;#39;re also learning English, or any languages, LanguagePuppy can definitely help you. It&amp;#39;s a Chrome extension I developed using Clojure. Check it out:&lt;/em&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Language Shadowing with subed in Emacs</title>
      <link>https://blog.kenhuang.io/blog/2022-01-12-language-shadowing-with-subed-emacs/</link>
      <pubDate>Wed, 12 Jan 2022 21:41:54 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2022-01-12-language-shadowing-with-subed-emacs/</guid>
      <description>&lt;p&gt;&#xA;So I&amp;#39;m trying to improve my English speaking skill by shadowing while watching TV episodes. The workflow before was to loop over video clips using mpv:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;hit &lt;code class=&#34;verbatim&#34;&gt;l&lt;/code&gt; to mark the start of the loop&lt;/li&gt;&#xA;&lt;li&gt;play the video and wait for it to be at the end of the loop&lt;/li&gt;&#xA;&lt;li&gt;hit &lt;code class=&#34;verbatim&#34;&gt;l&lt;/code&gt; again to mark the end&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Then mpv will loop over the clip, it basically works, but it&amp;#39;s a bit hard and tedious to set the start and end precisely.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Writing a Python Script in Emacs in 45 Minutes!</title>
      <link>https://blog.kenhuang.io/blog/2021-12-11-writing-python-in-emacs/</link>
      <pubDate>Sat, 11 Dec 2021 09:24:53 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2021-12-11-writing-python-in-emacs/</guid>
      <description>&lt;p&gt;&#xA;Note: watch my live coding session of this article:&#xA;&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;&#xA;      &lt;iframe allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen&#34; loading=&#34;eager&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; src=&#34;https://www.youtube.com/embed/MXF81Q0a91M?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; title=&#34;YouTube video&#34;&gt;&lt;/iframe&gt;&#xA;    &lt;/div&gt;&#xA;&lt;/p&gt;&#xA;&lt;div id=&#34;outline-container-headline-1&#34; class=&#34;outline-2&#34;&gt;&#xA;&lt;h2 id=&#34;headline-1&#34;&gt;&#xA;Intro&#xA;&lt;/h2&gt;&#xA;&lt;div id=&#34;outline-text-headline-1&#34; class=&#34;outline-text-2&#34;&gt;&#xA;&lt;p&gt;&#xA;If you&amp;#39;ve heard some rumors of Emacs that it has a very steep learning curve (or that Emacs makes a computer slow), you may be too scared to look at it. It indeed has some learning curve (learning anything does have one), but it isn&amp;#39;t very steep. I learned this after getting my hands dirty with Emacs a few years ago.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Send Notifications from Emacs with i3wm and Dunst</title>
      <link>https://blog.kenhuang.io/blog/2021-07-17-emacs-i3wm-dunst/</link>
      <pubDate>Sat, 17 Jul 2021 12:22:10 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2021-07-17-emacs-i3wm-dunst/</guid>
      <description>&lt;p&gt;&#xA;I barely use notifications, but recently I think it&amp;#39;s a valuable way to remind me things like helping me nurture habits, or to notify me of emergencies like a critically low laptop battery.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;So I try to integrate notifications to org-mode and Emacs today.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;The &lt;code class=&#34;verbatim&#34;&gt;org-notify&lt;/code&gt; package from &lt;code class=&#34;verbatim&#34;&gt;org-contrib&lt;/code&gt; (install it by &lt;code class=&#34;verbatim&#34;&gt;(package-install &amp;#39;org-contrib)&lt;/code&gt; ) could do this job easily before, so I first test it in the minibuffer with &lt;code class=&#34;verbatim&#34;&gt;(org-notify &amp;#34;test&amp;#34;)&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Unfortunately, it errors out:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Generate Call Graphs Using Doxygen in Emacs</title>
      <link>https://blog.kenhuang.io/blog/2020-08-22-generate-call-graphs-using-doxygen-in-emacs/</link>
      <pubDate>Sat, 22 Aug 2020 18:57:00 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2020-08-22-generate-call-graphs-using-doxygen-in-emacs/</guid>
      <description>&lt;p&gt;&#xA;&lt;a href=&#34;https://www.doxygen.nl/&#34;&gt;Doxygen&lt;/a&gt; is a nice tool for generating documentations for well-annotated C/C++ projects, the one feature that I like most is generating call graphs and class diagrams, so that I can learn a project quickly by browsing the diagrams from a higher point of view.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;I take the following steps to generate call graphs for a project on terminals on Linux:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code class=&#34;verbatim&#34;&gt;cd /path/to/a/project/&lt;/code&gt;, and generate a template config file by &lt;code class=&#34;verbatim&#34;&gt;doxygen -s -g doxygen.conf&lt;/code&gt; (Omit &lt;code class=&#34;verbatim&#34;&gt;-s&lt;/code&gt; to generate it with detailed comments).&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Tweak the file by specifying input and output directories, and set &lt;code class=&#34;verbatim&#34;&gt;HAVE_DOT&lt;/code&gt; and &lt;code&gt;CALL_GRAPH&lt;/code&gt; to &lt;code class=&#34;verbatim&#34;&gt;YES&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Trick to Troubleshoot Emacs Subprocess Creating</title>
      <link>https://blog.kenhuang.io/blog/2020-05-30-a-trick-to-troubleshoot-emacs-subprocess-creating/</link>
      <pubDate>Sat, 30 May 2020 11:52:00 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2020-05-30-a-trick-to-troubleshoot-emacs-subprocess-creating/</guid>
      <description>&lt;p&gt;&#xA;There are many packages of Emacs that leverage subprocesses to do their jobs, &lt;a href=&#34;https://magit.vc/&#34;&gt;Magit&lt;/a&gt;, &lt;a href=&#34;https://github.com/joaotavora/eglot&#34;&gt;eglot&lt;/a&gt;, &lt;a href=&#34;https://github.com/jorgenschaefer/elpy&#34;&gt;elpy&lt;/a&gt;, to name a few. And there are times that a subprocess doesn&amp;#39;t work as expected, for example, Magit is slow, and you&amp;#39;re sure that it&amp;#39;s ok when running git commands on shell. So how to spot these problems effectively and quickly?&lt;/p&gt;&#xA;&lt;p&gt;&#xA;The problem is that we don&amp;#39;t know what&amp;#39;s going on exactly, so here I want to share a few Elisp advices to make the subprocess creating visible, and print the exact program and its arguments to the &lt;code class=&#34;verbatim&#34;&gt;*Message*&lt;/code&gt; buffer. Visibility is the key.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ppcompile: An Emacs Package to Help Coding Locally</title>
      <link>https://blog.kenhuang.io/blog/2020-03-07-ppcompile-to-help-stay-coding-locally/</link>
      <pubDate>Sat, 07 Mar 2020 23:50:00 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2020-03-07-ppcompile-to-help-stay-coding-locally/</guid>
      <description>&lt;p&gt;&#xA;If you are a C/C++ programmer like me, you may experience jumping around different machines to write and compile your code, or you may write code on different machines for different projects, and scp/rsync/ftp the projects around. It works, but it&amp;#39;s a bit tedious and takes too much burden on our brains.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;For example, say I have two projects that should be compiled on their compiling machines respectively. There are two obvious workflows for writing code for them &amp;#34;simultaneously&amp;#34;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How To Revert a Series of Git Commits?</title>
      <link>https://blog.kenhuang.io/blog/2019-09-24-how-to-revert-a-series-of-commits-with-git/</link>
      <pubDate>Tue, 24 Sep 2019 23:14:00 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2019-09-24-how-to-revert-a-series-of-commits-with-git/</guid>
      <description>&lt;p&gt;&#xA;Sometimes, I need to revert a series of commits that I&amp;#39;ve already pushed, doing a git hard &lt;a href=&#34;https://git-scm.com/docs/git-reset&#34;&gt;reset&lt;/a&gt; (&lt;code class=&#34;verbatim&#34;&gt;git reset --hard&lt;/code&gt;) is not an option, as someone may already have new commits based on mine.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;For example, assume that I&amp;#39;ve made a few commits like below:&lt;/p&gt;&#xA;&lt;pre class=&#34;example&#34;&gt;&#xA;65a2c62 * commit 10&#xA;25cad43 * commit 9&#xA;72ad583 * commit 8&#xA;ceebf9a * commit 7&#xA;acf8a11 * commit 6&#xA;28d526f * commit 5&#xA;63af1e2 * commit 4&#xA;982c71c * commit 3&#xA;0fb4c2d * commit 2&#xA;acf9da1 * commit 1&#xA;b5f9933 * commit 0&#xA;&lt;/pre&gt;&#xA;&lt;p&gt;&#xA;For whatever reason, I need to &amp;#34;drop&amp;#34; the changes made by commit 6 to commit 10, that is, go back to &amp;#34;commit 5&amp;#34; without deleting these commits.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Generating org-mode Outlines for wikiHow Articles</title>
      <link>https://blog.kenhuang.io/blog/2019-07-20-generating-org-mode-outlines-for-wikihow-articles/</link>
      <pubDate>Sat, 20 Jul 2019 20:04:00 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2019-07-20-generating-org-mode-outlines-for-wikihow-articles/</guid>
      <description>&lt;p&gt;&#xA;Recently I found some great articles on &lt;a href=&#34;https://www.wikihow.com&#34;&gt;wikiHow&lt;/a&gt;, then I want to keep notes of them in &lt;a href=&#34;https://orgmode.org/&#34;&gt;org-mode&lt;/a&gt; files.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;At first, I manually copied the ToC of articles, but soon I found it&amp;#39;s tedious and takes a lot of time.&#xA;Today I wrote a &lt;a href=&#34;https://requests.readthedocs.io/&#34;&gt;requests&lt;/a&gt;-based Python script to help me extract the ToCs (Table of Content) into org-mode outlines. It takes two arguments, the first one is the URL, the second one is the containing heading&amp;#39;s level for the generated ToC in org-mode.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Understanding align-regexp of Emacs</title>
      <link>https://blog.kenhuang.io/blog/2019-07-20-understanding-align-regexp-of-emacs/</link>
      <pubDate>Sat, 20 Jul 2019 13:50:00 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2019-07-20-understanding-align-regexp-of-emacs/</guid>
      <description>&lt;p&gt;&#xA;&lt;a href=&#34;https://www.gnu.org/software/emacs/&#34;&gt;Emacs&lt;/a&gt;&amp;#39; &lt;code class=&#34;verbatim&#34;&gt;M-x align-regex&lt;/code&gt; is neat when I want to align some similar text, especially when we&amp;#39;re coding.&#xA;I use its trivial version(without prefix arg) regularly on day-to-day programming work before.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;For example, I can use it to align below code quickly by:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Choose the region&lt;/li&gt;&#xA;&lt;li&gt;&lt;code class=&#34;verbatim&#34;&gt;M-x align-regexp&lt;/code&gt; and type &lt;code&gt;=&lt;/code&gt; and &lt;code class=&#34;verbatim&#34;&gt;Enter&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;src src-python&#34;&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;aaaaaaaaaaaaaa&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;bbb&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;cccccccc&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&#xA;It will be aligned to below code, now it&amp;#39;s better to read:&lt;/p&gt;&#xA;&lt;div class=&#34;src src-python&#34;&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;aaaaaaaaaaaaaa&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;bbb&lt;/span&gt;            &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;cccccccc&lt;/span&gt;       &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&#xA;A few days ago, I found myself don&amp;#39;t understand how it works when I read the code of &lt;a href=&#34;https://github.com/manateelazycat/smart-align&#34;&gt;smart-align&lt;/a&gt;, A simple &lt;code class=&#34;verbatim&#34;&gt;align-regexp&lt;/code&gt; wrapper for easier usage.&#xA;I was confused by the parameters, especially &lt;code class=&#34;verbatim&#34;&gt;REGEXP&lt;/code&gt; and &lt;code class=&#34;verbatim&#34;&gt;GROUP&lt;/code&gt;, and &lt;code class=&#34;verbatim&#34;&gt;SPACING&lt;/code&gt;, here is its signature:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fine-tune Curly Braces Style of Yasnippet Snippet on the Fly</title>
      <link>https://blog.kenhuang.io/blog/2019-02-24-fine-tune-style-of-yasnippet-snippet-on-the-fly/</link>
      <pubDate>Sun, 24 Feb 2019 16:48:00 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2019-02-24-fine-tune-style-of-yasnippet-snippet-on-the-fly/</guid>
      <description>&lt;p&gt;&#xA;&lt;a href=&#34;https://github.com/joaotavora/yasnippet&#34;&gt;Yasnippet&lt;/a&gt; is a good friend to help us type less and write more, whenever we write some text snippets repeatedly. And there is also an official repository called &lt;a href=&#34;https://github.com/AndreaCrotti/yasnippet-snippets&#34;&gt;yasnippet-snippets&lt;/a&gt; that contains various snippets for many programming languages (modes), so that we can have many snippets in no time by installing it.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;But there is a little problem when it comes to conforming to different coding styles.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Take the &lt;code class=&#34;verbatim&#34;&gt;if&lt;/code&gt; snippet for example, normally it will generate code like this:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
