Recent Changes

Updates since 2017-12-31 06:34 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


  • 19:47 UTC (new) 2019-01-20 Filling and version control . . . . Marcin Borkowski It has been said a lot of times that when writing some (natural language) text with version control in Emacs, filling is a bad idea. Any change involving adding or deleting a significant number of characters and then refilling can result in all subsequent lines in a paragraph changed, and the diff looks really ugly then. The solution usually proposed is putting each sentence on a separate line, and then just use visual-line-mode to wrap your lines on the screen without putting any hard newlines in. Well, I sort of dislike this idea.


  • 05:23 UTC (new) 2019-01-14 Some Org Agenda keybindings . . . . Marcin Borkowski This post is just a friendly reminder that it may be a good idea to look in the manual from time to time, just in case there are some gems hidden there you don’t remember (even if you read it once). It turns out that you can do a lot of things from the Org Agenda buffer.





  • 22:01 UTC (new) 2018-12-24 Merry Christmas . . . . Marcin Borkowski As usual at this time of year, I have best Christmas wishes for everyone reading this. I wish that you all discover the beauty and truth of the . . .


  • 11:46 UTC (new) 2018-12-16 A simple tip on using destructive functions . . . . Marcin Borkowski This is something fairly obvious to every seasoned Lisp programmer, but let’s not forget that there are novices, too. Many Elisp functions are noted to be “destructive”, which means that they can change their arguments. For instance, if you want to sort a list, you may use the sort function, which is said to modify its argument by side effects (this is exactly what “destructive” means). This does not necessarily mean, however, that after executing (sort some-list), the variable some-list will magically contain a sorted version of it previous self! Let’s consider two examples.



  • 08:46 UTC (new) 2018-12-03 looking-back-p . . . . Marcin Borkowski Emacs has a very useful function looking-at, which says whether the text from the point on matches a given regex. Unfortunately, it modifies the match data, which are global state referring to the last search. Because of that, I often prefer to use looking-at-p, which takes care not to mess with the match data.
  • 08:42 UTC (diff) Comments on 2018-11-19 Font-locking diff blocks in Org-mode . . . . Marcin Borkowski Well, this is what my Emacs outputs when I use commands such as {{{dired-diff}}}, which is what I probably did, and then copied that to a src block.



  • 16:56 UTC (new) 2018-11-26 format-seconds . . . . Marcin Borkowski If you’ve ever done anything UI- and time-related in Elisp (or whatever language), chances are that you did stuff like (defun format-minutes (minutes) "Format MINUTES in a human-friendly way."


  • 08:38 UTC (new) 2018-11-19 Font-locking diff blocks in Org-mode . . . . Marcin Borkowski I sometimes miss a feature in Emacs where I could make a diff of two files (using Emacs built-in dired-diff command, bound to = in Dired, or abo-abo’s diff trick, which I have bound to e in Dired), but have the diff persist (as in, save it to a file). Technically, I can do this, of course, by just calling write-file and saving it to a file (preferably with a .diff extension so that it will open in Diff mode automatically), but sometimes I prefer to save things in my Org-mode file, along with my notes related to the project I’m working on. It turns out that Org-mode has me covered, although there is one minor caveat here.


  • 21:13 UTC (new) 2018-11-11 Poland gained independence 100 years ago . . . . Marcin Borkowski Today we [[|again]] [[|depart]] from the usual topics of my blog. We have a very important day today in Poland – [[|one hundred years ago my country gained independence]] after more than a hundred years of political nonexistence.



  • 14:46 UTC (new) 2018-10-27 Launching terminal in current directory . . . . Marcin Borkowski I am a bit ashamed that I do not always use Eshell – I sometimes rely on a “proper” bash in a terminal. (One possible reason is when I ant to run something that does not play too well with Eshell, like top or watch. I know it is possible to do that in Eshell, using eshell-visual-commands, but it seems I’m too lazy (or still too much accustomed to my usual terminal) to change that. Anyway, it is feasible to want to run a terminal (or any other program) in the current directory from Emacs. It turns out that it is easy to do using async-shell-command.


  • 11:48 UTC (new) 2018-10-22 Running visual commands in Eshell . . . . Marcin Borkowski It is a known thing that running commands that control the terminal like top in Eshell is problematic – Eshell plays well with commands that take stdin in and put stdout out, but any control codes are just displayed verbatim. Happily, there is a way around it.



  • 23:34 UTC (new) Comments on 2018-10-14 Magit and C-u i . . . . Anonymous Perhaps you could add such a mention to the manual? . . .
  • 17:59 UTC (new) 2018-10-14 Magit and C-u i . . . . Marcin Borkowski Last time I mentioned that I use multiple backup copies of my .env file. One problem with that approach was they they cluttered my Git status (or the magit-status window). I could put the relevant pattern in my .gitignore file, but I didn’t want to bother other programmers in the team with peculiarities of my personal setup.


  • 06:24 UTC (new) 2018-10-06 The version-control variable . . . . Marcin Borkowski As many of us know, Emacs has a habit (annoying for most people, I guess) of making backup copies of files it saves. Happily, it doesn’t kick in in version-controlled files (and most of my files fall into this category nowadays). But there are situations when I actually do want the backup copies.





  • 06:49 UTC (new) Comments on 2018-08-13 A tip on git stash . . . . Anonymous Magit users should note that they can type L L to toggle the visibility of the margin in the status buffer, which displays dates alongside all of the . . .



  • 07:56 UTC (new) 2018-09-10 Persisting Emacs variables . . . . Marcin Borkowski Some time ago I coded a certain Elisp tool (for internal use at Wiadomości Matematyczne) and I needed to preserve the value of some variable between Emacs sessions. I asked how to do this on the Emacs mailing list, and I received a whole lot of very interesting and worthwhile responses.


  • 17:09 UTC (new) 2018-09-03 Emacs obsolete commands . . . . Marcin Borkowski In one of my previous posts I mentioned that the Info-edit command is obsolete. You might be wondering what that means exactly. (I was, for sure.) Well, here’s the story.


  • 19:34 UTC (new) 2018-08-27 Whitespace in Emacs regexen . . . . Marcin Borkowski Some time ago I wanted to search for a sequence of two words in a buffer. Normally I’d search for lorem<space>ipsum, but what if there is a newline between them? Or a non-breaking space? Or a tab?



  • 16:20 UTC (new) 2018-08-13 A tip on git stash . . . . Marcin Borkowski I don’t know about you, but I use git stash fairly often. (This might be just a bad habit, and committing might be a better idea, but I do find stashing useful, especially for minor changes I’d like to apply from time to time on different branches but never commit. Yes, console.log and friends, I’m looking at you, but also at turning on various “debug” variables.) After some time, git stash list begins to look like this


  • 19:59 UTC (new) 2018-08-06 Editing past Git commits . . . . Marcin Borkowski Everybody and their mother are now writing Git tutorials of various kinds, so I decided to jump on the bandwagon and do my own just like the thousands that already exist. Just kidding. My one will be different.


  • 12:45 UTC (new) 2018-07-29 2018-07-29 The INSIDE EMACS variable . . . . Marcin Borkowski While researching stuff connected with Eshell and shells in Emacs in general, I encountered an interesting bit of information. It doesn’t seem to be useful for me personally, since I seldom use M-x shell or M-x term, prefering Eshell instead, but maybe someone may find a use for it. When you run a script/command from one of those Emacs non-elisp shells, the environment variable INSIDE_EMACS is set to a nonempty value so that scripts can recognize that they run inside Emacs.


  • 03:58 UTC (diff) Comments on 2008-10-13 Alkohol . . . . Marcin Borkowski No, ale to ani trochę się ne wyklucza z tym, co napisałem (prawie dziesięć lat temu, ale chyba nadal mogę się pod tym podpisać). Nadal utrzymuję, że . . .
  • 03:44 UTC (new) 2018-07-23 Handlebars inline and block helpers . . . . Marcin Borkowski In a project I’m involved in, we use a templating library called Handlebars.js. It is quite nice, and has a slightly less nice documentation. Since I’ve spent a considerable amount of time recently digging through the Internet to find some information on the so-called helpers, I thought I’ll share it here. Expect a series of (not necessarily consecutive) blog posts about Handlebars!


  • 15:40 UTC (new) Comments on 2008-10-13 Alkohol . . . . Barbara Marcin, zgoda, ale na początku użyłeś sformowania "choroba alkoholowa", a w ostatnim akapicie, jakby o nim zapomniałeś... Zły kusi, racja i kontrole . . .


  • 19:17 UTC (new) 2018-07-16 Eshell aliases . . . . Marcin Borkowski Some time ago, I wrote about a way for programs started in Eshell to use cat as a pager instead of less. Since originally I only wanted this behavior with Git, and Git has a =--no-pager option, it would be better to automatically add that option to Git. Well, it turns out that Eshell has the feature we know and love in bash: aliases.




  • 19:02 UTC (new) Comments on 2018-07-02 Smart yanking . . . . Omar Doesn't adding the advice in the text-mode-hook mean that after the first time you open a text-mode buffer the advice affects yanking in every single . . .
  • 03:04 UTC (new) 2018-07-02 Smart yanking . . . . Marcin Borkowski Notice: this is a long, technical post about a useful piece of Emacs Lisp. What it does it allowing to yank text with a space at either end both before and after a space between words and have Emacs adjust things so that you don’t end up with two spaces at one end of the yanked fragment and no space at the other one. If you just want the working code, you may get it from here: If you want to know the gory details, read on.



  • 18:38 UTC (new) 2018-06-16 ivy-use-selectable-prompt . . . . Marcin Borkowski It’s been a long-standing problem in Ivy that entering a string which was not on the list of candidates, but was a substring of one of the candidates, was non-trivial. You had to remember to press C-M-j instead of RET, and that requires some finger acrobatics. Well, it’s no longer a problem.


  • 10:34 UTC (new) 2018-06-10 Git diff in Eshell . . . . Marcin Borkowski I try to use Eshell more, as part of a general drive towards moving everything into Emacs. One thing that annoyed me a bit was issuing a git diff or something similar in Eshell. Invariably, I received a WARNING: terminal is not fully functional.


  • 06:49 UTC (new) 2018-05-28 Collaborating with non-Git-users - Emacs support . . . . Marcin Borkowski In the previous part, I showed how I can make Git add information about the commit in every file I want it to in such a way that it is updated every time I Git-archive the project. Actually, I have written an Elisp function to do this for me; it prepares a zip file with git archive and then writes a boilerplate email in mu4e, with the recipients’ addresses, attachment and a minimal body already in place.


  • 19:36 UTC (new) 2018-05-20 Collaborating with non-Git-users - workflow and basic setup . . . . Marcin Borkowski This is the first post in a three-part series describing my setup designed to work flawlessly and almost automatically when collaborating with people not using Git. It describes the premise and the basic elements of the machinery I use. I am now engaged in a project involving a few collaborators. It turned out that I am the only one who knows how to use a version control system and is willing to do so. Reminder to myself: never, ever work with people who insist on sending intermediate files via email and not learning a VCS.


  • 13:35 UTC (new) 2018-05-11 Beeminder and Emacs . . . . Marcin Borkowski Today’s post is special – instead of writing it here, I’m a guest on the Beeminder blog. Head over there to read it! (And thanks to Beeminder folks for having me there!)


  • 05:00 UTC (new) 2018-05-07 Ten years of work in Wiadomości Matematyczne . . . . Marcin Borkowski I mentioned a few times on this very blog that I work for a certain journal, Wiadomości Matematyczne. Last year was my tenth anniversary of my job there, and I gave a talk on the joint Polish TeX Users Group and TUG conference to celebrate that. Well, a few weeks ago my TUG paper based on that talk went public. If you are interested in LaTeX and want to learn something about what it looks like to use it to typeset a journal, it may be a nice read. Enjoy!


  • 06:24 UTC (new) 2018-04-28 org-mru-clock . . . . Marcin Borkowski After writing about counsel-org-clock, I got an email from Kevin Brubeck Unhammer, the author of another package facilitating clocking recent things: org-mru-clock (where “mru” stands for “most recently used” items).



  • 12:57 UTC (new) 2018-04-21 counsel-rg and symbol at point . . . . Marcin Borkowski Preview: Continuing my streak about counsel, I had a small a-ha moment a few days ago. I often use counsel-rg. It was rather annoying for me that I had to mark the function or variable name at point, copy it to the kill ring, invoke counsel-rg and then yank it back. Until I realized that all this was unnecessary.


  • 07:18 UTC (new) 2018-04-15 counsel-org-clock . . . . Marcin Borkowski Some time ago I blogged about my Org-mode hydra. It turned out that that a link to that short article was posted to Reddit, and one of the commenters pointed out his counsel-org-clock package.


  • 20:04 UTC (new) 2018-04-09 counsel-yank-pop . . . . Marcin Borkowski Some time ago I wrote a tip about yanking, and I was informed in a comment that helm has helm-show-kill-ring, which is a replacement for M-y. Turns out that the Ivy suite has counsel-yank-pop, which is a similar thing. Even better, instead of binding M-y to it manually, you can just turn counsel-mode on, and many Emacs commands will be automatically remapped to their counsel equivalents. Nice!


  • 03:39 UTC (new) 2018-04-01 Easter 2018 . . . . Marcin Borkowski As usual, I’d like to wish everyone reading this a Happy Easter! Yet again we live to witness the miracle of Jesus rising from the dead. Today does not seem to be a good time to live in. Sin is everywhere, the forces of evil seem to dominate, and the world seems to head towards self-destruction. But this is not actually the case. Jesus already defeated Satan, and we only must join the victorious battle. Happy Easter everyone! (And traditionally, I have a gift to all my readers: a Rosary decade for you!)




  • 18:56 UTC (new) 2018-03-26 Human-readable filesizes . . . . Marcin Borkowski A few days ago I needed to display a filesize (in one of the next blog posts I’ll show why I needed this!). The easiest way is to just display the integer – size in bytes – but of course this is not very human-friendly. The “right” way should use whichever units fit the number.


  • 05:01 UTC (new) 2018-03-18 My Org-mode hydra . . . . Marcin Borkowski I mentioned a lot of times that I am a big fan of Org-mode clocking feature. Even if I clock some things only for myself, I find it useful to learn how much time I actually need for some task. This is often surprising – for example, I think most people are completely unaware of how much you can accomplish by spending five to ten minutes every day on something (notice the “every day” part!). Of course, I want my clocking to be as smooth as possible.
  • 04:59 UTC (diff) Comments on 2018-03-10 A tip on yanking . . . . Marcin Borkowski That's interesting. I don't use helm, but a quick search shows that Ivy has something similar. I'll try it out!


  • 21:46 UTC (new) Comments on 2018-03-10 A tip on yanking . . . . deusmax Helm has built-in support for browsing the kill-ring when helm-mode is enabled. Even better, bind M-y to helm-show-kill-ring, see . . .
  • 05:14 UTC (new) 2018-03-10 A tip on yanking . . . . Marcin Borkowski I have a few longer posts in the works, but for today I want to share a simple trick. We Emacs users all know and love the kill ring, and many of us know about M-y (yank-pop) and even C-u ... C-y (i.e., a numeric argment to yank). For those who don’t know: C-u 1 C-y is equivalent to plain C-y, but C-u 2 C-y (or just C-2 C-y) inserts the previous killed text (much like C-y M-y), and also marks it as the current one. With higher arguments, it inserts earlier kills.




  • 07:13 UTC (new) 2018-02-25 Simple way of assigning formulas to fields and columns in Org tables . . . . Marcin Borkowski Today I’m going to share a simple trick concerning Org-mode spreadsheet tables. I knew that I could press C-u C-c = in an Org-mode table cell to install a formula in that cell (or C-c = to install a column formula). However, there is a simpler way: you can just type := followed by the formula and press TAB, RET or C-c C-c. (Without a colon, it installs a column formula.) Very handy! (And it was in the manual all along… Once more I learned that at least skimming through the manual from time to time is a good idea!)



  • 22:53 UTC (new) Comments on 2018-02-12 append-next-kill . . . . MathiasDahl An alternative, especially after the fact, can sometimes be to use yank-pop, with the default keybinding M-y. Kill some pieces of text. Then yank . . .
  • 20:23 UTC (new) 2018-02-12 append-next-kill . . . . Marcin Borkowski Today I’d like to share a simple trick which I learned a few days ago. It is well-known that if you perform a few killing commands in a row (like C-k or M-d), only one entry is put into the kill ring. Sometimes, however, I want to kill things in different places and still combine them into one kill ring entry. Enter C-M-w, or M-x append-next-kill. It makes the next killing command append its prey to the last kill ring entry.



  • 20:52 UTC (new) 2018-01-29 A simple script for shuffling exam questions . . . . Marcin Borkowski As we approach the end of the semester, my free time shrinks to nearly zero. Today I’m only going to share a simple tip. Last week, I prepared an exam. I wanted 10 questions, each one taken from one chapter of the lecture. I also wanted 6 sets (4 for the exam and 2 for the retake). And I wanted no bias (even unconscious) – problem sets for the retake should be neither easier nor harder than for the first attempt etc.


  • 04:31 UTC (new) 2018-01-22 Info-edit . . . . Marcin Borkowski There was an interesting (and sometimes quite amusing) discussion about Info on the help-gnu-emacs mailing list. Apart from learning that there exist people who do not even want to use the amazing Info mode, I learned that there is a very little known Emacs command Info-edit. It used to be bound to e in Info, but has been deprecated some time ago and now the only way to invoke it seems to be by M-: (Info-edit). It puts the browsed Info buffer into an editing mode; after the edit, you can press C-c C-c and be asked about where to save the edited file.


  • 05:08 UTC (new) 2018-01-15 Counting LaTeX commands in a bunch of files . . . . Marcin Borkowski I hope that I want bore anyone to death with blog posts related to the journal I’m working for, but here’s another story about my experiences with that. I am currently writing a manual for authors wanting to prepare a paper for Wiadomości Matematyczne. We accept LaTeX files, of course, but we have our own LaTeX class (not yet public), and adapting what others wrote (usually using article) is sometimes a lot of work. Having the authors follow our guidelines could make that slightly less work, which is something I’d be quite happy with. (Of course, making a bunch of university mathematicians do something reasonable would be an achievement in itself.) When I presented (the current version of) the manual to my colleagues in the editorial board, we agreed that nobody will read it anyway. And then I had an idea of preparing a TL;DR version, just a few sentences, where I could mention the one thing I want to get across: dear authors, please do not do anything fancy, just stick with plain ol’ LaTeX. And one component of that message could be a list of LaTeX commands people should stick to. (If you have never worked for a journal or somewhere where you get to look at other people’s LaTeX files, you probably have no idea about what they are capable of doing.) So here I am, having 200+ LaTeX files (there are twice as many, but I had only about 200 on my current laptop), meticulously converted to our template (which means our class and our local customs, like special commands for various dashes or avoiding colons at all costs), and I want to prepare a list of LaTeX commands used throughout together with the information about the frequency of using them.


  • 20:22 UTC (new) 2018-01-07 A small editing tool for work with AMSrefs . . . . Marcin Borkowski As I mentioned many times, I often edit LaTeX files written by someone else for a journal. One thing which is notoriously difficult to get right when writing academic papers is bibliographies. At Wiadomości Matematyczne, we use AMSrefs, which is really nice (even if it has some rough edges here and there). (BTW, BibLaTeX was not as mature as it is today when we settled on our tool; also, AMSrefs might be a tad easier to customize, though I’m not sure about that anymore…) One of the commands AMSrefs offers is \citelist. Instead of writing things like papers \cite{1}, \cite{2} and~\cite{3}, you write papers \citelist{\cite{1}\cite{2}\cite{3}}, and AMSrefs sorts these entries and compresses runs into ranges (like in [1-3]). The only problem is that most authors have no idea that this exists, and we often have to convert “manual” lists of citations into \citelist‘s. Well, as usual, Emacs to the rescue.