What We Need In An Editor

Vivek Haldar has an interesting post in which he asks, essentially, what we need in an editor. He remarks that most people seem to want an editor that “looks good” and has certain performance and feature aspects that no one can agree on.

Haldar notes that other than having a readable font and decent syntax coloring, the “look” of an editor doesn’t matter. None of that will surprise the average Emacs user but he does make a point that we Emacs aficionados seem to understand subconsciously: like fine wine, a good editor is an old editor. That serves as a welcome riposte to the oft stated criticism that Emacs is old technology and that modern and presumably hip developers are using something with lots of dialog boxes and whatnot. Of course, the point is that Emacs has been around long enough to adapt to its users and their needs.

His Emacs user taxonomy is also interesting. I don’t agree with every classification but I do think he was it mostly right. What do you think? Do you recognize yourself in one of his categories?

Posted in General | Tagged | 4 Comments

Learning Elisp

Xah Lee has an excellent post on learning how to program in Emacs Lisp1. His idea is to start with your favorite programming mode, disable it, and program your own. Begin with just doing syntax coloring and then slowly add features as you need them. Over the course of, say, a year you will build a robust mode for your language and learn a ton of Elisp.

I find that the best general method for learning a piece of technology is to use it to solve a problem. If you have some editing problem that needs solving, then try to do it with Elisp (Lee’s Elisp Tutorial can be a huge help here). If you don’t have some problem you need to solve but just want to learn Elisp so that you can make better use of Emacs then Lee’s suggestion of implementing a major mode for your favorite programming language is a good one. It may take some time but you don’t have any problem—urgent or otherwise—to solve so time shouldn’t be an issue. Either way, you’ll end up learning a lot of Elisp and be able to use it to make more effective use of Emacs.

Update: Lee notes in the comments that he has made this post into a separate page that you can find here.

Footnotes:

1 With Lee’s current blog there is no way of linking to a particular page. Go to his blog by following the link and search for “2012-11-03 ” to find the How Do You Actually Learn Emacs Lisp and Do Something with It? post.

Posted in Programming | Tagged , | 2 Comments

Apple’s Poisonous Touch?

As regular Irreal readers know, I mostly avoid the tech wars and especially tech wars involving Apple. I use Apple products and like them very much. I also use Linux, FreeBSD, and various other platforms so although I admit to admiring Apple products, I don’t think it accurate to describe me as a fan boy. Nonetheless, a recent Register article has such an outrageous headline that I’m forced to leap to Apple’s defense.

The article in question is headlined Apple’s poisonous Touch silently kills the GNOMEs of Linux Forest. That’s a lot of red meat so you might think it’s about Apple sending out their covert operations ninjas to sabotage the powerful GNOME opposition. But no. It turns out Apple’s dastardly plan was to do UIs correctly. By unfairly realizing that tablets and laptops have different UI needs and failing to conflate those needs into a single desktop environment, Apple poisoned the GNOME project.

Seriously? That’s what the Register calls “Apple’s poisonous touch?” Actually, the article itself is a reasonable exposition of the difficulties that the GNOME project finds itself in and the reason for those difficulties. It hardly mentions Apple at all except as an example of doing things right. GNOME’s problems are of their own making just as they’ve always been. Apple has nothing to do with it.

Judging from the disconnect between the headline and the article itself, it’s likely that the sensational headline was written by an editor with a feverish imagination rather than the author himself. No matter. At the end of the day the Register bears responsibility for an outrageous and irresponsible headline. If you were wondering why the technical press is so often the object of ridicule, now you know. I can hardly wait to hear what Gruber has to say.

Posted in General | Tagged , | Leave a comment

DOS Amplification Attacks

Matthew Prince over at the CloudFlare Blog has a nice post on DNS Amplification DDos Attacks. He starts by explaining that DNS amplification attacks are descendants of the old Smurf Attacks. He goes on to show how they work and what steps everyone running a DNS server should take to help prevent them.

An interesting post for anyone who’s wondered how these attacks work or how CloudFlare manages to deal with them. Definitely worth a read.

Posted in General | Tagged | Leave a comment

SBCL 1.1.1 Is Out

Steel Bank Common Lisp 1.1.1 is out. As usual, compilation and installation were a snap. Out of irrational paranoia I always run the verification tests after I compile. Of course, everything was fine: all the tests except those expected to fail performed as expected.

This version fixes some bugs, adds some enhancements for the SPARC platform, and adds experimental threads for the Windows platform. You can see the details in the release notes.

I’ve been using version 1.1.0 without any problems since it came out and expect similar results for the new version. Updating is so easy (even if you compile it yourself) that there’s no reason to delay. Download the sources or binary from the SBCL Download page and start Lisping.

Posted in General | Tagged , | Leave a comment

Elnode Video

Nic Ferrier’s Elnode project is a great example of the power that Emacs and Emacs Lisp can deliver. Its almost unbelievable that you can run a Web server inside Emacs, but that’s what Elnode does. Once again we see in Emacs the echo of the Lisp Machine.

Nic has put up a video that shows off some of its capabilities as well as how to install and configure it. He also has a longish post on his blog that describes Elnode, its capabilities, and its performance. It’s available from Marmalade so installation is a snap if you’ve like to try it out.

