Recent Changes

Updates since 2022-05-16 10:50 UTC

1 | 3 | 7 | 30 | 90 days
List latest change per page only Include minor changes
List later changes RSS RSS with pages RSS with pages and diff

2024-03-18

  • 16:52 UTC (new) 2024-03-18 Follow mode . . . . mbork It is a fairly common opinion that a function should not be larger than your screen. The reality, though, is often different. And even if your functions are shorter, you may want to see more than one at a time. The problem is that our screen are usually not that high. (My laptop gives me 66 lines of text with normal font settings.) You can have an external monitor rotated vertically (I have that at work to see as much of the logs of the application I’m working on as possible), but Emacs gives us another solution – the Follow mode.
  • 16:51 UTC (new) 2024-03-16 Follow mode . . . . mbork Deleted 2024-03-16_Follow_mode
  • 16:43 UTC (new) 2024-03-16 Follow mode . . . . mbork It is a fairly common opinion that a function should not be larger than your screen. The reality, though, is often different. And even if your functions are shorter, you may want to see more than one at a time. The problem is that our screen are usually not that high. (My laptop gives me 66 lines of text with normal font settings.) You can have an external monitor rotated vertically (I have that at work to see as much of the logs of the application I’m working on), but Emacs gives us another solution – the Follow mode.

2024-03-11

  • 05:35 UTC (new) 2024-03-11 More psql tricks . . . . mbork As I mentioned many times, I am a PostgreSQL fan. I wrote several times about psql, the default PostgreSQL terminal client. A few days ago I gave a short talk in my company about the virtues of psql, and in preparation for that I looked at its manual (again). As is often the case, I discovered a few hidden gems I didn’t know about.

2024-03-02

  • 05:09 UTC (new) 2024-03-02 Some tips about Emacs keyboard macros . . . . mbork Some time ago I had to create some rather repetitive code. These days I often use multiple cursors for such things, but for some reasons this time I decided to go the traditional route and use the built-in keyboard macros. Here’s the catch, though. When you want to use keyboard macros and insert an (incremented) number for every occurrence, you can type f3 (kmacro-start-macro-or-insert-counter) while recording the macro. What I needed, though, was to insert that number twice for every execution of the macro.

2024-02-28

2024-02-27

2024-02-26

  • 17:48 UTC (new) 2024-02-26 A simple trick with URL parsing in plain text emails . . . . mbork Today I only have a very short tip I thought up a few days ago. If you sometimes send URL via emails (like me), and you absolutely hate HTML emails (like me), there is a common and annoying problem. If the URL you send is the last thing in a sentence, and you want to be correct and end that sentence with a period (or other punctuation), a lot of email clients will treat that punctuation as part of the URL, and of course such “modified” URL won’t work for the recipient. I usually solved that by putting a space between the URL and the period – not 100% correct, but I could live with that. A few days ago it occurred to me that there is another, slightly hackish way to solve my issue. From now on I’m using a hash instead of a space. Assuming that the website I link to doesn’t have any element with the id~ of a period (or any other weird thing like an exclamation mark, of a period followed by a closing parenthesis etc.), the punctuation will be ignored by the browser, but I won’t need to put any space before the end-sentence period. You’re welcome!

2024-02-17

  • 16:30 UTC (new) 2024-02-17 Opening external drives in Dired . . . . mbork I use external drives pretty often – for backups, for moving files between machines, and for storing mp4 files, for example. I’ve been using UDisks for quite some time now. It automounts an external drive under the /run/media/$USER/VolumeName directory (where VolumeName is different for each drive, of course). I also use Dired as my main file manager. As most Emacsers know, it’s far from shiny, but it’s incredibly powerful, especially combined with some other Emacs features. One problem I have is that when I insert a drive into one of the USB ports, I’d like to be able to open it in Dired.
  • 16:29 UTC (diff) Comments on 2024-02-12 Finding Bible quotes . . . . mbork Ha, that's *very* interesting, thanks! I'm wondering if it's documented anywhere...

2024-02-12

  • 10:16 UTC (new) Comments on 2024-02-12 Finding Bible quotes . . . . jeski I played a bit with the Millenium Bible site and it seems that you are able to achieve something similar using their otworz.php API: . . .
  • 05:39 UTC (new) 2024-02-12 Finding Bible quotes . . . . mbork I often have the need to find some particular quote of the Bible – either I am reading some religious text or I want to link to some passage on my blog. What I miss is the ability to quickly see the relevant passage, open it in a browser and create an Org mode link to it.

