More on Mu4e

I know I’ve written a lot about Emacs and email lately but I can’t help myself—Stop me before I post again!—because there’s so much interesting material. Recently, I saw a pointer to a post from Martin Albrecht on his setup for using mu4e for email. More than most posts on the subject that I’ve seen, Albrecht has a carefully thought out, complete environment for email.

That includes such things as arranging to have email retrieved from his IMAP server on demand rather than constantly polling to see if there’s mail available, providing for footnotes in emails, using YASnippet to help generate boilerplate emails, arranging for special characters such as round quotation marks and math symbols to be used in the message body, and automatically using the correct dictionary depending on whether he is writing in English or German.

His solution for retrieving mail is particularly interesting. Rather than set a timer to have mbsync (or whatever) check for mail, he uses imapnotify to fire off mbsync when the server tells him there is mail ready. After mbsync finishes, imapnotify runs mu to index the new mail. This is how the native Mail app on macOS operates and it’s the one thing I’ve missed since moving to mu4e. As far as I can tell, imapnotify doesn’t run on macOS but it’s written in node.js (I think) so there’s probably no reason it couldn’t. Sadly, I don’t know anything about JavaScript, let alone node.js, but I’ve thought about adding a Mail app rule to fire off some Apple Script when mail arrives to do this, or perhaps using Automator somehow.

If you’re running on Linux and using mu4e and mbsync you should definitely take a look at Albrecht’s solution if your IMAP server supports IMAP IDLE. Actually, every Emacs user should take a look at his setup. It may give you a better email environment than you have now.

Posted in General | Tagged | 2 Comments

Apple Does it Again

In yet another privacy enhancing move, Apple announced that iOS 11 will no longer allow app developers to force always-on location services. If you’re like me, you became aware of this issue when Uber removed the “when App is running” option from their App’s location services so that users were forced to grant them permission to access their location at any time, whether or not the Uber App was running.

Uber claimed this was so they could figure out exactly where users were going after they were dropped off and use the data to provide better pick up services. Nevertheless, many users were uneasy with the move and some even resorted to manually disabling location services for the App except when they were actually using it.

That was an inconvenient and clunky solution that, happily, will no longer be needed. As of iOS 11, apps will be unable to disable the “only when running” option. Apple is also providing a mechanism to allow Apps to later request “always-on location services” after they have established some trust with the user. The post at the link has more details on this.

Apple deserves praise for this move and for building antitracking functionality into the new Safari. I wish other companies would be as diligent at protecting their users’ privacy.

Posted in General | Tagged | Leave a comment

Adtech Followup

As a followup to my post the other day on Adtech Progress, here’s some commentary from the EFF on the Google and Apple announcements. The TL;DR is that although the EFF welcomes both initiatives, they regret that Google, unlike Apple, has chosen not to do anything about tracking.

As I mentioned in my original post, the next version of Safari will have built-in antitracking technology. Chrome, on the other hand, will block the most annoying types of ads but will do nothing about tracking. That’s understandable, I guess, considering that Google’s business is based on Internet advertising but it should give one pause. If you live in the Apple ecosystem, this is a good reason to prefer Safari even if you otherwise like Chrome’s features. If you don’t want to do that, you should at least look into a plugin like Ghostery unless you don’t care about tracking.

Posted in General | Tagged | Leave a comment

Replacing Scrivener with Emacs

If you’re a writer who’s been using Scrivener, here’s a video on replacing Scrivener with Emacs and Org mode. The author is really a Vim guy so he’s using Evil but that’s really just a detail. His configuration as well as a link to the video is available so you can see how he set things up.

Again, it’s from the perspective of a Vim user but there’s a lot of good information. If you’re already an Emacs user and are using Scrivener or want to start a creative writing project, you should take a look at this video. It’s about 17 and a half minutes so plan accordingly.

Posted in General | Tagged | Leave a comment

Karl Voit’s Emacs Configuration

Karl Voit is an expert on organizing and storing information. One of his basic building blocks is Emacs and Org mode. It’s interesting, therefore, to see the history of how he’s organized his Emacs configuration. If you follow the link you can see how he’s progressed from an unorganized linear list of miscellaneous setq’s and defun’s to an Org-based configuration.

The impetus for moving to Org for his configuration was the growing importance of comments in his init.el. You can, of course, add all the comments you want to init.el but they’re hard to maintain because they’re hard to reformat. With Org, you just add text as usual and Emacs takes care of the formatting. The actual Elisp is in code blocks, which aren’t affected by changes in the surrounding documentation.

His current Emacs configuration is a long Org document that you can peruse for ideas. As Voit says, you don’t want to just blindly grab his configuration because some of it depends on his particular machines and environment but it is useful to see how he’s solved certain problems and what tools he’s using.

Posted in General | Tagged , | 1 Comment

Some Progress on Adtech

Regular readers know that Adtech is the general term for the technology that advertisers use to spy on us and collect information about our buying and surfing habits. It’s widespread, mostly fraudulent from an advertisers’ point of view, is a major malware vector, and is generally an unsavory enterprise. Now, finally, browser manufacturers are stepping up to do something about it.

