A C/C++ Development Environment

It seems odd to me that people keep asking for C/C++ environments for Emacs. Odd because you’d think this would have settled years ago. I’m guessing that this is mostly about having an IDE environment, like Eclipse, for C++. A year ago I wrote about Átila Neves’ video on setting up a C++ environment for Emacs. Baris Yuksel also has a set of two videos on setting up a C/C++ environment with Emacs.

Tu Do has another useful resource. This time it’s a short guide that talks about and demos various packages that you can add to Emacs to build an excellent C/C++ environment. The post has several screen demos showing how the packages work. The guide is part of Do’s Emacs Mini Manual that I wrote about previously.

The whole Mini Manual is useful and worth taking a look at but if all you want is a guide to setting up a C/C++ environment, Do’s C/C++ guide is worthwhile on its own.

Posted in General | Tagged , | Leave a comment

Migrate Data From Evernote to Org

Although I generally avoid committing data to proprietary applications, I find Evernote useful for capturing Web articles that I might want to revisit. If it’s really important, it goes into my journal, perhaps with a link to the original site but some articles are interesting but not essential. For those, it makes sense to use Evernote because it captures a copy of the HTML so even if the site goes away, the article is still available.

Recently, Evernote announced a price increase and some folks are looking for alternatives. I don’t mind a modest price increase but there’s been some disturbing speculation about the longevity of Evernote. That’s another reason why you might want to get your data off Evernote and installed someplace else.

I’m not there yet but some people are and for them, AshyIsMe has a simple script to download your data from Evernote to Org mode. It’s not yet full featured—images are not supported, for example—but it’s a good start. If you have important information on Evernote, it’s probably a good idea to back it up to Org mode even if you have no plans to leave Evernote.

I like Evernote and hope it survives but, as I say, if you have critical data on it, it makes sense to back it up somewhere else. I hope AshyIsMe continues work on his script and makes it better. Choice is always good.

Posted in General | Tagged , | Leave a comment

Shoutout

This is a shoutout to Artur Malabarba for his excellent elisp-bug-hunter that I wrote about last year. This morning, I upgraded my packages, one of which was Org, and afterwards Emacs would not load. I was getting an error about org-link-load-parameters being a void function. That looked like some problem with Org so I wasted a bit of time trying to figure out what the problem was.

I should have known better. After a while, I remembered about elisp-bug-hunter. It’s one of those utilities that you hardly ever use and I had to look up it’s name and how to use it by hunting up my old blog post. A quick run of bug-hunter-init-file told me that the problem was really in the org-mac-link package. I just commented out the code to load it and everything was fine. The next time org-mac-link is updated, I’ll uncomment that code and be able to grab links from other OS X apps again. In the mean time, Emacs is up and running.

So, thanks, Artur. Your excellent package saved the day here at the Irreal International Headquarters and allowed us to get on with our quest for world domination. If you haven’t already loaded elisp-bug-hunter, do it right now so you’ll have it on that awful day that you need it.

Posted in General | Tagged | 1 Comment

Emacs and Vi

Al Williams over at Hackaday has a post in which he discusses the Emacs/Vi holy war and looks at the merits of each editor. It’s interesting in the way that these posts always are but I think he misses the big—or at least, most important—difference between the editors.

He mentions that Vi is modal while Emacs is not and both methods have their adherents. For some, that difference may be enough to choose one over the other but the important difference, I think, involves command composability and programmability. Emacs is programmable and Vi has a composable command set. Mike Kozlowski brilliantly explored this in a post that I wrote about previously. Vi is often considered hard to learn but the command composability actually makes it easy. When people say it’s hard to learn, they’re usually referring to the fact that they find its modality unnatural.

Williams observes that Emacs lovers are often touch typists who started programming before GUIs were popular. The touch typist part, he suggests, is because Emacs is keyboard based and its users hate to take their hands off home row. But that applies equally to Vi. Like Emacers, experienced Vi users hardly ever bother with the mouse or things like the arrow keys. They keep their hands on the home row.

I would guess that if you come from the ancient pre-GUI days, you’re equally likely to use vi or Emacs. Both are, at bottom, text based even though they both have GUI versions and at least in Emacs’ case the GUI version is a bit more capable. Williams says that the reason pre-GUI people like Emacs is because it provides a windowing system of sorts even in a strictly text-based environment. It’s certainly more capable than the traditional vi windowing and maybe even Vim’s windowing1. And, of course, you can put things other than text in an Emacs window.

As I suggested in my post on the Emacs/Vi holy wars the other day, I think that Williams’ arguments really work better as an explanation for why some people prefer Vi or Emacs over those other editors. In any event, it’s an interesting post and worth reading if you’re interested editor taxonomy.

Footnotes:

1

When I last used Vim, the windowing was pretty good but still not as capable as Emacs’. That may have changed without my noticing since I only occasionally use Vim these days.

Posted in General | Tagged , | 5 Comments

New Video in OrgMode Tutorial Series

Rainer König has posted his latest video in the OrgMode Tutorial series. This time it’s about exporting from Org mode. König begins by remarking that he rarely uses this facility, which surprised me. It surprised me because I am always exporting from Org mode. I use it for the blog posts, of course, but also for lots of other files. This once again shows how people with different needs and workflows can find a comfortable home in the Emacs world.

Although I used export a lot, I rarely export agenda type files so König’s examples were instructive for me. You can fine tune what gets exported by adding a #+OPTION: line at the top of the file. With it, you can inhibit the displaying of TODO type keywords, or you can include additional information such as scheduling data or data in drawers. Take a look at the video for the details.