2024-02-05

  • 05:45 UTC (new) 2023-02-05 From the kill ring to a register revisited . . . . mbork Two weeks ago I wrote about my little command to move the topmost (or some other) kill ring entry to a register. It turned out that this particular post – which I thought was rather niche – spurred more interest than apparently more useful posts I have. Go figure.

2024-01-26

2024-01-22

  • 04:18 UTC (new) 2024-01-22 From the kill ring to a register . . . . mbork I am probably one of the five or six people on this planet who use Emacs registers. I mostly use them for text insertion (especially when I need to insert some boilerplate – and especially more than one piece of it – several times, but it’s not general enough to be put into Yasnippet), but I sometimes store window configurations in them, and I might have used them for other purposes once or twice. Sometimes, though, I kill some text to yank it elsewhere and only then realize that I’ll need to kill/yank some other fragments, too. Using the kill ring to do this one time is fine (with M-y or with browse-kill-ring); using it more times is rather inconvenient. Hence I decided to write a little command to copy the text from the kill ring to a specified register. And here it is.

2024-01-08

2023-12-25

  • 21:26 UTC (new) 2023-12-25 Merry Christmas 2023 . . . . mbork As usual at this time of year, let me wish all of you Merry Christmas! And also as usual, I promise to say a decade of the Holy Rosary for everyone reading my blog.

2023-12-11

  • 17:05 UTC (new) 2023-12-11 Replacing TeX control words behind the point . . . . mbork Two weeks ago, a friend from Polish TeX Users’ Group mailing list asked about an Emacs tool to replace control sequences with their Unicode counterparts. I also have this need from time to time, and I usually go with the TeX input method. He is not satisfied with it, though, because it replaces too much for him – for instance, he doesn’t want a_1 to get translated to a₁. He remembered some utility (written by another Polish TeX user) which replaces a TeX sequence with a Unicode equivalent, but only on demand. Since that one seems to be lost in the depths of time, he was left without a solution.

2023-11-27

  • 08:33 UTC (new) 2023-11-27 Clocking in to parent entries . . . . mbork Like many, many Emacs users these days, I’m a heavy user of Org mode. In fact, both of my blogs are written in Org. And while this very blog usually has fairly short entries, my other blog has much longer posts, divided into subsections. This creates a minor problem for me. I track time I spend on writing, but I don’t want to track time spent on individual sections of a blog post. In other words, even if I am in some lower-level heading, when I clock in, I want Org to clock in in the parent heading. Emacs being Emacs, I figured there must be a way to make that happen automatically.

2023-11-13

  • 06:24 UTC (new) 2023-11-13 Coloring CamelCase . . . . mbork Some time ago one of the members of the Emacs mailing list asked about coloring CamelCase identifiers. His idea is to define two faces and have all “even” words in a camel case indentifier colored with one of them, and the “odd” words colored with the other one. The question suggests using some code from Glasses mode, which is a lesser-known Emacs feature which inserts undescores between words in camel case identifiers (and it does it using overlays, so the underscores are not really part of the buffer, they just look like this). My general rule is to avoid camel case whenever I can, but I sometimes use Glasses mode, especially when I have to deal with jsx files, where camel case is the standard. It turns out that Glasses mode already has (almost) what is asked for.

2023-10-30

  • 18:52 UTC (new) 2023-10-30 My plans for 2023 - October update . . . . mbork It’s been another two months since my last update, so here we are again! It’s been a busy two months for me, though some plans still are not brought to the forefront (which is a shame, I know, but I can’t do everything).

2023-10-14

  • 05:04 UTC (new) TODO 2023-10-14 Avoiding repetitions . . . . mbork Deleted TODO_2023-10-14_Avoiding_repetitions
  • 05:03 UTC (new) 2023-10-14 Avoiding repetitions . . . . mbork I write a lot of prose. That does not mean I’m good at it nor very creative – I haven’t written any novels or even short stories. By “prose” I mean writing in a natural language (mostly English nowadays). In fact, most of the writing I’ve done in my life is technical in nature (usually either about technology or about mathematics). And (as you obviously know) I’m also a technology geek and an Emacs user. An immediate thought is: how to make Emacs help me write better?
  • 05:02 UTC (new) TODO 2023-10-14 Avoiding repetitions . . . . mbork I write a lot of prose. That does not mean I’m good at it nor very creative – I haven’t written any novels or even short stories. By “prose” I mean writing in a natural language (mostly English nowadays). In fact, most of the writing I’ve done in my life is technical in nature (usually either about technology or about mathematics). And (as you obviously know) I’m also a technology geek and an Emacs user. An immediate thought is: how to make Emacs help me write better?

