Emacs Chat: Tom Marble – Invoicing with Org and LaTeX; Clojure

Guest: Tom Marble

Audio and Video

Tom Marble's doing this pretty nifty thing with Org Mode, time tracking, LaTeX, and invoice generation. Also, Clojure & Emacs, and other good things. Enjoy!

For the event page, you may click here.

For more information about Tom Marble:

Want just the audio? Get it from archive.org: MP3


Sacha Chua: Hello and welcome to another episode of Emacs Chat. I'm Sacha Chua and today we're having Tom Marble talk about his fascinating ORG mode invoicing workflow and a couple of other things along the way.

Tom is a [0:00:16] developer in Minnesota, right? But Tom, what else are you interested in and who are you?

Tom Marble: Well first of all, thank you so much, Sacha, for having me on your chat.

I've followed your blog for years and have been an Emacs user for a really long time and we've had a chance to chat a little bit before and I'm really glad to be on the program.

Sacha: Thank you very much. I'd love to learn more about - when you say you've been an Emacs user for a long time, let's dig into how long has that been.

What got you interested in Emacs in the first place and what kept you going?

Tom: Gosh, it has been so long. I can't really remember exactly when I started using Emacs but I know for sure that I was using Emacs towards the end of '80s and I was in Silicon Valley, working for a semiconductor design company. We were experimenting with cool things like the X Windows system, Unix, that's where I think I first got into using Emacs on a regular basis.

Sacha: Have you set all throughout? Are there other stories where you went away from Emacs for a while, then you came back in, or has it just grown with you?

Tom: It's grown with me. I've used it really continuously ever since. I'm a little bit ashamed to admit that I feel like even though I've used Emacs for over 25 years, I still feel like an Emacs newbie. There's so much stuff to learn, so much stuff to know, I just open up new worlds every time I experiment with Emacs.

Sacha: What are some of your favorite ways to learn more about Emacs then?

Tom: Well, I just love to hear what people are doing. I love to do code pairing with other developers, or look over someone's shoulder and see what they're doing, or read blogs like yours. I love to see what other people are doing. It's just a lot of experimentation.

One of the things that I've heard for a long time was ORG mode. Everybody was talking about ORG mode and how crazy, how great it is and I thought, "Okay, well, I'll have to check this out." I spent some time experimenting with it and that's probably one of the biggest changes for me in my Emacs usages. When I finally got into using ORG mode, I sort of was like, "Oh, wow! I had no idea that Emacs could do all of these stuff."

Sacha: We originally started talking because you reached out to me for help with something that you're doing with ORG mode and that conversation was precisely what gave me the feeling that I had no idea that ORG mode could do all of these stuff and that's when you were showing me this workflow that you developed around tracking your time, putting together these invoices, turning them into PDFs even.

We could start off with a demo with that if you could walk us through that workflow and show us how you set it up.

Tom: Sure. I know because you tweeted earlier today that you just published your .emacs.d and I retweeted that. I know that I have a shell version of that on GitHub but I need to update this again and I knew you were going to ask. I will show you the invoicing stuff and then maybe I can show you my set up for .emacs.d.

Sacha: Fantastic. While you're getting that all set up - folks, if you're listening to this and if you have any questions, if you're listening live, you can click on the Q&A link to ask your questions right away, or you can also comment in the IRC channel on Freenode. We're under #Emacs-chat. If you're listening to this afterwards and you have questions, you can find Tom.

What's the best way to find you?

Tom: You can find me on Twitter - @tmarble and then from that you can get to my website, and my blog, and everything else.

Sacha: Fantastic. All right, let's do the demo because it looks really cool.

Tom: Now since you're on Freenode, I'm going to join in. You said it's #Emacs-chat?

Sacha: Don't worry, I'll keep an eye on it also.

Tom: Okay, cool.

Sacha: There are other people in there with us.

I really like the fact that you can connect to IRC from Emacs. It's a bit distracting sometimes except most of the time it just hides in [0:04:50] but do you know that conversations and interesting Emacs tips are just one CTRL+C, CTRL+[space] away?

Tom: I hate to admit this but I'm using IRSSI for IRC and I do - all my friends have said that, "Tom, you should really use ERC." I think that at some point, I will break down and do that.

Sacha: There's another interesting thing. You're actually telling me that you have Emacs peer pressure.

Tom: I have big Emacs peer pressure because I'm relenting and harassing people that use VI. I feel like whenever there's an opportunity to use Emacs, I really have to do it.

