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

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