2023-09-30

  • 19:17 UTC (new) 2023-09-30 Confirming potentially dangerous actions . . . . mbork A common situation is when I want to do something on my computer with possibly destructive consequences, like deleting a file, truncating a database table etc. One common approach to making sure this won’t happen accidentally is to require the user to press y or even type yes (this is what Emacs does with its y-or-n-p and yes-or-no-p functions). Some time ago I had a similar need in a shell script. I was afraid, however, that even requiring the user to type yes is not enough – it is easy to condition oneself to type a three-letter word without much thinking, after all.

2023-09-18

  • 18:41 UTC (new) 2023-09-18 Making Anki flashcards from subtitles . . . . mbork Those of you who follow my blog know that one of my hobbies is translating subtitles. The main reason I do this is to watch stuff with my daughter, who doesn’t yet speak English fluently. Some time ago it dawned on me that I can use my translations twice. Not only can I watch films and tv series with her, but I can use them to help her learn English.

2023-09-02

  • 11:52 UTC (new) 2023-09-02 Irregular recurring TODOs in Org mode, part I . . . . mbork Some time ago I mentioned a very peculiar type of TODOs I’d like to implement. These are things I’d like to do from time to time, but not necessarily on a regular basis. A canonical example is an inspirational blog post I’d like to reread once in a while. I admit that this idea is inspired by spaced repetition, where things I want to remember are presented to me repeatedly, but with increasing intervals. Here, however, the situation is a bit different.

2023-08-21

  • 17:47 UTC (new) 2023-08-21 My plans for 2023 - August update . . . . mbork Since about two months have passed since the last blog post with my 2023 plans update, it’s time for another one. This time it is going to be a bit shorter, since not a lot of stuff has happened (or rather, a lot did, but it was mostly concentrated on one of the projects, which I think is… good?).

2023-08-05

2023-07-22

