Lisp: Move enhance-imenu-lisp to Nyxt.
parent
cc97230636
commit
fb78466e11
|
@ -2,33 +2,6 @@
|
|||
|
||||
(require 'init-lispy)
|
||||
|
||||
(defun ambrevar/enhance-imenu-lisp (&rest keywords)
|
||||
"Add define-KEYWORD to `lisp-imenu-generic-expression'."
|
||||
(dolist (keyword keywords)
|
||||
(add-to-list
|
||||
'lisp-imenu-generic-expression
|
||||
(list (purecopy (concat (capitalize keyword) "s"))
|
||||
(purecopy (concat "^\\s-*("
|
||||
(regexp-opt
|
||||
(list (concat "define-" keyword))
|
||||
t)
|
||||
"\\s-+\\(" lisp-mode-symbol-regexp "\\)"))
|
||||
2))))
|
||||
;; Following defines are common, e.g. in Next.
|
||||
(ambrevar/enhance-imenu-lisp "mode" "command" "parenscript")
|
||||
|
||||
;; For cl-dbus.
|
||||
(add-to-list
|
||||
'lisp-imenu-generic-expression
|
||||
(list (purecopy "D-Bus")
|
||||
(purecopy (concat "^\\s-*("
|
||||
(eval-when-compile
|
||||
(regexp-opt
|
||||
(list "dbus:define-dbus-method")
|
||||
t))
|
||||
"\\s-+(\\([^)]+\\)"))
|
||||
2))
|
||||
|
||||
(add-hook 'lisp-mode-hook 'ambrevar/turn-on-complete-filename)
|
||||
(add-hook 'lisp-mode-hook 'ambrevar/turn-on-tab-width-to-8) ; Because some existing code uses tabs.
|
||||
(add-hook 'lisp-mode-hook 'ambrevar/turn-off-indent-tabs) ; Should not use tabs.
|
||||
|
@ -202,13 +175,16 @@
|
|||
(with-eval-after-load 'sly
|
||||
(advice-add 'sly-mrepl--insert-prompt :around #'ambrevar/sly-prepare-prompt)
|
||||
|
||||
(with-eval-after-load 'sly-mrepl
|
||||
(defun ambrevar/set-lisp-implementations ()
|
||||
(let ((core (dump-sbcl-core-for-sly)))
|
||||
(setq sly-lisp-implementations
|
||||
`((sbcl ("sbcl" ,@(when core
|
||||
`("--core" ,core))))
|
||||
(ccl ("ccl"))
|
||||
(ecl ("ecl")))))
|
||||
(ecl ("ecl"))))))
|
||||
(advice-add 'sly :before #'ambrevar/set-lisp-implementations)
|
||||
|
||||
(with-eval-after-load 'sly-mrepl
|
||||
(setq sly-mrepl-history-file-name (expand-file-name "sly-mrepl-history" user-emacs-directory))
|
||||
(define-key sly-mrepl-mode-map (kbd "C-c M-o") 'sly-mrepl-clear-repl))
|
||||
|
||||
|
|
Loading…
Reference in New Issue