Outage

Internet access to the International Headquarters of Irreal has been disrupted due to a cable cut. Our regularly scheduled program will resume as soon as it's fixed.

Posted in Administrivia | Leave a comment

The Inevitable End of Government Surveillance

Kontra gives us a useful reminder:

Here’s the backstory from the New York Times.

Posted in General | Tagged | Leave a comment

More Font-locking Fun from Fuco1

The other day, I wrote about Fuco1’s efforts to add some context awareness to Emacs font-locking. Now he’s back with a new font-locking problem. This time, he wants to highlight interpolated variables in quoted strings in shell code. Those of you familiar with the Unix way will recall that there are two situations: variables will be interpolated in double-quoted strings but not in single-quoted strings. Fuco1 wants to distinguish the two cases by highlighting the first case but not the second. Thus we want

Foo = "bar"
String1 = "We want highlighting for $Foo in this string."
String2 = 'But no highlighting for $Foo is this string.'

This is another case where the font-locking has to be context aware: we want it in a double-quoted string but not in a single-quoted string so the context of where the interpolated variable appears matters.

As Fuco1 said in his original post, you can substitute a function for the normal regular expression controlling font-locking as long as the function has the same interface and returns as re-search-forward. Check out Fuco1’s post for how he solved the problem. If you, like Fuco1, have a refined sense of style in such matters, you can install his code and get his results yourself.

Posted in General | Tagged | Leave a comment

Xah's Tutorial on Text Properties

Xah Lee has a new page out in his Emacs Lisp Tutorial that serves as a 10 minute introduction to text properties. Text properties are one of those things that you probably won’t need to fiddle with directly unless you are writing a (major or minor) mode but you often see them mentioned in such commands as buffer-substring-no-properties, which is a common function that anyone might use to write Elisp that manipulates text. So even if you don’t use them directly, it’s nice to know what they are and how they work.

The tutorial just gives you a flavor of what you can do with properties but it links to the full documentation if you really want all the details. It’s pretty easy to deal with the properties, as you’ll see when you read the tutorial.

I haven’t written about Lee’s tutorial for some time but I thought this new page was interesting and that others might enjoy it too. Lee has done a lot of work on the tutorial since I last mentioned it and it looks pretty good and is easy to navigate. One thing I especially like is that hovering over a function will pop up the doc string for that function so it’s easy to follow the action if an example uses a function you’re not familiar with.

If you work off-line a lot or just want to help out, you can buy a copy of both the Emacs and Emacs Lisp tutorials for $25.

Posted in General | Tagged | 1 Comment

Finally!

It appears that at long last even the U.S. Senate is getting tired of the Intelligence Community’s dissembling on the abuse of §702 of the FISA act. They are insisting that they be informed of the number of Americans caught up in §702 surveillance. The answer should be essentially none because it’s against the law for Americans to be targeted.

Of course, as we know from Snowden and declassified FISA orders, thousands (or more)of Americans are routinely having their communications swept up in NSA operations. The point is, we don’t know because the Intelligence Community, despite numerous promises to do so, has refused to give the legislators the number.

The senators, finally, are fed up. They have, it turns out, a big stick to use to break the information free. Section 702 is up for renewal this year and there is a growing bipartisan willingness to hold up the reauthorization if the spooks don’t start playing by the rules. The usual suspects, of course, are trying to push through a permanent renewal with no changes but perhaps this time senators who have actually read the Fourth Amendment will prevail. One can only hope.

Posted in General | Tagged | Leave a comment

Adding Keymaps to Org Source Blocks

If you use Org mode and Babel, you know that by calling org-edit-special (bound to Ctrl+c by default) you’re put in a separate buffer that has the mode of the source block you were working in. That’s really convenient because you get syntax highlighting, proper indentation, and all the other benefits of being in a programming mode.

If you do a lot of coding in source blocks, you may find it inconvenient to always be switching into the org-edit-special mode. John Kitchin does a great deal of coding this way and decided to make his life easier by adding a keymap to the source block itself so that he could get the advantages of the programming mode without having to switch to the special buffer.

I use Org Babel a lot but I’m happy switching to the other buffer. Perhaps if I were doing it as much as Kitchin, I’d feel differently. If you would like to avoid the org-edit-special buffer, take a look at Kitchin’s post and the accompanying video.

