Files
.emacs.d/modules/completion/siren-cape.el
Jim Myhrberg fe6a4e7ce5 fix(elisp): add lexical-binding comment to all files to suppress new Emacs 31 warnings
I've set `lexical-binding` to `nil` in all Emacs Lisp files to suppress
the warnings introduced in Emacs 31 requiring all elisp files to have a
`lexical-binding` comment.

This retains the default behavior of dynamic binding when no
`lexical-binding` comment is present. With it set to `t` across the
board, various things break, and fixing those is a task for another day.
2025-06-29 12:23:03 +01:00

39 lines
1.2 KiB
EmacsLisp

;;; siren-cape.el --- jimeh's Emacs Siren: cape configuration. -*- lexical-binding: nil; -*-
;;; Commentary:
;; Basic configuration for cape. Auto completion on steroids.
;;; Code:
(require 'siren-company)
(require 'siren-yasnippet)
(use-package cape
:after company
:hook
(lsp-completion-mode . siren-cape-capf-lsp-mode-setup)
:preface
(defun siren-cape-capf-lsp-mode-setup ()
(siren-cape-capf-add-hooks t))
(defun siren-cape-capf-add-hooks (&optional local)
(if local (make-local-variable 'completion-at-point-functions))
;; Use `siren-prepend' function instead of `add-hook' to ensure our custom
;; completion functions are listed before `lsp-completion-at-point'.
(siren-prepend completion-at-point-functions 'cape-file)
(siren-prepend completion-at-point-functions 'yasnippet-capf))
;; (siren-prepend completion-at-point-functions
;; (cape-capf-super #'lsp-completion-at-point #'yasnippet-capf))
(defun siren-cape-capf-remove-hooks (&optional local)
(remove-hook 'completion-at-point-functions 'cape-file local)
(remove-hook 'completion-at-point-functions 'yasnippet-capf local))
:init
(siren-cape-capf-add-hooks))
(provide 'siren-cape)
;;; siren-cape.el ends here