1

I mistyped some command sequence and ESC stopped working as a meta prefix in Aquamacs (it still functions as usual in the command-line emacs, including both Apple's system version and the command-line version that comes with Aquamacs). Afterwards, hitting ESC generates the <escape> function key. Unfortunately, I didn't notice in time for view-lossage to tell me what I did. I restarted Aquamacs in the hope of restoring functionality, but the issue persisted.

I've hunted around in the startup files I know of that have been modified recently (~/.emacs, ~/.emacs.d/{.emacs.desktop,SessionDesktop.el}, ~/Library/Preferences/Aquamacs Emacs/{.emacs.desktop,customizations.el}), but all of the relevant settings I can find seem to be correct. ESC is still listed as a prefix command in the bindings for major mode; globally, its binding is listed as ESC-prefix. meta-prefix-char is listed as 27. When started without init files, ESC works as meta prefix.

key-translation-map doesn't appear to have an entry for ESC (I didn't see anything with emaps-describe-keymap, and (lookup-key key-translation-map [27]) returns nil).

What else might I examine to determine which setting to change? Is there any other steps I should take to restore ESC as the meta prefix?

outis
  • 178
  • 8
  • 1
    Have you checked the modification dates of the persistent user-configuration files and peeked inside anything that had activity on or about the date/time you experienced the change that affects new launches of the application? It has been a few years since I played with Aquamacs, but there are some user-configuration files that you should be checking to troubleshoot this issue. And, if you played with things like Karabiner, or SystemPeferences keyboard stuff, then check that too. – lawlist Dec 14 '18 at 06:07
  • 1
    Does it work if you run `/Applications/Aquamacs.app/Contents/MacOS/Aquamacs -q` in the terminal to launch Aquamacs with no init files? I have had something like this happen on occasion with Aquamacs, although it has always been fine after a restart. – Win Dec 15 '18 at 02:07
  • @Win: Thanks, good tip. ESC does work with -q. Time to try taking out init files. – outis Dec 15 '18 at 22:35
  • @lawlist: there aren't many with more recent mod dates. See updated question. – outis Dec 15 '18 at 22:36
  • 1
    Maybe related: https://emacs.stackexchange.com/questions/14755/how-to-remove-bindings-to-the-esc-prefix-key. You could take a look at `(lookup-key key-translation-map [27])`. – Tobias Dec 15 '18 at 23:41
  • @Tobias: I had checked key-translsation-map with emaps-describe-keymap and didn't see an entry for code 27, but that's much more direct; I'll try it in case I overlooked the entry. – outis Dec 15 '18 at 23:48
  • @Win: you provided the key. if you post the process of using `-q`, then selective disabling (binsearch!) of init files & (if a culprit file is found) lines in the file, then I'll accept. – outis Dec 16 '18 at 00:00
  • @outis you figured it out, so mark your answer as accepted, so others will know that it worked if they come across it later. – Win Dec 16 '18 at 22:53

1 Answers1

0

The culprit turned out to be a key binding. The mistyped command isn't relevant.

Disabling the init files in groups, I narrowed it down to .emacs. Searching through it for keybindings related to meta and ESC, I came across a binding for [escape C-tab]. Removing the binding and restarting Aquamacs restored functionality. I had found my culprit.

As for why the keybinding was there, I had tried to bind [M-C-tab] to #'simple-unindent; when that didn't work, I bound [escape C-tab]. That bounding held, but also caused the described behavior.

outis
  • 178
  • 8