The Author On Inhibit Mouse

Note

Sorry this is late. The Internet has been out all day here.

Post

James Cherti, the author of inhibit-mouse, has a blog post that talks about the package. Irreal wrote about the package last week but you may enjoy learning a little bit more about it first hand from its author.

Cherti discusses why you might want to disable the mouse and why he believes that inhibit-mouse is a better solution than the disable-mouse package. The majority of his post explains how to configure the package: it turns out that it’s very configurable. The information in Cherti’s blog post is much the same as the README on his GitHub respository for the package so you can read either one.

As I said last week, it’s really easy to generate unintended mouse actions especially if you’re working on a laptop with a trackpad. Inhibit-mouse is an easy way of preventing that and helping you wean yourself from Emacs mouse usage.

Despite what you read here on Irreal and elsewhere, there isn’t really anything wrong with using a mouse with Emacs or any other app but if you prefer not to or, if like me, you find yourself making inadvertent mouse clicks, inhibit-mouse or disable-mouse are fairly easy ways to solve the problem.

Posted in General | Tagged | Leave a comment

Eliminating Emacs “Bloat”

Over at the Emacs subreddit, emacff wants to know how he can eliminate Emacs “bloat”. It’s a harmless question and if it’s purpose was trolling, it largely failed as emacff received reasonable answers to his question. Still, it’s annoying. We see this sort of question all the time. Someone is in a tizzy because Emacs includes the doctor or tetris commands or something else the complainer doesn’t see the point of.

There are two answers to these complaints. The general answer is that Emacs is best thought of as a modern day Lisp Machine so of course it has functions not related to editing just as the original Lisp Machines did. The editor is just one function of many.

The specific answers is that these functions—and, indeed, many others—use virtually no resources except for a tiny bit of disk space. That’s because many Emacs functions aren’t loaded until they’re called so the only resources they’re using is the disk space that holds their code. On a modern computer that’s literally in the noise as far as disk space is concerned.

Emacs users are famous for spending a huge number of cycles fiddling with their editor configuration and I suppose worrying about removing unwanted functionality is another example of that. Except users tweak their configuration to improve their workflow. Eliminating tetris from your Emacs build doesn’t improve anything. It just wastes your time. To my mind, it’s like complaining about some application your OS provides but that you don’t use. Sure, you can get rid of it. Until the next OS update. Similarly with Emacs. All you’re doing is introducing a reoccurring task to be performed every time you update your editor.

It is, of course, possible to do what emacff wants but it’s a lot of work and requires technical skill that many users—especially those who ask questions like this—are unlikely to have.

Posted in General | Tagged | Leave a comment

Obscure Emacs Packages: tmr

Jakub Nowak has entered the Emacs Carnival: Obscure Packages sweepstakes. His entry is about tmr. For those of you who don’t know, tmr is a packages that allows you to set timers from within Emacs.

Until I got my iWatch last April, I never cared much about timers. I’d just look at the clock and wing it. My iPhone, of course, has a timer but I didn’t use it a lot. With the iWatch, setting a timer and having it with you all the time is easy and I got in the habit of using timers more than I had.

Still, if you’re working on your computer and need to set a timer for something you’re doing on that computer, it’s natural to have the timer running on the computer itself. The tmr package from Protesilaos Stavrou (Prot) is just what you need. You can set multiple timers in various ways and display a list of active and expired timers from within Emacs.

Take a look at the manual at the above “tmr” link to see the capabilities and how to access them.
Prot, of course, has contributed many packages and in the scheme of things this may seem like a small one but when you want to time something, it’s just what you need. Take a look and see if you don’t agree.

Posted in General | Tagged | Leave a comment

Adding Web Links To BibTeX Via Org Protocol

In a nice followup to yesterday’s post on Casual BibTeX, Charles Choi has another post on easily capturing a Web link to your BibTeX file. The idea is that you’re looking at some paper or other information in your Web browser and want to capture the reference to your BibTeX file.

The method works by abusing the Org protocol mechanism to deliver capture template information to a BibTeX file rather than an Org file. It’s really simple to set up. You merely add the capture template that Choi provides to your list of capture templates and you’re good to go.

