symbol-overlay
symbol-overlay copied to clipboard
Symbol-overlay conflicts with haskell-mode
Symbol-overlay-mode will cause Emacs to freeze with haskell-mode enabled,I am not sure it is cause by haskell-mode
or symbol-overlay
.
Steps to reproduce the issue:
- Back up your current configuration
.emacs.d
file with another name - Create an
.emacs
file in the current user'sHOME
directory (for example, myHOME
is theC:\Users\Aqua
directory), and copy the following code to the.emacs
file.
(require 'package)
(add-to-list 'package-archives '( "melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(require 'symbol-overlay)
(global-set-key (kbd "M-i") 'symbol-overlay-put)
(global-set-key (kbd "M-n") 'symbol-overlay-switch-forward)
(global-set-key (kbd "M-p") 'symbol-overlay-switch-backward)
(global-set-key (kbd "<f7>") 'symbol-overlay-mode)
(global-set-key (kbd "<f8>") 'symbol-overlay-remove-all)
(require 'haskell-mode)
(add-hook 'haskell-mode-hook 'interactive-haskell-mode)
- Start Emacs, an error will be raised now, because the required packages have not been installed.
- Manually refresh the package contents and install
haskell-mode
andsymbol-overlay
M-x package-refresh-contents
M-x package-install RET haskell-mode
M-x package-install RET symbol-overlay
-
Restart Emacs, now it can start normally.
-
C-x, C-f
Create atest.hs
file in any directory, pressto turn on symbol-overlay-mode. Enter the following content from the beginning in the empty test.hs
file.
triples = [(a,b,c) | c <- [1..10], a <- [1..c], b <- [1..a]]
-
When I input the third
1
, and then input aspace
or.
It will be stuck (as shown in the figure below, the cursor now is at the position indicated by the red arrow). -
press
C-g
can go back to normal , and get error from Messages :
Symbol-Overlay mode enabled in current buffer
Error during redisplay: (internal--syntax-propertize 44) signaled (quit)
Error during redisplay: (internal--syntax-propertize 57) signaled (quit)
- if at step 7 can't reproduce issue, you can move cursor back to the the position after the second
1
, and delete..c
, and input..c
again.
Tested on: Emacs 28.0.50 native compile and Emacs 27.2 OS: macOS Big Sur 11.5 and Windows 10
Same here.
My reproduction steps:
- Start emacs via emacsq.sh
⋊> emacsq.sh -P haskell-mode,symbol-overlay --eval "
(progn
(add-hook 'haskell-mode-hook 'interactive-haskell-mode)
(add-hook 'haskell-mode-hook 'symbol-overlay-mode)
(view-echo-area-messages)
(toggle-debug-on-error)
(profiler-start 'cpu)
(switch-to-buffer \"*.hs\")
(haskell-mode)
(insert \"triples = [(a,b,c) | c <- [1..10], a <- [1..c], b <- [1\")
(goto-char (point-max)))" -nw
- Wait until
1
is highliged
- Type
...
(Get no response)
- Press
C-g
-
M-x profiler-report
Function CPU samples % + ... 847 54% - command-execute 717 45% - call-interactively 717 45% - funcall-interactively 703 44% - self-insert-command 639 40% - symbol-overlay-refresh 639 40% - looking-at 639 40% - internal--syntax-propertize 639 40% - syntax-propertize 639 40% - haskell-syntax-propertize 616 39% - haskell-lexeme-looking-at-token 510 32% haskell-lexeme-looking-at-qidsym 110 7% haskell-lexeme-looking-at-char-literal 38 2% haskell-lexeme-looking-at-string-lit... 28 1% match-string-no-properties 10 0%
- macOS 10.12.6
- Emacs 27.1 / 28.0 (rev: 6f776fbc3532a96dc86eb4e6091ed94f4c52aae7)
- haskell-mode-20210622.2049
- symbol-overlay-20210422.2110
FWIW, I cannot reproduce this bug.
- macOS 13.0.1 (22A400)
- Emacs 29.0.60 (rev: 19ef86f775a39eab46231c3eb6fc702e06857a5a)
- haskell-mode 20221113.1425
- symbol-overlay 20220304.917
seems to work fine on Emacs 29.1. unfortunately i cant upgrade all of my systems from 28 yet, so i would be very grateful if anyone could figure out why this happens.