Another Blogging Solution

If you enjoyed yesterday’s post about Daniel Gomez using Org-mode to write his thesis, perhaps you’ll also like his other offering, An Emacs Library for frictionless Blogging.

Gomez publishes his blog on write.as, a publishing platform that allows you to make a blog post, say, by sending the Markdown content in an HTML POST request. If you read yesterday’s post, you know that Gomez is an avid Emacs and Org-mode user so naturally he wanted to write his posts with Org-mode and publish them directly from Emacs. To do that he wrote a small library that takes an Org file, extracts the title, converts the Org formatting to Markdown, sends the Markdown to write.as, and retrieves the publishing information from write.as in return.

It’s an excellent solution if you don’t mind having your blog be part of a “federated” platform such as write.as. It’s perfect for someone like Gomez, who as a PhD student and occasional blogger, doesn’t have the time or inclination to deal with a dedicated server (or virtual server) and a more complicated blogging platform such as WordPress. Once he wrote his library, publishing a post consists of writing it and calling a single function to publish it.

Take a look at Gomez’s post for the details. His code is available on GitHub.

Posted in General | Tagged , | Leave a comment

Writing a Thesis with Org Mode

I keep seeing statements from the uninformed to the effect that you can’t use Org-mode for “serious” writing. First it was, “you can’t use Org-mode for journal articles.” After John Kitchin put the lie to that story, the naysayers moved on to, “Org-mode could never be used for GNU manuals, except we have this.

The latest skirmish is about whether you can use Org-mode to write your thesis. Despite the many examples of people doing just that, we still have plenty of people saying it can’t/shouldn’t be done.

Daniel Gomez was having none of that and wrote a very nice post showing how to set up an Org-mode thesis writing environment. His thesis has all the pain points that the naysayers claim makes writing a thesis with Org-mode too hard or impossible. It’s a scientific thesis so it’s got equations, figures, and code; large parts of the thesis were published in journals with other formatting requirements; and finally, his thesis supervisor prefers to use Microsoft Word.

Gomez shows how to overcome all these obstacles and write both the journal articles and thesis in Org-mode. The journal articles can imported directly into the thesis because he’s tagged the unwanted content and formatting to be ignored when it’s used in the thesis.

If you’re about to write your thesis and would like to do so in the comfortable Org-mode environment, take a look at Gomez’s post.

Posted in General | Tagged , | Leave a comment

“Refactoring” Prose

I’ve been working on a couple of prose—as opposed to code—files. One’s fairly short (\(≈3,500\) words). The other is a bit longer (\(≈11,000\) words). I realized the other day that I was probably punctuating quotes with question marks incorrectly so I checked and found that, indeed, I’d done it wrong. In my defense, the rules for punctuating things in quotes don’t make any sense and tend toward the arcane. Regardless, the text needed fixing.

I did an occur to see how often I’d make the mistake and then I realized I could fix things on the spot by going into edit mode and using iedit to fix them all at once. The idea probably popped into my mind because of abo-abo’s great post on refactoring that did something similar.

The be clear, what I did was:

  1. Call occur with a regex describing the punctuation I wanted to correct
  2. Type e in the occur buffer to enter edit mode
  3. Mark one of the occurrences of the mistake
  4. Call iedit to fix every occurrence at once
  5. Type Ctrl+c Ctrl+c to write the changes back into the original file.

I could, of course, have used query-replace-regexp but I already had the occur buffer open and I liked being able to see all the errors at once. It’s a cute workflow for quickly making the same change multiple times in a longish file.

Posted in General | Tagged | Leave a comment

The Emacs 26.1.90 Pretest

Nicolas Petton has announced the availability of the Emacs 26.1.90 pretest. Eli is asking everyone to build and use it so that we can have an efficient test.

If you’re a macOS user, you should definitely do so even if you don’t usually bother with pretests or release candidates. I built it last night and I can already see improvements from my compile of the 26.1 branch after the emergency patches to fix the display problems introduced with macOS 10.14.

I’m using it as my working version of Emacs and even though it’s been only a day, I’m happy with it and haven’t seen any problems. If you can, please do the same.

Posted in General | Tagged | Leave a comment

Statistics and Lies

Regular readers know that we here at Irreal have occasionally been hard on researchers in the social sciences. That’s especially true for Psychology where at least one study found that only 39% of published research results could be reproduced.

One wants to believe that things are better in the “hard” sciences—especially in medicine and health where erroneous results can affect us all. Sadly, these fields are not immune either. There are several well-known examples of this such as the fat versus carbs debate where the official orthodoxy of 50 years turned out to be wrong with disastrous results for the health of the population.

Mistakes do happen, of course, but a recent article from the American Council on Science and Health reports that 1 in 4 statisticians say they were asked to commit fraud by other researchers. The particular fraud that 1 in 4 statisticians were asked to commit was altering or removing date, a clear ethical violation that everyone would consider fraud. Other types of fraud were considered, ranging from the trivial such as not showings plots that failed to strongly support the desired result to the very serious such as falsifying data or misreporting \(p\) values. The article has a table summarizing the various frauds and their reported frequency.