Sacha: Emacs-using friends in real life, Emacs-using friends online who are telling you you should use ERC and all these other things.

Tom: In real life.

Sacha: We'll dig into that more a bit later.

Are you ready for your demo?

Tom: Yes. Maybe I should start my screen share.

I hope that this will show up. I have just a text window here and what I'm going to do is I'm just going to start up Emacs and I'm going to show you about a new package that I'm developing - I'm calling it

“Timesheet” which is based on ORG mode. What I've done is I've set this up in my init files which I'll show you later and I have a new command. I'm going to do mx-timesheet-example and what that's going to do is that's going to create an ORG file for us called, "yoyodyne.org" which is an example customer.

Kind of where this comes from is I'm a consultant and I obviously have to keep track of my time and the most convenient way to do that is actually in Emacs. What I decided to do is extend the clock features of Emacs to record times.

Now, I haven't got all of the indentation stuff worked out yet because I'm doing a brand new set up. But what I wanted to show you is how I'm using Emacs to record times and then keep track of times. Let me do this. I'm just going to show everything.

The way that this works, is at the top of the file here, I have a handful of ORG mode things. Basically I want to start up ORG mode and then what I have is I have some constants. For example I have my yoyodyne customer as the name, my example "Billing rate" here and then I have the sample address to which invoices will be sent. Let's say I'm Emacs consultant then I have the address of the customer which is yoyodyne.

Here I have a couple of major sections in ORG mode. First one is tasks and the idea of tasks is this is going to be where I have different projects for my customer and I'm going to record the time against each of these tasks. For example in this case, I have two tasks - I have prototype and I have new product.

What these tasks are intended to do is to show you where the time is going. For example under planning, just by convention I preference this with the name of the customer and the project, then I have a project planning as one planning task. Then let's say I have a daily teleconference. So, I'll call that the teleconference task. Then when it comes to actually coding or development, then I have a couple of tasks. Here I have a storyboarding task where I might be doing ideation for project, then I might actually be working on a Feature. I'll want to record the time against Feature one for example.

Then I want to do documentation so I'm going to have a documentation section, we work on a user manual. And then under Quality which is very important, we're going to have a test suite and we're going to set up Jenkins to do automatic testing.

This is basically how that works. Now I'm going to expand this folder so you can see kind of the addition that I've made to the clock. This section here is the clock entry and I won't go through all the details of checking in and out of clocks because that's really fantastically documented on the ORG mode Wiki.

But the neat thing about doing your time tracking here in Emacs is that you can see exactly the times that you've checked in for a particular project, and you can see the dates and so on, and I have a handy-dandy function which will recalculate this. If I say, "I started this at 9:30. I didn't start it at 8:30. I can just go like this." Which is F10+C - I'll give you that shortcut in a second and what that will do is that will show me here at the edge exactly how many hours I clocked in on this part of a task. Then let's say I went to a meeting, and then I came back, and I clocked back into the task, and I logged in a bunch of more hours.

That's an example of what an individual time entry looks like. Then let's say for example everyday I have a teleconference and that's from let's say 11 to noon. So, I record these everyday and I just add a couple of weeks worth of data points so that you can see. Now what happens is at the end of the day, what you can do is roll up the time for the day.

I'm going to press my F10 big T which is calculate the time at point. That brings me down to my timesheet section. For this month, 2014-04 and then the date that I was first starting, let's say the first date of this month there is 7.5 hours for this day overall and then it's by projects. The prototype projects had 7.5 hours and the planning sub task get 7.5 hours and I did two things. I did planning and I was in the teleconference.

That shows you a breakdown on a day-to-day basis of where the time goes. For one of my clients, they want to have this kind of a time card everyday so they can see exactly where I spent time on a previous day. This is for reporting requirements that they have.

I did this idea for a few days here in this example and at the last day of my example, I actually started working on a new product. Here you see an example of yesterday for example, I would spend 5 hours planning on a new product and 3 1/2 hours wrapping up this prototype effort.

This way you can see for the day I spent 8.5 hours, I spent five on the new product part and I spent 3.5 on the prototype part. Then you can just go down to these levels of detail. That gives you the daily timesheet view. Then this very same client of mine really wants very detailed report. They want an addition to the daily report, they want a summary at the end of the week. That's where I created these weekly report and what they show you - and this is one of the cool things about ORG mode is that I have a spreadsheet here right in ORG mode that is created by my timesheet package and what it's doing is it's grabbing the times that I just showed you above for the week and it's putting them in every line as a project, and it's putting in the hours per day and it's summing the hours at the end of the week. Also, it has a daily total for this during the day.

