Zamansky 18: Narrowing and iedit

Mike Zamansky has his latest video up. This time it’s on iedit and narrowing. For narrowing, he uses Artur Malabarba’s narrow-or-widen-dwim package. I love this package and you should definitely be using it too. It makes narrowing really easy and you don’t have to remember all the different key sequences associated with the narrowing commands. It’s a real win.

The other half of the video is about iedit. This command lets you edit every instance of a symbol—or more generally, any sequence of characters—at the same time. Zamansky’s video is an excellent demonstration of its functionality. If you’d like to see it used in a real-world example, take a look at this post from abo-abo that I wrote about previously. If you haven’t seen it before, it will astound you.

One problem with iedit is that it works on an entire buffer, which sometimes includes too much. That’s where narrowing comes in. You can narrow to a region or function, say, and have iedit act on just the narrowed portion of the buffer. Again, Zamansky gives a nice demonstration of this.

This is an excellent video and only nine and a half minutes long so it’s easy to schedule time to watch it. If you aren’t familiar with iedit or narrowing, you can consider it a must see.

Posted in General | Tagged | 1 Comment

The EOS Org Mode Configuration

Yesterday, I wrote about Lee Hinman’s EOS Emacs configuration and mentioned that because the configuration is factored into modules, it’s easy to adapt them to our own configurations. An example of this is Hinman’s Org Mode configuration. It’s a treasure trove of configuration items that I didn’t know about but that can be very useful.

One example, that I immediately implemented, is the org-special-ctrl-a/e variable. By setting that to t, Ctrl+a and Ctrl+e will ignore stars and tags when moving to the beginning and end of a header line. A subsequent Ctrl+a or Ctrl+e will move to the absolute beginning or end of the line.

There are several other similar useful configurations and if, like me, you do a great deal of your work in Org mode, you’ll want to implement some of them yourself. In general, if you’re an Org user—and you should be—you should definitely take a look at Hinman’s configuration. As I say, it’s full of good ideas.

Posted in General | Tagged , | Leave a comment

Living in Emacs

As you know, I’m fond of the notion of living in Emacs to the greatest extent possible. For me, that’s an ongoing process much like a Japanese garden: a process that is always seeking perfection but that is never complete. Others, like Lee Hinman, have made better progress.

Hinman calls his Emacs configuration EOS, The Emacs Operating System. It’s a thing of beauty. He has modules for nearly every component of his workflow—even most of his Web browsing. Those modules are written in Org mode with lots of explanatory text to help you understand what’s going on.

The module setup is nice because it allows you to choose the parts that support your workflow while ignoring the rest. If you’re not a Twitter user, for example, you can just ignore that module. Most people probably won’t want to use EOS out of the box but its module structure and internal documentation make it easy to adapt. If you have a minimal configuration, a good strategy would be to clone EOS, make the changes that are sensible for your workflow, and then install it. If you already have an extensive configuration, Hinman’s configuration will serve as a model for rationalizing your configuration’s structure and as a source of ideas for additions to your configuration.

Even if you aren’t interested in moving your life into Emacs, Hinman’s configuration is worth looking at for the many ideas you can mine from it. It’s an excellent resource.

UPDATE [2016-11-01 Tue 11:08]: Forgot to mention that I found the EOS link from this tweet by Arne Babenhauserheide

Posted in General | Tagged | Leave a comment

Overlays

Xah Lee has an interesting post on overlays. Overlays are not something that a user needs to worry about; they are a means of altering the display of certain areas of a buffer and are therefore a concern only for the Elisp coder. A common example is Magnar Sveen’s excellent multiple-cursors package. It makes use of overlays to show the multiple cursors and altered highlighting.

Lee’s example shows how to temporarily display certain lines in a buffer with a bold face but the real value of his post is that it serves as a nice introduction to working with overlays. If you’re an Elisp coder and haven’t worked with overlays, take a look at his post. It will serve to get you going.

Posted in General | Tagged | Leave a comment

Dennis Ritchie Day

Tim O’Reilly declared today, October 30, as Dennis Ritchie Day. That was five years ago but nonetheless we should all pause and consider how much Ritchie affects our life and work. He was a giant and we should give thanks that he spent some time with us.

Posted in General | Tagged | Leave a comment

Zamansky Discusses Miscellaneous Packages

Mike Zamansky has a new video up. This time it’s about a few of the miscellaneous packages he uses. He covers

  • Highlight line mode
  • Beacon mode
  • Hungry delete mode
  • Expand region

I use two of those and the others are compelling enough that I may try them out.

The video is just short of 11 and 3/4 minutes so it’s easy to watch during a coffee break. As always with Zamansky’s videos, you’re sure to learn something so it’s definitely worth your time.

