I don’t know why I haven’t shared this little helper before, but here it is. (defun mu-date-at-point (date) "Insert current DATE at point via `completing-read'." (interactive (let* ((formats '("%Y%m%d" "%F" "%Y%m%d%H%M" "%Y-%m-%dT%T")) (vals (mapcar #'format-time-string formats)) (opts (lambda (string pred action) (if (eq action 'metadata) '(metadata (display-sort-function . identity))…
I make a lot of mistakes when I write prose, because I usually write down everything that comes to mind and then edit sentences and paragraphs over and over again until I get what I want. This is a recipe for all sort of errors, of course. Although I have been a happy user of Flyspell and proselint , in order not to get distracted by warnings and errors nowadays I like to avoid automatic…
Usually when I start writing a new document I am not immediately interested about the output layout. This may sound unorthodox to one accustomed to the WYSIWYG likes of Microsoft Word, but since I mainly write in Markdown and LaTeX, I like to focus on what I want to say first and think about typesetting the text later. The look of the output matters, though, so eventually I have to deal with it.…
Another year, another recap. 2023 has been a strange bunch of months for different reasons. Last year I complained about not finding enough motivation with my studies and the book clubs I had joined. 2023, on the other hand, has been definitely better in these regards. I will return to my studies later when I will deal with my favourite books, but in terms of book clubs I am now a member of the…
When I wrote about using Ugrep with Consult I hinted at the chance of having my custom command available in Embark as well. Building on top of Consult is great. Much like consult-git-grep and consult-ripgrep , the integration with Embark is around the corner. As Omar Antolín Camarena explained to me, though, it is not immediately obvious how to combine mu-consult-ugrep with Embark. Consult async…
I have already discussed how one can leverage ugrep and consult-xref to make a completing-read variant of project-find-regexp . However, today I would like to go a bit further and show how easily Consult can be extended to include a command that behaves like consult-grep , consult-git-grep , and consult-ripgrep , but with ugrep as its engine. True, something along these lines has been around for a…
By now Emacs users are well aware of Tree-sitter and the built-in integration that comes with Emacs 29 . I am a bit late to the party because only recently I have started to look into treesit-language-source-alist and treesit-install-language-grammar , but right now I am more interested in how Clojure programming can benefit from Tree-sitter. Danny Freeman is the maintainer of clojure-ts-mode ,…
After having adapted vertico--format-candidate to behave like I want in my Marginalia-less setup, I noticed I still had undesired documentation during completion. Now, Daniel Mendler created the beautiful Corfu to improve completion at point in Emacs. However, he did not forget about old school users such as myself and provided consult-completion-in-region for the minibuffer lovers out there. My…
One of the Emacs packages I do not seem to get used to is Marginalia . There is nothing wrong with it and since Daniel Mendler is involved the ELisp underneath is great. However, to me it’s just too much information where I rarely want it. When I need that sort of documentation it’s always a quick key binding away. Given the author it should not come as a surprise that Marginalia works…
When I wrote about formatting Clojure buffers I also mentioned that Clojure LSP can take care of this among other things. Since my working days are pretty much Clojure days, it’s time to check out how LSP can help me in this regard and whether the experience is worth an extra tool. Installing Clojure LSP is trivial so I will leave you on your own with that. After the installation the first…
More than a month after my commitment to the default built-in completion system I can say that everything has been going smoothly. I adjusted my muscle memory to hit TAB in the minibuffer whenever I need to pop up the *Completions* window, which to my surprise has not been happening as much as I was expecting. The only thing that I added to the original setup is the following: (keymap-set…
Despite me doing my best to track Emacs development and build the latest master regularly, I forgot to check out the improvements on the default *Completions* buffer that are going to be available on the next official release of our favourite text editor. Thankfully, Robert Enzmann did it for me. Much like Robert, I’ve been living with Vertico, Consult, Corfu and Orderless for a while now,…
For those who remember, the combination of AUCTeX and Eglot makes me happy . And those with even better memory surely recall me mentioning BibLaTeX for my footnotes. The thing with footnotes, though, is that having beautiful, automatic completion for my bibliography is only half of the story. The other half is leveraging yet another great package from the unstoppable Daniel Mendler: Tempel . As…
This year I am going to approach my usual recap in a different way. Instead of separating best-of lists I will look back at 2022 in a single writing to keep it simple. 2022 will not be remembered as a particularly stimulating time. For instance, I have struggled to keep my enthusiasm alive when it comes to university. This is not solely because of the whole mess with dual lessons , but it…
Contrary to my experience with free or open source projects, when it comes to the proprietary software I have been developing for work since late 2004, code formatting has never been matter of discussion. There was a team, back in my days in the UK, that enforced some strict rules via Ant, but until today that was the sole exception. Luckily the people I am coding with nowadays are more open to…
Ages ago I did the minimally required amount of work to get Chris Done’s goto-last-point to MELPA. Recently the maintenance of that package has been taken over by someone else as part of me moving away from GitHub and caring only about projects I want to actively maintain. The thing with goto-last-point is that it’s too much code for me. I simply want to jump back to the last change in…
This is just a quick update on the status of Eclipse JDT Language Server support in Eglot. Since my Python skills are close to none, Roland Grunberg kindly stepped forward to make sure that jdtls can take care of setting up everything in order to avoid ugly workarounds in Emacs and, I guess, other text editors and IDEs as well. The fix will be available on the next Eclipse JDT milestone. However,…
One Emacs package that has been with me for a very long time is diff-hl , and the reason is not its on-the-fly coloured fringe markers, but the fact that colours stay there when I visit the same buffer later. This is useful since more often than not I end my work day with something still in progress, so the next morning it’s easier to use diff-hl-next-hunk and diff-hl-previous-hunk to move…
While reading the nice Straightforward Emacs: Automatically Highlight Buffer Text , I kept wondering whether I could get a similar solution with Emacs built-in facilities. The article explains how to highlight “TK” and variations of it (e.g., “TKTKTKTK”) using the helpful hl-prog-extra . The author says they had to rely on an external package “after some searching and…
This is going to be a small correction to my previous post about Ugrep and project navigation. If you remember, I was using xref-show-definitions-completing-read to make project-find-regexp offer its results in the minibuffer. The problem with that command is that the results are grouped by file, which is good, but within the groups they do not appear to be sorted by line number, which is not so…
When I described how I use Ugrep in Emacs I forgot to mention something. It’s true that I rely on project-find-regexp ( C-x p g ) for searches, but there is a specific use-case where this command is not as handy as it usually is: project-wide navigation. To be more precise, in my daily workflows it can happen that all I need to do is jump to a different file where the thing at point is used.…
When thanks to its developers I added support for jdtls in Eglot , I did it by removing a lot of boilerplate in the package devised to accommodate the complex setup needed for Eclipse JDT to start the language server. This made the java-mode entry in eglot-server-programs simpler and it also moved the responsibility of providing the correct defaults to the jdtls script itself. However, recent…
Almost a year ago I wrote about my handy mu-recursive-grep , an easy way to combine rgrep and vc-git-grep . But after Leah Neukirchen mentioned ugrep recently, I could not resist checking whether it was a good fit for my daily Emacs usage. A couple of benchmark 1 impressed me enough to add support for it directly via xref-search-program-alist . The details to configure everything you need are over…
Tracking Emacs development is always nice, because I get to explore new things as soon as they are made available. Yesterday Lars Ingebrigtsen introduced a new command: restart-emacs . Let’s C-h f restart-emacs RET to check what we are dealing with: Kill the current Emacs process and start a new one. This goes through the same shutdown procedure as ‘save-buffers-kill-emacs’, but…
Last time I mentioned that I helped making it possible for Eglot to use jdtls , the Python helper script packaged with Eclipse JDT to start the language server with sane defaults. The only problem I had during my work on this is that jdtls requires Python 3.9 or later, why my Ubuntu 20.04 machine comes with the 3.8.10 version. Since changing the default Python on Ubuntu can bring pain, 1 I decided…
I don’t think I have enough words to express my admiration for Eglot . The more I use it, the more I appreciate its minimalist approach that just does the right thing and then gets out of my way. With the help of its maintainer João Távora and the friendly Felicián Németh, I have done my part to help keeping it up to speed with Eclipse JDT latest developments. I had to give back something,…
As you may already know, I take buffer switching seriously . Jokes aside, one of the key bindings I use the most is C-x p b , which is bound to project-switch-to-buffer by default. As the above linked article explains, it takes little time to find myself with many open buffers, some of which may not be immediately relevant to the context of my actual work. Instead of tweaking switch-to-buffer ,…
My recent experiments with Eglot and Java led me to figure out how to speed up the connection to Eclipse JDT Language Server. Basically I wanted a simpler version of eglot--eclipse-jdt-contact to avoid any prompt and just do the right thing for me. Looking at Eglot’s bug tracker, there is an issue with some tips: #424 . I followed the instructions and added the relevant code to my init.el :…
The more I move to VC, 1 the more I end up relying on M-! ( shell-command ). Admittedly, this is a tool I’ve hardly ever used before, but since VC lacks many features covered by Magit, sometimes I need to interact with the power of Git straight from the command line. One of the best things about Magit is that I don’t have to remember the many Git options to use it every day. Through…
Two weeks without Magit 1 have forced me to rethink how I use Git in my projects. I have already written about some commands I have been using, but beside basic things, how does Emacs hold up in a more complex situation? Let’s talk about interactive rebasing. If you are familiar with Magit, 2 you know how simple it gets. This is what I usually do from magit-status : l for magit-log l for…
Following my previous article on VC, I felt like proposing a key binding for vc-git-stash to the Emacs developers was something that could turn out to be useful for other VC users. As it is usually recommended to do in these cases, 1 I filed my request using M-x report-emacs-bug : #52158 . You can see that I specifically mentioned mu-vc-git-stash , the thin wrapper I coded to have VC stashing…
Some days ago I briefly wrote about my willingness to give Emacs built-in VC system a try for real. For real means that it’s easy to praise the beauties of vc-git when working on personal projects such as this blog, but is VC actually worth it on bigger projects where different people commit and push regularly, rebasing is a habit, and merge conflicts are unavoidable necessities? A warning…
I have been pretty busy since my last update here, but that does not mean I haven’t had the time to explore a couple of things for my everyday Emacs usage. Lately I had to deal with some Java and some JavaScript. No fancy libraries on top of them, no languages built upon them, just plain, old Java and JavaScript. I took that as a chance to familiarize myself with LSP and especially with…
Look around this blog and you will find nice words about ripgrep . I especially enjoy how I can plug it into Emacs, like the time when I devised my own Helm commands for it. However, roughly a year ago I started my journey to a more vanilla Emacs experience. During this time I have been slowly moving away from the niceties of ripgrep in order to stick to a couple of built-in tools: rgrep and…
I don’t know about you, but I like to monitor my Emacs configuration to see if it is growing out of control due to my penchant for experimenting with ELisp and new packages. This led me to a simple question: why not have a command that can produce a summary of the installed packages? Specifically, I want to know the total number of packages installed and I’d like to list the packages…
The more I remove code from my init.el to rely on Emacs defaults, the more I am getting used to it. This means I stopped using the likes of nswbuff and counsel-projectile , but it doesn’t mean there isn’t room for small tweaks. The basic switch-to-buffer ( C-x b ) does exactly what it says: it lets you switch to a buffer of your choice. Now, if you play around in Emacs for a while you…
Not too long ago I wrote about my pleasant experience with icomplete-vertical-mode , a recent addition on Emacs master which gives a vertical spin to the good old Icomplete. But now Emacs also comes with fido-mode , which enhances icomplete-mode with ido-mode powers. The question is: can I combine fido-mode and icomplete-vertical-mode to have the best of both worlds? Yep, it turns out I can and it…
I explained my need for an English dictionary when I wrote about my own [helm-wordnut]({% post_url 2020-06-13-helm-wordnut %}). To sum it up: my English is good but it’s not David Foster Wallace good, so a dictionary is mandatory. Last October Torsten Hilbrich added dictionary-el to Emacs master so, in my quest for a Vanilla Emacs appreciation, I decided to give it a try. According to the…
This is going to be a real quick one, mainly a “thank you!” to Lars Ingebrigtsen. Lars has recently added a new option on the Emacs master branch: dired-kill-when-opening-new-dired-buffer . I will let the documentation speak for itself: dired-kill-when-opening-new-dired-buffer is a variable defined in ‘dired.el'. Its value is t Original value was nil You can customize this variable. This variable…
Tracking the Emacs development by building its master branch may not be a smooth experience for everyone, but for the average enthusiast is the perfect way to see their favourite tool evolve, trying experimental things, and reporting back to the core developers to help them. Sure, one has to deal with occasional build failures, but with Git at one’s service it’s always easy to reset to…
First you have to excuse the awful title, but a cinephile cannot resist the temptation of an easy reference when the Emacs package he is going to write about is called Vertico . Daniel Mendler has become such a prolific contributor to our Emacs world. His work with Omar Antolín Camarena and Clemens Radermacher (to name a few!) has been showing me how much can be done with little improvements on…
Last time I left straight for the built-in package.el , a choice I have not had the pleasure to regret so far. Now I am going to reason about a more ambitious change in my Emacs configuration: I am not using use-package any more. Before answering your concerned why!? let me just say that if you are happy with use-package you should stay with it. By wrapping all the settings for a built-in feature…
After more than a year with straight as my package manager, recently I have decided to sit down and look closely at how I handle my Emacs packages. For all the interesting design choices and splendid documentation straight offers, I have never used neither its version freezing capabilities nor the chances to edit the source code of a package to try possible fixes before sending patches upstream.…
What a year this 2020. Beside the pandemic changing our lives in unpredictable ways, from the perspective of my Emacs usage much was going on in my init.el until I felt that a temporary break was necessary . Most of my tinkering concerned the minibuffer and its completion mechanisms. I finished last year and started this one with Helm, but I am about to close 2020 with the built-in minibuffer…
My recent move from Flycheck to Flymake has proven to be a solid choice because the Emacs built-in syntax checker has yet to let me down. And since by now I am sure my love for project.el is absolutely obvious, could I miss the opportunity to make these two underappreciated gems shine together? Honestly, though, the credit here goes all to Protesilaos Stavrou. His Flymake setup made me aware of a…
In my first appreciation of project.el I wrote about a patch for project--files-in-directory . It’s a working solution, I won’t deny that, but patching code always feels hacky. It’s like a dirty workaround you cannot avoid to look at every time you visit your Emacs configuration. By inspecting the code of project.el I noticed that project-files is a generic function. In Emacs…
The recently available Emacs User Survey made me think, once again, about the status of the technological world around me. The survey was painstakingly discussed on the emacs-devel mailing list, and generated some interesting reactions among people outside the core developing team as well. More interesting for the perspective of this writing are the reactions to the discussions on emacs-devel ,…
As a Clojure developer one of the most important packages in my everyday Emacs usage is CIDER . There are many things to love about it, chief among them the great interactive code evaluation and a sweet integration with popular Clojure tools. I still haven’t played with its debugging facilities, but yes, I know I should. However, there is something that has been bothering me for quite a…
There was a time when I just didn’t trust Emacs. This lack of confidence was the result of mixing good and evil: listening to other reliable Emacsers’ opinions while being too lazy to see for myself what Emacs could do. The outcome of this endeavour was a frenetic copying-and-pasting of code snippets in my init.el , blindly dragging in more and more external packages. Don’t get…
In his article What’s new in Emacs 27.1? Mickey Petersen wrote that the built-in project.el 1 is a library “not widely used” and “about 20 years too late”, concluding that it is “a missed opportunity”. From what I can tell project.el has been around since 2015. As everything else in our Emacs world, it’s an effort from volunteers offered back to the community. I see no reason to avoid…