While trying to edit an awk file with emacs 28.2 its not self-inserting all charcaters, but trying to evaluate certain keystrokes! For example if I press 3 emacs sees C-u 3-! Pressing a causes it to query me for Cscope Initial Directory! Clearly some mode has been enabled that I didn't ask for and don't want!

Looking at modes (C-h m) I see:

Enabled minor modes: Abbrev Auto-Composition Auto-Compression
Auto-Encryption Blink-Cursor Column-Number Cscope
Display-Fill-Column-Indicator Electric-Indent Engine File-Name-Shadow
Font-Lock Global-Auto-Revert Global-Edit-Server-Edit Global-Eldoc
Global-Font-Lock Global-Undo-Tree Hs Indent-Tabs Line-Number
Mac-Mouse-Wheel Menu-Bar Override-Global Ruler Shell-Dirtrack
Show-Paren Tooltip Transient-Mark Undo-Tree Which-Function Winner

(Information about these minor modes follows the major mode info.)

AWK//l mode defined in ‘cc-mode.el’:
Major mode for editing AWK code.
To submit a problem report, enter ‘M-x c-submit-bug-report’ from an
‘awk-mode’ buffer.  This automatically sets up a mail buffer with version
information already added.  You just need to add a description of the
problem, including a reproducible test case, and send the message.

But what enabled AWK//l mode? It's not in auto-mode-alist!

For the moment my workaround is to use find-file-literally.

M-x c-submit-bug-report is also failing - possibly I need to update org-mode - TBC.

  • 1
    What does Org mode have to do with c-submit-bug-report? As for autto-mode-alist, it has an entry for awk that invoked awk-mode: why it shows up as AWK//l on the mode line I cannot guess, but I'm pretty sure it's the same mode. BTW, that's a major mode. OTOH, you probably don't need all the minor modes that are enabled. Start with M-x cscope-mode which should toggle it off (check with C-h m again) and restore a to sanity. I'm not sure who would be responsible for the 3 insanity. If worse comes to worst, turn them all off one by one and see which one is the culprit.
    – NickD
    Commented Jun 17, 2023 at 0:24
  • 1
    It is not awk-mode that does crazy things with the keys: when I open foo.awk it is in awk-mode (which shows AWK//l on the modeline), but both 3 and a are inserted into the buffer. It has to be one of the minor modes that are enabled on that buffer.
    – NickD
    Commented Jun 17, 2023 at 0:31
  • Thanks @NickD for responding. Interesting, I don't have a cscope-modeinteractive function. Using M-x cscope-minor-mode says that it turns that off but the digit keys are still assigned, as reported by C-h k 3 : "3 runs the command digit-argument (found in cscope-list-entry-keymap)". I recall updating github.com/dkogan/xcscope.el recently, I shall take a look at that.
    – alls0rts
    Commented Jul 4, 2023 at 5:41

1 Answer 1


It turned out to be a bug in modified xscope.el function cscope-minor-mode (line 3111: (use-local-map cscope-list-entry-keymap))) , which is enabled via a hook in my init.el

(require 'xcscope)
(add-hook 'c-mode-common-hook 'cscope-minor-mode)

That bug is not present in the official upstream version, I have updated to that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.