Ivy Initial Input String

If you’re an Ivy user—and you should be—you’ve probably noticed that sometimes the Ivy prompt will have an initial “^” so that the search will be anchored at the beginning of line. This happens depending on the command that called the ivy-read routine. If Ivy guesses wrong, you can always remove the “^” or add one.

Sometimes, though, it always guesses wrong for your particular work flow. I’ve just learned from this Emacs subreddit question that you can, to an extent, control when the “^” is appended to the prompt. Actually, you can specify any string to prepend.

The decision as to what to append is controlled by the ivy-initial-inputs-alist. Again, you can easily correct the default action at the time of the call so unless you have a situation where Ivy is always guessing wrong, it’s probably not worth changing the default value of ivy-initial-inputs-alist.

Posted in General | Tagged | Leave a comment

Setting Up a Lisp Development Environment

For a language as old as Lisp, there are a surprising number of queries asking how to set up a Lisp environment. If you’re a Lisper, your answer to this is probably Emacs/Slime/Quicklisp and one of the Lisp systems such as SBCL.

Baggers, who has several videos about Lisp, posted a nice video on setting up an Emacs/Slime/Quicklisp/SBCL system. He does this on a Windows system because it’s the most difficult system to get things going on. If you’re using Linux or macOS, the process is similar but not quite as fiddly. The video covers the whole process starting with downloading a copy of Emacs, setting up slime, downloading SBCL and installing Quicklisp.

I’ve often said that if you’re looking for a great Common Lisp system, it’s hard to do better than SBCL but n00bs may find it difficult to get things set up and working. Baggers’ video is an excellent how-to for setting up a Lisp system from scratch.

Posted in General | Tagged , , | Leave a comment

Emacs Lisp Development Tools

I just stumbled across a video of John Wiegley’s talk at the 2013 Emacs Lisp Development Conference on Elisp development tools. Wiegley covers some of the tools he uses in his own development. Many of those tools will be familiar to most Emacs developers but some were new to me. Three that I especially want to take a look at are redshank, elisp-slime-nav, and workgroups.

The talk is really interesting and helpful but sadly the production values of the video are terrible. Much of the time the screen shots are out of focus or someone is walking between the camera and display. Even so, it’s worth spending the hour watching it. Wiegley, of course, is a master Elisp developer and listening to what he has to say on the matter can help you develop your own skills.

The other interesting thing is how far we’ve come since 2013. Abo-abo’s swiper/ivy/counsel was not yet available, and Wiegley’s use-package was just beginning and not nearly as powerful as it is now. That was only four and a half years ago yet I would be missing half the tools I use every day if we were suddenly teleported back to the time of the conference.

The video is just over an hour so you’ll have to schedule some time but, as I say, it’s very worthwhile.

Posted in General | Tagged , | 5 Comments

An Elisp Introduction

A couple of years ago, I wrote about Aaron Bieber’s talk to the Boston Vim Meetup on why and how he moved from Vim to Emacs. It was a great talk and worth watching if you haven’t already (especially if you’re a Vim user thinking about switching to Emacs). One of the keys to becoming a journeyman Emacs user is gaining a familiarity with Elisp. You don’t have to be an expert but you should feel comfortable doing simple tasks such as configuration.

About a year ago, Bieber wrote a post on getting started with Emacs. It’s by no means a complete introduction but it does give you a feeling for how you would go about writing a small Elisp function. Without saying so explicitly, Bieber uses an incremental or interactive approach to building the function. That is, he builds and tests a small part of it and then moves on to expanding it, again incrementally.

As I’ve said many times, this is one of the most powerful things about programming with Lisp: you can try out very small parts of your solution without having to worry about building a scaffolding for testing. If, after you read Bieber’s post, you want to learn more Elisp, Xah Lee’s Elisp Tutorial is a good resource.

Posted in Programming | Tagged , | Leave a comment

Apple's Open Office

Managers and bean counters tell themselves all sorts of pretty lies to justify open office plans. It will increase collaboration, they say. Employees will know what the rest of the team is doing and be better able to solve problems, they think. Yet, somehow, despite all the putative benefits, these managers virtually never think it’s a good idea for them. That’s because deep down they know it’s really about being cheaper and they won’t have to endure it so why not?

Sadly, Apple has joined the list of companies that should know better but don’t. Their new headquarters is going to feature open office space for engineers, developers, and other employees. The employees aren’t happy. Some of those employees say they are planning to or considering leaving the company. It’s those engineers and developers that have made Apple the success it is. Inflicting the horror of an open office on them seems like an ungrateful—and ultimately self-destructive—thing to do.

