Get Xah’s Emacs Tutorial for Free

Xah Lee is giving his Emacs tutorial away for free for the next few days. Read down in the comments to get the link to download the files.

Xah’s tutorial is a good resource. I learned Elisp mostly through his Elisp tutorial. Here’s your chance to get your own copy. Of course, it’s always available on-line

Posted in General | Tagged | Leave a comment

Thoughts on Emacs

Mike Zamansky has the latest video in his Using Emacs series up. This time he takes a break to give us his thoughts on learning Emacs and making the videos. He’s discovered—as every teacher who records his lectures for the first time does—that’s it much harder than standing up in front of a class or a group of colleagues in a lecture and giving the same presentation. That’s because you don’t get any feedback from the audience. You can’t tell if they’re understanding the material, bored, delighted, or something else because it’s just you and the computer.

The other point he makes is that when learning something, Emacs in particular, it’s often enough to know that something can be done even if you don’t know how to do it. He gives the example of using timers in Emacs. He saw that Sacha Chua had relative times in the transcripts of her Emacs Chats and from there it was (relatively) easy to discover how to add them to his own notes. I’ve found the same thing. Once I know that Emacs has a way of doing something, I can usually easily discover how to do it.

As I’ve said before, this is a great series and even if you’re an experienced Emacs user, you’ll probably learn a few new things from the videos. The video is 8 minutes, 39 seconds long so it should be easy to fit it into your schedule.

Posted in General | Tagged | Leave a comment

Rainer König on Advanced Exporting in Org Mode

Rainer König has posted the latest video in his Orgmode Tutorial series. This time it’s about Advanced Exporting. König starts with a single Org mode document and exports it to Beamer, PDF, and ODT. The file was written with Beamer in mind so they look best when exported to Beamer but PDF looks good to my eyes too. The ODT export wasn’t as successful but there’s probably no reason it couldn’t be.

Many people prefer to use pandoc when exporting to ODT because they feel it does a better job. Happily, I seldom have need to export to ODT so I can only report what others day. In any event, König’s video shows how a single document can be exported to several different end formats.

You can take a look at the video for the details but it’s really just a matter of choosing what you want to export to. The only non-obvious thing you have to do is enable the backends you want to use. König does this through the custom interface but it’s just as easy to simply customize org-export-backends. See the documentation for the standard list of backends. There are others available as contributed packages.

Posted in General | Tagged , | Leave a comment

Query

Does anyone know how to diminish Yasnippet on the Emacs mode line? I’ve tried everything I can think of and have consulted with Duck Duck Go but I’m still getting the annoying “yas” on my mode line.

This does not work

(use-package yasnippet
  :ensure t
  :diminish yas-global-mode
  :config (yas-global-mode 1))

nor does substituting (yas-mode | yasnippet-mode | yasnippet-global-mode), and probably some others I’ve forgotten, for yas-global-mode. I also tried adding a

