• Emacs Natural Title Bar With No Text in MacOS

    To make emacs more modern looking in v26, you can enable a “natural title bar” (the color of title bar matches the color of the buffer).

    Compile emacs with the right flags (using railwaycat/homebrew-emacsmacport):

    brew install emacs-mac --with-natural-title-bar
    

    Add the settings to your init.el:

    (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
    (add-to-list 'default-frame-alist '(ns-appearance . dark))
    (setq ns-use-proxy-icon nil)
    (setq frame-title-format nil)
    

    Hide the document icon:

    defaults write org.gnu.Emacs HideDocumentIcon YES
    

    Restart and enjoy a modern looking emacs.


  • The Man in the Arena

    A speech by Theodore Roosevelt in Paris 1910 that railed against cynics who looked down on those attempting to do great things.

    “It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming; but who does actually strive to do the deeds; who knows great enthusiasms, the great devotions; who spends himself in a worthy cause; who at the best knows in the end the triumph of high achievement, and who at the worst, if he fails, at least fails while daring greatly, so that his place shall never be with those cold and timid souls who neither know victory nor defeat.”

    See also:


  • Breaking the Bonds on Me Is Going to Liberate Everyone Else

    A distinctly American idea is that liberating oneself will result in the liberation of everyone else. This helps explain teenage rebellion (the whole system is broken so I’ll be a nonconformist and everyone else will follow), but also the behavior of anti-maskers (I value my freedom to decide what’s best so I’ll be loud about not wearing a mask and show everyone). While outwardly projecting a message that this is good for everyone, it’s deeply rooted in selfishness.

    From personal experience, this explains reactions my mom (born and raised in Korea) had to some of my more rebellious friends—“they’re spoiled.”

    See also:


  • Using a Language Server in a Docker Container

    Projects that use docker for local development run into a problem when trying to use language servers with their text editor—they don’t handle multiple environments.

    There are a few ways around it, but they all have trade-offs.

    Running a remote language server

    You can connect to a remote language server (it is a server after all) by wrapping the command in a script and configuring your text editor to use it.

    For example (assuming you have docker container with pyls):

    #!/bin/bash
    
    # Runs a python-language-server in a running container for use with
    # eglot in emacs.
    
    docker compose -f /path/to/my/docker-compose.yml \
                   exec \
                   -T \
                   myservice pyls
    
    

    Everything works with the exception of jump-to-definition (at least when using Emacs eglot). That’s because the file path returned by the language server is the file path in the container, not your host machine.

    In Emacs, you can hack around this in eglot (albeit in an inelegant way) by redefining xref-make-file-location like so:

    ;; HACK: If the xref file doesn't exist, it probably came from a
    ;; remote LSP server using eglot. Try mapping it to the local
    ;; file system. Maybe someday it will be supported in eglot.
    ;; See: https://github.com/joaotavora/eglot/issues/350
    (eval-after-load "xref"
      '(defun xref-make-file-location (file line column)
         (if (not (file-exists-p file))
             (make-instance 'xref-file-location :file (format "~/your/host/file/path" file) :line line :column column)
           (make-instance 'xref-file-location :file file :line line :column column))))
    

    Edit files in the remote language server container

    To get around the compatibility issues that comes from running in two different environments (the host machine and the container), you can edit the files remotely in the container that is running the language server (in Emacs you can use docker-tramp). This keeps the environment consistent, but it’s a bit clunky when you need to remember where the files are and flipping back and forth (e.g. when doing a `git commit` from the host machine).


  • A List of Tasks Describes Multi-Party Processes Poorly

    A list of tasks to complete does not contain sufficient information to describe a multi-party process. For example, if you were to describe ‘pick up the milk’ to an extraterrestrial you might say 1) go to the store 2) buy milk 3) check out 4) go home. However, this hides the complexity of interactions.

    Sticking with the example, what actually happens is that you get into the car and turn the ignition. The car turns on or not. If it doesn’t turn on then you are blocked (a terminal state). If the car turns on you drive to the store (ignoring the interactions between cars, traffic lights, etc. for brevity). Once at the store you find the milk and go to the cashier. You hand the item to them. They place it in a bag. They tell you how much to pay. You pay them. They accept the payment, they give you a receipt. You take the bag. You go to your car (repeating the process earlier) and go home.

    If you were new to buying milk from the store, the checklist from the first paragraph would not help you because it hides complexity by making it seem like a single-party sequence rather than a complex set of interactions between multiple parties. It lacks context and therefore would not be repeatable.

    See also: