Hung-Yi’s Journal

Front-end Developer, Emacs Adventurer, Home Cook

24 Feb 2021

The Programmer's Way to Write in Title Case Using Emacs Lisp

It turns out that writing in proper title case can be important for a front-end developer, since there are often things on screen that need to appear as a title to convey importance: dialog headers, menu items, buttons labels, to name a few.

The problem is I had always dismissed it as something for school, academics or "real" writers, so I never bothered to learn the rules properly. This meant many distracting trips to https://titlecase.com/. Realising this, I used Emacs to make a quick way to convert something to title case without relying on my brain. This post is my journey on how I wrote that thing.

25 Jan 2021

Authentication Issues with MSAL.NET on WSL2

I've found that Microsoft's Azure AD MSAL Extensions for .NET don't seem to work very well under WSL2. In particular, there is this this issue that's reportedly been fixed as of November 2020 but, even with Azure.Identity v1.3.0, it remains a problem for me. The error can look something like value cannot be null: attributeValue1 or Unable to load shared library 'libsecret-1.so.0'.

13 Oct 2020

Use Emacs-Tree-Sitter for Highlighting in Doom Emacs

Tree-sitter is a general programming language parser that efficiently builds and updates Abstract Syntax Trees (AST) for your code. Basically, it can read programming languages and understand the structure and meaning of code without having to execute it. Among many amazing things, one of its best and simplest features to take advantage of is richer syntax highlighting, which is what I use it for in Emacs. Today I'll show you how to set up emacs-tree-sitter in Doom Emacs1 so you can quickly get prettier code with next to no effort.

11 Oct 2020

A Function to Get Org-Mode Contents Under a Heading

Today I'm sharing an interactive function I wrote as an exercise to extract just the inner text content of an Org-mode subtree, excluding the heading itself and any subheadings or their contents. The function adds it to the kill-ring (a.k.a. copies it to the clipboard) and returns it, but can easily be modified to do anything to the contents.

06 Oct 2020

Tearing Off Windows in Emacs

Do you often yourself referring to something in Emacs over and over again, but actually doing work somewhere else? For instance: referring to API code while writing front-end code, or referring to a file while entering commands into a shell? Let's go through the ways I would normally handle this and why I think the tear-off-window command can help.