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

Searching all Opened Buffers

Abo-abo has a post on swiper-all that everyone using swiper should read. It turns out that there’s a command called swiper-all that will perform the swiper search on all opened buffers. That is, on all buffers associated with a file. That’s a tremendously useful facility and if you have swiper installed you already have it. You can call it with 【Meta+xswiper-all or, if you think you’ll use it a lot, you can bind it to a key sequence.

If you aren’t a swiper user, take a look at Mike Zamansky’s video on searching with swiper to see how it works. You can also check out the swiper GitHub site and the documentation. I’ve been using it for about a month and really like it. Discovering swiper-all just makes it better.

Posted in General | Tagged | Leave a comment

Suggest

Wilfred Hughes has contributed a cute and potentially useful package that he calls suggest. The idea is that you’re looking for an Elisp function to perform a particular calculation or transformation but don’t know the function’s name. Suggest asks you for an input and the desired output and then suggests functions to accomplish that.

One example that Hughes offers is: given

2
2

with the desired output of

4

suggest offers

(+ 2 2)
(* 2 2)
(expt 2 2)

That’s pretty neat and almost seems like magic but really amounts to taking a list of functions and applying each one to the input(s) to see if it yields the desired result. Despite the brute force, Hughes says it almost always yields an immediate result.

There’s a bit more than just trying every function available though. For example, you have to be careful about side effects. As Hughes says, you don’t won’t to delete a file as a side effect when you’re testing prospective functions. Hughes has a curated list of functions that seems to work well. He says he’s already learned a couple of new functions from the app.

If you’re trying to learn Elisp, this may be a useful tool to get you started. Take a look at Hughes’ post to see if it might help you out. Regardless, it’s a neat hack and worth playing with just for the entertainment value.

Posted in General | Tagged | Leave a comment

How to Get Started in Security

Parisa Tabriz has a nice post on how to get started as a security engineer. She does mention some resources but the post is not really a check list of things you should do and sites you should visit. Rather, it is a series of observations based on her own career and how she landed a job at Google.

She starts by making the quotidian observation that it’s not like the movies. A lot of the work is like other engineering: detail oriented and often tedious. Still, she clearly loves her work and has a real enthusiasm for it.

She notes that there’s no standard curriculum and that the practitioners come from many different academic backgrounds. Her two best suggestions, I think, are

  1. Stop reading and get your hands dirty actually doing the work
  2. Write code; it will help you understand the problems that developers face trying to write secure code.

There are several other useful suggestions. If you’re interested in the field, it’s definitely worth taking a look at Tabriz’s post. After all, she’s a Security Princess.

Posted in General | Tagged | Leave a comment

New Zamansky Emacs Video Up

Mike Zamansky has posted the latest Emacs video in his series. This time it’s about flycheck. As usual, the video is from the point of view of how Zamansky himself uses Emacs.

The demonstration is mostly about using flycheck with Python because that’s the language that Zamansky uses most of the time but he also shows an example of using it with C. He points to the flycheck home page and the list of supported languages, which includes Elisp, of course.

I often see queries on how to set up a Python environment in Emacs. Zamansky discusses that a bit too but doesn’t cover Elpy because it’s more powerful than he needs. He does talk about Pylint, Flake8, and Jedi, though. If you’re looking for a Python environment, check out this video. Those of you who haven’t tried flycheck yet should check it out too.

Posted in General | Tagged | 1 Comment