I have two example weeks where I have last week and then this week. Then what's different is that in this case, for this week, you see, "Oh, yesterday I spent five hours on the new product time." You see that that's a different row because it's a different project. That's what allows me to generate these weekly time sheets without any average. Again, just to keep Emacs keybinding.

Sacha: Yes, that's fantastic. I remember when I used to have vectors and I try to set the different values but having it all in a table and then taking advantage of ORG's spreadsheet functionality makes it so much easier to do that.

Tom: Absolutely. I don't have to show, I'm sure people that are familiar with ORG know that I could come in here for example and I could change this from five to 5.5 hours and I just have to recalculate. I have it bound to a different key over here. You can see what my key binding is. That's the thing, there are so many bindings.

Sacha: Yes. Usually just rely on ORG doing the right thing when that CTRL+C, CTRL+C is somewhere.

Tom: Yes, that's right.

It's org-table-iterate and what that will do is it will update the table. In this case, I have the secret ORG table formulas here at the bottom. When I iterate, what that will do is if I change a given cell, it will update the total for the project, it will update the total for the day and of course it will update the overall total.

Sacha: That's cool. I just noticed that iterate actually repeats it until the table doesn't change anymore, so you could actually even have that kind of converge in a number.

Tom: Yes. You can have really complicated, really complicated things.

You'll notice that I hand-edited this cell here to be 5.50.

Sacha: Which you shouldn't do.

Tom: Which I shouldn't do so I'm going to recalculate this weekly spreadsheet and bam! It went back to five, which is sort of what it was before.

This is kind of nice. It removes some of the tedium of creating timesheets but the fun part is actually creating invoices because that is sort of the tedious part. Now what's really cool is I am going to create an invoice from this thing. I'm going to just do a keystroke here. There are some packages that I haven't installed in this particular thing which I'm going to debug that's for creating the PDF but I'll show you the PDF separately.

What just happened is that in this invoices section, I created a brand new invoice and it keeps track of my next invoice number. In the header for the invoice, I have this properties block, and I keep all sorts of things here. I keep the bill date, the due date, the total number of hours, the amount it's due and in particular when I generate the PDF and when I check this in the GitHub, this should work or I'll explain the people how to do that so that it works.

I have a link here to the PDF so you can actually go in. Just press enter and get to the PDF right away. Then here is a fun part. This is the header part to the invoice and it's as an ORG mode table. This shows up in the PDF but you have all the data right here in Emacs. You have the from, the to, and the total number of hours, the amount it's due, and invoice number. Then of course the thing that you want next is you want the details. So I have the detail section for the invoice and just so that you can see how this is working, I'll show you up above.

You'll see that there's this magic table export file thing. What I did is I created this table in Emacs that you see right here, this ORG mode table and because of this property, what will happen is when I want to export the table, it will export it to this TSV file using ORG table to TSV. So when I create a PDF, what will happen is it will take this ORG table, save it as a TSV and then it will actually use that to do some cool LaTeX stuff in the background to actually create the PDF.

Now under the detail. Similar thing down for the detail. If there's a detail TSV file that's created in here - I'll show you - this part of the invoice has for everyday, there's a project that I worked on, the number of hours that I worked, and the rate, and the total for the day and then the overall total. For example in this yesterday example, I worked on two projects - new product and prototype. So you see both of them listed there for that day.

Sacha: Wow!

One of the things I noticed from your header table is that you're actually using table formulas to pull in the values of the properties. Is that what I'm reading from the [0:19:01]?

Tom: Yes, absolutely. I'm pulling in the properties.

That was a trick that I learned. It's that what I do is I set the table properties and then I use those in formulas for the spreadsheet table. You see that really appear. For example here I have a property. For example it's Totalhours. Then down here, this formula is really long but there's a place down here where I actually use that property here.

Just for the little bit of eLisp, you can create these properties and then from that I create the table, then from the table I export it, then from the export I create a LaTeX file, and from that I create a PDF. I will share with you what the PDF looks like.

In my package, the Emacs package…

Sacha: Craigslist.

Tom: Yes. This is going to be the example I'm going to ship with my timesheet.el package.

Sacha: Awesome! So pretty.

