REPL Driven Development

David Vujic has a nice post on interactive programming—what he calls “REPL driven development”—and the huge difference it’s made to his development workflow. His post, Test Driven Development Deluxe, recounts his frustration with having to switch context from the code in his editor to the terminal so he could run a test. By the time he got back to the code, he’d lost a lot of the context he’d built up while coding.

Vujic is writing in Clojure so he has the power of the REPL at his command. His editor is Emacs so it’s a simple matter to test an individual form or a whole function right in the editor. He loves the instant feedback he gets from that and how easy it is to wrap his test commands into a test function in support of his TDD workflow.

The ability to use interactive programming is one of the main reasons that I try to do most of my programming in some sort of Lisp (Elisp, Scheme, Common Lisp). I still haven’t tried Clojure, though. Maybe after taxes and the rest of the Yak Shaving gets done.

Posted in General | Tagged | Leave a comment

Fixing Two Spaces Between Sentences

Marcin Borkowski (mbork) has an interesting post on how to deal with two spaces after a sentence when transferring data from Emacs to an external application via the clipboard. The problem is that mbork likes to use two spaces so that he can take advantage of Emacs’ sentence-aware commands but most people—at least most Poles—insist, some strongly, on single spaces.

The one/two spaces between sentences is a long-standing holy war that I’ve written about before. Years after learning to put two spaces after sentences (an artifact of learning to type on an actual typewriter) I became persuaded that the one-spacers had the better story and converted to a single space. That, of course, broke the sentence-aware commands in Emacs but I didn’t mind too much. Then I discovered that, as usual, Emacs lets you have it your way. All you need do is tell Emacs how you end sentences:

(setq sentence-end-double-space nil) ;period single space ends sentence

For one reason or another, mbork chose not to use that solution and instead wrote some code to change the two spaces into one. His final solution will still have problems with code in some languages but appears to be working for him.

As well as being interesting, mbork’s post is also serendipitous. Serendipitous because his code for the changing the number of spaces echoes a point from Thursday’s post. Part of his code wants to move to the beginning of a buffer. He does that with (goto-char 0), which is incorrect because the lowest point in a buffer is 1 not 0. Nevertheless the code works. That’s for the same reason that (goto-char 1) works in a narrowed buffer: goto-char clips values outside buffer to be inside the buffer. Another example of Emacs having our backs.

Finally, mbork wonders if his strategy of using a buffer to make his transformations really makes much difference. The answer is almost certainly yes as Chris Wellons explained and I wrote about here.

Update [2021-02-13 Sat 16:56]: Used actual Elisp in goto-char invocations.
Update 2 [2021-02-14 Sun 14:49]: Added link to mbork’s post.

Posted in General | Tagged | Leave a comment

Red Meat Friday: The End of the Story

The seemingly never-ending saga of SCO versus Linux may finally have come to an end. SCO’s Darl McBride who spearheaded the effort has declared bankruptsy. If you’re too young to remember those days, it’s hard to comprehend how much the tech industry obsessed over the matter. One company that capitulated to the extortion became an instant pariah in tech circles. Groklaw, the famous Web site the controversy spawned, is still online if you want to revisit those days.

Of course, schadenfreude is always premature when it comes to this story. Just two and a half years ago the suit rose, phoenix-like, from the dead years after everyone thought the matter was settled. At this point, I’d be distressed but not surprised if the suit outlived me.

Posted in General | Tagged | Leave a comment

(goto-char 1) vs. (goto-char (point-min))

Here’s a short tip for all you Elispers that clears up an obscure point about moving around in buffers. For a long time I’ve been dimly aware that the preferred way to move to the start of a buffer is

(goto-char (point-min))

instead of the simpler

(goto-char 1)

The reason for that is obvious once it’s pointed out: if the buffer is narrowed, the first point in the buffer may not be 1. Still, it never seemed to make a difference in practice. Xah Lee comes to the rescue with a concise post that explains what’s really going on. Take a look at Lee’s post to see why either form works but it is best to use (point-min).

As a final exercise, suppose that like Lee, you decide to replace every (goto-char 1) with (goto-char (point-min)) in all the .el files in, say, your ~/src directory. How would you do that?

Posted in General | Tagged , | Leave a comment

Burner Emails

FourZeroThree has a nice four and a half minute video on how and why you should have a burner email account. The idea has been around for a long time under the name of disposable email addresses. The idea is that you never give out your real email address to Web sites or others who may abuse it. If you’re really paranoid, you might not give it out to anyone. Instead, you have a set of proxy addresses which forward any emails sent to them to your real address.

There are a number of ways to do that. The easiest is if you have control of a mail domain and can create and delete email addresses at will. Not everyone can or wants to deal with that, of course, but there are several email proxy services that let you do the same thing. Watch the video to see some of them.

It’s a good video with some useful information but you should understand what they can and cannot do. Using a burner email address will help protect you from Facebook, Gmail, and other malefactors who want to harvest and sell your personal information but it won’t protect you from the government. If you’re dealing drugs or into other illegal activities, the government will have no problems piercing a burner email veil. Most of us, of course, don’t fall into that category and simply want to keep the snoopers at bay. A burner email won’t do the job on its own but it’s a good start.

Posted in General | Tagged , | Leave a comment

Video Demonstration of Org-roam

If you’re wondering what org-roam is all about, there are a couple of useful videos over at the YouTube Emacs Elements channel. The first video explains what org-roam is and how it works. It works through a couple of examples that show how to insert links and how to reveal back links. One nice aspect of the video is that it shows how to use the org-roam capture templates to enter notes. That’s more important than it might seem because for a working Zettelkasten it’s vital that entering notes be as frictionless as possible so that you won’t hesitate to capture all your ideas and notes.

