MacAdie’s Go To Emacs Commands

Eric MacAdie is probably familiar to many Irreal readers from his reports on the EmacsATX meetings. His latest post recounts his history with Emacs and includes a list of the Emacs commands that he got by with for most of his more than twenty years of using it.

Like a lot of Emacs users, he started out using only a tiny bit of Emacs’ power. It even sounds from his post as if he started Emacs every time he wanted to edit a file and then exited afterwards. Of course, judging from all the complaints one sees about Emacs startup time, folks are still doing this.

After his auspicious beginning with Emacs he changed jobs and became a Java developer. With that came a period of apostasy in which he defected to jEdit. Happily, he returned to the one true editor and is now active in the Emacs community.

The list of commands that he depended on for many years are pretty much what you’d expect. There’s the standard navigation commands, some window manipulation commands, and the simple search commands.

One thing that struck me is that he uses the Esc key method for Meta. In the old days some keyboards didn’t have an Alt key to serve as Meta so they used the Esc convention. Those days are long over but some people—even experienced Emacers like Mike Zamansky—still prefer it.

In any event, the post serves as another quick introduction to Emacs along with some reasons why you might want to try it out.

Posted in General | Tagged | Leave a comment

One Last Time With Marking The Active Window

I thought I was finished writing about marking the active Emacs window so that it stands out. It all started with my post on James Dyer’s method of placing a red line on the left hand fringe. I liked his solution but thought that simply coloring the mode line would be better.

Ignacio Paz Posse left a comment to that post showing that it was actually very easy to do. I immediately tried his solution and thought it was perfect. Since then, three new things have happened or come to light.

  1. Sacha Chua also implemented Posse’s solution. She chose a light blue (bg-blue-subtle) that looks nice but doesn’t stand out enough for my taste.
  2. I changed the color I was using from dark goldenrod to goldenrod. It still stands out but isn’t quite as dark and doesn’t swallow the non-black foreground colors as much. I also changed the attribute from mode-line to mode-line-active. I think I understand why just mode-line works but it’s nice to be precise when you can be.
  3. Dyer rewrote his code to fix a conflict with visual-fill-column-mode. That was easy so if you like the idea of marking the active window with a left red fringe. his post explaining the fix is here.

In any event, there’s no reason to live with the hard-to-discern gray/light-gray default. As far as I’m concerned, something more distinguishable should be the default but I can only imagine the uproar that would result if that default were changed.

Posted in General | Tagged | Leave a comment

A Paean To Emacs

Mario Jason Braganza over at Janusworx has what amounts to a love letter to Emacs. Three and a half years ago, he started using Emacs. His post is a list of “If you had told me then”. Some of them, such as using Emacs as his primary editor nearly everywhere, are obvious and conventional and could be said of any editor that a user has committed to.

Others, such as Emacs is not an editor but more like a whole computer with an editor bolted on, is much more specific to Emacs. He also notes that Emacs is not just for writing but can be used for tasks not related to writing such as using Org mode to organize his life and keeping what he calls his “commonplace book”.

He lists other, more complicated tasks as well but the point is the same: if you told him three and a half years ago that he would be doing these things with Emacs, he would have thought you were crazy. He ends his post with a wish for three and half more decades of the delights of Emacs.

Posted in General | Tagged | Leave a comment

Org Mode Island?

I ran across this post from Jeremy Friesen that was in response to another post by Jack Baty. The TL;DR is that Baty has been doing more and more of his writing in Org mode and this somehow makes him feel lonely as if he were trapped on an (org mode) island.

This got Friesen thinking about his own Org mode use and the bulk of his post is an explanation of how and why he uses Org for his writing. His conclusion is much like mine: all his writing starts out in Org mode and is exported to other formats or applications as needed.

I didn’t understand exactly what Baty was complaining about. It seems to me that using Org is the opposite of being on an island. Yes, you write in a single language—much as most people speak primarily in a single language—but you can export that writing to virtually any format you need. It’s more like being in a big city where you can get anything you want than being on an isolated island.

In response to Friesen’s post, Baty wrote a follow-up post in which he clarified what he meant by feeling isolated in Org mode. As far as I can tell, what it means is that it makes him feel trapped in Emacs because you can’t really use Org effectively anywhere else. Again, I don’t understand. If you don’t like Emacs, that makes a kind of sense but Baty says he loves Emacs. So what’s the problem?

My problem is actually the opposite. Every time I have to write something somewhere besides Emacs/Org-mode, I feel like I’m stranded in a strange land where nothing works as it should.

Posted in General | Tagged , | Leave a comment

Marking The Active Window Redux

Just the other day I wrote about James Dyer’s solution for marking the active window so that it’s immediately obvious which window has focus. In that post, I said that although Dyer’s solution was a good one, I thought that simply having the background color of the active window’s mode line something other than a slightly different shade of gray would work just as well and suit me better.

Ignacio Paz Posse to the rescue. In a comment to the post, he says that changing the background color of the mode line is exactly what he does and added a snippet of code to do just that. Since this is Emacs and since I was, of course, reading the email notification of his comment in it, I simple put the cursor at the end of the code snippet, typed Ctrl+x Ctrl+e, and just like that my active window’s mode line was dark goldenrod and stood out from the other windows.

The background color of my windows are a light tan (oldlace) so goldenrod was, serendipitously, just perfect. The code