Tom: I created just a funny logo here which is just a PDF that's included in LaTeX and all the stuff that you saw in ORG mode turned into this gorgeous PDF, all the data is here and what I will do is I will show you - then you have the same detail for everyday and it even has a hyperlink if you end up going over more than a page.

Sacha: I guess you can tell that the last row of the details table is colored, it's shaded.

Tom: You're asking about this part here. Okay. This is certainly a fair question. Let me go back and show you the Emacs again.

What's happening is I have a folder for this customer called yoyodyne and I have invoices, I have the invoices for this month. What I've done is I've copied over some boiler plate LaTeX thing. I have defs.tek. If you can see this, this is where I have the things like the author included, and then I also have main.tek. Main.tek is a LaTeX file where I have all of the sort of standard things that you want. Notice here I'm including the defs, I'm including the header, I include - by the way, what you see here is header.tek and I created that from header.tsv using just a shell script. I run a program from Emacs and that creates that, and that just gets included in LaTeX.

Sacha: That's going to be replacing some Emacs Lisp code at some point?

Tom: It probably should. Yes, you're right. It probably should.

Right down here I include the detail. If I go into detail.tek, in my script what I do is at the bottom, now what I'll do is I will include the gray parts to make that summary lines. Yes, that could absolutely be created with eLisp. I'm doing it in shell because that's how I started.

None of this is particularly magic. It's just gluing together a bunch of pieces that we've got, then viola! Then you get invoice.

Sacha: That really characterizes a lot of Emacs configuration. The individual steps are perhaps not that complicated but you're really gluing together all these small steps and what makes it work is that you've got this idea of what you want it to turn into, and you just fill in all the gaps along the way.

You have this PDF that you wanted to look like and you figure out, "Okay, I need to get the data into the table, then get the table into LaTeX, and then get the LaTeX to go into the PDF." Then everything will be amazing.

Tom: That's right.

Sacha: That's fantastic.

One of the other things I was curious about is actually when talking to people who customized Emacs to do little workflows like this. What other things are in your Emacs configuration that might inspire other people as well to just keep customizing things?

Tom: Well, I think I will do like you. I will update my .Emacs.d so people can see it.

One of the things that I want to talk about is Clojure because it's my new favorite programming language and we could talk about some ideas that I have with Clojure and Emacs.

Sacha: Sure.

Tom: Maybe what I could do is I could show you how I have .emacs.d set up for this example.

Sacha: For sure.

Tom: What I did right here is I'm running in a to-root Emacs just to make sure that I have all the dependencies I need and I'm not cheating. Because what happens over time is you add all these cool stuff on text – I'm not sharing. Let me just go back and share.

You end up adding all the stuff to your .Emacs and then sometimes you forget, "Wow, I added this. I added that." Or, "There's a dependency. I kind of forgot about it." That's why it's really important to keep track of all that stuff. That's what I wanted to start in the to-root, start simple so I would be forced to track all of the dependencies.

Here is what I do and I hope the people will find this useful. I'll publish this separately from my timesheet.el library which by the way, I'm really trying hard to prepare for Melpa and I'm going to make a poll request from Melpa really soon.

Sacha: Great.

Tom: What I did here is I created init.el, sort of convention for how to load things in Emacs. Let me just walk you through that. Basically what I do is I start by loading melpa.el and first of all what I do is I add the .files directory which is .emacs.d to the load path so that I can load things in this directory. And one of the things in this directory is melpa. I just copied the standard melpa stuff here.

I did add this little snippet for running Emacs 23 or before but I haven't tested it because I'm an Emacs 24 person. But you run this and then you can then visualize melpa, which if anybody isn't aware of, it's just fantastic for getting all kinds of great Emacs packages.

Sacha: It's huge.

Tom: It's huge. Then I use the S package for string manipulation right away. So I require that right away at the beginning. Otherwise I'll [0:27:45] my requirement things a little bit further down.

Then the main customization file, I call custom.el. I think this is kind of a convention. What I do is load the custom.el file and I'll go into that in just a second. Then what I do is I give these an opportunity to have a host or user-specific files. For example, I take the fully-qualified domain name of the host and just get the host name, and then I'm looking for a system-specific-config which is just hosting.el.

In my case, this computer is called ficelle, so that's the host name and I have the ficelle.el. Or you can have either a user-specific config. In this case, the example that I'm running here, I created a fake user called foo. So there could be a foo.el or a foo directory under .emacs.d where you could put a bunch of different files.