The second, shorter, video discusses some tweaks that make dealing with org-roam files a bit easier. It also shows some more examples of using templates.

These videos are a nice introduction to how one might use org-roam. You probably won’t want to use the bindings from the videos—they mostly use the Ctrl+h prefix—but that’s just a detail. The videos are 14 minutes, 16 seconds and 7 minutes, 4 seconds long so they shouldn’t be too hard to fit in. If you’re looking for an Emacs-based Zettelkasten solution, you should take a look at these videos.

Posted in General | Tagged , | Leave a comment

Emacs Editing

Over at the Emacs subreddit, WorldsEndless has an interesting post that considers Emacs as a text editor. That is, how convenient is it to edit text with Emacs, putting any of its other virtues aside. He considers both the built-in capabilities and a few of the common packages that most of us use.

What’s surprising, given the constant griping about how “Emacs out-of-the-box is unusable,” is how far you can get with just the built-in functions. Most decent editors can probably do all the things he calls out—with the possible exception of the transpose functions—but Emacs really stands out when you start customizing with the third party packages. WorldsEndless mentions flyspell-correct; some of the ace-* functions; multiople-cursors; and consult-yank-pop, which is similar to one of my favorites, counsel-yank-pop.

I, of course, have my own list. I wrote about my favorites here and here. Doubtless all you Emacers have your own favorites. The takeaway is that Emacs provides really great facilities for wrangling text. The only other editor that I’ve used that comes close is Brief from back in the MSDOS days and I wouldn’t go back even if I could.

I think it’s a fair assertion that the built-in functionality of Vim provides more functionality than the built-in functionality of Emacs but once the you add in packages Emacs is far ahead. You may or may not agree but there’s no denying that Emacs provides great text handling functionality.

Posted in Blogging | Tagged | Leave a comment

Mouseless

If you grew up with computers using a GUI interface, the idea of not using a mouse probably seems ridiculous. Why would anyone want to do that? As I’ve said in other contexts, you can live without air conditioning too but why would you? Some, like Rob Pike, have even claimed that using a mouse is faster than using a keyboard.

Emacs users, of course, famously revile the use of a mouse with their editor but likely fall back to using it in other contexts such as a browser. Sometimes, though, the choice is snatched away from you and you’re forced to live without a mouse. That’s what happened to loafofpiecrust when his mouse failed. As he reports over at the Emacs subreddit, he was in the middle of doing his homework when his mouse failed but was able to continue because he was using Emacs, probably using EXWM, and had made arrangements for mouseless browsing in Firefox with tridactyl. He notes that he found not having the mouse made him even faster.

Naturally, I was jealous. First because as a Mac user I don’t have EXWM available but also because I use Safari and don’t have tridactyl available either. It turns out though, that vimari does the same thing for Safari and bytes in has a list of similar software to allow mouseless browsing with other browsers. There’s even disable-mouse if you want to enforce mouseless editing within Emacs.

Most of us probably wouldn’t want to do away with a mouse in most situations, but it’s nice to know that it’s possible. I might try vimari out to see if browsing without a mouse is feasible. If that were to be the case, essentially all my computing could be done without a mouse.

Posted in General | Tagged , | Leave a comment

Irreal Problems

I just discovered this past week that I’m no longer getting emails notifying me of comments to Irreal posts. As far as I can tell, the problem started either with the new year or when I upgraded the Disqus WordPress plugin around the same time. If anyone else is seeing a similar problem, please leave a comment.

This has had the unfortunate effect that complaints about things like missing links went unanswered and the problems unfixed. I’ve gone through the posts manually looking for unseen comments so I think things are up to date now. My apologies to those who made substantive comments on the content of a post and were seemingly ignored.

One of the comments that I missed was from Vladimir Nikishkin who noted that the links to Irreal’s RSS feed are broken. I made a quick check of my WordPress configuration and didn’t see anything related to RSS although I did find some documentation. Is anyone else seeing a problem with the RSS feed? In the 10 years that Irreal has been running on WordPress, I’ve never before had a complaint about the feed so I’d like to make sure this is a general problem before I commit resources to hunting down a solution.

In the mean time, I’ll ping Disqus to see if they know why I’m not getting notified of comments. These sorts of problems tempt me to consider a static blog although I’m sure that would bring its own set of problems.

Afterword

Just before publishing this, I checked the “Entries feed” item on the blog menu and it does appear to be correct. Now I’m even more confused.

Posted in Administrivia | Tagged | Leave a comment

Red Meat Friday: Real Programmers Use TECO

Think you’re tough because you use Vi or Emacs? Or even ed? “Real Programmers” don’t think so.

It’s hard to see the entire text in the embedded tweet. It says,

Some of the concepts in these Xerox editors have been incorporated into editors running on more reasonably named operating systems. EMACS and VI are probably the most well known of this class of editors. The problem with these editors is that Real Programmers consider “what you see is what you get” to be just as bad a concept in text editors as it is in women. No, the Real Programmer wants a “you asked for it, you got it” text editor – complicated, cryptic, powerful, unforgiving, dangerous. TECO, to be precise.

Oddly, I know of some oldtimers who claim to still use TECO. I can’t believe they use it as their everyday editor though. Probably it’s more a matter of firing it up once in a while to keep current like I do with ed.

You can read a bit more about TECO and the other things that “Real Programmers” do at the link in the tweet.

Posted in General | Tagged , | Leave a comment