(set-face-attribute 'mode-line nil
:foreground "black" :background "dark goldenrod" :box '(:line-width 1 :color "black"))

is simplicity itself. Because of Prot’s video, I assumed that even a simple change like that would be tricky but happily it’s straightforward. In any event, if you want a mode line that sticks out more than the standard dark gray, this is how to do it. You can adjust the color to fit your color scheme.

One more point worth mentioning is how easy it was to test this. As I said, I simply evaluated the code in the email and the changes took place immediately. That’s one of Emacs’ secret powers: if it’s Elisp and it’s in a buffer, you can execute it and see the results immediately without worrying about copying or other applications.

Posted in General | Tagged | Leave a comment

Developing In Difficult Places

Over at Bite Code! there’s a post that I found really interesting. It’s about doing software deveopment or training in difficult places. “Difficult places” means places lacking the usual computing infrastructure or having a hostile political or geographical environment. The post describes what to pack and how to prepare for an assignment in one of those places.

One of the author’s main points is that you can’t depend on anything being available at the destination so you have to take everything you could possibly need—actually at least two of everything you might need—with you. That means even high end items such as laptops but also mundane items such as soap, paper and pens, cables, power strips, adaptors, and personal hygiene items.

You should, he says, expect that at least one of every type of item you take will be lost, stolen, confiscated, or broken. For that reason, you have to keep duplicates in different places. At the same time, you shouldn’t take anything that you can’t afford to lose.

Trust me when I tell you that I have no desire for such work. The joke in my family is that my idea of roughing it is poolside at the Hilton. Still, I find the post fascinating. The idea of having everything I need with me wherever I am appeals to me. It’s probably why I never go anywhere without my phone, laptop, and iPad.

I tagged this post “Emacs”, even though Emacs is never mentioned in the Bite Code! post, because Emacs in many ways exemplifies the same mindset. It packs all the documentation and tools you need in a single package.

That’s not quite true, of course, especially if you’re developing in something other than Elisp but the point stands. If you have Emacs and the appropriate packages, you have most of what you need for your day-to-day work. It doesn’t include every version of Python as discussed in the Bite Code! post but it does take you a long way and it doesn’t depend on an external connection, the cloud, license servers, or any of the other things that the post tells you to avoid for work in difficult places.

Posted in General | Tagged , | Leave a comment

Not A Text Editor

Here at Irreal, the minions and I are still decompressing from Christmas so this will be another short post. Troy Fletcher has a silly and lighthearted video on Emacs not being a text editor. The TL;DR is that Emacs is not (just) an editor but nearly everything else.

The video is an explication of all those other things. It’s not an editor, it’s an operating system. It’s not an editor, it’s a file management system. It’s not an editor, it’s an entertainment system… And on and on. Even though it’s a bit silly, it is a good rendition of many of the things that Emacs can do besides editing text.

The video is 28 minutes, 58 seconds long so there’s more to say than you might expect. The most distracting thing about it is that the inset of Fletcher is a split screen with two different views of him talking and gesticulating. I don’t know if that’s a normal part of his videos, a technical glitch, or another special piece of irony for the video.

In any event, if you have a half hour to kill, you might enjoy watching a video devoted to why Emacs is awesome.

Posted in General | Tagged | Leave a comment

Marking The Active Window

I use the default mode line and am mostly happy with it except that the difference between the mode line of the active window and the other windows can be hard to discern. I know I could make myself a custom mode line like Prot did that makes the active window obvious but I’m not a fan of bling and it always seemed more trouble than it’s worth.

Still, it would be nice to have the active window clearly marked. James Dyer had a similar problem and found a nice solution. His idea was to color the left hand fringe of the active window red. That turns out to be pretty easy as you can see from his post.

Another, possibly better, solution is to set the background color of the active window’s mode line to a different color. That’s what happens now, of course, but I have in mind something a little more distinctive than slightly different shades of gray. In theory, that shouldn’t be too hard but as Prot showed messing around with the mode line is trickier than you might think.

In any event, take a look at Dyer’s post for one good solution. There are doubtless others so feel free to leave a comment if you have one.

Posted in General | Tagged | Leave a comment

Custom Emacs Command Line Flags

I’m writing this on Christmas day so the festivities mean that I don’t have as much time as usual available for writing this post. Happily, I came across this post by Norman Walsh in which he mentions a fact that I didn’t know and you probably don’t either. It turns out you can define custom flags for the Emacs command line.

That’s pretty easy to do: You just add a (flag . handler) cons to the command-switch-alist variable. You can see an example of it in Walsh’s post. You might wonder why you’d want to do that. Walsh gives one use case in his post but it probably always boils down to wanting to perform some special, optional configuration when Emacs is started.

Wash’s post isn’t so much about that ability as it is the use case he has for it. It’s a short post and worth a minute or so to read.

Posted in General | Tagged | Leave a comment

Holding NSA’s Feet To The Fire

Senator Ron Wyden is on a tear. It’s probably not fair to describe him as the only legislator fighting for the fourth amendment in the face of fierce opposition from various law enforcement agencies but he’s certainly the most prominent.

His latest crusade is to get the NSA to come clean on their Fourth Amendment skirting program to purchase Americans’ location information from commercial data brokers. He not even asking them to drop the program, just to release the details of what they’re doing. The NSA, of course, is having none of that and is refusing to comply.

Wyden is responding by holding up the confirmation of the NSA’s new director, Lieutenant General Timothy Haugh. Wyden is quick to say that he has nothing against Haugh: he just wants the NSA to answer his questions.

The information isn’t even classified. The NSA is relying on the fact that it’s marked “Controlled Unclassified Information” (CUI), a made up designation with no legal basis. Rather it’s something that President Obama decreed into existence with an executive order.

Questions of what information agencies such as the NSA should release are difficult. On the one hand we want them to protect the country. On the other, we don’t want them trampling citizens rights while they’re doing that. In this case, it’s pretty clear that the reason to withhold the information is to avoid embarrassment and blowback from the citizenry. When the information is needed for legitimate purposes, the government should get a warrant as they’re supposed to. But that’s such a bother. Easier just to buy it and refuse to admit what you’re doing.

Posted in General | Tagged | Leave a comment