Another “Perfect” Mail Setup

As you all know, I really like the idea of email within Emacs and collect various solutions to implementing it. I’ve long settled on mu and mu4e and have no intentions of looking for something else. Still, it’s nice to see what software and configurations other people pick.

Aqeel Akber has settled on his own perfect email setup. His uses notmuch for both the indexer and mail client. Like me, he uses to mbsync to retrieve his email (from Google in his case). Unlike me, he uses msmtp to take care of sending his emails. This is an advantage because, among other things, it takes care of queuing his emails if they can’t be sent immediately.

Akber likes to partition his computer system into “subsystems,” which he believes makes them easier to configure, manage and reason about. His configuration reflects this but you needn’t blindly follow his setup. On the other hand, if you want to, you can simply download his configuration and make the necessary changes to have a similar system. If you’re looking for an Emacs/Email solution, Akber’s post is worth taking a look at. A problem that many seem to have is how to get mbsync to work with Gmail. Akber has solved that problem so if you have it too, that alone makes his post worthwhile.

Posted in General | Tagged | Leave a comment

RMSbolt

I have always felt that knowing, at least in a general way, how a higher level language compiles down to machine code enables one to write better code in the higher level language. That’s not to say that everyone should learn their processor’s assembler language—that’s not necessary these days and would require an effort greater than the expected returns—only that you should be able to read an assembly listing and get a general idea of what it’s doing. This seems so obvious to me that I don’t understand how people can disagree. Some do, however, and they probably won’t be interested in this post.

For many languages it’s possible to get a listing of the assembler output or, in the case of languages like Python, a listing of the bytecode. The problem is that in most cases it’s enough trouble that you won’t bother unless you have a pressing need. Jay Kamat’s RMSbolt package makes everything easy and will give you an automatically updating display of the generated code in a window next to your source code.

Take a look at the animated GIFs in the project’s README to see it in action. This is really ideal because it will let you try alternative statements and see how their code differs. Compilers are always doing surprising things, sometimes even erroneous things, so this can be very useful.

RMSbolt supports C/C++, OCaml, Haskell, Python, Java, Pony, and (limited) Common Lisp. It’s available from Melpa and doesn’t require anything other than Emacs 25 or greater and whatever compilers you’re using.

UPDATE [2018-10-03 Wed 17:55]: Fix link.

Posted in General | Tagged | Leave a comment

Reproducible Research and Literate Programming in Econometrics

About a year and a half ago Rob Hicks wrote an interesting post on bringing literate programming and reproducible research methods to Econometrics. Hicks works mostly in Python and Matlab but also sometimes needs Strata and R. When he began looking for some software to make research and writing easier, he had pretty simple requirements: being able to handle LaTeX (including graphics and math), supporting both Python and Matlab, and being able to publish his results in PDF or HTML.

Of course, once he began investigating, his list grew. Most of the new items were concerned with supporting additional programming languages and with being able to easily produce (at least an almost) submission-ready manuscript. You can check his post for his final list of requirements.

Hicks considered four possible solutions:

  1. Strata with Markdoc
  2. R with Markdown
  3. Jupyter Notebook
  4. Org Mode

He includes three tables that summarize his results.

No one reading this will be surprised that he chose Org mode as his solution. It’s unmatched at producing great documents and packages such as John Kitchin’s Org-Ref make manuscript preparation much easier. It also supports nearly every language and—although Hicks doesn’t mention it—it’s easy to add others.

Most of us, of course, aren’t doing research in Econometrics but Hick’s results are applicable to a large number of fields and it’s well worth taking a look to see if his results are applicable to yours.

Posted in General | Tagged , | Leave a comment

Blogging with Org Mode

Ambrevar (Pierre Neidhardt) has an interesting post on why and how he uses Org mode to blog. His two main criteria are that

  1. He can write his blog posts in Org mode.
  2. He was complete control over how his blog is laid out.

It turns out that he can accomplish that using org publish. That required that he write a bit of Elisp for things like his RSS feed but he mostly used org-publish out of the box. Take a look at his post to see how he set things up and what the result looks like.

What I found most interesting about the post was his discussion of the tension between keeping a post up to date and the value of preserving the original post. At Irreal, I do that by making whatever fix is required and adding a note at the bottom of the post. Ambrevar has a different, arguably better, solution: He keeps his posts in a publicly available Git repository. That way, readers can see both the original post and any corrections/updates that he makes. This, it seems to me, offers the maximum in transparency.

If you’re a blogger or interested in becoming one, take a look at Ambrevar’s post. Whether or not you use his method, he has a nice list of goals and things you should think about when you set up your blog.

Posted in General | Tagged , | Leave a comment

Update on the Mojave/Emacs Problem

This is an update on my post concerning the Emacs GUI not working on the macOS Majave update. There’s lots of useful information in the comments to that post so you should read those if you’re a Mac Emacs user thinking about upgrading to Mojave. Things are moving fast now. I wrote this post yesterday and I’ve had to rewrite most of it because things have changed so quickly.

Alan Third, who’s been working on the patches to fix this, reports that he’s pushed the patches to the Emacs-26 branch. Davide Restivo says that these patches are now on master as well, and I’ve verified that they have indeed been merged.

