Making Things Easier

A family member and I were having an argument a discussion about the relative ease of using a MacBook Pro with macOS and a Lenovo laptop with Linux. A lot of you guys are thinking, “Yeah, I’m with the Linux guy!” but before you choose sides you should know that he has been seduced by the dark side and is a Vim user1.

Anyway, the discussion evolved into how you would put a link to a Web page open in your browser into an email. My family member said he would double click on the URL bar of the browser, switch to his email, and middle click to insert the link. I replied that I don’t even have a middle button but that I don’t need one because I’m an Emacs user and had written a bit of Elisp to automatically insert the URL of the browser’s currently active page. Thus I merely started writing my email and when I got to the place that needed the link, I just called my Elisp.

That bit of Elisp is a function called jcs-insert-url but I said that the most I ever had to type was Meta+x j i u and often I only needed part of it depending on how autocompletion was feeling at the time. I added that I could, of course, add a key binding like Hyper+u to call the function and make the whole process even easier. Then I started wondering why I hadn’t done that. I keep on typing Meta+x j i u whenever I want to insert a URL. That’s crazy. So I added the binding and now my life is even easier.

The point of this post—finally—is a reminder to myself and to you to occasionally think about your workflow and ask if there’s some adjustment that would make things easier. It’s amazing how often the answer is yes.

Footnotes:

1

I’m just trash talking. Regular readers know I was a Vi/Vim user for many years, still think highly of it, and consider it one of the two best editors for serious programmers.

This entry was posted in General and tagged . Bookmark the permalink.
  • I'm guessing that this is a renamed version of the jcs-get-link you posted about at http://irreal.org/blog/?p=2895 . Thanks for sharing! =)

    • jcs

      Actually it's a little bit different. jcs-get-link formats the URL as an Org link and asks for a label. jcs-insert-url just inserts the URL as is. That said, they are, of course, essentially the same.

      • I'm sure lots of readers would love to copy the snippet. =) Come to think of it, I should probably make a function to automatically insert a Org source block with the definition of a function...

        • jcs

          I thought I'd written a post about it but all I could find were the posts about jcs-get-link. Tomorrow, I'll make a short post with the code. Of course, as with jcs-get-link, it only works with macOS. I think, although I haven't investigated the matter, that FireFox can easily do the same thing.

  • The question is to Hyper, or not to Hyper.

    1. It probably won't be portable, it'll work on macOS and maybe Linux.
    2. We only get one on macOS.

    My experiment right now is to modify the shift key so that
    1. When struck, it acts as a caps lock. I think that I read that in one of your posts.
    2. When held, it acts as Fn (Hyper). So you get Hyper parity and your keyboard is balanced with your other modifiers.

    • jcs

      It probably won't be portable, it'll work on macOS and maybe Linux.

      It'd probably work fine with any of the BSDs too (given the right keyboard) so that leaves only Windows. One of my goals in life is to never subject myself to that again so I'm fine with Hyper.

      All that said, I could have used a different modifier. It's just that Hyper is easy on my Macs so that's what I use.

      My experiment right now is to modify the shift key so that...

      That sounds pretty neat. How do you capitalize words like at the beginning of a sentence? Let's face it, we're all yearning for a space cadet keyboard.

  • I used to use the firefox plugin org-link to grab formatted org links. But after the great Quantum Firefox plugin mass extinction event I've been looking for a replacement.

    org-mac-grab-link looks perfect but alas I am running Debian.

    In Melpa there is grab-x-link which I installed but can't seem to get to load. It uses xdotool to get titles and links from chrome and firefox.

    How difficult would it be to fork org-mac-grab-link to point to a bash script that uses xdotool instead of an apple script? And besides applescript, is there anything in org-mac-grab-url that requires mac os other than the applescript? couldn't it simply point to any external script that get's the job done? Then if someone can come up with whatever the equiv of bash scripts that are used in windows it would be cross platform.

    I'll try to find some time later this week to look into this more.

    • jcs

      Thanks. Brad. That's a great solution that will allow anyone to do the same sorts of things that jcs-insert-url and jcs-get-link. I've written about your solution in a subsequent post.