Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<ESC> in editing mode triggers Proof General autocomplete #8853

Closed
carlpaten opened this issue May 5, 2017 · 6 comments
Closed

<ESC> in editing mode triggers Proof General autocomplete #8853

carlpaten opened this issue May 5, 2017 · 6 comments
Labels
- Bug tracker - Coq stale marked as a stale issue/pr (usually by a bot)

Comments

@carlpaten
Copy link

Description :octocat:

Pressing <ESC> to enter normal mode triggers Proof General autocomplete.

Reproduction guide 🪲

  • Install Proof General (I used the Ubuntu package)
  • Start Emacs
  • Open a .v file
  • Enter editing mode with i
  • Write o
  • Press <ESC>

Observed behaviour: 👀 💔
o is autocompleted into omega; editing mode switched to normal mode

Expected behaviour: ❤️ 😄
No autocompletion, just mode switching.

System Info 💻

  • OS: gnu/linux
  • Emacs: 25.1.1
  • Spacemacs: 0.200.9
  • Spacemacs branch: master (rev. 8e1af14)
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(helm emacs-lisp)
  • System configuration features: JPEG SOUND GPM DBUS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 ZLIB

Backtrace 🐾

@carlpaten
Copy link
Author

The report above was hand-transcribed, apologies for any errors.

I would love a work-around, I can't figure out what's going on.

@chkl
Copy link

chkl commented May 8, 2017

I'm experiencing the same problem after a package upgrade.

System Info 💻

  • OS: gnu/linux (Archlinux)
  • Emacs: 25.2.1
  • Spacemacs: 0.200.9
  • Spacemacs branch: master (rev. 8e1af14)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(javascript html markdown haskell latex coq helm auto-completion evil-commentary emacs-lisp git org spell-checking syntax-checking version-control)
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES
    y

@sindikat
Copy link
Contributor

I found out that this is Evil's fault, not company-coq's. Solution is to set

(setq evil-want-abbrev-expand-on-insert-exit nil)

before Evil loads (e.g. in Spacemacs this means to put the above line in dotspacemacs/user-init). I recommend to close this issue.

See also:

@Blaisorblade
Copy link
Contributor

Thanks a lot for the workaround!

  1. It looks like this is just the interaction of Evil and Coq — (coq-mode-abbrev-table) is the only table with predefined entries. And that's why the problem seems Coq-related?

I recommend to close this issue.

  1. Nobody has to fix this, of course, but I understand Spacemacs wants to work well out-of-the-box, and right now this bit doesn't.

Not sure how to achieve that though, I guess many people rely on the default? Maybe making coq-mode default autocompletions opt-in might be a simple solution with the minimal disruption for other people—not sure though. Or maybe that's silly.

@bmag
Copy link
Collaborator

bmag commented Nov 2, 2018

Per a comment in the issue on PG's repo, another workaround is to prevent the abbrev table from being installed, by evaluating this expression before loading coq-abbrev.el:

(setq coq-mode-abbrev-table '())

An option to solve the issue is to add a variable in coq layer's config.el file for opting into using coq's abbreviation table. If the variable is nil, coq layer will call (setq coq-mode-abbrev-table '()), otherwise coq layer won't make that call and coq's abbreviation table will be generated and installed.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Bug tracker - Coq stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

5 participants