(diminish 'yas-global-mode)

(and variations) to the :config section of use-package.

If you have any wisdom to share, please leave a comment.

Posted in General | Tagged | 3 Comments

The Lies They Tell Us

I’ve been complaining about the horror of open-plan offices for some time. I firmly believe that the only people in favor of them are short sighted managers looking to reduce costs. Still, I keep seeing articles assuring me that, yes indeed, programmers really do like open-plan offices because enhanced communication. Or something.

Here, at last, is the truth neatly captured in a single tweet:

Posted in General | Tagged | 2 Comments

Making Us Root for Sci-Hub

A couple of months ago I wrote about Jason Shen’s article on how Sci-Hub was blowing up academic publishing. I said I was conflicted about Sci-Hub because they basically make journal articles from academic publishers available for free and that’s easy to see as stealing. On the other hand, the academic publishers, for the most part, do not have clean hands either. It’s easy to see their whole business model as rapacious and exploitative. As I say, conflicted.

Now the publishers are making it easy to root for Sci-Hub. California State University librarian Gabriel Gardner mentioned Sci-Hub during a panel discussion and The Association of American Publishers (AAP) responded by writing Gardner’s dean complaining that he had made favorable comments about Sci-Hub.

Nobody likes a tattle tail, of course, but it’s even worse than that. Gardner, it turns out, was reporting on an article he and some colleagues had written pointing out the problems with illegal sites like Sci-Hub. So not only was the AAP acting in a wholly inappropriate way to an academic discussion that they didn’t like, they didn’t even have their facts remotely correct.

As I said, the publishers don’t have clean hands and this episode just shows that no one should feel sorry for them. For years they’ve run a rent seeking scam on academia and now they’re screaming that Sci-Hub is interfering with their business model. I may be conflicted but it’s hard to feel sorry for them.

Posted in General | Tagged | 1 Comment

More Spice with Emacs and Org Mode

Tiago Oliveira Weber has a nice followup to his previous post on doing spice experiments with Org mode. I wrote about his previous post last month. His latest offering discusses how you can explore design ideas, perform calculations, run circuit simulations, and generate a report all from a single file in Emacs using Org mode.

I’m not an Electrical Engineer so I don’t really understand all the fine points of his simulation but that isn’t necessary. What’s important for most of us is how leverages Org mode and his own ob-spice to communicate between Octave (or Matlab) and ngspice, his spice software.

This, it seems to me, is so much easier than the usual way of working. Everything you do is kept in a single file that you can use to produce a final report after your design and experiments. If you’re in EE or some other discipline that has similar methodology, be sure to take a look at Weber’s post to see how you can make use of is ideas.

Posted in General | Tagged , | Leave a comment

Emacs: The Universal OS

I came across this tweet

the other day and it reminded me of Perry Metzger’s wonderful talk at the New York Emacs Meetup entitled The Editor of a Lifetime. In it he recounts how one of his fellow graduate students says he doesn’t care what operating system he uses because they’re all just boot loaders for Emacs. That’s an old joke, of course, as is the notion that Emacs is an operating system but both the tweet and the video make a good point.

One way to look at Emacs is as a universal Operating System. That is, it looks the same and (pretty much) runs the same no matter what the actual host operating system is. For Accidental Rebel this means that he can have a Unix-like shell even when he’s condemned to run on Windows. For others, it means that they don’t have to expend too many brain cycles trying to remember the quirks of whatever OS they happen to be on. For example, Dired can handle almost all file operations in a uniform way from Emacs no matter what architecture you’re using.

This notion of a universal OS may help explain why so many of us try so hard to never leave Emacs. Once you’ve learned enough Emacs you can always have a comfortable and familiar platform no matter what machine you’re running on. It’s only when you have to leave Emacs that you notice you’re in some alien environment.

Posted in General | Tagged | 1 Comment

The W3C and DRM

Posted in General | Tagged | Leave a comment

Inserting Today’s Date

Ben Maughan over at Pragmatic Emacs posted a nice little bit of Elisp to insert today’s date. That reminded me that the first Elisp, other than routine configuration lines, that I wrote was a function to insert the date. Mine was a bit different in that two of the options involve the time. Just for the record, here it is

(defun jcs-datetime (arg)
  "Without argument: insert date as yyyy-mm-dd
With C-u: insert time
With C-u C-u: insert date and time"
  (interactive "P")
  (cond ((equal arg '(4)) (insert (format-time-string "%T")))
        ((equal arg '(16)) (insert (format-time-string "%Y-%m-%d %T")))
        (t (insert (format-time-string "%Y-%m-%d")))))

(global-set-key (kbd "C-c d") 'jcs-datetime)

Without any arguments, it acts just like Maughan’s function. With one universal argument it inserts just the time. With two universal arguments it inserts the date and time. I always want my dates to be Year-Month-Day so I don’t have a %d-%m-%Y option, like Maughan.

If, like me, you tend to do most of your work from Emacs, this is a tremendously useful thing. It seems like I’m always wanting to insert a date and the above function makes it easy. Looking at the code and my current workflow, it would probably make sense to switch the first two options so that a single universal argument gives the date and time and a double universal argument gives just the time but it’s been this way for a long time and is burnt into my muscle memory so I’ll probably just leave it the way it is.

Posted in General | Tagged | 1 Comment