Starting in early 2018, the Chromium browser will block ads that do not meet the Better Ads Standards. The standard does not address tracking ads but does call out some of the more annoying practices such as autoplay videos. There’s no mention of what, if anything, Chromium is planning on doing about tracking.

Meanwhile, Apple has announced that they will be rolling out changes to Safari that specifically addresses the tracking problem. It seems like a pretty sophisticated framework aimed at preventing advertisers from tracking users. You can read some of the technical details at the WebKit Blog. The new Safari will also block autoplay.

I welcome both these initiatives. Some have suggested that it gives Google (in particular) too much power but it’s still much better than the situation we find ourselves in today. As I’ve said before, I recognize that ads are the price we pay for the content we enjoy and I’m fine with the ads as long as they aren’t overly intrusive—like autoplay videos—and don’t track my browsing habits. Until the advertisers knock it off, I’m going to continue to use Ghostery and similar utilities but I welcome whatever help I can get from the browser manufacturers.

Posted in General | Tagged | Leave a comment

Importing Data from a RESTful Website into an Org Table

Charl Botha has a really interesting post on importing data from a RESTful Webservice into an Org table. He gives the example of downloading cryptocurrency trading values and updating a table showing the total value of a user’s holdings but it’s easy to imagine all sorts of useful applications for the strategy.

Besides the idea of using the request package to retrieve data from a Website, Botha also demonstrates a couple of useful techniques that I didn’t know about. The first is the cl-function macro that allows you to use the full set of Common Lisp function argument forms. You probably won’t use that very often but it’s just what’s needed for Botha’s application.

The second technique is the use of the let-alist form. That’s a new macro from Artur Malabarba in Emacs 25 that makes it easy to access data in alists in a concise and natural way. Take a look at Botha’s post for a nice example of its use.

So even if you don’t have a need to import Web data into an Org table, it’s still worthwhile studying Botha’s post for the useful techniques.

Posted in General | Tagged , | Leave a comment

Semantic Locality

I’m an old time Unix guy who’s still more comfortable on the command line than a big GUI. That’s probably why I enjoy living in Emacs to the extent possible. One of the most powerful concepts from Unix is the idea of small tools that do one thing (usually to a text stream) well and to connect those tools with pipes to do a larger, more complicated task.

I was looking through my queue of blog ideas and came across this Eric Raymond post from last March. In it, he introduces the concept of “semantic locality” as a way of explaining when and how the set of small tools operating on a text stream works. You really need to read his post to understand his argument but the TL;DR is that text stream concept works when the data has semantic locality. That is when you can do useful work on small pieces of data that are (mostly) contiguous. You can see right away why data with semantic locality is susceptible to the small tools approach. As esr points out, even more it tells you when that approach probably won’t work.

Semantic locality is really just a formalism of our intuition. Even if you’ve never heard of it, you can—if you’re an experienced Unix hand—probably decide when a pipeline is a good idea and when it isn’t. It’s useful though because it gives us a systematic way of thinking about the problem. I found the post interesting and if you’re a Unix guy or gal you probably will too.

Posted in General | Tagged , | Leave a comment

Fuco1 on Anchored Fontlocking

Matus Goljer (Fuco1) has a really meaty post on one of the dark corners in Emacs. By dark corner I mean little understood and complicated. Fuco1 doesn’t think very much of the font lock logic, depending, as it does, on regular expressions1. Never-the-less, he admits, it does work very well in practice. Fuco1 had a use case that he thought would serve as an example of a problem that the existing font lock logic couldn’t handle. When he looked into it a bit more, he discovered that the mechanism is a little more flexible than is generally believed and that it could, in fact, solve his problem.

I’ll let you read Fuco1’s post for the details. If you’re like me, you’ll probably never have occasion to need the full flexibility of the font lock mechanism but the details of his solution are fascinating anyway. It’s not documented very well so Fuco1 had to tease out the details by reading the code. Even the commentary in font-lock.el, which I read using the wonderful finder-commentary, doesn’t tell the whole story.

My takeaway from all this is that Emacs has some (more or less) hidden capabilities that the average user won’t ever stumble on and that sometimes you have to get your hands dirty and read the code to find out what’s going on. It’s yet another reason to spend a little time learning to read Elisp.

Footnotes:

1

Ironically, one of authors of the font lock package is Jamie Zawinski.

Posted in General | Tagged | Leave a comment

Some Scimax Enhancements

I’ve been seeing a lot of tweets and posts asking about how to do Python development in Emacs. There are a bunch of good solutions, of course, but one of the best resources is John Kitchin. Kitchin is a Chemical Engineering professor at Carnegie Mellon and integrates Python and Emacs into his workflow at a very fundamental level. He’s collected his solutions to integrating Python and Emacs into the publicly available Scimax package for Emacs. I’ve written about Scimax a couple of times and if you aren’t familiar with it, you should check out his posts about it.

Kitchin has just released some enhancements to the package. In a sense, they aren’t earth shattering but they do make working with Python, and iPython in particular, more enjoyable. If you follow the link, you can see Kitchin’s explanation of the enhancements but, as he says, it’s probably easier to see what’s going on by watching the video included in the post.

The thing about Kitchin’s Scimax is that he is using it everyday to do real research and write his papers. You know it has to be good because he’s depending on it for his own work.

Posted in General | Tagged , | Leave a comment