Marcin Borkowski: Homepage

https://mbork.pl/Homepage

35 posts

Tech 97% · Culture 3%

Subscribe via RSS

  1. Using timers to perform weekly tasks

    There are some things I do on a regular basis, and of course I try to automate as much as possible so that I don’t need to remember them. One of these things is a weekly review. A part of my weekly review is checking how much time I’d spent on various things during the past week.

    0 ▲
  2. Repeating commands

    Emacs is well-known for its arcane keybindings, often involving three or more keypresses. For example, C-x z is bound to the repeat command which – well – repeats the last command. However, there is another feature of Emacs which uses the word “repeat” and is very useful.

    0 ▲
  3. Emacs Lock mode

    Today I only have a short tip. Sometimes you may have an important Emacs buffer you don’t want to kill accidentally. (For example, it might be an Eshell buffer with a long-running process, or a scratch buffer not associated with any file where you have some notes – although that is obviously asking for trouble.)

    0 ▲
  4. How many screens left

    One of the things I do in Emacs is reading. Sometimes it is an article copied from the internet using org-web-tools, sometimes it is a long answer to my question to an LLM, and sometimes it is an ebook I’m reading using nov.el. Either way, I often like to know how much I have left.

    0 ▲
  5. forward-paragraph in Magit

    As I’ve mentioned many times, I am a heavy Magit user. Pretty often I do code reviews from within Magit. There was one thing that has bothered me for a long time.

    0 ▲
  6. Duplicating lines and other Emacs miscellanea

    A few weeks ago I wrote about how I remapped yank to my command which allows to transform the yanked text. The whole setup – where I press C-y twice to trigger the transformation transient – has one drawback: I sometimes legitimately want to call yank twice in a row. This happens when I need to copy the current line and modify the copy so that I have two similar lines in a row. (I often need this when editing Ledger transactions, for example.) What I sometimes do in such a situation is…

    0 ▲
  7. Comments on Emphasizing a region in Org mode

    Another solution is using external package surround (https://github.com/mkleehammer/surround), an Emacs package for inserting, changing, and deleting . . .

    0 ▲
  8. Pasting primary selection from keyboard

    A few years ago I wrote about a setup I coded for myself for when I want to make paying my bills a tiny bit less painful. One thing I mentioned then was the primary selection. For those of you who don’t know it: under X.org, you can select a portion of text (for example by dragging the mouse over it) and then paste it in the same or another application with clicking the middle button. It is extremely useful for quick copy-and-paste operations where you do not have to issue a separate “copy”…

    0 ▲
  9. Developing Claude Code skills

    As I’ve mentioned some time ago, I’ve been using Claude Code for some time now. Now, a disclaimer is in place. I’m still a bit skeptical about the current “AI” hype – in particular, I really avoid using the term “AI”. I consider it a very misleading marketing gimmick. When non-technical people hear the phrase “artificial intelligence”, a computational model capable of generating more or less random sequence of letters which sometimes create a semblance of “understanding” or “intelligence” is…

    0 ▲
  10. Transforming yanked text

    Recently I found myself killing and yanking more often than ever. One problem with that is that the capitalization and punctuation of what I have yanked is often wrong. As a (pretty stupid) example, I might see the sentence “This is bad.”, and I might want to write another one: “He thinks that this is bad, and he’s right.” If I use kill-sentence (M-k) or backward-kill-sentence (C-x DEL), I have the whole This is bad. in the kill ring, but what I need to yank is this is bad (with lower-case “t”…

    0 ▲
  11. A text expander for Android

    Like many Emacs users, I’m a heavy Org mode user. Some time ago I decided that I need a way to access at least some of my Org files on my (Android) phone.

    0 ▲
  12. Emphasizing a region in Org mode

    One of the most basic features of Org mode is its markup. It is basically the Markdown of the Emacs world (although some people, like Karl Voit, claim that it’s superior to Markdown), and it lets do basic things like italic, bold or verbatim very easily – at least if you’re writing text. I, on the other hand, happen to edit text pretty often. This is very different from writing. When I write, typing a slash before and after something I want to emphasize is easy. When I edit and just want to…

    0 ▲
  13. A fancier splash screen in terminal Emacs

    I’ve been using Emacs in a terminal for some time now (an experience worth a blog post another day). One thing that bothered me a little was that the “splash screen” (what Emacs displays at the start) does not show the familiar Emacs logo. I decided to fix this.

    0 ▲
  14. Outlining in programs

    One of the Emacs’ “killer apps” is Org mode, and one of the most iconic features of Org mode is visibility cycling. It is no wonder people (including me) want a similar feature in other modes.

    0 ▲
  15. Hideshow mode

    Recently I discovered a very cool feature of Emacs. Apparently, it’s been present in Emacs for over 30 years, although the Git log shows that it’s been heavily worked on very recently. Meet Hideshow mode. It’s purpose is simple: it allows to, well, hide or show blocks of code.

    0 ▲
  16. Fast spell-checking in Emacs with Jinx

    Emacs has had a spell-checker for a very long time. In fact, I’ve been using ispell-word for at least several years now, as I have mentioned for example here. However, I’ve only used Flyspell mode once, over two decades ago, when I tried it out on a machine with maybe 8MB RAM and a Pentium-class processor clocked at about 100MHz and decided that it’s too slow to be really useful. Well, things have changed a bit since then, haven’t they?

    0 ▲
  17. Bank statement analyzer

    Some time ago, a friend of mine asked if I know an app which could allow him to analyze his spending based on bank statements. I did a quick research and I found a few tools like this, but nothing looked good enough for me to safely recommend it to him. Fortunately for him, he asked me that question in the exact moment in my life when (a) I had a lot of free time and (b) I wanted to spend it learning some potentially useful new skills. It didn’t take me long to decide to code such a tool myself.

    0 ▲
  18. opening pdfs in pdf-tools

    As I wrote many times, I use pdf-tools as main pdf viewer. I thought that one thing that would be nice is being able to open pdfs in it from outside Emacs. For example, texdoc could use it instead of Evince (which is pretty nice, but it’s not Emacs!).

    0 ▲
  19. Disabling minor modes with local variables

    I’ve known about file local variables for a long time. I also knew about the eval keyword, which can be used as a file variable, but instead of binding the given value to the (non-existent) variable eval, Emacs evaluates it. This is often useful, but the usefulness is diminished by the fact that Emacs nags the user whether it is safe to evaluate a form provided that way. (Of course, it is reasonable security-wise, and that’s why I didn’t set enable-local-variables to :all – I still prefer the…

    0 ▲
  20. Comments on Scrolling pdfs in other windows

    This is a common-enough need that the Emacs developers have you covered -- you don't need advice for this. From the release notes for Emacs 29: . . .

    0 ▲
  21. Scrolling pdfs in other windows

    I have written about pdf-tools quite a few times – it’s a fantastic Emacs package for viewing and annotating pdfs without leaving the comfort of Emacs. It is not ideal, though – or at least, not ideal for me. One feature of Emacs I often use is the scroll-other-window command (bound to C-M-v), and its sibling scroll-other-window-down (C-M-S-v). They are extremely useful for example when reading documentation or watching live Markdown preview, and I wish they worked with the TeX and pdf-tools…

    0 ▲
  22. Copying images in Emacs

    A few weeks ago I was on vacation. Of course I brought back quite a few pictures with me. When I got back, I sat to select some of them to make a gallery for my family and friends. I started with copying all pictures from two mobile phones and a camera to my laptop. Then I wanted to copy a few carefully chosen images to one directory. To my surprise, Emacs’ Image mode does not have a command to copy the currently viewed image to another directory.

    0 ▲
  23. My impressions with agentic coding

    For the past several months I’ve been experimenting with so-called “agentic coding”, that is, using LLMs to write software. I have to say that I’m quite impressed by the possibilities this opens – and at the same time, pretty annoyed by the limitations…

    0 ▲
  24. Ignoring pdfs when auto-reverting files

    I quite like the global Auto Revert mode. It is especially useful when I something else than Emacs sometimes changes my files. (I bet some readers immediately thought about the now-fashionable agentic coding, but plain old git switch is enough!) It has one drawback, however. I hardly ever use TeX nowadays, but when I do, I use pdf-tools. Auto Revert mode doesn’t play nice with pdfs open in Emacs, often trying to revert them before TeX finishes writing to them, which results in ugly flickering.

    0 ▲
  25. Comments on Marking today’s files in Dired

    The `dired-mark-if' `macro` also marks special lines (such as those specifying a directory path), so let's exclude such lines: (dired-mark-if (let . . .

    0 ▲
  26. Marking today’s files in Dired

    As anyone reading my blog knows, I’m a big fan of Dired. One of its killer features is the set of marking commands, which allow marking files based on their extensions, names (regex-based), contents (also regex-based). There is also a “universal marking command”, dired-mark-sexp, which allows the user to provide an Elisp expression serving as a predicate and marks all files satisfying that predicate. What’s even more, you can use several symbols in that predicate, like size or name (head to the…

    0 ▲
  27. describe-personal-keybindings

    Some time ago one Emacs user made themselves a local web app showing various Emacs keybindings – basically, a web-based Emacs cheatsheet. It’s definitely a nice project even if not for me – if I were to create something like that, it would run in Emacs and not in the browser, it would definitely mention transpose-.* commands, and it would never be dark-mode-only;-). But it’s a really cool and nice project nevertheless! That’s not the topic of this post, however. In a Reddit discussion about…

    0 ▲
  28. Node.js reporting

    Some time ago I wrote about a new-ish feature of Node where it parses .env files (dotenv-style) itself. Today, I’m going to mention a feature which has been in Node for some quite time, but somehow I’m not sure many people know about it.

    0 ▲
  29. How I use my numeric keypad with Emacs Ledger mode

    As the readers of my blog know, I’m a heavy Ledger user. One thing that annoyed me was the fact that I couldn’t use my numeric keypad to enter amounts. The reason was simple – the “comma” key on that keypad inserted a comma in Emacs and not a period.

    0 ▲
  30. How to quickly generate the list of all columns in a PostgreSQL table

    It is well-known that select * is an antipattern (except maybe in an SQL REPL). What to do, however, if you have a select * in your codebase and you want to change it to a proper list of column names?

    0 ▲