Posted in General | Tagged , | 2 Comments

Zamansky 34: ibuffer and emmet

Mike Zamansky is back with the 34th video in his excellent Using Emacs series. This time he considers ibuffer and emmet. Most of you probably already know about ibuffer. I’ve used it since I started with Emacs and really prefer it to the default list-buffers. It turns out that it has some nice filtering and organizational capabilities that you might not be aware of. Zamansky covers these and points to a post by Martin Owen in case you want to see it written down.

The other package that Zamansky covers is emmet-mode, a fork of zencoding-mode. It’s a sort of super snippet package for HTML and CSS. It’s hard to describe so I’ll let you watch Zamansky’s video to see it in action. Arjen Wiersma has a slightly longer video that covers the same material. If you work with HTML or CSS you really want this package. There’s probably a bit of a learning curve (the cheat sheet is huge) but once you learn the basic patterns it has a certain tractive logic that makes it easier than it appears at first.

Zamansky’s video is just short of 11 and a half minutes so it should be easy to schedule some time for it while the coffee is brewing. Zamansky recommends that you take a look at Wiersma’s video too. That video is 12 and three quarter minutes so, again, it shouldn’t be hard to fit it in.

Posted in General | Tagged | 1 Comment

Using EWW as Your Default Browser (Sometimes)

As much as I like to stay in Emacs, most of my browsing is done in Safari. It provides a much better and richer experience than is (currently) possible in Emacs. Still, there are a lot of browsing tasks that are a natural fit for EWW. It’s just that I usually don’t remember to invoke it rather than a “normal” browser.

Over on the Emacs subreddit, emacsclient has nice suggestion that may work for some of you. He gives a small bit of Elisp that intercepts calls to the browse-url function and asks if you want to use EWW or your default browser. Depending on how often you call a browser from within Emacs, this may be a little distracting. Or maybe it’s just a nice way of conditioning yourself to think about using EWW more. Of course, many functions just call browse-url so perhaps emacsclient’s code is the best general solution.

Posted in General | Tagged | Leave a comment

How to Read Papers Efficiently

If you’re a researcher, or a grad student, or even just a diligent developer, you probably spend a great deal of time reading technical papers. Some of those will be of little or no use, some will be beyond your current understanding, and some will be very valuable and extend your knowledge. Piotr Limanowski has a very nice post that discusses strategies for reading those papers as efficiently as possible. Part of that, of course, is identifying which ones are worth further effort and which can be abandoned or saved for later.

Limanowski recommends a 3-pass approach in which the first two passes essentially winnow those papers worth spending time on and the final pass is where you read carefully and take notes. What I particularly like about his strategy is that he leverages Emacs and Org mode during the third stage. He uses pdf-tools to annotate the PDFs and Org mode to take notes that are linked to the PDF.

I’ve been intending to install pdf-tools for some time but the documentation says it’s not really supported under macOS so I’ve been reluctant to try. After reading Limanowski’s post, I followed the directions at the pdf-tools githup site and installed pdf-tools without a problem. It really is much better than the default Emacs PDF functionality.

Even if you’re not reading technical papers, you should take a look at Limanowski’s post. If you do anything with PDFs, it will give you some useful hints for improving your workflow. If you do read technical papers, the strategy he recommends is worth considering.

Posted in General | Tagged , | Leave a comment

More on Google's Ad Blocking

When I first wrote about the changes coming to Chrome and Safari in the Adtech arena, I noted that some observers were worried that Google’s changes gave them too much power and could be abused. It turns out that they were right to worry.

The Intercept_ article linked above reveals what’s really going on. You really should read the whole thing but the TL;DR is that this is a Google strategy to first crush their competition by blocking their ads and second to do away with third party ad blockers, at least in Chrome. As I say, you should read the whole thing.

I’ve never been a big fan of Chrome—preferring to stick with Safari—so this doesn’t affect me one way or the other but Chrome is arguably the most popular browser so it does affect a lot of people. The Intercept_ article speculates that the DOJ could get involved if Google tries to push this too far. And, of course, the EU tends to be more aggressive about policing this sort of thing. It will be interesting to see what happens.

Posted in General | Tagged | 1 Comment