2023-07-15

  • 04:26 UTC (new) 2023-07-15 Drawing ASCII art charts in Emacs buffers . . . . mbork Two months ago I wrote about how I track my weight in Emacs. I am still doing it, and dieting works quite well, but I had one problem with my setup: I really wanted to have a graphical representation of my weight data – in other words, a chart. After quickly assessing the existing solutions (the chart.el library included in Emacs and Org Plot, I decided that I need something else. I don’t want to have to run an external program (in this case, gnuplot), and I want to have a simple ASCII art scatter plot (but neither a bar chart nor just an additional column containing a histogram of the values in the table.

2023-07-08

  • 13:20 UTC (new) 2023-07-08 Finding a common prefix of a set of strings . . . . mbork Some time ago I needed a very specific thing. Given two strings, I wanted to find their longest common (initial) substring. For example, given abc and abd, I wanted ab. I thought that Emacs Lisp must have something like this already, and I wasn’t wrong. It turns out there are even two functions which can do that!

2023-07-03

  • 05:24 UTC (new) 2023-07-03 From mp3s to podcasts . . . . mbork Many years ago I used to listen to podcasts a lot. I had my two favorite ones, and they provided me with more than 90 minutes of interesting material to listen every week (and that is not counting several hundred archive episodes!). Recently, I decided to start listening again to interesting people while I commute. This time, though, I want to listen to webinars instead, and I have them in the form of mp3 files. Thing is, how do I get them on my smartphone?

2023-06-26

2023-06-19

2023-06-12

  • 18:08 UTC (new) 2023-06-12 Counting time, backwards . . . . mbork Some time ago I thought that I would like to have a feature Org mode doesn’t seem to have. There are things I would like to do once in a while, but I don’t need a reminder with a hard deadline (like a repeating one) – I’d prefer a gentle nudge. What if I could display a list of things I select, each one with information how long ago I did it last?

2023-06-03

  • 10:31 UTC (new) Comments on 2023-06-03 Org agenda clock check . . . . Anonymous You missed the very important and really helpful overlap check!
  • 05:30 UTC (new) 2023-06-03 Org agenda clock check . . . . mbork Some time ago (well, a long time ago) someone posted an interesting discovery in Org mode agenda: “clockcheck mode”. I stored the link to that message with the intention of blogging about it and forgot about it. I rediscovered it some time ago and decided to take a look.

2023-05-29

2023-05-20

2023-05-13

  • 11:46 UTC (new) 2023-05-13 Dieting with Org mode . . . . mbork Some time ago I started to weigh myself every day. Some people argue that this is a bad idea and you should weigh yourself once per week to avoid worrying about random fluctuations. I disagree – the way not to worry about random fluctuations is to look at moving averages instead, Hacker's Diet-style. Note: I do not necessarily endorse Hacker’s Diet as a whole, but the moving average approach is certainly a good one. For the sake of simplicity, I am going to use simple (unweighted) moving averages over one week. I want to keep my weight data in an Org mode table (obviously).

2023-05-06

  • 08:21 UTC (diff) Comments on 2023-05-06 Juggling playlists in EMMS . . . . mbork Thanks, I had no idea that exists! I'll check it out.
  • 07:59 UTC (new) Comments on 2023-05-06 Juggling playlists in EMMS . . . . Garjola Hi, Very interesting and helpful post. Just one thing: I use the enwc package to manage networks from Emacs. With it, you can get the network id . . .
  • 06:12 UTC (new) 2023-05-06 Juggling playlists in EMMS . . . . mbork It’s been several times now that I described my productivity system here. While I like it a lot, it still has room for improvement. Some time ago I mentioned it to a colleague and shared one frustration I have with it. When I fail to do even one thing on my carefully prepared plan for a day (which happens once in a while, of course), sometimes I lose motivation and skip more subsequent items. This leads to spending less time on things I want to do and more time on procrastination that day. It happens seldom enough not to be a real issue (and it doesn’t mean I fail to do anything – just less than usual or hoped for), but it is a bit frustrating. He suggested a pretty clever (and obvious in hindsight) way to deal with this. His idea is to have a separate music playlist „for work” and train my brain to associate that particular music with focused work. That way I would have another nudge to do particular kind of stuff.

2023-04-29

2023-04-22

  • 19:02 UTC (new) 2023-04-22 Org mode clock table for the last week . . . . mbork Some time ago I mentioned that I started doing “weekly reviews” of what I have done last week and what I am going in the next week. One part of my weekly reviews is checking how much time I spent doing various things last week. Of course, Org mode clock tables are an excellent tool for that. There is one caveat, though. What does “a week” mean? It turns out that it is not obvious at all. The main problem here is the :wstart parameter, telling what day is the first day of the week.

2023-04-15

  • 18:42 UTC (new) 2023-04-15 Downcasing word at point in the whole buffer . . . . mbork Some time ago, one of the members of the Emacs-humanities mailing list mentioned a very specific problem. He wants to be able to replace all occurrences of the word at point with its upercase (or lowercase) variant. This is one of these things that can be solved with a bit of custom Elisp. Being a big fan of writing small (or sometimes not so small) helper functions to make editing easier, I offered to do a bit of coding to accomplish this task, and here it is. Being a teacher, I’d like to provide at least a short explanation, too. (Most of you probably know that I spent quite some time in 2021 doing exactly this – coding Elisp and explaining it – and the result is my book Hacking your way around in Emacs, designed as a “next step” after Robert J. Chassell’s excellent An introduction to programming in Emacs Lisp. Check out Chassell’s book if you are interested in learning Elisp, and then my book if you ant to go further!)

2023-04-13

2023-04-09

  • 04:39 UTC (new) 2023-04-09 Easter 2023 . . . . mbork So, another year has passed since I last wrote about Easter. It would seem that it’s monotonous, but it isn’t – life brings so many unexpected things that I am surprised every day. I am extremely thankful for quite a few things in the last year, but all this pales in comparison to one Event – Christ’s resurrection. If not for that, everything else – every kind person I encountered, every nice surprise I had, every achievement, every pleasure – all that would mean nothing. If there is no resurrection of the dead, then Christ cannot have been raised either, and if Christ has not been raised, then our preaching is without substance, and so is your faith (1 Corinthians 15:14). Good thing is that it’s all true! All that is not to say that last year was without issues. With war going on in neighboring country and plenty of personal problems I can’t say that life is ideal. But it does not negate the fact that I have a lot to be thankful for! Christ has risen, rejoice! And as the tradition goes, be assured that I will offer a decade of Rosary for all my readers here.

2023-04-01

  • 15:54 UTC (new) 2023-04-01 Showing an image between lines in Emacs . . . . mbork I am now coding a bigger thing in Elisp (and I will definitely blog about it when it’s done), but for now let me say something about an issue I encountered along the way. I needed to display an image between the lines (in the literal sense;-)), preferably not interfering with the editing process – so just inserting two newlines and a space with an image display property inbetween was out of the question. (I wanted the user to be able to edit the buffer irrespective of the image display, and actually inserting anything into the buffer would mess with the undo mechanism).

2023-03-25

  • 07:20 UTC (new) 2023-03-25 Using a thesaurus from within Emacs . . . . mbork Now that I started to devote more time to writing, I need a thesaurus more and more often. What I usually did was to go to my browser and use thesaurus.com – but as we all know, leaving Emacs is always a pain. I fired M-x package-list-packages and it turned out that there are several packages to look up synonyms from the comfort of Emacs.

2023-03-20

  • 21:35 UTC (new) 2023-03-20 Manually entering clocking data . . . . mbork As I alluded many times in the past, I use Org mode’s clocking feature almost all the time. However, there are times I don’t. One of such cases is a rare situation when I don’t have access to my computer. Since I started commuting using public transport, I do some reading in a streetcar or bus. When I get to my laptop again, I want to update my clocking data. How to do that?

2023-03-11

  • 08:33 UTC (new) 2023-03-11 Adding my TODOs to agenda . . . . mbork Last month I wrote about my way of managing TODOs. It occurred to me that I could make it even better. Why not add my set of TODOs to look into to my agenda?

2023-03-04

2023-02-27

2023-02-18

  • 08:52 UTC (new) 2023-02-18 My approach to TODOs . . . . mbork Some time ago I described my productivity system. I also mentioned that it is still evolving. One of the aspects where it needed some evolution is handling TODOs – and this is precisely the stuff I am working on right now. Now the main problem I’ve been having for a long time now is that I tend to add a lot of TODOs to my list, which grows much faster than I deal with them. The worst thing here is that when I have so many TODOs lumped together, important and urgent things often get mixed up with unimportant and not urgent ones, etc. So, I devised a way to handle this situation.

2023-02-11

  • 08:37 UTC (new) 2023-02-11 Linear scaling of subtitles timestamps . . . . mbork As I have mentioned here a few times, I spend some time translating subtitles. That’s a prestigious line of work with a long and glorious tradition. However, there are many problems awaiting a bold adventurer who wants to do that. While I really like translating, it is a lot of effort, and sometimes I get the feeling that it’s just nothing but work, work, work, all the time. Well, life is pain. Anyone who says differently is selling something.

2023-02-08

2023-02-07

2023-02-04

  • 09:17 UTC (new) 2023-02-04 My accounting book is finished . . . . mbork As I mentioned in my post about plans for 2023, I spent some time last two weeks on Personal accounting in Ledger, my booklet about, well, personal accounting in Ledger. It is now finished.

2023-02-01

2023-01-31

  • 16:35 UTC (diff) Comments on Strona domowa . . . . mbork Thanks! How about this? https://mbork.pl/?action=rss;days=30;all=0;showedit=0
  • 08:42 UTC (new) Comments on Strona domowa . . . . Anonymous Hi domowa, I'm using elfeed for reading blogs/newsletts, It would be very helpful if your page contains a rss.xml. Why not add one? Thanks . . .

2023-01-30

  • 15:18 UTC (new) 2023-01-30 The benefits of everything being a buffer . . . . mbork For today I only have a very short tip – or maybe let’s call it an anecdote. As all Emacs users probably know, one of the very basic Emacs concepts is the buffer. A few days ago I encountered an (admittedly, not very common) situation when this came in very handy.

2023-01-23

2023-01-14

  • 07:03 UTC (new) 2023-01-14 My plans for 2023 . . . . mbork It is the first time I write a post about my plans for the upcoming year. It’s going to be a writing year!

2023-01-09

  • 06:09 UTC (new) 2023-01-09 TODO stats table . . . . mbork Last week I showed how to compute a summary of all TODO keywords in an Org mode subtree. Today we’ll find out how to insert those data in an easy and readable way in the buffer.

2023-01-05

2023-01-03

2023-01-02

  • 15:41 UTC (new) 2023-01-02 Computing Org mode TODO stats . . . . mbork When I started using Org mode, I followed the very common (and very sound) advice and did not try to learn it all at once. This means that I didn’t use clock tables at all. Well, some time has passed, and I learned that they are actually pretty useful. One obvious application is to get a report for the sake of invoicing, but I also use them to gain knowledge about where I spend how much time. Recently I realized that I miss another, similar feature in Org. Much like having a clock table – which is a summary of time spent on tasks in a file or subtree – I would like to be able to see a report telling me how many tasks I have in a subtree, and how many of them are in various states.

2022-12-25

  • 09:17 UTC (new) 2022-12-25 Merry Christmas 2022 . . . . mbork Merry Christmas to you all! Many people seem to fall in the rut of “Christmas again, and my life is still rubbish – nothing changed, and probably nothing will ever change…”. Folks, this is so wrong! What I think is this: “yet another Christmas” means that God believes that I am capable of change, and is giving me one more chance – again! Thank you, my Lord! That is not to say that I should not try to do my best to be better. In my case this means (among other things) that I’m (finally) starting to do regular weekly reviews, and planning my weeks and (hopefully) quarters and years. But enough of it. This is not a post about my productivity, this is about the joy of Christmas! Our Savior is born, rejoice! (Also, per the tradition, I will offer a decade of rosary for all my readers!)

2022-12-19

  • 07:22 UTC (new) 2022-12-19 A few new things in Emacs 29 . . . . mbork Everybody with an Emacs blogs raves about Emacs 29 these days. Things like Eglot, tree-sitter, SQL support and the like. Well, this is all nice – more than nice, brilliant! – but let’s not forget a few minor advances which are coming with Emacs 29. Let me mention a few things that I especially like.

2022-12-12

  • 10:39 UTC (new) 2022-12-12 Debugging chained operations in Lodash . . . . mbork I use Lodash in some of my projects. One of the nice features of Lodash is the chaining concept. If you have an object (often an array) which you want to transform usign a series of operations like map, filter etc. Now this is great – if it works. But what if it doesn’t and the result is completely unexpected? It would be nice if you were able to see the intermediate results of the chained operations without, so to speak, breaking the chain… It turns out you can!

2022-12-11

2022-12-08

2022-12-05

  • 19:33 UTC (new) 2022-12-05 A simple function to create abbreviations . . . . mbork A few days ago I wanted to write to a colleague about accessibility – or, as it is often called, a11y. As you probably know, the 11 comes from the fact that there are 11 letter between “a” and “y” in the word “accessibility”. Of course, I didn’t want to count the letters manually – I just marked the word, pressed M-= (count-words-region) and subtracted 2 from the result. Then it occurred to me that it is Emacs who should be doing things like that, not me.

2022-11-28

  • 17:05 UTC (new) 2022-11-26 Extracting Youtube subtitles in Emacs . . . . mbork A few days ago I read about an amazing package. Like the OP, I very much dislike watching videos with lectures – text is much, much better way to communicate. (In fact, when I was a student, I preferred to skip lectures and learn from my colleagues’ notes instead. It was much more efficient.) I decided that I really need to try out youtube-sub-extractor.el. It turned out that it’s very easy to do so.

2022-11-19

  • 19:55 UTC (new) 2022-11-19 Streamlining my workflow with Magit and BitBucket . . . . mbork We use BitBucket at our company, which is some source of frustration for us. One of the issues we have with BitBucket is that it seems to lack a decent CLI tool. This means that in order to e.g. create a pull request, you go to the website, click a few times and only then confirm that a PR is really what you want. Well, after some time I learned that it’s not that bad. When you git push your changes, Git (on the command line) responds with the URL you need to go to create a pull request out of the branch you just pushed. (This is most probably achieved via post-receive or some other Git hook.) Nice. Well, of course I don’t use Git from the command line – I use Magit. So naturally I wanted Emacs to extract that information for me and open the URL in the browser. It turns out that it was easier than I thought.

2022-11-14

  • 20:43 UTC (new) 2022-11-14 Doubling backslashes . . . . mbork Today’s post is not meant to be very useful to most people, but it serves as a demonstration of a point (well, that, and a bit of advertisement;-)). However strange it may sound, a few days ago I have a very atypical need. I needed to move some LaTeX code to a JSON file. This meant that all the backslashes had to be doubled, of course – LaTeX code is full of them, and they need to be escaped in JSON. Obviously, query-replace​’ing backslashes with double backslashes is easy, and query-replace only operates on the region when it is active, but I wanted to make sure I didn’t replace them twice by accidentally marking too much. So – partly as an exercise, I guess – I decided to write a command to replace every backslash in the region by two backslashes, but only if it was a single one.