Posted in General | Tagged | Leave a comment

How to Fix Swiper Search Failure

I woke up yesterday and started working only to become sad. As soon as I tried to do a swiper search I got the error

Wrong type argument: window-live-p

I’ve come to depend on swiper and hated to be without it. It’s all Zamansky’s fault; his Searching a Swiper video got me hooked and now I can’t live without it. I compensated by using isearch-backward, which is still bound to Ctrl+r, but I was bummed to be without the swiper functionality.

I thought that abo-abo would have it fixed pretty quickly but when a day went by without resolution I did a little investigation. It turns out that it’s easy to fix this. I deleted and reinstalled both swiper and counsel and everything started working again. It may be that one or the other of them is sufficient but the whole operation for the two of them at once was so fast I’d just reinstalled them both.

Posted in General | Tagged | 2 Comments

Consumers Win One

Yesterday, in my post about AT&T, Time Warner, and the Iron Law of Data Collection, I complained that in all whining about what an unfair advantage AT&T/Time Warner would have in advertising, little notice was taken of the fact that the data in question doesn’t belong to AT&T, it belongs to their users. In a rare victory for consumers (at least here in the U.S.) the FCC has agreed and passed a regulation to the effect that ISPs and carriers can not sell or use consumers’ viewing information without their permission.

Naturally, the media and communication companies are upset and we will doubtlessly see law suits and lobbying to try to get the ruling overturned. It doesn’t go into effect for a year so consumers may never see the benefits of the ruling. That would be a shame. The carriers are all in on the common carrier provisions that let them regard the information they’re carrying as an opaque bit stream for whose content they can’t be held responsible. But ask them to please not spy on that bit stream and suddenly it’s valuable proprietary information.

But I shouldn’t be peevish. At least for now consumers can expect to enjoy a little bit of privacy and the ownership of their viewing and communication habits.

UPDATE [2016-10-29 Sat 13:55]: The FCC has a fact sheet about the ruling.

Posted in General | Tagged | Leave a comment

The Iron Law Strikes Again

It’s been a while since I’ve written about the Iron Law of Data Collection. That’s the idea that when the Government collects data, regardless of the stated rationale, there will inevitably be mission creep that sees the data being used in new, unintended ways and that it always leads to abuse. It turns out that the law applies to organizations other than the government.

In the same post linked above, I noted that If the data is there, anyone with an interest in exploiting it will demand access. Those interests are not limited to law enforcement and public safety concerns. Media companies plan to ask U.S. regulators to force AT&T to share the huge store of customer use data that they’ve been collecting since 1987 through their Hemisphere program. Although the data is often shared with law enforcement, without warrant but for a fee, the purpose of the Hemisphere program is to monetize that data.

With AT&T’s proposed acquisition of Time Warner, media companies are whining that the data will give AT&T/Time Warner an unfair advantage in targeted advertisements and are demanding that regulators force AT&T/Time Warner to share that data with them. Notice how the notion that that data doesn’t really belong to ATT&T in the first place—it’s the viewing/texting/calling history of its customers—doesn’t come into play here. The data is there, it’s exploitable, and all the players are demanding access.

In a just world, it would be against the law to collect (or at least to store indefinitely) that information but then law enforcement would have to deal with getting those pesky warrants when it wanted to check on whom we’ve been communicating with. Worse, the other carriers, who do periodically purge their records, will see their customer data as exploitable and also begin storing it long term.

It’s the iron law. Once that data is collected it will be used in ways that we find objectionable. The only solution, as I say in every iron law post, is to prevent that collection in the first place. The carriers should collect that data only for billing purposes and purge it as soon as the bill is paid. Of course, that’s not going to happen because exploitable.

Posted in General | Tagged | Leave a comment

A Literate Programming Example with Org Mode

Arne Babenhauserheide has posted a nice example of literate programming with Org mode. It’s a bare-bones example but shows what you can do including stitching code blocks together.

Using Org mode for literate programming probably isn’t as powerful as something like Knuth’s CWEB but it does have the advantage of working with just about any language and of running the code directly from the (untangled) source file to insert results directly into the document.

Even if, like many people, you don’t care for the literate programming paradigm, the idea of combining code and narrative is still very powerful. The approach used by (for example) John Kitchen to embed the code used for calculations and figure generation is a huge aid in reusing results, calculations, and figures and is a significant step towards reproducible research.

In any event, take a look at Babenhauserheide’s example. It may give you some useful ideas and it certainly serves as another demonstration of the power of Org mode and Babel.

Posted in General | Tagged , | 1 Comment