What I do is load the system specific one. If there's just one user-specific when you can load that. Otherwise, load all the .els in the user directory. What I did just for debugging is I put these cute little message things to BNA so you could see what file you're in and we can look at my messages buffer. You can see how that happened when I loaded things up.

Okay, now I knew we were having this Emacs chat and I wanted to have a way of debugging my timesheet.el package and I found that it was really hard to get packages version quickly all the time. So what I needed to do is I needed a handy way of uninstalling the old one and installing the brand new one very quickly. I developed a couple of little helper functions – one which is packaged versions which will tell you the versions of a package that are installed.

Because this is Emacs and we have our Elpa, let's just go to this and I'll just go ielm and let's just do package-versions and let's say for example I want to see what I have for ORG. That's the version of ORG that I've got. Or I want to see what do I have for timesheet and that's the version that I'm running right now. I also made this so that it's smart and it can handle either a string or a symbol.

Sacha: Cool.

Tom: Yes. Now this is the fun function, is package update. What I do below is I say, “Okay, I want to package update to timesheet to 0.2.21 and it's going to be loaded in from “/var/tmp.” What this function will do here is it sets up a bunch of variables. I'm trying to get it to the point where you can see this right. It sets up a bunch of variables and make sure the install [0:31:03] is present.

What it will do is in last your package is installed with the correct version, then you'll update it. If you are going to update it, what it will do is it will say - if it has been installed before, what you should really do is go for all the old versions that are crusty and rusty, you should just go ahead and delete them, so I call package-delete. Then when that's all done, I do package-install on a new one and then I load it.

Either I come in here for example when timesheet is up to date or I update it and load it, and in either case I get down to here in my custom.el where I can require it and I know it will load.

Other things that I have in custom.el are other packages that I know I'm going to want and then typical thing in custom.el is the section where all your host save stuff goes, all your customizations. For example you see here the next invoice number, here is one of the customizations. You can change what you want your next invoice number to be for the timesheet invoice.

That is the custom.el. Now I mentioned to you going back to init that there were this system-specific-config. Let's look at that. The system here is called ficelle and all that this does is it just runs a message. That's kind of boring.

Sacha: But people might use it for like changing SMTP servers, or doing that, or system related stuff. Yes, good idea.

Tom: Yes and the users foo as I mentioned.

So I have a couple of Emacs files in my foo directory. One is I have my eLisp where I kind of like to put my chunks of eLisp here so I have this handy function called wipe-scratch which will clean out the scratch buffer. Just for fun, you can go over to “*scratch.”

Sacha: Yes. But you could just go to your [0:33:17] “delete-region”, “point-min”, “point-max”, or just erase-buffer I think that does that but yes.

Tom: Again, there's so much that I have to learn and I'm not saying that I know all the right libraries to use. It's a big challenge.

Sacha: That's cool. Yes, for sure.

Tom: Bindings, this one is kind of useful for my timesheet example because now what I show here is, okay, I have an outline map and I do this in my regular bindings.el. I have all kinds of online stuff bound to F10 as a prefix and now here I have all my favorite timesheet functions that I was showing you before. For example update the clock for today, give me the timesheet for today, or the weekly sheet for this week, or create the invoice for this month, or create the invoice for last month.

Sacha: Hey, do you know about ORG speed commands?

Tom: I don't know about ORG speed commands.

Sacha: Okay. I started using them recently but basically if you set the ORG speed commands to “true” or at least none-nill, anytime you point this on, the stars that make up a heading, you can type in “T” for example to be ORG to do or whatever else, then you can wrap your own user commands onto this. Now I can go to a task and I can hit “!” to cut in and also update my web-based time tracking thing. That might be something you'd be interested as well.

Tom: Definitely.

Sacha: ORG has a couple of those conveniences that are buried somewhere in the manual.

Tom: That's great. That's exactly what I need to learn about. I'd love to learn about that.

Sacha: That's basically your configuration. A little bit of some keybindings to make your life easier, you use prefix keys so that instead of having CTRL+ALT+meta whatever, you can just say all right, F10 something, and you got your timesheets working with ORG.

You mentioned Clojure and then I got around playing with it which is great because Cider was very easy to install and get running with Lame.

What's your Clojure set up like?

Tom: Well, that's a great question.

First of all, for those of you that don't know, Clojure is a relatively new language that is a Lisp that runs on a JVM. What's neat about Clojure is it's got all the great ideas of common Lisp without some of the baggage of the ANSII spec and it's got all the power of the Java virtual machine without some of the baggage of the Java language itself.