Posted in General | Tagged | 5 Comments

A Little Red Meat for Emacsers

I don’t have anything interesting to say today so here’s a little red meat for Irreal’s Emacs lovers:

Posted in General | Tagged | 1 Comment

A Personal Emacs Package Repo

As longtime Irreal readers know, I don’t worry about my init.el very much. Rather than organize my configuration into separate, function-specific files like my more organized colleagues, I just throw everything into a single init.el. I keep thinking I should at least turn it into an Org file but until then, I’ve settled for converting my package configuration to the excellent use-package.

Dave Pearson is the anti-me. Not only has he broken out his configuration into separate files, he also took all those personal functions that most of us accumulate, packaged them up, and installed them in his own personal package repository. He hosts the repository on GitHub so it’s easy for him to sync his configuration to different machines.

If that sort of thing appeals to you, Pearson has written a how-to on building your own personal repository. It’s a straightforward procedure. The hardest part is probably building the packages that hold your functions. The nice thing is that once you’ve set up the archive on GitHub (or your favorite such place) you can start converting your functions to packages and uploading them at your leisure. Again, if this sounds like something you’d like to do, take a look at Pearson’s how-to for the details.

Posted in General | Tagged | Leave a comment

Note Taking with Org Mode

Heikki Lehväslaiho has a nice series of 4 blog posts on how he takes notes with Org mode. He lists the first three posts in each entry but not the fourth; it’s here.

The last two posts are particularly interesting. He talks about how he takes notes from his Elfeed buffer and from his phone. Elfeed has some built-in methods for capturing links but Lehväslaiho’s method makes it speedy and easy. If, like me, you’re more interested in forming Org mode links, it would be easy to slightly modify his elfeed-link-title function to make the link and perhaps query you for the link description instead of using the title.

If you’re using an Android phone, Lehväslaiho shows how to get notes from the phone into an Org file using a package he wrote. Sadly, it doesn’t appear to work for iPhones

Posted in General | Tagged , | 1 Comment

WeChat

Those of you who been following Irreal lately know of my fascination with the WeChat mobile app and its use in China where it serves as a wallet and messaging service. Chinese users pay for practically everything with it, use it to access government services, and for more mundane things like haling a cab or texting a friend.

I love this idea and wish we has something similar in the West. I don’t care so much about having every function in a single app but I would like to have something like Apple Pay that worked everywhere. If I have to use the Uber app to get a ride, that’s okay. The MIT Technology Review has an interesting article asking if WeChat can thrive in the U.S.

The answer so far is maybe not. Just as Western companies often have difficulty penetrating Chinese markets, Tencent, the maker of WeChat, has had limited success in penetrating markets outside of China and what success they have had is mostly with ethic Chinese traveling abroad. Part of that is that although I can download the WeChat app, I can’t link it to my bank account so I can’t use it to pay for things. On the other hand, there are already lots of successful social and messaging apps available so it doesn’t make a lot of sense to start using WeChat. That is, the network effects of the incumbent players inhibit Tencent from gaining traction in the West just as WeChat’s dominance in China would prevent, say, Facebook from succeeding in China were the Chinese government to cease blocking it.

If you’d like to learn a bit more about WeChat, take a look at my two previous posts about it. WeChat or something like it is in our future and it can’t come too soon for me.

Posted in General | Tagged | Leave a comment

Magit Bisect Tutorial

The other day, I wrote about Guowei Lv’s two very nice tutorials on using Magit rebase. Now Lv has another tutorial out on using Magit bisect. When you’re trying to track down which commit introduced an error, the Git bisect function can greatly reduce your work (\log n versus n). I’ve used it from the command line a few times and it really helped.

I’ve never used it from Magit because I wasn’t sure how to do it and in the heat of the moment, it just seemed easier to use the command line. Lv shows, that was just silly. As usual, Magit makes using Git easier and you can do it right from Emacs.

Lv’s tutorial looks at a toy bug and first runs through the bisect process from within Magit manually. That’s pretty nice but of course you can automate the process further if you can test the commits with a script. Lv reruns the bisect process using a script for testing the commits and the process is almost completely automatic.

As with rebasing, bisecting might be something you don’t use that often. If that’s the case, it probably makes sense to bookmark Lv’s tutorial so you can refresh your memory as needed.

Posted in General | Tagged , | Leave a comment