Closed velppa closed 2 years ago
I recommend to disable all Cape completion-at-point-functions
and then turn them on one by one until you find the issue. Also take a look at the recommended configuration from the README. It is better to not add to many functions by default - instead trigger them manually using the explicit key, since this makes sure that you get the desired completion backend.
(use-package cape
:init
;; Add `completion-at-point-functions', used by `completion-at-point'.
;;(add-to-list 'completion-at-point-functions #'cape-file)
;;(add-to-list 'completion-at-point-functions #'cape-tex)
;;(add-to-list 'completion-at-point-functions #'cape-dabbrev)
;;(add-to-list 'completion-at-point-functions #'cape-keyword)
;;(add-to-list 'completion-at-point-functions #'cape-sgml)
;;(add-to-list 'completion-at-point-functions #'cape-rfc1345)
;;(add-to-list 'completion-at-point-functions #'cape-abbrev)
;;(add-to-list 'completion-at-point-functions #'cape-ispell)
;;(add-to-list 'completion-at-point-functions #'cape-dict)
;;(add-to-list 'completion-at-point-functions #'cape-symbol)
;;(add-to-list 'completion-at-point-functions #'cape-line)
:config
(setq my-cape-keymap (make-sparse-keymap))
(let ((map my-cape-keymap))
(define-key map (kbd "p") 'completion-at-point)
(define-key map (kbd "t") 'complete-tag)
(define-key map (kbd "d") 'cape-dabbrev)
(define-key map (kbd "f") 'cape-file)
(define-key map (kbd "k") 'cape-keyword)
(define-key map (kbd "s") 'cape-symbol)
(define-key map (kbd "a") 'cape-abbrev)
(define-key map (kbd "i") 'cape-ispell)
(define-key map (kbd "l") 'cape-line)
(define-key map (kbd "w") 'cape-dict)
(define-key map (kbd "\\") 'cape-tex)
(define-key map (kbd "_") 'cape-tex)
(define-key map (kbd "^") 'cape-tex)
(define-key map (kbd "&") 'cape-sgml)
(define-key map (kbd "r") 'cape-rfc1345)
t)
:bind-keymap
("C-c t" . my-cape-keymap))
Hi Daniel, thanks for Cape and other packages (especially Consult).
I use the following configuration of Cape with Emacs 28.1 on macOS with native compilation:
When I edit a Ledger-mode source block in Org Mode in the posting that has computations, and press TAB (mostly accidentally, like C-i), Emacs hangs. I figured out that it is Cape that causes it, after disabling the above block Emacs works fine (says "No completions").
Example of Org Mode document, where
|
marks the cursor position:Org Babel has
ledger
language enabled usingob-ledger.el
.I checked what TAB is bound to,
org-cycle
, then I checked what TAB is globally-bound to,indent-for-tab-command
, checked variablecompletion-at-point-functions
:So I have no idea why Cape hangs Emacs ;-(
I tried to debug by killing Emacs with
pkill -SIGUSR2 emacs
, but it doesn't work on macOS.Could you suggest how to narrow down the root cause of this?