Posted in General | Tagged | Leave a comment

Recursive Input to query-replace

The other day I needed to change all occurrences of a certain Unicode character with another in a large file. No problem, I thought, I’ll just fire off a query-replace and be done. Of course, now I had to enter those two Unicode characters to the query-replace prompt. My usual way of entering Unicode characters is with 【Ctrl+x 8】 but that didn’t work because I was already in the minibuffer. Grrrr.

After a moments thought I brought up the *scratch* buffer, put the two characters in it with my usual 【Ctrl+x 8】 procedure, loaded the characters into a couple of registers, and used the registers to give the characters to query-replace. Even granting that needing to do this is a rare occurrence, that was a singularly terrible solution.

In my shame, I started thinking of better ways to do it. The first thing I realized was that the registers were silly (I had just been using a register for something else and they were on my mind). Instead, I could have merely copied the two characters into the kill ring with 【Meta+w】 and then used 【Ctrl+y】 and 【Meta+y】 to give them to query-replace. Still not a good solution but better than the nonsense with registers.

Finally, I remembered my previous post on making the minibuffer recursive. When I wrote about that I set enable-recursive-minibuffers to t but because I didn’t use it in my day to day work I never added it to my init.el. Too bad. Once I re-enabled the recursive minibuffer processing I was able to do what I wanted in the first place: fire off query-replace and then enter the characters with 【Ctrl+x 8】. The very next thing I did was to add it to my init.el.

Again, entering Unicode characters in the minibuffer is not something I do very often but when I need it, this is a great solution. Does anyone know of a better solution?

Posted in General | Tagged | 4 Comments

Securing WordPress Sites

WordPress.tv has an interesting video by Chris Wiegman of bit51 entitled Securing WordPress is Easier Than Making Coffee. If you have a WordPress site this is worth an hour of your time. He begins by showing how a seemingly trivial plugin can open you up to an easy exploit requiring no more than Chrome. Wiegman says that the core of WordPress is actually pretty secure but that poorly written themes and plugins can make you vulnerable.

I particularly liked the section about tools. Wiegman discusses several tools that you can use to check your site, back it up, and harden it against exploits. Many of these are free so even the casual blogger can afford to be protected.

Again, there’s a lot of useful information in the video and it’s worth watching.

Posted in General | Tagged , | 1 Comment

Remapping the Caps Lock Key

Read any article on optimizing your workflow with Emacs and odds are the first recommendation is to remap 【caps lock】 to 【Ctrl】. For as long as I can remember, the first thing I’ve done when setting up a new machine is to remap the caps lock key. I did this long before I started using Emacs—not because I was worried about RSI issues but because I was tired of hitting 【caps lock】 instead of 【Tab】 and getting a bunch of unwanted capital letters in my text. For me, the remapping was simply a way of turning off the caps lock function. (Why are they still putting that key on the keyboard, anyway?)

Recently I decided to try actually using 【caps lock】 as 【Ctrl】. It hasn’t been easy. After years of bending my pinkie down to the standard 【Ctrl】 key, it felt unnatural to use 【caps lock】 instead. After a few weeks, I’m finally getting used to it and except for occasionally mixing up 【Shift】 and 【caps lock】, I’ve pretty much retrained my muscle memory.

Actually, I’ve discovered that having two control keys is handy. For most key sequences modified with 【Ctrl】, I used the 【caps lock】 key but when the sequence is modified by both 【Ctrl】 and 【Meta】 (such as 【Ctrl+Meta+f】 to move forward by a sexr) it’s convenient to use the standard 【Ctrl】 key.

If you’ve remapped 【caps lock】, what was your experience? Did you have a hard time getting used to it or did it seem natural to you right away? My difficulties may be the result of using the standard 【Ctrl】 key for so long. In any event, I’d be interested in hearing about other people’s experiences.

Posted in General | Tagged | 13 Comments

More on Setting the Emacs Frame Height

I got some really great comments to my Setting An Emacs Per-System Height post. If you are interested in automatically sizing your Emacs frames you should definitely take a look at them. Not all the suggestions are OS X specific so there’s good information no matter what platform you are using.

Unlike many people, I like to keep all my Emacs configuration in a single (init.el) file. Even so, I really liked this suggestion from Mark Hepburn: keep your system-specific and platform-specific configurations in separate files. So I put the configuration specific to my laptop, manfred, in a separate file (manfred.el) and similarly for aineko. Then I inserted

(load (car (split-string (system-name) "\\.")) t) ; load adds suffix

into my init.el to automatically load the system-specific configurations.

Similarly, rather than having commands such as

(when (macp)
  (setq ping-program-options '("-c" "4")))

scattered throughout my init.el, I put all those configurations into darwin.el and added

(load (symbol-name system-type) t)

to my init.el file.

This has the advantage of being easier to manage. Rather than constantly updating init.el to account for new systems or platforms, I need only add a <system>.el file and perhaps a <platform>.el file to a new machine. So far, I’m considering this an experiment but it feels right to me.

Posted in General | Tagged | Leave a comment