2022-11-07

2022-10-30

2022-10-29

  • 10:16 UTC (new) 2022-10-29 A bash helper for prefixed scripts . . . . mbork Let’s say we have some project we are working on. The project involves a number of shell scripts for various tasks, like versioning, building, testing, deploying etc. It is useful to have these scripts in your $PATH while working on that project. There are several ways to do that. One way is to add the directory containing them to $PATH, but only for the time we’re working on the project. Another is to use things like npm run and the scripts property of package.json (and I’m fairly sure many other languages feature similar facilities). Recently, I found yet another one, which is pretty useful and extremely cool at the same time. I prefixed all the scripts with the project’s (abbreviated) name, say dw-​. So, assume I have scripts like dw-version.sh, dw-build.sh, dw-test.sh etc. Now I can permanently add the directory containing them to my $PATH, since I (kind of) namespaced them and they won’t get mixed with any other project’s scripts (nor general use utilities). The only trouble that’s left is that typing dw- each time is a bit tedious. Well, Bash to the rescue.
  • 10:15 UTC (diff) Comments on 2022-10-03 Converting words and sentences to identifiers . . . . mbork Correct, though in my use-case the phrase always starts with a letter, so I didn't need that.
  • 10:14 UTC (diff) Comments on 2022-10-24 Playing videos from the last position in mpv . . . . mbork {{{ string-search is a built-in function in ‘C source code’. Probably introduced at or before Emacs version 28.1. }}} I compile Emacs from the . . .