Everyone I’ve heard from who is getting their Emacs from distributions like Brew say that they haven’t had any problems (see the comments to the original post) so that’s another avenue if you need or want to upgrade now.

It appears that it’s probably safe to upgrade now but I’ll probably wait a few more days just to see what happens. There may even be an official release, although I haven’t heard anyone who actually knows what’s going on say so. I’ll probably write another update when I upgrade. I compile directly from source so if that works, everything else should too.

Posted in General | Tagged | Leave a comment

File and Directory Variables

I must admit that I seldom use file local variables. Mostly that’s because I have a standard default configuration for each file type but it’s also because I can never remember the exact format. That’s just silly, of course, because Emacs has a command to add them pretty much automatically.

The same thing is true with directory local variables but with the additional complication that I never think about using them. I have code in my init.el that checks if the current directory is ~/org/blog and if so sets certain variables and toggles things like fill-mode and visual-line-mode. That’s crazy because it’s far easier to just use directory local variables to do the same thing.

But again, I could never remember how to set up these variables. Fortunately, Marcin Borkowski (mbork) has me covered. He’s got an excellent post on how to add file and directory local variables and deal with the gotchas that come up. Really, there’s no excuse for my sturm und dang. It mostly boils down to just calling add-file-local-variable and add-directory-local-varible and filling in the blanks but be sure to read his post for the details.

Posted in General | Tagged | Leave a comment

Emacscast #5

Rakhim Davletkaliyev has posted the fifth episode of his excellent Emacs podcast, Emacscast. This time he talks mostly about blogging with Hugo but, as usual, he starts with a description of the changes he’s made to his configuration since the last podcast.

Those changes mostly involve moving from Helm to Ivy on the grounds that Helm does more than he needs and that the lighter weight Ivy better fits his needs. As I’ve said many times, I consider Ivy one of my most important packages: it’s right up there with Org mode and Magit. The other interesting item from the configuration news is his Castelmacs package, which is a minimalist Emacs configuration especially for the Mac. It’s aimed at people who have a lot of Mac muscle memory and would like to use that with Emacs.

In the last episode, Davletkaliyev said that he experimented with using Hugo and Emacs to blog and that the experiment was so successful that he switched both his personal blog and the EmacsCast blog over to the framework. In this episode, he gives the back story on his blogging and discusses how he does things with Hugo. If you’re looking for a nice blogging engine and don’t want a heavy weight solution like WordPress, you should listen to what Davletkaliyev has to say about Hugo. It appears to be an excellent solution that lets you write your posts with Org mode. It’s also the solution that Mike Zamansky just moved his C’est La Z blog (home of the popular Using Emacs videos) to so you can see three examples of the results.

The podcast is 38 minutes so you’ll have to schedule some time.

Posted in General | Tagged , | Leave a comment

Dedicated Frames

Over on the Emacs subreddit, freetonik has an interesting tip for Emacs users. The idea is to have several frames each dedicated to a particular function. It made me think of Xah Lee because he likes to work (mostly) with frames rather than windows. Really, though, it’s more like what many of us do with our window managers: we dedicate one window to, say, our editor, another to the browser, a third to things like email, and so on.

It’s a natural way to work but I don’t think I’d like it for Emacs. That may be just because it’s not what I do now and that I’d like it if I tried it but probably not. The thing about Emacs is that it’s really easy—especially with Ivy, Helm, or Ido—to find and switch to any buffer you want. In many of the cases mentioned by freetonik, I have dedicated keys to go directly to a desired buffer. For example, F6 brings up the mu4e main menu for email and Hyper+e brings up a full screen eshell.

Still, if like many of us, you’re essentially using Emacs as a window manager (because all your tasks operate inside it), it might make sense to dedicate frames to certain tasks just as we do with “real” window managers. Is anyone, besides freetonik, doing this? If so, how is it working for you? Leave us the benefit of your wisdom in the comments.

Posted in General | Tagged | Leave a comment

PSA: GUI Emacs Broken on Mojave

As all the Apple faithful know by now, Apple released the latest version of macOS on Monday. I was literally minutes away from starting the upgrade when I stumbled upon a tweet that indicated a problem with Emacs and Mojave:

I did a bit of research and the problem appears to be real. Perry Metzger, who knows a thing or two about Emacs, posted a report to the Emacs-Devel list with the same complaint. The problem is that Emacs is using a now deprecated method of drawing the screen and with Mojave it no longer works. According to the thread, there’s a not-altogether-satisfactory patch available but more work needs to be done by the people who understand that particular low-level area of Emacs.

If you’re using Emacs on a Mac, you should probably hold off upgrading to Mojave until things get sorted out. Terminal Emacs is unaffected so if you restrict your Emacs use to the terminal, you’ll probably be Okay.

Posted in General | Tagged | Leave a comment

Using Multiple-Cursors to Kill Multiple Processes

I came across this tip on reddit the other day. It’s probably not something you’ll use every day but it can come in handy when you have a lot of processes in your list-processes output and want to kill a bunch of them. This most often comes up for me when I’m having trouble pushing Git updates and end up with several hung Git processes. Mutiple-cursors is a handy way of getting rid of all of them without worrying about stepping down the list and repeatedly typing d.

It’s not going to revolutionize your workflow but, as I say, it can be a handy time saver occasionally.

Posted in General | Tagged | Leave a comment