If you like Lisp and you like high-performance programming, Clojure just might be the language for you.

Sacha: I was pleasantly surprised to find it once I've gotten the REPL server up and running evaluating - of course naturally evaluating all these expressions super fast but having come from, Edit, Compile, Run Cycles, or Java, this is so much more fun.

Tom: It's so much more fun and the other thing is not only does Clojure run on a JVM, it also runs in Javascript. You can actually imagine running Clojure script in your web browser which is just amazing for having the same language and the fun is that you have in the backend.

Sacha: Okay, why Emacs for Clojure versus other possibly better known IDEs?

Tom: It's a great question and it turns out that as an Emacs user, you really are just used to having the REPL, having all the features that are available to there, being able to move back and forth between the various buffers and so on. As you point out, Cider is the new way of interacting with Clojure. So you can evaluate forms, you can run programs in the REPL, you can do all sorts of things and I think that one of the more popular IDEs is called Light Table which is fantastic by the way because it's very accessible for new users to get going quickly with Clojure.

But I think for advanced users, you quickly want to have the power of Emacs at your fingertips and Cider allows you to do that and allows you to have access to all of your different shortcuts that you'd expect in a programming environment.

Sacha: Do you have that set up on your system right now? Is that something you can demo?

Tom: I believe that I do. Let me see if I have a good example for you.

This is my standard Emacs and what I'm looking at here is a project.clj. This is kind of the overall project clojure file that you use to define your dependencies and other plugins that you're going to use.

In this case, this is a Clojure project that I have in GitHub called Om Chat and Om is this amazing Clojure script frontend run by David Nolen which uses the Facebook ReactJS library to do the most amazing client-side Clojure script that you can imagine. Let me just show you a little bit about what this is like.

What I'm going to do is go into the main function here and I'm going to do cider-jack-in. What this is going to do is it's going to create an end REPL for me and I updated the dependency to Clojure 160. So it's probably downloading that in the background. It's something like a live demo.

Sacha: Put you on the spot there.

Tom: Yes, put me on the spot. Yay!

Here we are and we're in the REPL. Here I can come up and I can evaluate things here within the Clojure buffer. This is one of the things I have autopair turned on. Autopair is sometimes nice but sometimes it's very aggressive – not the autopair but the one about quotes.

Sacha: Smartparens I'm guessing is what your…

Tom: Here you can see what it's like to interact in the REPL and I'll just show you a little bit more of what you get here in a mixed Clojure and Clojure script application. You actually have clj and cljs. In this case, this is the Clojure script side of the application. This is actually running inside the browser.

In this case I have one variable called app-state that contains all the state for the application and in this case I have a counter, and I have some chat backlog, and some functions to send and get messages and so on.

I don't want to get into too much of the details of that application but what I did want to say is that Emacs is a very powerful tool for doing Clojure development and I think that for users that are used to Emacs, I think that they'll find that it's really great. Plus, there's an advantage. If you already know Emacs Lisp, learning Clojure is pretty easy and I think vice versa.

Sacha: I was playing around the ORG mode and Clojure because it turns out it's very easy to add Clojure as one of the supported languages in it. So with your programming becoming more popular where you have ORG mode descriptions, or comments, or explanations interspersed with your code blocks, and you can evaluate the code blocks right there. I think it's great that you have all these languages to play around with.

Tom: Do you have a demo for me?

Sacha: I can show you that. Let me switch over to my Emacs first and see if I can move this into the configuration I have before.

Tom: I think from our discussions before I think you said you do a lot of stuff with Babel?

Sacha: Yes, I love playing around with it. Certainly the configuration of Got is that.

Can you see my config?

Tom: Yes I can.

Sacha: Anyway I found that way of Clojure has a basic Emacs configuration set up. What I did there is once you install Cider and you add these very, very few lines to your config, you can take this plus 1, 2 and CTRL+C, CTRL+C on it, evaluate that and of course you have to actually do this thing first. Then you can evaluate that.

Live demos! Joy!

Tom: I'm sorry I put you on the spot.

Sacha: No, don't worry, it's going to happen.

Sacha: Step one, I have to think what I'm selling here.

Okay, I don't entirely have this sorted out yet but theoretically once you do have it all sorted out again - because I had this working and then I didn't save my config - you could evaluate that and have the results show up in another block which is kind of nice.

Tom: It's really cool. I definitely want to check that out.

Sacha: I'm not really panicking, no. Eventually I'll get the hang of this.