2022-10-28

2022-10-27

2022-10-25

2022-10-24

2022-10-15

2022-10-10

  • 20:35 UTC (new) 2022-10-10 Adding timestamps to youtube links . . . . mbork I sometimes keep YouTube links in my Org mode files. They are often links to lectures which I don’t usually watch in one sitting. One trouble I always have is remembering the point where I stopped watching last time and starting there. Obviously, I decided to write some Elisp to ease that task a bit.

2022-10-03

  • 21:07 UTC (new) 2022-10-03 Converting words and sentences to identifiers . . . . mbork Preview: Some time ago I had a need to “convert” a phrase, or even a whole sentence, into an identifier. By “converting to an identifier” I mean lower-casing the whole thing and changing non-letter characters into underscores. For example, “Hello, world!” should become hello_world. I came up with some simple code to do that – but it turned out that there were some pitfalls I did not expect.

2022-09-26

  • 15:56 UTC (new) 2022-09-26 Knex, PostgreSQL and bytea columns . . . . mbork Today I have yet another PostgreSQL-related tip. Some time ago I needed to put contents of some binary file into a bytea column, using Node and Knex.js. I couldn’t find any tutorials, so I decided to try to do the simplest thing and see if it breaks. To my astonishment, it didn’t – it Just Worked™!

