Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Show HN: An encrypted, local, cross-platform journaling app

    ShannonMax: A Library to Optimize Emacs Keybindings with Information Theory

    Bridging Elixir and Python with Oban

    Facebook X (Twitter) Instagram
    • Artificial Intelligence
    • Business Technology
    • Cryptocurrency
    • Gadgets
    • Gaming
    • Health
    • Software and Apps
    • Technology
    Facebook X (Twitter) Instagram Pinterest Vimeo
    Tech AI Verse
    • Home
    • Artificial Intelligence

      Read the extended transcript: President Donald Trump interviewed by ‘NBC Nightly News’ anchor Tom Llamas

      February 6, 2026

      Stocks and bitcoin sink as investors dump software company shares

      February 4, 2026

      AI, crypto and Trump super PACs stash millions to spend on the midterms

      February 2, 2026

      To avoid accusations of AI cheating, college students are turning to AI

      January 29, 2026

      ChatGPT can embrace authoritarian ideas after just one prompt, researchers say

      January 24, 2026
    • Business

      The HDD brand that brought you the 1.8-inch, 2.5-inch, and 3.5-inch hard drives is now back with a $19 pocket-sized personal cloud for your smartphones

      February 12, 2026

      New VoidLink malware framework targets Linux cloud servers

      January 14, 2026

      Nvidia Rubin’s rack-scale encryption signals a turning point for enterprise AI security

      January 13, 2026

      How KPMG is redefining the future of SAP consulting on a global scale

      January 10, 2026

      Top 10 cloud computing stories of 2025

      December 22, 2025
    • Crypto

      Is Bitcoin Price Entering a New Bear Market? Here’s Why Metrics Say Yes

      February 19, 2026

      Cardano’s Trading Activity Crashes to a 6-Month Low — Can ADA Still Attempt a Reversal?

      February 19, 2026

      Is Extreme Fear a Buy Signal? New Data Questions the Conventional Wisdom

      February 19, 2026

      Coinbase and Ledn Strengthen Crypto Lending Push Despite Market Slump

      February 19, 2026

      Bitcoin Caught Between Hawkish Fed and Dovish Warsh

      February 19, 2026
    • Technology

      Show HN: An encrypted, local, cross-platform journaling app

      February 19, 2026

      ShannonMax: A Library to Optimize Emacs Keybindings with Information Theory

      February 19, 2026

      Bridging Elixir and Python with Oban

      February 19, 2026

      Old School Visual Effects: The Cloud Tank (2010)

      February 19, 2026

      Show HN: A Lisp where each function call runs a Docker container

      February 19, 2026
    • Others
      • Gadgets
      • Gaming
      • Health
      • Software and Apps
    Check BMI
    Tech AI Verse
    You are at:Home»Technology»ShannonMax: A Library to Optimize Emacs Keybindings with Information Theory
    Technology

    ShannonMax: A Library to Optimize Emacs Keybindings with Information Theory

    TechAiVerseBy TechAiVerseFebruary 19, 2026No Comments5 Mins Read2 Views
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    ShannonMax: A Library to Optimize Emacs Keybindings with Information Theory
    Share
    Facebook Twitter LinkedIn Pinterest WhatsApp Email

    ShannonMax: A Library to Optimize Emacs Keybindings with Information Theory

    ShannonMax

    ShannonMax uses information theory to analyze your emacs usage and suggest better keybindings.

    In particular, it helps you find commands where changing the keybinding can significantly reduce the amount you type.

    WARNING: When using a keylogger, be careful not to log any sensitive information!

    Cite This:
    Straus, S. (2024). Better Keybindings with Information Theory [Computer software]. https://github.com/sstraust/shannonmax

    Original Talk: https://www.youtube.com/watch?v=MytPttbIUOY

    How to Use

    1. Download the files shannon-max.el, and target/emacskeys-0.1.0-SNAPSHOT-standalone.jar. Put them in the same directory, somewhere in your emacs path. So the structure should look like:

      ~/.emacs.d/custom/shannon-max.el
      ~/.emacs.d/custom/target/emacskeys-0.1.0-SNAPSHOT-standalone.jar
      

      And you should have something in your .emacs that looks like this:

      (add-to-list 'load-path "~/.emacs.d/custom")
      (require 'shannon-max)
      (setq shannon-max-jar-file
        (expand-file-name "~/.emacs.d/custom/target/emacskeys-0.1.0-SNAPSHOT-standalone.jar"))
      
      

      You’ll also need to have java/the jvm available on your machine and chmod +x the jar file to make it executable.

    2. Start collecting data.

      Add
      (shannon-max-start-logger) to your .emacs configuration file.

      After a few minutes, check the contents of ~/emacs-logged-keys to verify the logger is working correctly.

    3. Once you have enough data, call M-x shannon-max-analyze to see the results!

    Viewing the Output

    At any time, you can call M-x shannon-max-analyze to see the results.

    In the results buffer:
    C-c C-n to scroll down a page of results
    C-c C-p to scroll up a page of results
    C-c C-e to call keymap-global-set to globally bind a keysequence (emacs version 29 only)

    Interpreting the Results

    Shannonmax compares the actual length of your keybinding (e.g. “x e” has length 2), to the theoretical length of your keybinding (how long it should be, given how much you actually use it). We use information theory on the logged data to determine a keybinding’s theoretical length.

    Commands you use more often should have shorter keybindings, so in general, the strategy is to rebind “Keybindings that are too long” to something that’s shorter and more convenient. If you run out of keys on your keyboard, you can free up space by unbinding infrequently used “Keybindings that are too short”.

    You can learn more about it by watching the video here: https://www.youtube.com/watch?v=MytPttbIUOY

    Customizing the Behavior

    shannon-max-custom-keypress-cost

    By default, shannon-max assumes every keypress costs 1. Sequences with control characters are given an additional cost of 1 per control character.

    So for example:

    • “a” Has a cost of 1
    • “a b” Has a cost of 2
    • “C-a” Has a cost of 2
    • “C-M-a” Has a cost of 3
    • “C-x C-s” Has a cost of 4

    If you have a different view of the world, you can write your own cost function.

    If you create your own cost function, you’ll also need to modify alphabet-size to the corresponding value.

    shannon-max-alphabet-size

    This represents “How much can I type with a single keypress?”. It’s used to compute the theoretical length of a given key command.

    For example, if you only have two keys on your keyboard, then in theory your keybindings must be very long, if you are to represent every possible command with just 2 keys. But if you have 100 keys on your keyboard, your keybindings can be very short.

    By default, we assume you have 52 keys on your keyboard, and every keypress costs 1.

    If you change your cost function, you need to calculate the correct alphabet size for your new cost-weighted “keyboard”. The right way to do this is by solving the characteristic function as described here: https://people.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf (page 3). I want to make this calculation more automatic, and it’s planned for future work.

    If you’re too lazy to calculate it out you can fiddle with the value until it seems right, and you should still get somewhat useful/actionable results.

    shannon-max-filtered-commands

    A list of emacs commands to ignore from the output. By default we also filter all commands matching “lambda”, “(“, or “[“. This is particularly useful for removing things like the self insert command.

    shannon-max-filter-commands-fn

    Basically does the same thing as shannon-max-filtered-commands, but as a function.

    Known Limitations

    Keylogger Limitations

    Certain packages mess with the keylogger’s ability to correctly log commands. In particular, shannonmax uses real-last-command and this-command-keys-vector inside of post-command-hook in order to determine what keys/commands to log. Certain packages (like ido-mode) interfere with our ability to correctly set these values. We use post(rather than pre)-command-hook so that logged keys are correctly set in god-mode.

    If you have feedback on how to get around this, I’d love your thoughts and advice!

    Better Support For Major Modes

    Certain keybindings are only active in major/minor modes. Ideally we’d compute separate keymaps for every major minor mode, but it’s tricky/takes a lot of thought and care to handle this correctly in a way that’s relevant and useful.

    Support for Multi-Command Codings/Arithmetic Codings

    To get really optimal output, we’d like to understand how pairs or sequences of commonly used emacs commands can be folded into a single keybinding

    More Things to Work On

    • Easier Installation on MELPA
    • Better Custom UI menus for rebinding keys (rather than keymap-global-set)
    • Better support for capitalized letters

    Any other thoughts? Feel free to open an issue on this Repo 😀

    Share. Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Telegram Email
    Previous ArticleBridging Elixir and Python with Oban
    Next Article Show HN: An encrypted, local, cross-platform journaling app
    TechAiVerse
    • Website

    Jonathan is a tech enthusiast and the mind behind Tech AI Verse. With a passion for artificial intelligence, consumer tech, and emerging innovations, he deliver clear, insightful content to keep readers informed. From cutting-edge gadgets to AI advancements and cryptocurrency trends, Jonathan breaks down complex topics to make technology accessible to all.

    Related Posts

    Show HN: An encrypted, local, cross-platform journaling app

    February 19, 2026

    Bridging Elixir and Python with Oban

    February 19, 2026

    Old School Visual Effects: The Cloud Tank (2010)

    February 19, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Ping, You’ve Got Whale: AI detection system alerts ships of whales in their path

    April 22, 2025684 Views

    Lumo vs. Duck AI: Which AI is Better for Your Privacy?

    July 31, 2025273 Views

    6.7 Cummins Lifter Failure: What Years Are Affected (And Possible Fixes)

    April 14, 2025156 Views

    6 Best MagSafe Phone Grips (2025), Tested and Reviewed

    April 6, 2025118 Views
    Don't Miss
    Technology February 19, 2026

    Show HN: An encrypted, local, cross-platform journaling app

    Show HN: An encrypted, local, cross-platform journaling appMini Diarium An encrypted, local cross-platform journaling app…

    ShannonMax: A Library to Optimize Emacs Keybindings with Information Theory

    Bridging Elixir and Python with Oban

    Old School Visual Effects: The Cloud Tank (2010)

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    About Us
    About Us

    Welcome to Tech AI Verse, your go-to destination for everything technology! We bring you the latest news, trends, and insights from the ever-evolving world of tech. Our coverage spans across global technology industry updates, artificial intelligence advancements, machine learning ethics, and automation innovations. Stay connected with us as we explore the limitless possibilities of technology!

    Facebook X (Twitter) Pinterest YouTube WhatsApp
    Our Picks

    Show HN: An encrypted, local, cross-platform journaling app

    February 19, 20262 Views

    ShannonMax: A Library to Optimize Emacs Keybindings with Information Theory

    February 19, 20262 Views

    Bridging Elixir and Python with Oban

    February 19, 20262 Views
    Most Popular

    7 Best Kids Bikes (2025): Mountain, Balance, Pedal, Coaster

    March 13, 20250 Views

    VTOMAN FlashSpeed 1500: Plenty Of Power For All Your Gear

    March 13, 20250 Views

    This new Roomba finally solves the big problem I have with robot vacuums

    March 13, 20250 Views
    © 2026 TechAiVerse. Designed by Divya Tech.
    • Home
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms & Conditions

    Type above and press Enter to search. Press Esc to cancel.