Tom: I put you totally on the spot. I'd love to learn more about using Babel with Clojure. I think that sounds like fun.

Sacha: Anyway, the two websites that I mentioned up here which is [0:46:01] Clojure has a basic Emacs tutorial and Bastien Guerry also has an Emacs ORG Babel over tone which is basically playing music with Clojure. He's got that set up also so that he's got this kind of literate programming thing talking to your Clojure and all that sort of other good things.

Tom: By the way, I have to mention that Craig Andera does a fantastic podcast for Clojure which originally was the Think Relevance Podcast Now. It's the Cognicast and one of his projects are to process all the audio using Clojure. That's one of his projects that he's working on.

Rich Hickey, the author of Clojure did some really amazing Clojure work with music. He's a musician from way back and at the last Clojure con, she did some demos of sound synthesis using Clojure which was just totally mind-blowing.

Sacha: Awesome. Stuff to play around with. I'm delighted that things are going quite interestingly well.

Two cool things that you've shared. You've shared an ORG mode invoicing workflow that uses LaTeX and some of the Clojure stuff that you've been playing around with.

A couple of questions I want to circle back to. You mentioned you have real-life Emacs friends?

Tom: I know. Both of them.

Sacha: What's that like?

Tom: Well, I will say I have to give some shout outs to some people that I really admire in Emacs because like I say, I've done this for 25 years and I still feel like a newbie. As people can see, I'm definitely an eLisp newbie. But I'm enjoying it and I'm enjoying getting into it.

Many of you probably know Phil Hagelberg, also Technomancy is an amazing Emacs developer. He is the Leiningen developer for Clojure and has done all kinds of crazy cool stuff with Clojure and Emacs. So I'm very inspired by Phil's work.

Another guy that really is inspiring to me is Rob Brown and he's the Debian Emacs maintainer because I'm a Debian user and really appreciate all the work that Rob does. Big shout out also to Tom Tromey who as you may know is the one who created Elpa in the first place and he's now an engineer in Red Hat. I have known Tom for a number of years. Tom is just amazing. He teaches me something new everytime I chat with him so I just love that.

I have more Emacs friends too, I will say. I'm just happy to share what I know and try and learn from everyone. One of the things, Sacha, you and I talked about before regarding Clojure is it's kind of hard to get started with Emacs and Clojure. There's just so much stuff to set up. I know we had a beginner's night at our Clojure Minnesota user group and I tried to help a friend of mine get Emacs coming from Clojure. It turned out he was using Emacs 23 which made it a little bit harder. But he's an advanced common Lisp user and very experienced Emacs user. We still had a little bit of trouble getting it going. So, I had this idea that maybe we could automate this set up a little bit. Maybe we could have sort of like a starter kit idea for Clojure that would give you Cider mode, Clojure mode and some of the other keys, packages that you want from Elpa and get things set up with some reasonable keybindings so that you'd be ready to go.

Sacha: Maybe even something like a vagrant virtual machine. It's all packaged up, it doesn't matter what operating system you're running it on, you just start this and off you go with this consistent environment. Therefore you can follow all these trails without wondering whether it's your problem.

Tom: Exactly. That's a great idea. I think that's exactly what I'd like to do. It's something like that where a vagrant script and combined with possibly some Debian packages, and even maybe just some eLisp that you can load that would get you going.

Sacha: The other thing we talked about in terms of this kind of making it easier for people or even just working together, you mentioned setting up SSH access to server and then letting people who are interested connect to it using Tmux. Do you want to share a little bit more about your idea?

Tom: Yes. I have been a Screen user for a really long time. Screen has been great but it's showing some signs of age and Tmux which is like Screen has a feature which makes it easier to share a character-based session. I remember I think you had a tweet a while back about how it was not possible to really do Emacs commands in a Hangout properly.

So, I set up a shared Tmux session on one of my VPSs where for example you and I could go in to the same Tmux session and each of us could have full keyboard access with all of the function keys and all the other things, so we could demo. Either of us could be live editing on the same thing with an Emacs - well, it doesn't have to be Emacs - but anything within that shared shell window.

Sacha: Actually you see something like that with Screen before. So basically I would use screen-x in order to connect and have some other people connect to it as well. But it's a good idea. In fact I'm going to start the screen sharing now so people can see what we started working on when I connected to your SSH with a guest account.

I guess one of the places we could take this is if people are interested in kind of pairing sessions for Emacs, then maybe people could come together and say, "Hey, I'm trying to work on this part of my config" or, "I'm really interested in learning more about this part of the code" or, "I'm trying to solve this. Does anyone want to come watch me do it and maybe offer suggestions?"