These findings are discouraging to those of us who believe that the purpose of science is to seek the truth or even to those of us who want to stay healthy. My guess is that this fraud is mostly the results of the perverse rewards system used by universities and funding agencies. Goodhart’s law predicts that those operating under such a system will find a way to game it. Unfortunately, one such way appears to be fraud.

Posted in General | Tagged | Leave a comment

Moving the iOS Cursor

I’m a bit under the weather today so this is just a quickie. Not only is it just a quickie, it’s a quickie of interest to only iOS users.

You know how when you’re entering text in an iOS app and want to make an edit how hard it is to position the cursor correctly? It usually takes me a two or three tries to get it where I want it.

Via Karl Voit, I now know the solution:

If it’s not clear from the tweet what you’re supposed to do, just hold the space bar down and move your finger or thumb over it to move the cursor. Most excellent. It works on both the iPhone and iPad.

Thanks to Krissy Brierre-Davis for eliminating one of my on-going annoyances.

Posted in General | Tagged | Leave a comment

Longform Writing With Org-mode

Regular readers know that I’m fascinated with how non-coders use Emacs and especially how (prose) writers leverage it to remove friction from the writing process. Phil Daniels over at The Copytist is a professional writer who’s working on a longish book of about 400 pages.

His writing environment was centered on Microsoft Windows running Google Docs. It had, apparently, been working well for shorter projects but Google Docs just couldn’t handle the larger manuscript. Daniels mentions, in particular, the difficulty of moving chapters around.

With the deadline looming, he decided to try something new and after watching Jay Dixit’s video on using Emacs for writing he installed Emacs, pasted his manuscript into an Org file and got to work. He discovered, as many have, that Emacs and Windows have a troubled relationship so he installed Debian, added the necessary packages, and had what he considers the perfect writing environment.

Two things struck me about his post. First, although I have written at length about the dangers of committing any writing that you care about to Google Docs, I’ve never used it so I was surprised that despite it popularity it doesn’t perform very well. I’ll be adding that to my list of reasons to avoid it.

Second, although Daniels is delighted with how efficient Emacs makes his writing, he hardly uses any of its features. Doubtless that will change as he becomes more experienced with Emacs and discovers new chores that Emacs can help him with but it’s amazing at how much he can get done using just a few basic Emacs navigation commands and a couple of the Org-mode structure editing functions.

If you’re interested in a writing environment, take a look at Daniels post. It’s short and it describes an environment that few would consider complete but it points the way.

Posted in General | Tagged , | Leave a comment

A Thought for the Day

So true. Are you listening Apple?

Posted in General | Tagged | Leave a comment

Government and Cybersecurity

This is almost too easy. Remember how governments everywhere are whining about not being able to read our encrypted communications and are demanding a backdoor? “Don’t worry,” they tell us, “we’re the government and we’re experts in this stuff. We know what we’re doing.”

What to make, then, of the Japanese Minister in charge of Cybersecurity who says he has never used a computer and doesn’t know what a USB drive is? To be sure, the Japanese have their own culture where things work differently from what most of us are probably used to but they, too, are flabbergasted and outraged so this doesn’t appear to be a cultural misunderstanding.

It’s easy to make fun of this type of thing and, honestly, the story is probably overblown but it does add another datum the considerable store of data indicating that governments should not be trusted with our secrets. Misuse and abuse is bad enough but the incompetence that even hypersecure government agencies such as the American NSA have demonstrated should stand on its own as an adequate reason to be skeptical of governments’ ability to protect our secrets.

Posted in General | Tagged | Leave a comment

Is Terminal Emacs Better?

Most people will, I think, agree that Betteridge’s Law applies to the headline of this post. Back in January, I wrote about a nice discussion on the Emacs subreddit about whether GUI or terminal Emacs was better. It was a balanced discussion but the consensus was that there was really no reason—absent special requirements—to prefer terminal Emacs. Aaron Bieber was more emphatic in his post Don’t Use Terminal Emacs. His final advice on the matter was “…stop using Emacs in the terminal. Full stop.”

Of course, not everyone holds that position. Over on the Emacs subreddit, vokegaf explains why he uses Emacs in the terminal and only in the terminal. He begins by listing some of the disadvantages to terminal Emacs but dismisses them as not important for him. You’ll probably disagree with his dismissal of some of them but use cases do differ. Then he goes on to list the advantages of terminal Emacs. Most of them struck me as just silly but the real issue for him is use on remote machines.

He knows about Tramp, of course, but insists that starting up a remote terminal Emacs over SSH is a better solution. That’s mostly because he likes at leave his remote environment running and attach and detach to and from it with screen or tmux. He expands on that a bit in the comments so if you’re interested in the discussion be sure to read those too.

I agree with Bieber and have never run Emacs in terminal mode as my default procedure. Sure, I have my EDITOR and VISUAL environment variables set to emacsclient and I occasionally fire up a terminal Emacs if I’m already in a terminal and need a quick edit but normally I’m always in the GUI version.

As always, everyone’s workflow is different so there’s not “right” answer. The thing about Emacs is that it let’s you have it your own way.

Posted in General | Tagged | Leave a comment