2022-09-17

  • 14:10 UTC (new) 2022-09-17 Safe killing with Emacs . . . . mbork Some time ago Samuel Wales had a very interesting question on the Emacs mailing list. He sometimes kills some portion of text to yank it elsewhere, but gets distracted and forgets about the yanking. This way, the text is lost. He basically wants to make the “kill-yank” cycle atomic so that you never end up in the intermediate step where the information is lost.

2022-09-12

  • 18:35 UTC (new) 2022-09-12 Shifting dates or timestamps in PostgreSQL . . . . mbork For today I only have a short and simple PostgreSQL tip. Recently, for the purpose of testing, I needed a user created more than a day ago. Instead of manually typing a timestamp, I created a user now and did this

2022-09-05

  • 18:53 UTC (new) 2022-09-05 Comments in srt files . . . . mbork As I mentioned several times here, I do quite a lot of editing of srt subtitle files for videos. Sometimes I have problems when I translate subtitles into Polish, and then I usually ask native speakers about some obscure idiom or even more obscure (at least for me) cultural reference. In such cases, I figured I’d really like it if I could put comments into srt files to remember these places.

2022-08-27

  • 15:56 UTC (new) 2022-08-27 Screenshots from Emacs . . . . mbork Some time ago there was a discussion on the Emacs mailing list about making screenshots from Emacs. From one of the posts there I learned about the x-export-frames function, whose existence is fascinating for me. It basically allows you to make a screenshot of your Emacs frame without ay external program, in one of several formats (including pdf and png). Jean Louis provided some simple code in that post which I reproduce here (with minor changes). The frameshot command takes a picture of your current Emacs frame, puts is in the frameshot-directory directory and moves the point to its line.

2022-08-22

  • 15:22 UTC (new) 2022-08-22 The Emacs range package . . . . mbork Some time ago I discovered something really cool. It turns out Emacs has a package named range which can be used to operate on, well, ranges of integers. The truth is, it supports much more: arbitrary finite sets of integers.

2022-08-15

  • 05:54 UTC (new) 2022-08-15 Personal accounting in Ledger . . . . mbork As I mentioned a few times, I use Ledger to keep track of my personal (actually, family) finance. While I definitely do not use the full power of Ledger (I don’t really need to), I find the very basic concept of double-entry bookkeeping extremely simple and elegant (in a mathematical sense).

2022-08-08

2022-08-01

  • 06:35 UTC (new) 2022-08-01 Making secrets with Emacs . . . . mbork Let’s play with encryption! Well, not real encryption – but fun encryption. And few things are more fun than playing ciphers with kids!