Yes, that will be great for a Google Hangout or some other thing like that. We have audio and then people can use Tmux, or Screen, or whatever other multiplexing terminal they want to share an SSH account.

Tom: As a matter of fact, I haven't talked to him about this but one of the Clojure developers, Nelson Morris, who is responsible for Clojure - think of that as sort of like the Melpa of Clojure. If you follow his Twitter account, he is offered to do pairing sessions for people that are interested in learning Clojure or advanced users that want to take it further. His Twitter handle ishttps://www.google.com/url?q=https://twitter.com/xeqixeqi&sa=D&sntz=1&usg=AFQjCNHalmL5aVkbbsYtGgygdIXFg-92iQ@xeqixeqi and if you want to do pairing, you could check out Nelson's tweet about that and find out if he's available to do some pairing and I know that he likes to use Tmux.

Sacha: Great to take that as a model for Emacs pairing as well because I'm always up for talking to people about Emacs and my schedule is pretty flexible on Mondays, Wednesdays and Fridays. So let's make that happen.

Tom: Sounds good.

Sacha: Let me set screen sharing off and double-check if anyone's had any questions. I think people will also ask afterwards which is all coolest.

Thank you so much for sharing your fascinating ORG invoice workflow. The output is really pretty and I guess it's a little bit intimidating at the moment because you will think, "Oh, no I have to know LaTeX also in order to get this all customized to their needs." But I'm sure your packaged timesheet with a couple of templates that people can use to play around with that and see where it goes.

Tom: That's right.

Sacha: It's like in ORG Invoice. I just found out, there's an ORG Invoice in the contrary of files for ORG.

Tom: Oh, I'll have to check that out.

Sacha: Maybe you can borrow that ideas from there too.

Tom: Absolutely. I do have an example in my package and like I said, I will try to get that up on Melpa soon.

Sacha: For sure.

Tom: I'll check out ORG Invoice.

If you don't know LaTeX, you shouldn't be intimidated. There really isn't anything that you really need to do there. In fact I think the only thing that I have in LaTeX that you could customize is like the metadata for the PDF. Sometimes if you want to look at the properties of the PDF and say, "Oh, so and so Sacha Chua authored that" you can customize that in a LaTeX. Otherwise I could easily make that an Emacs customization of course.

Sacha: Well, good luck with that. It's always interesting to see how other people have customized Emacs and thank you for sharing your story.

If people want to find you, they can find you on Twitter. Right? @Tmarble?

Tom: That's right. I've got a link to my blog from Twitter at @Tmarble.

One more thing, Sacha, I wanted to tell you. We talked about getting beginners involved in Clojure and one of the efforts that I'm part of right now is something called Clojure Bridge. The idea of Clojure Bridge is it's building on the idea of Rails Bridge to get women involved in our programming community specifically for Clojure. Rails Bridge is for Rails and Clojure Bridge is for our Clojure.

The first Clojure Bridge conference just happened in Durham North Carolina and I think the reviews were fantastic. I'm along with our local Clojure user group. I'm organizing a Clojure Bridge here in Minneapolis in the middle of May and I just wanted to call that out so that if people are interested, go tohttp://www.google.com/url?q=http://clojurebridge.org/&sa=D&sntz=1&usg=AFQjCNEsYMfCVXf8rMderz3IdBk-hucGDgClojurebridge.org an see if it's coming to a city near you, or get in the mailing list and see if there are people around you that might like to put one together. There's great entry materials for everybody that wants to learn Clojure. It has really come a long way.

Especially I think that in tech generally but especially in programming, we need to have more diversity and we need to have more women. For example if we could collaborate, Sacha, you and I and making Emacs for Clojure be more user-friendly and accessible, I'd love to do that.

Sacha: I want to do an Emacs Bridge.

Tom: Emacs Bridge, why not?

Sacha: Yes. We'll figure something out. But thank you for working at that. It's very, very good stuff. I went through the Clojure Bridge resources and I submitted a poll request for that also.

Tom: Oh, awesome.

Sacha: Yes, thanks for bringing it to my attention.

Thanks again for this chat and good luck.

Tom: All right. Well, thank you so much for having me.

Check out Emacs Chat for more interviews like this. Got a story to tell about how you learned about or how you use Emacs? Get in touch!


blog comments powered by Disqus
Back to top | E-mail me