It’s not completely automatic. You still have to specify the Author and Organization when prompted in the minibuffer but it’s much easier than entering all the information by hand and you have the advantage the the BibTeX schema will be respected.

If, like a lot of people, you locate your references on the Web, Choi’s trick will save you some time and effort. To be sure, it’s not as powerful as John Kitchin’s Org-Ref but as a simple method of capturing a BibTeX entry from the current Web site, it’s perfect. If you need more, take a look at the Org-Ref video linked above to get an idea of how far you can push the Web site to BibTeX idea.

Posted in General | Tagged | Leave a comment

Casual BibTeX

Charles Choi is at it again. He has a new addition to his Casual suite. This time it’s for handling BibTeX files. As you probably know, BibTeX files are essentially plain text databases of bibliographic data. They’re deeply integrated with LaTeX but are also supported by Emacs and Org mode.

The problem is that, being a database, the BibTeX file has a schema that must be adhered to in order to ensure proper operation with LaTeX and Org mode. Emacs, of course, has a mode to handle all that but Choi finds it less than adequate. The commands are hard to discover and remember and Choi believes they are insufficiently opinionated in enforcing the BibTeX schema.

His newest Casual app, Casual BibTeX, aims to fix this in the same way that the other Casual apps have addressed their domains. The app provides a Transient menu that makes remembering the Emacs commands easy and also enforces the BibTeX schema with a forms based interface.

If you find yourself routinely adding and editing BibTeX entries you should take a look at Choi’s latest Casual app. Even more to the point, if you only occasionally deal with BibTeX files, you have even more reason to embrace Casual BibTeX because you probably won’t remember the BibTeX mode commands or the format of the BibTeX schema.

Posted in General | Tagged | Leave a comment

Obscure Emacs Packages: Yankpad

Randy Ridenour has risen to the challenge from the latest Emacs Carnival on obscure Emacs packages. His candidate is the Yankpad package. I vaguely remember hearing about Yankpad (edit: I mentioned it here) but didn’t remember anything about it so I’m glad Ridenour mentioned it.

The TL;DR is that Yankpad is a sort of reimagined YASnippet by Erik Sjöstrand. It’s like YASnippet but different. One difference that I really like is that all the snippets are kept in a single Org file. That makes it easy to add, delete, and edit snippets.

Another difference is that instead of being organized by major mode as YASnippet is, Yankpad is organized by “categories”, which are groupings that you define. Those categories can be things like projects, classes, email, or whatever makes sense to you. You can also have global categories for snippets that you want available everywhere.

Another nice thing about Yankpad is that if you have YASnippet installed, Yankpad will pass its expanded text through it. That means things like YASnippet’s tab stops and escape into Elisp will work with Yankpad too. It seems like the best of two worlds.

There are several ways of specifying expansions and ways to trigger them. It seems like the typical “scratch an itch” project. Every time Sjöstrand needed a new feature or another way of adding snippets, he simply added it. The result is a nice package that can meet most or all of your snippet needs. Take a look at Ridenour’s post or the Yankpad GitHub repository for the details.

Posted in General | Tagged | Leave a comment

On “Everything In Emacs”

It’s a matter of faith here at Irreal, and in many other places, that any function that can be brought into Emacs should be brought into Emacs. Oddly, to us true believers, there are those who disagree.

One such person is Michał M. Sapka who argues that editors are for editing text not flying spaceships. Sapka is not the usual know-nothing who’s never gotten within six feet of Emacs. He has, in fact, been using Emacs for a number of years. Recently, he’s returned to Vim specifically because he thinks that editors should edit text and not do things like read email or handle version control. He says that if he wants X/—where /X is not an editing function—he’ll use a dedicated X application. He wants small, dedicated, programs that do one thing well. That is, of course, the Unix Philosophy that almost everyone claims allegiance to.

