Deactivate Mark

If you’re like me, you probably don’t think very much about activating and deactivating the mark. We know it gets set when we do a large movement or when we set it manually with Ctrl+Space. We know that the current region is defined by the point and mark and maybe even that we can jump to a whole list of current and previous marks.

Leave it to Marcin Borkowski (mbork), who’s an expert at teasing out Emacs minutia, to discover and explain some of the mystery surrounding the deactivation of the mark. It turns out that there’s both a function and variable named deactive-mark. The function does just what it says on the tin: if you call it, the mark is deactivated.

The use of the variable is a little more complicated. The TL;DR is that Emacs has its own notions about when to deactivate the mark and that this is mediated through the deactivate-mark variable. Being Emacs, a user can, of course, change Emacs’ default ideas of mark deactivation. You can read all the details in mbork’s post.

The truth is that you’ll probably never need to fine tune Emacs’ mark activation/deactivation but if you’re writing a function that depends on the current mark being maintained, you should definitely take a look at mbork’s posts to learn how to avoid having Emacs change it out from under you.

Update [2021-04-14 Wed 18:04]: Added link to mbork’s post.

Posted in General | Tagged | Leave a comment

Mickey on Native Compilation

As a nice coda to Saturday’s post on native compilation, the incomparable Mickey has his own post on native compilation. As most Emacers know, Mickey is an Emacs expert and his opinions on Emacs matters are always worth paying attention to.

Mickey says that native compilation is a significant step forward that has few downsides. Those “downsides” boil down to a new dependency (libgccjit) and the fact that initial compilation is slow. He adds that even the slow compilation has improved in the last 6 months.

He ends the post with his recipe for compiling the native compilation branch. With the coming merging of that branch into Master, it will be marginally easier. Of course, the feature is still under development so it’s not for the timid but if you don’t mind living on the edge or if you want to compile a second version of Emacs to play around with, it’s pretty easy.

Posted in General | Tagged | Leave a comment

Name & Shame: Procter & Gamble

The other day, I saw this disturbing post on Daring Fireball. The TL;DR is that Procter & Gamble (P&G) has been working with several Chinese trade and advertising groups to develop and test a way of bypassing Apple’s upcoming iOS change that requires a user’s permission to track them. You can read the details in this Mint article or, if you have a subscription, the Original Wall Street Journal article.

The adtech scum hate Apple’s new policy, of course, and Facebook has been particularly vocal about it but we don’t usually think of P&G in connection with all this. They are, however, one of the largest advertisers in the world, depend heavily on targeted advertising, and even maintain their own database of over 1.5 billion profiles.

If this sort of thing bothers you, you’re probably thinking that you’ll make your own silent protest by refusing to buy P&G products. Unfortunately, P&G is even harder to avoid than Google. You’d probably be surprised at how many of their products you use everyday. If you’re curious, here’s a list of their brands. As you can see, they’re everywhere1. That’s too bad because they really should be punished by the customers they’re abusing.

Footnotes:

1
Obligatory reference to Chickenman omitted.

Posted in General | Tagged | Leave a comment

Native Compilation: Ready to Merge

Eli Zaretskii has announced that he expects to merge the new native compilation code into the Master branch next week. This is a significant milestone for a really important feature.

Most of the comments were along the lines of “I’ve been using this feature for months and haven’t had any problems.” A few expressed concerns about some edge cases but I didn’t see any show stoppers. The largest TODO appears to be documentation.

Once it gets merged into Master, we can reasonably expect that it will officially be released with Emacs 28. Perhaps—we can only hope—native compilation will put an end to the “Emacs is slow” snark. But probably not.

Posted in General | Tagged | Leave a comment

Red Meat Friday: Journalism

You guys might think I’m hard on journalists but here’s how an expert does it:

Posted in General | Tagged | Leave a comment

Running a Shell Command from Emacs

Over at Emacs Redux, Bozhidar Batsov has a short post on using Meta+! to run a shell command from the minibuffer. The output can go to various places—see Batsov’s post for the details—but usually what you want is to specify the prefix argument (Ctrl+u Meta+!) so that the output of the command is inserted at point.

It’s a useful command but I hardly ever use it. I’m much more likely to use shell-command-on-region (Meta+|) which pipes the contents of the buffer into a shell command. Analogously to Meta+!, specifying the universal argument will cause the contents of the buffer to replaced by the output of the shell command.

Emacs has so much builtin functionality that you probably won’t use these commands very often but sometimes they’re just what you need.

Posted in General | Tagged | Leave a comment

No Post Today

I’ve been under the weather most of the day and am only now beginning to feel better so there will be no (substantive) post today.

Posted in Administrivia | Leave a comment

Justice!

This wants to be a Red Meat Friday item but it’s not Friday and there’s not really any red meat since everyone—but Zuckerberg, perhaps—is totally onboard with this. So no red meat but all the schadenfreude you can eat.

Of course, as Kontra says, “So what?”

Posted in General | Tagged | Leave a comment

The TSA: Keeping Us Safe From Cash

One, not so bad, consequence of covid19 is that we haven’t heard much from the TSA and its shenanigans. That doesn’t mean, however, that they haven’t been busy violating people’s rights.

You’d think that traveling domestically with cash is legal and you’d be right. If you call the government and ask them, they’ll tell you it’s legal and there are no restrictions on carrying any amount of cash. Apparently, the TSA didn’t get the memo. If the TSA screeners discover you’re carrying (more than pocket) cash, they will detain you and turn you over to law enforcement who will confiscate the money without any accusation of illegal activity. It turns out to be very difficult to get it back—usually by filing suit—and typical takes 6 months or longer. Again, all this happens with no charges being filed. They just take your money and won’t give it back unless you force them to.

The Institute for Justice, an organization that fights intrusive government actions like these, has filed suit to put an end to this piracy and has just achieved its first victory. The US District Court rejected the government’s attempt to squash their suit and the case is proceeding. One can only hope that the IJ will manage to put an end to this disgraceful practice.

I first became aware of the IJ when they intervened in the infamous Kelo Decision and helped get laws passed in 43 states prohibiting such dubious takings. If you’re an American who cares about your rights, the IJ is an apolitical organization doing excellent work that could use your support.

Posted in General | Tagged | Leave a comment

Reading PDF Files with DocView

Emacs-Elements has a nice demonstration on using Emacs’ DocView to read PDF files. One of the nice things about DocView—as opposed to PDF Tools—is that it can read PS, DVI, Djvu, and ODF files as well as PDF files. The downside, of course, is the way it works. When you open a document with DocView, it uses an external tool to render it as one or more PNG files. That can take a few seconds for a long document but more importantly—for me, at least—is that the PNGs are cached. That makes it speedy to reopen the document but it clutters up your file system unless you manually delete the cache.

The video shows how to configure DocView and integrate it with Bookmarks+ to make it easy to locate and open documents. It turns out that you can use any of three external programs to render PDFs into PNGs and the video has some advice on which to use.

Most of the rest of the video demonstrates how to navigate through a document and do things like extracting a rectangular region. DocView is surprisingly featureful and you can see some of that in the video.

If you can’t get PDF Tools working or don’t want to bother trying, DocView is a builtin solution that works well. Its main deficiency, as compared to PDF Tools, is that you can’t annotate the PDF.

Posted in General | Tagged | Leave a comment