König says he has about 9 more videos planned. That will be a total of about 35, which will make an excellent video introduction to Org mode. His videos seem to me to be particularly informative and useful so if you’re looking for an introduction to Org mode, this is a good place to start. They’re mostly about 10 minutes so you can watch them as you have time or even binge watch if you like.

Posted in General | Tagged , | Leave a comment

Zamansky on Elpy and YASnippet

Mike Zamansky has posted his latest Using Emacs video. This time the subject is Elpy and YASnippet. In his last video, Zamansky said he doesn’t use Elpy because it’s overkill for his purposes and also because he thought it was fiddly to set up. It turns out that it’s easy to install and configure using use-package. If you want a single package that does it all for a python environment, Elpy is definitely worth a look. If your Python use is more casual, you may be happier with the setup that Zamansky uses.

The other topic of the video is YASnippet. I use YASnippet and love it. Like Zamansky, I tend not to use it for things like for loops or class definitions but rather for large pieces of boiler plate. For example, the headers for my Org mode blog post sources are entered with YASnippet. That way I don’t have to enter the same 5 lines for each post but at the same time I can tab through the headers filling in the parameters specific to that post.

It’s easy to write your own snippets if the ones that come with YASnippets don’t do what you need. You should check before writing a new one, though, because the package comes with a bunch of snippets for many different languages and environments.

Take a look at Zamansky’s video to get an idea of how they work. As with Elpy, they’re easy to install with use-package as the video demonstrates. I know a couple of Emacs users who don’t like YASnippet but almost everyone swears by it. You should at least give it a try and see if it helps with your workflow.

Posted in General | Tagged , , | 4 Comments

Keeping Emacs and Packages in Sync Across a Team

Lakeyosemit asks an interesting question on the Emacs reddit. He says he and his team collaborate using literate programming and reproducible research with Emacs and Org mode. Recently, they’ve encountered a problem where certain experiments weren’t reproducible by all team members because different versions of Emacs and packages were being used. Lakeyosemit asks how can he keep the Emacs and package versions in sync across the team?

First off, I really love that they’re using Emacs/Org to do their work using reproducible research and literate programming. It might be a little more work for individual team members setting up a new experiment but it will certainly ease the workflow of the team. Not all teams are working on collaborative projects for which this makes sense but if you are this methodology is a winner.

I’ll let you read the responses. There are several useful suggestions including using use-package to pin packages to a certain repositories be they MELPA Stable or a local repository. No one really addressed the issue of keeping Emacs in sync but that seems to me to be pretty easy. The updates are infrequent and you can just tell everyone that you’ll be updating in two weeks. You’d probably want to make sure the new version didn’t break any before announcing an update though.

Posted in General | Tagged | 1 Comment

Making Parent Directories Automatically

Marcin Borkowski, mbork, posted a handy snippet of Elisp to automatically create parent directories if they don’t already exist. It’s similar to mkdir -p in that if intermediate directories don’t already exist they are created for you.

That turns out to be easy because the Elisp function make-directory will do this if the second argument is non-nil. All you need do add a hook function to find-file-not-found-functions that calls make-directory with the required non-nil second argument. See mbork’s post for an example of the simple code needed to do this.

Posted in General | Tagged | Leave a comment

SICP in Info

Those of you who have been around for a while know that I consider Structure and Interpretation of Computer Programs (SICP) one of the best—if not the best—computer science books ever written. I was an experienced software engineer when I first read it and I still learned a huge amount from it.

If you haven’t read it, you really owe it to yourself to do so. It’s really about more than Lisp so even if you’re not a Lisper, it’s sure to teach you a lot of wonderfully useful things. There’s a lot of resources for it including a cleaned up PDF and EPUB3 but a good place to start is the original book in HTML that the authors and MIT press put up. In 1981, Abelson and Sussman gave a series of lectures at HP based on the book. You can get videos of those lectures here. I can’t recommend that you watch them enough.

The point of this post is that now you have another way of reading the book: it’s available as an Info file that you can load from Melpa. Load the file and you can enjoy SICP from the comfort of Emacs.

Posted in General | Tagged , , | 3 Comments

Org Template for Specification Documents

Karsten Schmidt published a really nice template for producing great looking specification documents. The result looks like this. Here is the Org document that produced that output. The whole project, including the CSS style sheet is on GitHub.

You may or may not be interested in producing specification documents but the template is valuable regardless because of the many techniques that it demonstrates. For example, the Changes since last version section is generated automatically from the git commits since the last version.

All the diagrams are generated on-the-fly using Org-babel. One nice feature is that the styles for the diagrams are specified separately from the content of the diagrams using literate programming techniques (see the Diagram definitions section in the Org file). That means that if you have multiple, say, dot diagrams, they will all have the same style features and that if you want to modify the style you can do it in one place for all the graphs.

If you read the exported HTML document along side the Org document carefully, you will almost certainly learn some valuable tricks. If your CSS skills are as poor as mine, reading over the style sheet will also show you some nice techniques.

The template puts me in mind of the AT&T memorandum cover sheet that Troff produced (here’s an example). All that boiler plate on the first page is generated automatically much like a great deal of Schmidt’s document is generated automatically from the input text. You can easily adapt this template for use in whatever recurring documents you produce so it will more than repay the study you devote to it.

Posted in General | Tagged , | Leave a comment