emacs

Easy incrementing find and replace in emacs

I start with a list with a bunch of entries like this: newsletter W02 newsletter W02 newsletter W02 newsletter W02 EDIT: New Solutions It turns out that emacs automatically initializes a variable that tracks how many interations your replacement function has made, and in lisp mode you can get to it with \#. This way, the single line necessary to number all my newsletters becomes this: W\(02\) → W\,(format "%02d" (+ 4 \#))) and, of course, you can adjust that 4 to whatever you need it to be for your starting digit.

Make GNUs "sent" show recipient, not author

https://www.reddit.com/r/emacs/comments/e66ewg/make_gnus_sent_show_recipient_not_author/ I’m a GNUs user and am pretty happy with it. However, I have a “Sent” message group where the summary line is the same as everywhere else, meaning it includes the author (me!) and not the recipient. How can I change the summary line format in just the outgoing buffers (or, alternatively, if the author is me)? For reference, here’s my current insensitive line-format variable: (setq gnus-summary-line-format "%U%R%([%-30,30f]:%) %-50,40s(%&user-date;)\n") The winning solution?

Emacs can't show light background

Although I’ve long had a habit of frequently changing my themes, even having a key chord set for that, at some point recently I became unable to switch to any light-background theme; it was always some shade of black. This became a real problem since Wikipedia in eww became unreadable for equations. I looked into this and found the answer from Sacha Chua, who pointed me to M-x customize-face default which had somehow had my default background set to some dark dark gray (I’m guessing when I was playing with persp mode).

Auto-add BCC address to notmuch/message-mode messages

I use GNUs for most of my email needs, but also have notmuch for rapid search of my inbox. Trouble is, when I choose a message in that notmuch search, it doesn’t open it with gnus but with its own message-mode spinoff called Message[Notmuch]. In GNUS I have an automatically added BCC address (my “sent-mail” inbox, which is downloaded across devices to sync what I’ve sent). How can I get the same automatic BCC added to anything I send in reply with Message[Notmuch]?

Helm-grep project refactoring: search and replace

With this you can readily search an entire project directory for some text, and then make whole-scale changes to any or all files containing that text. I assume you already have helm-projectile installed and you use it; if not, you’re missing out! First, install wgrep and helm-wgrep, for which I use use-package and my emacs.el init file: (use-package wgrep :ensure t :config (use-package wgrep-helm :ensure t)) Then, execute helm-projectile-grep for the text you desire.

Emacs multi-inbox Email Setup

I use the Emacs package Gnus (included in Emacs) to manage my email, and have used it this way for years. There are many reasons for managing your email locally, and even more for managing them in Emacs, but it took me years to make it through the obstacle course of actually figuring out how to do it. It requireed learning many new concepts that our day of webmail and Exchange-programs generally glosses over.

Gnus remove group

After years of using Gnus for my mail I had some anomolous groups like “mail.sent” (later I had reworked this to archive.sent, but couldn’t get rid of mail.sent); I had tried deleting the folder on my hard drive, but this only resulted in errors with trying to enter the group from the group list, but still the group was shown (even with a number of unread messages). Turns out the answer is easy:

Saving Window configs in Emacs (in-session)

Sometimes I end up with complex window configs while working in emacs, as you see in the title image. Using Winner mode you can easily track linearly backward through your screens, “undo” style; but sometimes I have a set up–as when developing a system–that I want to return to frequently. It turns out you have Window Registers for this purpose, and they work well. window-configuration-to-register: C-x r w <key> This saves it for easy reloading with C-x r j <key> and you’re back where you want to be!

Emacs for Study: PDF Conversion and Editing

Sometimes in the process of studying it is desirable to take the papers you are researching, which usually come as PDFs, and to convert them to an editable form. After you’re finished editing the final product could be PDF, Microsoft Word, web HTML, or something else. As this is a process that I’ve required for a number of different reasons, this tutorial covers the tools I use. Unlike other tutorials I’ve done, this process utilizes several tools beyond emacs.

Emacs save custom agenda filter views

If you work much with the Orgmode agenda you soon find that you can have a huge amount of appointments and todo tasks to deal with. You can sort these by putting tags on the, either straight from the agenda view (with :) or in the actual org file (with C-c while point is over a headline). You can then use those tags to filter and search your agenda (from agenda view, with / and \ followed by TAB).