Skip to content

meld

This directory contains voice control integration for Meld, a visual diff and merge tool. By defining application identifiers and custom key mappings, this module enables hands-free file comparison and patch navigation within Meld.

The integration is composed of two main files:

  • meld.py — Defines the application context, targets the correct executable, and implements tab control actions.
  • meld.talon — Map voice commands to specific shortcut keys for navigating diff changes and activates the generic tab management interface.

Application Definition and Tab Management

The meld.py script configures Talon to recognize Meld on Windows by checking for either the window title Visual diff and merge tool or the executable meld.exe.

Once the application is focused, meld.py overrides Talon's standard tab actions to match Meld's shortcut scheme:

  • Tab Creation: tab_open maps to ctrl-n.
  • Tab Navigation: tab_previous and tab_next map to ctrl-alt-pageup and ctrl-alt-pagedown respectively. Specific tabs (1 through 9) can be jumped to using alt-[1-9] via tab_jump.
  • Unsupported Actions: Actions like duplicate tab, reopen tab, and jump to final tab are explicitly stubbed out with debug prints, as Meld does not natively support these workflows.

Voice Commands

The meld.talon file links voice triggers to the corresponding keyboard actions. It enables the global user.tabs tag so that all standard tab-navigation voice commands function seamlessly using the mappings defined in the Python file.

Additionally, it defines specialized commands for stepping through file differences (diff hunks):

  • "change next": Triggers alt-down to jump to the next code change.
  • "change previous" or "change last": Triggers alt-up to jump to the previous code change.