2022-07-25

  • 06:22 UTC (new) 2022-07-25 Make pass help me remember my passwords . . . . mbork As I mentioned a long time ago, I use pass as my password store. Recently I was thinking about a scenario where I lose access to my computer and backups and need to check emails. I decided that it would be beneficial to remember at least some of my passwords.

2022-07-18

  • 18:32 UTC (new) 2022-07-18 Making some things more legible . . . . mbork Continuing the topic of one of the last posts, let me talk about another way to make dealing with a bank easier. In emails or web pages concerning payments people often have bank account numbers. Such a number consists (at least in Poland) of 26 digits. The first two are check digits, and the rest are the “basic bank account number”. Oftentimes people just paste the string of 26 digits, which is very difficult to read (and I sometimes do want to actually read the number, for example to make sure that two numbers agree). To solve that, it is customary to group these digits into sets of four (so the pattern is: two check digits and then six sets of four), divided by spaces. However, often I receive an email where there are just 26 digits lumped together. Let’s make them look better.

2022-07-11

  • 14:48 UTC (new) Comments on 2022-07-11 A poor man's Emacs - Jira integration . . . . Karl Voit Hi, thanks for the writeup! I also used (and am using) Jira-to-Org workflows. My most elaborated is published on . . .
  • 14:05 UTC (new) 2022-07-11 A poor man's Emacs - Jira integration . . . . mbork I use Jira at work. (I know, I know. Actually it’s not that bad – at least it’s much better than Asana.) Of course, I also copy all my tasks to Emacs to clock them using Org-mode. A few days ago a teammate, seeing my Org file with all the Jira tasks, asked me how I pull them from Jira to Org. A bit embarassed, I told him that I’ve been just creating a new headline, typing the task id (like LT-1337) and copying the task title from Jira. This is not as bad as it sounds since it happen very rarely – say, once or twice per day, so automating this doesn’t really pay off. Still, it would be nice. So, I set out to do exactly that.

2022-07-02

  • 19:30 UTC (new) 2022-07-02 Paying my bills with Emacs . . . . mbork I use Emacs to pay my bills. Literally. I mean, I use it in my day job, obviously, but it’s not what I’m talking about today. In Poland, the most often used way to pay bills like electicity, phone, internet etc. is via bank transfers. To make a transfer you need to type at least the account number of the person or company you transfer money to, the description of the transaction and (obviously) the amount you need to pay. To simplify things, I defined a few recurring recipients in my bank system so that I only need to choose the recipient and type in the invoice number (as the description) and the amount. Still, this is a bit cumbersome. And this is where Emacs can come in.

2022-06-24

2022-06-20

2022-06-14

2022-06-13

  • 19:14 UTC (new) 2022-06-13 Highlighting and de-highlighting things . . . . mbork From time to time I want to perform a kind-of “human search” on a file. For example, there is some keyword – or maybe something describable by a regex – and I want to be able to easily spot all of its occurrences in some file. For some reason, isearch or Swiper won’t work for me. (This may happen if, for instance, I don’t exactly know what I’m looking for. Imagine going through some file and deciding to search for some keywords only when I actually see them for the first time. So, I’m skimming a buffer and once I see the word “banana”, I go “hey, bananas are good, let’s find more of them” and then I want to easily see every line containing the word “banana”. Skimming further, I can see the word “apple” and I suddenly have a craving for apples, so I want to add apples to things that should be easily seen. And so on.) It turns out that Emacs has a few commands which can help with that.

2022-06-04

  • 07:04 UTC (new) 2022-06-04 Diffing structural changes revisited . . . . mbork Two and a half years ago I blogged about diffing program structure changes. Since then I learned about a fantastic new diffing tool, called (very appropriately) Difftastic, by Wilfred Hughes, the author of many great Emacs packages I will definitely blog about some day.

2022-05-29

  • 08:26 UTC (new) 2022-05-29 A short hike in Polish . . . . mbork Dzisiejszy post jest nieco nietypowy, choćby z z tego powodu, że jest dwujęzyczny – co ma sens, zważywszy na jego temat. Today's post is rather atypical, if only because it is //bilingual// -- which makes sense, given the subject.

2022-05-23

  • 05:39 UTC (new) 2022-05-23 Copying code snippets . . . . mbork Two weeks ago I wrote about copying stuff from Emacs to the system clipboard, converting from Org-mode to markdown along the way. Even earlier, I wrote a snippet of code to convert double spaces to single ones when copying. Let’s continue the thread of transforming stuff while copying it from Emacs.

More...

Filters