Despite claiming otherwise, it seems to me that Sapka doesn’t really understand Emacs’ point of view. As I’ve said many times, I think that point of view is best expressed as saying that Emacs is today’s version of a Lisp Machine. Viewed that way, Emacs is not an editor. It does have an editor function but as with the original Lisp Machines, that’s just one of many functions. As much as I hate trotting out the tired old meme, Emacs really is more like an operating system that thinks of the underlying operating system as a device driver.

Emacs has modes and packages that act like Sapka’s dedicated apps and as Àlvaro Ramírez has shown you can even glue them together so that the output of one is the input of another. In short, you don’t have to give up the Unix Philosophy to use Emacs. You can have it while at the same time enjoying the many advantages of using Emacs.

Posted in General | Tagged | Leave a comment

Cycling Through Line Wrapping Methods

One of the strengths of Emacs is that for most operations there are options. Line wrapping is a case in point. There are several line wrapping methods and which one you use depends on context.

When coding, you may not want any line wrapping. For text, it’s my experience that wrapping at fill-column is usually a good solution unless you need to export the text. In that case, assuming a fixed line length probably won’t work that well: a good line length on a computer screen is going to be a mess on a cell phone. I’ve long since solved that problem by using visual-line-mode for my exported text. It looks good on my screen as I’m writing it and will automatically adjust to whatever screen that it’s displayed on—at least for the devices that commonly export to. A lot of people use it for all their text modes.

Still, there’s a reason we have all those wrapping methods and depending on what you’re doing, you may want to use one or the other. It would be nice to have a way of cycling through the various methods. Sacha Chua to the rescue. She has a nice bit of code that cycles through

  • Having everything on one line
  • Breaking the line at the fill-column
  • Having at most one sentence per line but respecting fill-column
  • Having one sentence per line irrespective of fill-column.

That makes it easy to pick the option that’s best for any particular situation or even to experiment with the options. All the code is in the post and is easy to follow. If you find yourself needing to switch between various line wrapping methods, take a look at her post for some ideas.

Posted in General | Tagged | Leave a comment

Org Links Everywhere

Sacha Chua has a very nice post on using Org links everywhere. Chua really likes the ability to insert links that Org mode provides and wishes she could use it everywhere. It’s Emacs so of course she can do that.

Her post is a long explanation of how she accomplished that. Being Sacha, she wanted some specific actions depending on the type of link and where it was being inserted. You can read about those rules and the code she uses to accomplish them in her post.

Her exposition is fairly long and detailed so rather than try to summarize it, I urge you to take a look at her post. If you’re interested in the same sort of thing, her code is available in the post itself and from links that she provides.

As Chua says, “Consistent keybindings mean less thinking.” Being able to use Ctrl+c Ctrl+l to insert links anywhere—not just in Org buffers—is a real win, especially if you have some bespoke rules as to what the default link description should be.

Chua’s post is another example of the customizations that allow her to get so much done but, more importantly, how the flexibility of Emacs allows a user to fine tune Emacs to be exactly what’s needed to accomplish the user’s workflow with the least effort.

Posted in General | Tagged , | Leave a comment

Turning Off The Mouse In Emacs

If you’ve been around Irreal for even a little while, you know I hate using the mouse. I don’t like to use it anywhere but I particularly hate using it in Emacs. So I don’t—mostly. I use WebKit to display my HTML emails and it’s convenient to use the track pad (or the arrow keys) to scroll the email but mostly I never use the mouse while I’m in Emacs. Unfortunately, it’s really east to get inadvertent mouse actions with a track pad because your hands naturally lie on it when you’re typing.

If you, too, hate having to deal with the mouse, James Cherti—whom I’ve written about before [1, 2, 3]—has a solution. His inhibit-mouse package effectively turns off the mouse when you’re in Emacs and the mode is enabled. It seems like a nice package and may be just what you need.

As much as I hate the mouse—including the inadvertent clicks that take me to a different window in the middle of my work—I’m not sure I’d want to turn it off. The times when I do want to use it, it’s is to save work and having to stop and re-enable the mouse largely negates that.

Still, you may differ and, if so, this package could be just what you need to bring your runaway mouse under control. Cherti has a good write up about it in his README at the above link so take a look if you think you might be interested.

Posted in General | Tagged | Leave a comment